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 01/43] arm_gicv3_kvm: kvm_dist_get/put_priority: skip the registers banked by GICR_IPRIORITYR
Date: Fri, 15 Jun 2018 15:24:39 +0100	[thread overview]
Message-ID: <20180615142521.19143-2-peter.maydell@linaro.org> (raw)
In-Reply-To: <20180615142521.19143-1-peter.maydell@linaro.org>

From: Shannon Zhao <zhaoshenglong@huawei.com>

While for_each_dist_irq_reg loop starts from GIC_INTERNAL, it forgot to
offset the date array and index. This will overlap the GICR registers
value and leave the last GIC_INTERNAL irq's registers out of update.

Fixes: 367b9f527becdd20ddf116e17a3c0c2bbc486920
Cc: qemu-stable@nongnu.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/intc/arm_gicv3_kvm.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
index 5649cac46ee..d8d3b254035 100644
--- a/hw/intc/arm_gicv3_kvm.c
+++ b/hw/intc/arm_gicv3_kvm.c
@@ -135,7 +135,14 @@ static void kvm_dist_get_priority(GICv3State *s, uint32_t offset, uint8_t *bmp)
     uint32_t reg, *field;
     int irq;
 
-    field = (uint32_t *)bmp;
+    /* For the KVM GICv3, affinity routing is always enabled, and the first 8
+     * GICD_IPRIORITYR<n> registers are always RAZ/WI. The corresponding
+     * functionality is replaced by GICR_IPRIORITYR<n>. It doesn't need to
+     * sync them. So it needs to skip the field of GIC_INTERNAL irqs in bmp and
+     * offset.
+     */
+    field = (uint32_t *)(bmp + GIC_INTERNAL);
+    offset += (GIC_INTERNAL * 8) / 8;
     for_each_dist_irq_reg(irq, s->num_irq, 8) {
         kvm_gicd_access(s, offset, &reg, false);
         *field = reg;
@@ -149,7 +156,14 @@ static void kvm_dist_put_priority(GICv3State *s, uint32_t offset, uint8_t *bmp)
     uint32_t reg, *field;
     int irq;
 
-    field = (uint32_t *)bmp;
+    /* For the KVM GICv3, affinity routing is always enabled, and the first 8
+     * GICD_IPRIORITYR<n> registers are always RAZ/WI. The corresponding
+     * functionality is replaced by GICR_IPRIORITYR<n>. It doesn't need to
+     * sync them. So it needs to skip the field of GIC_INTERNAL irqs in bmp and
+     * offset.
+     */
+    field = (uint32_t *)(bmp + GIC_INTERNAL);
+    offset += (GIC_INTERNAL * 8) / 8;
     for_each_dist_irq_reg(irq, s->num_irq, 8) {
         reg = *field;
         kvm_gicd_access(s, offset, &reg, true);
-- 
2.17.1

  reply	other threads:[~2018-06-15 14:25 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15 14:24 [Qemu-devel] [PULL 00/43] target-arm queue Peter Maydell
2018-06-15 14:24 ` Peter Maydell [this message]
2018-06-15 14:24 ` [Qemu-devel] [PULL 02/43] hw/arm/mps2-tz: Put ethernet controller behind PPC Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 03/43] hw/sh/sh7750: Convert away from old_mmio Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 04/43] hw/m68k/mcf5206: " Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 05/43] hw/block/pflash_cfi02: " Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 06/43] hw/watchdog/wdt_i6300esb: " Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 07/43] hw/input/pckbd: " Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 08/43] hw/char/parallel: " Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 09/43] stellaris: Stop using armv7m_init() Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 10/43] hw/arm/armv7m: Remove unused armv7m_init() function Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 11/43] arm: Don't crash if user tries to use a Cortex-M CPU without an NVIC Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 12/43] hw/core/or-irq: Support more than 16 inputs to an OR gate Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 13/43] cpu-defs.h: Document CPUIOTLBEntry 'addr' field Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 14/43] cputlb: Pass cpu_transaction_failed() the correct physaddr Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 15/43] CODING_STYLE: Define our preferred form for multiline comments Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 16/43] bswap: Add new stn_*_p() and ldn_*_p() memory access functions Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 17/43] exec.c: Don't accidentally sign-extend 4-byte loads in subpage_read() Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 18/43] exec.c: Use stn_p() and ldn_p() instead of explicit switches Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 19/43] target/arm: Extend vec_reg_offset to larger sizes Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 20/43] target/arm: Implement SVE Permute - Unpredicated Group Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 21/43] target/arm: Implement SVE Permute - Predicates Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 22/43] target/arm: Implement SVE Permute - Interleaving Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 23/43] target/arm: Implement SVE compress active elements Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 24/43] target/arm: Implement SVE conditionally broadcast/extract element Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 25/43] target/arm: Implement SVE copy to vector (predicated) Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 26/43] target/arm: Implement SVE reverse within elements Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 27/43] target/arm: Implement SVE vector splice (predicated) Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 28/43] target/arm: Implement SVE Select Vectors Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 29/43] target/arm: Implement SVE Integer Compare - " Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 30/43] target/arm: Implement SVE Integer Compare - Immediate Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 31/43] target/arm: Implement SVE Partition Break Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 32/43] target/arm: Implement SVE Predicate Count Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 33/43] target/arm: Implement SVE Integer Compare - Scalars Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 34/43] target/arm: Implement FDUP/DUP Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 35/43] target/arm: Implement SVE Integer Wide Immediate - Unpredicated Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 36/43] target/arm: Implement SVE Floating Point Arithmetic " Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 37/43] aspeed_scu: Implement RNG register Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 38/43] m25p80: add support for two bytes WRSR for Macronix chips Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 39/43] iommu: Add IOMMU index concept to IOMMU API Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 40/43] iommu: Add IOMMU index argument to notifier APIs Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 41/43] iommu: Add IOMMU index argument to translate method Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 42/43] exec.c: Handle IOMMUs in address_space_translate_for_iotlb() Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 43/43] target/arm: Allow ARMv6-M Thumb2 instructions Peter Maydell
2018-06-15 15:30 ` [Qemu-devel] [PULL 00/43] 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=20180615142521.19143-2-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).