qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/3] pcie: don't skip multi-mask events
Date: Fri, 21 Jun 2019 02:46:46 -0400	[thread overview]
Message-ID: <20190621064615.20099-2-mst@redhat.com> (raw)
In-Reply-To: <20190621064615.20099-1-mst@redhat.com>

If we are trying to set multiple bits at once, testing that just one of
them is already set gives a false positive. As a result we won't
interrupt guest if e.g. presence detection change and attention button
press are both set. This happens with multi-function device removal.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/pci/pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 88c30ff74c..b22527000d 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -383,7 +383,7 @@ static void pcie_cap_slot_event(PCIDevice *dev, PCIExpressHotPlugEvent event)
 {
     /* Minor optimization: if nothing changed - no event is needed. */
     if (pci_word_test_and_set_mask(dev->config + dev->exp.exp_cap +
-                                   PCI_EXP_SLTSTA, event)) {
+                                   PCI_EXP_SLTSTA, event) == event) {
         return;
     }
     hotplug_event_notify(dev);
-- 
MST



  reply	other threads:[~2019-06-21  6:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21  6:46 [Qemu-devel] [PATCH 0/3] pcie: hotplug fixes Michael S. Tsirkin
2019-06-21  6:46 ` Michael S. Tsirkin [this message]
2019-06-25 11:14   ` [Qemu-devel] [PATCH 1/3] pcie: don't skip multi-mask events Igor Mammedov
2019-07-01  7:01   ` Marcel Apfelbaum
2019-07-01  9:56   ` Philippe Mathieu-Daudé
2019-06-21  6:46 ` [Qemu-devel] [PATCH 2/3] pcie: check that slt ctrl changed before deleting Michael S. Tsirkin
2019-06-25 12:45   ` Igor Mammedov
2019-07-01  9:23     ` Michael S. Tsirkin
2019-07-01  7:03   ` Marcel Apfelbaum
2019-07-01 13:07   ` Igor Mammedov
2019-06-21  6:46 ` [Qemu-devel] [PATCH 3/3] pcie: work around for racy guest init Michael S. Tsirkin
2019-06-25 13:07   ` Igor Mammedov
2019-07-01  9:20     ` Michael S. Tsirkin
2019-07-01 12:04       ` Igor Mammedov
2019-07-01 12:08         ` Michael S. Tsirkin
2019-07-01  7:04   ` Marcel Apfelbaum
     [not found]     ` <20190701105708.5d28f497@redhat.com>
2019-07-01  9:12       ` Marcel Apfelbaum
2019-07-01  9:13       ` Marcel Apfelbaum
2019-07-01 13:01   ` Igor Mammedov
2019-07-01  9:34 ` [Qemu-devel] [PATCH 4/3] pcie: minor cleanups for slot control/status Michael S. Tsirkin
2019-07-01  9:56   ` Philippe Mathieu-Daudé
2019-07-01 13:07   ` Igor Mammedov
2019-07-01 13:51   ` Christophe de Dinechin

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=20190621064615.20099-2-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).