Re: [PATCH v19 03/14] KVM: arm64: Manage GCS access and registers for guests
Mark Brown <[email protected]>
| Newsgroups | org.kernel.vger.linux-doc,dev.linux.lists.kvmarm,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest |
|---|---|
| Message-ID | <[email protected]> |
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
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmqIRPEACgkQJNaLcl1U h9Drjgf/Vfk6QH5Vi22Te0vQDa4XeCH2ch4K7HUFQutlQ4xTEjHPq5hmy83/CXXx 8CsmOBawMC79a2K3lr9cYQiWufkuEwzafLHmPumfTctLJvIIkfu1iIJel1+Guarx pOlPJRmPcwYMrjIqg2yFTpK8FlJAyMH/wZrotY3fgZR327dllHXRhWYUfawIP5Bm qmxLqyITLJu0pj1BC8pObGV1YUVfJFEEUSHmh6/HccTDJyXEPHZ+6NNlPciWD2bC 4+02O/3xV+dduqjZeiyXgYiorZV5+UkYVwhLOuuepZ0SqPxzAciqA7/3AKHbWGKS 1H3+8FzsA/oV9aCUqzsN/uQpzf8VRQ== =mXCE -----END PGP SIGNATURE-----