[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/43] arm_gicv3_kvm: kvm_dist_get/put_priority: skip
From: |
Peter Maydell |
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 |
From: Shannon Zhao <address@hidden>
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: address@hidden
Reviewed-by: Peter Maydell <address@hidden>
Reviewed-by: Eric Auger <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
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, ®, 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, ®, true);
--
2.17.1
- [Qemu-devel] [PULL 07/43] hw/input/pckbd: Convert away from old_mmio, (continued)
- [Qemu-devel] [PULL 07/43] hw/input/pckbd: Convert away from old_mmio, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 05/43] hw/block/pflash_cfi02: Convert away from old_mmio, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 17/43] exec.c: Don't accidentally sign-extend 4-byte loads in subpage_read(), Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 16/43] bswap: Add new stn_*_p() and ldn_*_p() memory access functions, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 04/43] hw/m68k/mcf5206: Convert away from old_mmio, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 15/43] CODING_STYLE: Define our preferred form for multiline comments, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 09/43] stellaris: Stop using armv7m_init(), Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 23/43] target/arm: Implement SVE compress active elements, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 06/43] hw/watchdog/wdt_i6300esb: Convert away from old_mmio, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 12/43] hw/core/or-irq: Support more than 16 inputs to an OR gate, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 01/43] arm_gicv3_kvm: kvm_dist_get/put_priority: skip the registers banked by GICR_IPRIORITYR,
Peter Maydell <=
- [Qemu-devel] [PULL 14/43] cputlb: Pass cpu_transaction_failed() the correct physaddr, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 21/43] target/arm: Implement SVE Permute - Predicates Group, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 18/43] exec.c: Use stn_p() and ldn_p() instead of explicit switches, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 19/43] target/arm: Extend vec_reg_offset to larger sizes, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 03/43] hw/sh/sh7750: Convert away from old_mmio, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 20/43] target/arm: Implement SVE Permute - Unpredicated Group, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 25/43] target/arm: Implement SVE copy to vector (predicated), Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 24/43] target/arm: Implement SVE conditionally broadcast/extract element, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 02/43] hw/arm/mps2-tz: Put ethernet controller behind PPC, Peter Maydell, 2018/06/15
- [Qemu-devel] [PULL 26/43] target/arm: Implement SVE reverse within elements, Peter Maydell, 2018/06/15