From 861dc73518a049887b709f031359713e5f6b284e Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Thu, 20 Jun 2019 13:44:32 -0400 Subject: pcie: don't skip multi-mask events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Igor Mammedov Reviewed-by: Marcel Apfelbaum Reviewed-by: Philippe Mathieu-Daudé --- hw/pci/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/pci/pcie.c') 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); -- cgit v1.2.3