summaryrefslogtreecommitdiffstats
path: root/drivers/xen/events
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2020-10-22 11:49:06 +0200
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>2020-10-23 12:41:25 +0200
commiteabe741782d5a52ce884dba4bab8825f977ab1eb (patch)
tree9caef07843681e1d53942f7ca1c813a9671eea33 /drivers/xen/events
parentxen/events: only register debug interrupt for 2-level events (diff)
downloadlinux-eabe741782d5a52ce884dba4bab8825f977ab1eb.tar.xz
linux-eabe741782d5a52ce884dba4bab8825f977ab1eb.zip
xen/events: unmask a fifo event channel only if it was masked
Unmasking an event channel with fifo events channels being used can require a hypercall to be made, so try to avoid that by checking whether the event channel was really masked. Suggested-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Link: https://lore.kernel.org/r/20201022094907.28560-5-jgross@suse.com Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen/events')
-rw-r--r--drivers/xen/events/events_fifo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c
index 243e7b6d7b96..b234f1766810 100644
--- a/drivers/xen/events/events_fifo.c
+++ b/drivers/xen/events/events_fifo.c
@@ -237,6 +237,9 @@ static bool clear_masked_cond(volatile event_word_t *word)
w = *word;
do {
+ if (!(w & (1 << EVTCHN_FIFO_MASKED)))
+ return true;
+
if (w & (1 << EVTCHN_FIFO_PENDING))
return false;