]> git.baikalelectronics.ru Git - kernel.git/commit
xen/evtchn: fix ring resize when binding new events
authorJan Beulich <JBeulich@suse.com>
Wed, 4 May 2016 13:02:36 +0000 (07:02 -0600)
committerDavid Vrabel <david.vrabel@citrix.com>
Wed, 4 May 2016 15:37:01 +0000 (16:37 +0100)
commite521502bc188c2d05d95467589874d12b2d3b779
tree940f070cecbb3f335be0c1f976a472c990ebf4ab
parentb611c42aaf490c60c689f39787501089d1a47fae
xen/evtchn: fix ring resize when binding new events

The copying of ring data was wrong for two cases: For a full ring
nothing got copied at all (as in that case the canonicalized producer
and consumer indexes are identical). And in case one or both of the
canonicalized (after the resize) indexes would point into the second
half of the buffer, the copied data ended up in the wrong (free) part
of the new buffer. In both cases uninitialized data would get passed
back to the caller.

Fix this by simply copying the old ring contents twice: Once to the
low half of the new buffer, and a second time to the high half.

This addresses the inability to boot a HVM guest with 64 or more
vCPUs.  This regression was caused by c2c3cb4fc3223b98 (xen/evtchn:
dynamically grow pending event channel ring).

Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: <stable@vger.kernel.org> # 4.4+
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
drivers/xen/evtchn.c