On Fri, Aug 21, 2026 at 12:39:08AM +0100, Wei-Lin Chang wrote: > Hey I feel the question wasn't answered completely :)
> Here is the reason for the asymmetric save restore (besides the tcr2
> part):
...
> Quite a few other registers are saved only if guest E2H == 1 because of
> the same reason.
There's a big comment in the code about saving in the E2H case only in
the existing code FWIW:
/*
* In VHE mode those registers are compatible between EL1 and EL2,
* and the guest uses the _EL1 versions on the CPU naturally.
* So we save them into their _EL2 versions here.
* For nVHE mode we trap accesses to those registers, so our
* _EL2 copy in sys_regs[] is always up-to-date and we don't need
* to save anything here.
*/
if (vcpu_el2_e2h_is_set(vcpu)) {
signature.asc
Description: PGP signature

