Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 451807 - xenkbd's test for ring empty is wrong
Summary: xenkbd's test for ring empty is wrong
Status: CLOSED DUPLICATE of bug 434800
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel-xen
Version: 5.3
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Markus Armbruster
QA Contact: Martin Jenner
Depends On: 434802
Blocks: 449772
TreeView+ depends on / blocked
Reported: 2008-06-17 14:48 UTC by Markus Armbruster
Modified: 2008-07-21 16:43 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2008-07-21 16:43:12 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Markus Armbruster 2008-06-17 14:48:33 UTC
Description of problem:
The test in input_handler() compares against out_cons instead of in_cons. 
out_cons is always zero with the current code.

The broken test can misbehave in two ways:
* If input_handler() runs when a multiple of 2^32 events have been put into the
ring buffer, in_prod is zero, and the test decides the ring buffer is empty even
when it is not.
  When this happens, the bug delays processing keyboard and mouse events until
more arrive.  It deadlocks the virtual keyboard and mouse if the ring buffer
happens to be full.  Possible, but quite unlikely.

* If input_handler() runs when another number of events have been put into the
ring buffer, in_prod is non-zero, and the test decides the ring buffer isn't
empty even when it is.

  When this happens, the bug makes us execute superfluous memory barriers and
send a bogus event to the backend, which the backend ignores.

Steps to Reproduce:
Haven't tried.

Additional info:
Proposed fix is in the patch for bug 434802.
Upstream fix:

Comment 1 RHEL Product and Program Management 2008-06-17 15:00:34 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update

Comment 4 Markus Armbruster 2008-07-21 16:27:28 UTC
See bug 434802 for a proposed fix.

Comment 5 Markus Armbruster 2008-07-21 16:43:12 UTC
The proposed fix from bug 434802 has been committed as a fix for bug 434800. 
Turning this one into a duplicate of 434800 to keep things simple and sane.

*** This bug has been marked as a duplicate of 434800 ***

Note You need to log in before you can comment on or make changes to this bug.