> Are you aware of any work that needs doing in the wider QEMU to support 
> nested virt or should it just be a case of doing the plumbing inaccel/hvf to 
> turn it on?

I’m not the greatest person to chime in unfortunately as I’m not an expert on 
QEMU by any means.

What I can offer that may be of assistance:

- Fundamentally, the APIs expose the EL2 states. The state shadowing is managed 
by Hypervisor.framework directly.
- The new GIC APIs take care of interrupt injection, and would need to be used 
in concert with the EL2 APIs if you need interrupt support (highly likely 😬). 
This would
be where I’d investigate on the QEMU end first to see if this would fit within 
the architecture without a bunch of reworks. 
https://developer.apple.com/documentation/hypervisor/hv_gic_create(_:)


> On Jul 16, 2025, at 5:17 AM, Alex Bennée <alex.ben...@linaro.org> wrote:
> 
> Danny Canter <danny_can...@apple.com <mailto:danny_can...@apple.com>> writes:
> 
>> Joelle is correct, M3 and newer SoCs have support for the EL2 APIs.
> 
> Thanks for the confirmation. I'm looking at getting a M4 Mini for my
> team so we can help review and test patches for HVF going forward.
> 
> Are you aware of any work that needs doing in the wider QEMU to support
> nested virt or should it just be a case of doing the plumbing in
> accel/hvf to turn it on?
> 
>> 
>> -Danny
>> 
>>> On Jul 15, 2025, at 8:53 AM, Joelle van Dyne <j...@getutm.app> wrote:
>>> 
>>> UTM currently supports NV only with the Apple Virtualization backend,
>>> not QEMU HVF. While M2 supports NV, it is not enabled by XNU kernel
>>> and `hv_vm_config_get_el2_supported` returns false. I heard there was
>>> some compatibility issue in the hardware. M3 and newer generations
>>> fully support NV in hardware and by XNU.
>>> 
>>> On Tue, Jul 15, 2025 at 4:51 AM Marc Zyngier <m...@kernel.org> wrote:
>>>> 
>>>> On Tue, 15 Jul 2025 12:15:52 +0100,
>>>> Alex Bennée <alex.ben...@linaro.org> wrote:
>>>> 
>>>>> - do we know which Apple silicon supports FEAT_NV2?
>>>> 
>>>> M2 and latter definitely support FEAT_NV2. That's how KVM NV support
>>>> has been developed for two years until I was given better HW.
>>>> 
>>>> Whether Apple supports NV on M2 in HVF, I have no idea. The rumour
>>>> mill says "no", but I don't have a way to check. The M3 I use at $WORK
>>>> is definitely able to give me EL2 without VHE with UTM. I haven't
>>>> played with M4, but I have it on the record that it behaves like M3
>>>> with UTM.
>>>> 
>>>>       M.
>>>> 
>>>> --
>>>> Without deviation from the norm, progress is not possible.
> 
> -- 
> Alex Bennée
> Virtualisation Tech Lead @ Linaro

Reply via email to