Bug 451807

Summary: xenkbd's test for ring empty is wrong
Product: Red Hat Enterprise Linux 5 Reporter: Markus Armbruster <armbru>
Component: kernel-xenAssignee: Markus Armbruster <armbru>
Status: CLOSED DUPLICATE QA Contact: Martin Jenner <mjenner>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3CC: xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-21 16:43:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 434802    
Bug Blocks: 449772    

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: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/418

Comment 1 RHEL 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
release.

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 ***