Subject: Re: [PATCH v5 18/69] KVM: arm64: nv: Handle virtual EL2 registers in vcpu_read/write_sys_reg()

From: Marc Zyngier <[email-masked]>
Date: Mon, 20 Dec 2021 09:10:38 +0000

On Mon, 20 Dec 2021 07:04:44 +0000,
Ganapatrao Kulkarni <[email-masked]> wrote:
> 
> 
> On 30-11-2021 01:30 am, Marc Zyngier wrote:
> > KVM internally uses accessor functions when reading or writing the
> > guest's system registers. This takes care of accessing either the stored
> > copy or using the "live" EL1 system registers when the host uses VHE.
> > 
> > With the introduction of virtual EL2 we add a bunch of EL2 system
> > registers, which now must also be taken care of:
> > - If the guest is running in vEL2, and we access an EL1 sysreg, we must
> >    revert to the stored version of that, and not use the CPU's copy.
> > - If the guest is running in vEL1, and we access an EL2 sysreg, we must
> 
> Do we have vEL1? or is it a typo?

Not a typo, but only a convention (there is no such concept in the
architecture). vELx denotes the exception level the guest thinks it is
running at while running at EL1 (as it is the case for both vEL1 and
vEL2).

Depending on the exception level and the running mode (VHE or not) you
emulate at any given time, you access the sysregs differently: they
can be either live in the CPU, stored in memory, with or without
translation. That's why I'm using these 'parallel' exception levels to
denote which is which...

HTH,

	M.

-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel