qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 06/46] pci: designware: Update MSI mapping unconditionally
Date: Mon,  1 Jul 2019 17:39:03 +0100	[thread overview]
Message-ID: <20190701163943.22313-7-peter.maydell@linaro.org> (raw)
In-Reply-To: <20190701163943.22313-1-peter.maydell@linaro.org>

From: Andrey Smirnov <andrew.smirnov@gmail.com>

Expression to calculate update_msi_mapping in code handling writes to
DESIGNWARE_PCIE_MSI_INTR0_ENABLE is missing an ! operator and should
be:

    !!root->msi.intr[0].enable ^ !!val;

so that MSI mapping is updated when enabled transitions from either
"none" -> "any" or "any" -> "none". Since that register shouldn't be
written to very often, change the code to update MSI mapping
unconditionally instead of trying to fix the update_msi_mapping logic.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/pci-host/designware.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index 0fdfff57848..ec697c8f9df 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -297,16 +297,10 @@ static void designware_pcie_root_config_write(PCIDevice *d, uint32_t address,
         root->msi.base |= (uint64_t)val << 32;
         break;
 
-    case DESIGNWARE_PCIE_MSI_INTR0_ENABLE: {
-        const bool update_msi_mapping = !root->msi.intr[0].enable ^ !!val;
-
+    case DESIGNWARE_PCIE_MSI_INTR0_ENABLE:
         root->msi.intr[0].enable = val;
-
-        if (update_msi_mapping) {
-            designware_pcie_root_update_msi_mapping(root);
-        }
+        designware_pcie_root_update_msi_mapping(root);
         break;
-    }
 
     case DESIGNWARE_PCIE_MSI_INTR0_MASK:
         root->msi.intr[0].mask = val;
-- 
2.20.1



  parent reply	other threads:[~2019-07-02  0:55 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-01 16:38 [Qemu-devel] [PULL 00/46] target-arm queue Peter Maydell
2019-07-01 16:38 ` [Qemu-devel] [PULL 01/46] hw/arm/boot: fix direct kernel boot with initrd Peter Maydell
2019-07-01 16:38 ` [Qemu-devel] [PULL 02/46] hw/arm/msf2-som: Exit when the cpu is not the expected one Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 03/46] hw/arm/virt: Add support for Cortex-A7 Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 04/46] i.mx7d: Add no-op/unimplemented APBH DMA module Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 05/46] i.mx7d: Add no-op/unimplemented PCIE PHY IP block Peter Maydell
2019-07-01 16:39 ` Peter Maydell [this message]
2019-07-01 16:39 ` [Qemu-devel] [PULL 07/46] pci: designware: Update MSI mapping when MSI address changes Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 08/46] i.mx7d: pci: Update PCI IRQ mapping to match HW Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 09/46] aspeed: add a per SoC mapping for the interrupt space Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 10/46] aspeed: add a per SoC mapping for the memory space Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 11/46] hw: timer: Add ASPEED RTC device Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 12/46] hw/arm/aspeed: Add RTC to SoC Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 13/46] aspeed: introduce a configurable number of CPU per machine Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 14/46] aspeed: add support for multiple NICs Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 15/46] aspeed/timer: Fix behaviour running Linux Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 16/46] aspeed/timer: Status register contains reload for stopped timer Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 17/46] aspeed/timer: Fix match calculations Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 18/46] aspeed/timer: Ensure positive muldiv delta Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 19/46] aspeed: remove the "ram" link Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 20/46] aspeed: add a RAM memory region container Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 21/46] aspeed/smc: add a 'sdram_base' property Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 22/46] aspeed: Add support for the swift-bmc board Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 23/46] hw/misc/aspeed_xdma: New device Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 24/46] aspeed: vic: Add support for legacy register interface Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 25/46] aspeed: Link SCU to the watchdog Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 26/46] hw/arm: Add arm SBSA reference machine, skeleton part Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 27/46] hw/arm: Add arm SBSA reference machine, devices part Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 28/46] target/arm: Makefile cleanup (Aarch64) Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 29/46] target/arm: Makefile cleanup (ARM) Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 30/46] target/arm: Makefile cleanup (KVM) Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 31/46] target/arm: Makefile cleanup (softmmu) Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 32/46] target/arm: Add copyright boilerplate Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 33/46] target/arm/helper: Remove unused include Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 34/46] target/arm: Fix multiline comment syntax Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 35/46] target/arm: Fix coding style issues Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 36/46] target/arm: Move the DC ZVA helper into op_helper Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 37/46] target/arm: Move CPU state dumping routines to cpu.c Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 38/46] target/arm: Declare get_phys_addr() function publicly Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 39/46] target/arm: Move TLB related routines to tlb_helper.c Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 40/46] target/arm/vfp_helper: Move code around Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 41/46] target/arm/vfp_helper: Extract vfp_set_fpscr_to_host() Peter Maydell
2019-07-05  7:24   ` Laurent Desnogues
2019-07-05  9:00     ` Philippe Mathieu-Daudé
2019-07-01 16:39 ` [Qemu-devel] [PULL 42/46] target/arm/vfp_helper: Extract vfp_set_fpscr_from_host() Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 43/46] target/arm/vfp_helper: Restrict the SoftFloat use to TCG Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 44/46] target/arm: Restrict PSCI " Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 45/46] target/arm: Declare arm_log_exception() function publicly Peter Maydell
2019-07-01 16:39 ` [Qemu-devel] [PULL 46/46] target/arm: Declare some M-profile functions publicly Peter Maydell
2019-07-02 13:07 ` [Qemu-devel] [PULL 00/46] target-arm queue Peter Maydell

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=20190701163943.22313-7-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --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).