Access denied to Hypervisor redistributor register

Hi!

I would like try to boot the Linux kernel with the Hypervisor framework and see how far I get. So far the kernel runs up to the point where it's trying to identify the redistributor of the Hypervisor's GICv3, but I get an exception when it's reading the memory-mapped GICR_FIDR2 register. I tried the same via hv_gic_get_redistributor_reg() and get HV_DENIED.

What could be the reason for this exception? I believe I've initialized enough of the GIC for it to work. No interrupts yet, though.

It is of course entirely possible I forgot to set/clear some bits, but there are several redistributor registers missing in the framework, so it's not possible to do the full initialization a hardware GIC v3 implementation needs. I assume the Hypervisor's GIC abstraction takes care of several steps internally.

What are the steps to initialize the HVF's GIC? Do you have a working example? I couldn't find anything on the internet. The popular virtualization software out there all seem to bring their own emulated interrupt controller.

I'm using Sequoia 15.0.1.

Thank you for any hints!

Answered by Engineer in 808726022

Hard to guess what the problem could be from the description alone. Have you configured the vCPU affinity with HV_SYS_REG_MPIDR_EL1 for your vCPU?

Could you share a code sample to reproduce the issue? If not here, it can be with feedback assistant.

Typo: register is called GICR_PIDR2.

Ok, after looking at the bits of the exception syndrome (class=0x24, iss=100000000000000000000110) which means translation fault at 2nd level if I read things correctly, I decided to step through the HVF code with lldb and noticed that a retab failed. Not sure why pointer authentication failed here. Reading/writing other registers works fine.

Still, would be great if you have pointers to what is needed to get the HV GIC working. Thank you!

Accepted Answer

Hard to guess what the problem could be from the description alone. Have you configured the vCPU affinity with HV_SYS_REG_MPIDR_EL1 for your vCPU?

Could you share a code sample to reproduce the issue? If not here, it can be with feedback assistant.

Access denied to Hypervisor redistributor register
 
 
Q