|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 3/8] xen/events: avoid handling the same event on two cpus at the same time
On 14.02.21 22:34, Julien Grall wrote: Hi Juergen, On 11/02/2021 10:16, Juergen Gross wrote: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. Reported-by: Julien Grall <julien@xxxxxxx> Signed-off-by: Juergen Gross <jgross@xxxxxxxx> --- V2: - new patch --- drivers/xen/events/events_base.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c It is basically releasing a lock. So release semantics seem to be appropriate. It is also not clear to me if there are any expected ordering between clearing is_active and clearing the pending bit. No, I don't think there is a specific ordering required. is_active is just guarding against two simultaneous IRQ handler calls for the same event being active. Clearing the pending bit is not part of the guarded section. clear_evtchn(evtchn);The 2 lines here seems to be a common pattern in this patch. So I would suggest to create a new helper. Okay. Juergen Attachment:
OpenPGP_0xB0DE9DD628BF132F.asc Attachment:
OpenPGP_signature
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |