Skip to contentSkip to conversation

target/arm: Init GIC CPU IF regs for A15/A7

PATCH In review Adam Lackorzynski 2 participants 4 messages May 29, 2020 – Jun 1, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/arm: Init GIC CPU IF regs for A15/A7

Initialize the CPU interface registers also for Cortex-A15 and Cortex-A7 CPU models, in the same way as done for 64bit CPU models. This fixes usage of GICv3 in virtualization contexts in 32bit configurations.

---
 target/arm/cpu.c | 6 ++++++
 1 file changed, 6 insertions(+)
target/arm/cpu.c +6 -0
index 32bec156f2..f525d45f6a 100644
@@ -1972,6 +1972,9 @@ static void cortex_a7_initfn(Object *obj)
     cpu->ccsidr[0] = 0x701fe00a; /* 32K L1 dcache */
     cpu->ccsidr[1] = 0x201fe00a; /* 32K L1 icache */
     cpu->ccsidr[2] = 0x711fe07a; /* 4096K L2 unified cache */
+    cpu->gic_num_lrs = 4;
+    cpu->gic_vpribits = 5;
+    cpu->gic_vprebits = 5;
     define_arm_cp_regs(cpu, cortexa15_cp_reginfo); /* Same as A15 */
 }
 
@@ -2014,6 +2017,9 @@ static void cortex_a15_initfn(Object *obj)
     cpu->ccsidr[0] = 0x701fe00a; /* 32K L1 dcache */
     cpu->ccsidr[1] = 0x201fe00a; /* 32K L1 icache */
     cpu->ccsidr[2] = 0x711fe07a; /* 4096K L2 unified cache */
+    cpu->gic_num_lrs = 4;
+    cpu->gic_vpribits = 5;
+    cpu->gic_vprebits = 5;
     define_arm_cp_regs(cpu, cortexa15_cp_reginfo);
 }
 
Signature · 1 line
2.27.0.rc2
#1 lore raw
Quoted 8 lines · Adam Lackorzynski

Initialize the CPU interface registers also for Cortex-A15 and Cortex-A7 CPU models, in the same way as done for 64bit CPU models. This fixes usage of GICv3 in virtualization contexts in 32bit configurations.

Hi; I'm confused by this patch. The Cortex-A15 and Cortex-A7 do not have or support the GICv3, so why would we need to set GICv3-specific settings for them?

We're probably missing a sanity-check somewhere to forbid user attempts to use non-GICv3 CPUs with the GICv3.

thanks
-- PMM

#2 lore raw
Quoted 10 lines · Peter Maydell
Quoted 8 lines · Adam Lackorzynski

Initialize the CPU interface registers also for Cortex-A15 and Cortex-A7 CPU models, in the same way as done for 64bit CPU models. This fixes usage of GICv3 in virtualization contexts in 32bit configurations.

Quoted 7 lines

Hi; I'm confused by this patch. The Cortex-A15 and Cortex-A7 do not have or support the GICv3, so why would we need to set GICv3-specific settings for them?

We're probably missing a sanity-check somewhere to forbid user attempts to use non-GICv3 CPUs with the GICv3.

Indeed that's another option. Besides that A15+GICv3 currently just works with this.
So I guess the alternative is to switch to 32bit from EL3 when using an A57?

Thanks,
Adam

#3 lore raw
Quoted 2 lines · Adam Lackorzynski

Indeed that's another option. Besides that A15+GICv3 currently just works with this.

Not sure how...

Quoted 1 line

So I guess the alternative is to switch to 32bit from EL3 when using an A57?

If you're using KVM then you can use -cpu host,aarch64=off

thanks
-- PMM