This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pi4 hypervisor, handle irq

I am working on hypervisor with raspberry pi 4B board.
when I study interrupt virtualization, I encounter a problem, I am follow this document
https://developer.arm.com/documentation ... exceptions

There are two mechanisms for generating virtual interrupts:

1 Internally by the core, using controls in HCR_EL2.
2 Using a GICv2, or later, interrupt controller.

I use method 1. Everything worked fine, I can route IRQ to my EL2 code, and I can forward it to EL1 Linux kernel.

But, when I tested, I tried to disable IRQ from EL1, use "msr daifset, #0xf", after this, IRQ will not trigger to EL2 also.
I am confused, because the document above said pstate.I will only affect vIRQ(for EL1) not pIRQ(EL2). I tested a GPIO interrupt and IPI interrupt, both failed.

I search the web, there are few article on this topic, and can't find any additional settings.
All document I found, said set I bit in EL1, will not affect EL2/3.

Thanks, if anyone can help.

Parents
  • Raspberry PI4 datasheet[1] shows that it uses GIC-400, which is GICv2.

    Do you run the PI4 from the bare-mental code to design your EL2 hypervisor?

    Or you just reuse the PI 4 OS that runs in Linux OS and you enable the KVM feature as the host OS?

    The information we got is not enough for further check, but we'd recommend you to:

    • read the bcm2711-peripherals datasheet about the GIC-400 section
    • based on the datasheet, to understand the interrupt you triggered in your test code is really vIRQ or pIRQ?
    • Refer to the GIC-400 TRM [2] to use some interrupt status registers to verify your real interrupt status when your use case happens

    [1]: https://datasheets.raspberrypi.com/bcm2711/bcm2711-peripherals.pdf

    [2]: GIC-400 TRM https://developer.arm.com/documentation/ddi0471/b 

Reply
  • Raspberry PI4 datasheet[1] shows that it uses GIC-400, which is GICv2.

    Do you run the PI4 from the bare-mental code to design your EL2 hypervisor?

    Or you just reuse the PI 4 OS that runs in Linux OS and you enable the KVM feature as the host OS?

    The information we got is not enough for further check, but we'd recommend you to:

    • read the bcm2711-peripherals datasheet about the GIC-400 section
    • based on the datasheet, to understand the interrupt you triggered in your test code is really vIRQ or pIRQ?
    • Refer to the GIC-400 TRM [2] to use some interrupt status registers to verify your real interrupt status when your use case happens

    [1]: https://datasheets.raspberrypi.com/bcm2711/bcm2711-peripherals.pdf

    [2]: GIC-400 TRM https://developer.arm.com/documentation/ddi0471/b 

Children