Skip to contentSkip to conversation

arm/arm64: fix gicv3-active test

PATCH In review Andrew Jones 2 participants 3 messages Jan 9, 2018 – Jan 10, 2018 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm/arm64: fix gicv3-active test

GICR_ICACTIVER0 (aka GICD_ICACTIVER) is based of the SGI_base, not the RD_base.

---
 arm/gic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arm/gic.c +1 -1
index a945f7ab8385..5dd958e8b66b 100644
@@ -274,7 +274,7 @@ static void ipi_clear_active_handler(struct pt_regs *regs __unused)
 		if (gic_version() == 2)
 			base = gicv2_dist_base();
 		else
-			base = gicv3_redist_base();
+			base = gicv3_sgi_base();
 
 		writel(val, base + GICD_ICACTIVER);
 
Signature · 1 line
2.13.6
#1 lore raw
Quoted 13 lines · Andrew Jones

GICR_ICACTIVER0 (aka GICD_ICACTIVER) is based of the SGI_base, not the RD_base.

---
 arm/gic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arm/gic.c +0 -0
index a945f7ab8385..5dd958e8b66b 100644

arm/gic.c static void ipi_clear_active_handler(struct pt_regs *regs __unused) · line 277

Quoted 5 lines
arm/gic.c +1 -1
@@ -274,7 +274,7 @@ static void ipi_clear_active_handler(struct pt_regs *regs __unused)
 		if (gic_version() == 2)
 			base = gicv2_dist_base();
 		else
-			base = gicv3_redist_base();
+			base = gicv3_sgi_base();

Shouldn't this be:

		if (gic_version() == 2)
			base = gicv2_dist_base();
		else if (irqnr < GIC_NR_PRIVATE_IRQS)
			base = gicv3_sgi_base();
		else
			base = gicv3_dist_base();

Which would support all IRQs ?

Thanks,
-Christoffer

Quoted 6 lines
arm/gic.c +0 -0
 		writel(val, base + GICD_ICACTIVER);
 
Signature · 1 line
2.13.6
#2 lore raw
Quoted 29 lines · Christoffer Dall
Quoted 13 lines · Andrew Jones

GICR_ICACTIVER0 (aka GICD_ICACTIVER) is based of the SGI_base, not the RD_base.

---
 arm/gic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arm/gic.c +0 -0
index a945f7ab8385..5dd958e8b66b 100644

arm/gic.c static void ipi_clear_active_handler(struct pt_regs *regs __unused) · line 277

Quoted 5 lines
arm/gic.c +1 -1
@@ -274,7 +274,7 @@ static void ipi_clear_active_handler(struct pt_regs *regs __unused)
 		if (gic_version() == 2)
 			base = gicv2_dist_base();
 		else
-			base = gicv3_redist_base();
+			base = gicv3_sgi_base();

Shouldn't this be:

		if (gic_version() == 2)
			base = gicv2_dist_base();
		else if (irqnr < GIC_NR_PRIVATE_IRQS)
			base = gicv3_sgi_base();
		else
			base = gicv3_dist_base();
Quoted 1 line

Which would support all IRQs ?

Yes, that would be the most general approach. Although, currently, the unit test always uses an IPI with the SGI hard coded to 1 when generating the interrupt. Of course I'm not opposed to extending the condition as you've done above to prepare the handler for SPIs, but we'd need to modify check_irqnr() as well, so I think we might as well just wait for the addition of SPI tests to add/change everything at once.

Thanks,
drew