]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xen/events: avoid race with raising an event in unmask_evtchn()
authorDavid Vrabel <david.vrabel@citrix.com>
Tue, 12 Mar 2013 15:27:31 +0000 (15:27 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 22 Mar 2013 12:25:13 +0000 (08:25 -0400)
commit13c5e5d26e45a64d6448e6d6cc253b4ace99797e
tree2f339d685d84a0a662c61bed209ae2ddcf5deeda
parent88ec7458cd880d6085dd20d6035ebedd64ffe34c
xen/events: avoid race with raising an event in unmask_evtchn()

In unmask_evtchn(), when the mask bit is cleared after testing for
pending and the event becomes pending between the test and clear, then
the upcall will not become pending and the event may be lost or
delayed.

Avoid this by always clearing the mask bit before checking for
pending.

This fixes a regression introduced in 3.7 by
b5e579232d635b79a3da052964cb357ccda8d9ea (xen/events: fix
unmask_evtchn for PV on HVM guests) which reordered the clear mask and
check pending operations.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: stable@vger.kernel.org
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/events.c