xen/events: avoid handling the same event on two cpus at the same time
authorJuergen Gross <jgross@suse.com>
Mon, 15 Mar 2021 09:06:31 +0000 (10:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 15:10:19 +0000 (16:10 +0100)
commit959b239634239ca2db0de5c822dad1ae48c0a861
tree96ffa0752f80abe31ea0d5ab04d2d40695d27901
parenta8103671cc79610b121b0bdfd5cfdc7fa43de88e
xen/events: avoid handling the same event on two cpus at the same time

commit b6622798bc50b625a1e62f82c7190df40c1f5b21 upstream.

When changing the cpu affinity of an event it can happen today that
(with some unlucky timing) the same event will be handled on the old
and the new cpu at the same time.

Avoid that by adding an "event active" flag to the per-event data and
call the handler only if this flag isn't set.

Cc: stable@vger.kernel.org
Reported-by: Julien Grall <julien@xen.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Link: https://lore.kernel.org/r/20210306161833.4552-4-jgross@suse.com
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/xen/events/events_base.c
drivers/xen/events/events_internal.h