mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH 4/5] xen/events: unmask a fifo event channel only if it was masked
Date: Thu, 22 Oct 2020 09:42:13 +0200	[thread overview]
Message-ID: <20201022074214.21693-5-jgross@suse.com> (raw)
In-Reply-To: <20201022074214.21693-1-jgross@suse.com>

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>
---
 drivers/xen/events/events_fifo.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/xen/events/events_fifo.c b/drivers/xen/events/events_fifo.c
index 243e7b6d7b96..f60c5a9ec833 100644
--- a/drivers/xen/events/events_fifo.c
+++ b/drivers/xen/events/events_fifo.c
@@ -236,6 +236,9 @@ static bool clear_masked_cond(volatile event_word_t *word)
 
 	w = *word;
 
+	if (!(w & (1 << EVTCHN_FIFO_MASKED)))
+		return true;
+
 	do {
 		if (w & (1 << EVTCHN_FIFO_PENDING))
 			return false;
-- 
2.26.2


  parent reply	other threads:[~2020-10-22  7:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22  7:42 [PATCH 0/5] xen: event handling cleanup Juergen Gross
2020-10-22  7:42 ` [PATCH 1/5] xen: remove no longer used functions Juergen Gross
2020-10-22  7:42 ` [PATCH 2/5] xen/events: make struct irq_info private to events_base.c Juergen Gross
2020-10-22  7:42 ` [PATCH 3/5] xen/events: only register debug interrupt for 2-level events Juergen Gross
2020-10-22  7:54   ` Jan Beulich
2020-10-22  8:28     ` Jürgen Groß
2020-10-22  7:42 ` Juergen Gross [this message]
2020-10-22  7:55   ` [PATCH 4/5] xen/events: unmask a fifo event channel only if it was masked Jan Beulich
2020-10-22  8:28     ` Jürgen Groß
2020-10-22  7:42 ` [PATCH 5/5] Documentation: add xen.fifo_events kernel parameter description Juergen Gross
2020-10-22  8:01 ` [PATCH 0/5] xen: event handling cleanup Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201022074214.21693-5-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jbeulich@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®