[PATCH v3 18/41] KVM: arm64: Move userspace system registers into separate function

Julien Grall julien.grall at arm.com
Fri Feb 9 10:50:14 PST 2018


Hi Christoffer,

On 01/12/2018 12:07 PM, Christoffer Dall wrote:
> There's a semantic difference between the EL1 registers that control
> operation of a kernel running in EL1 and EL1 registers that only control
> userspace execution in EL0.  Since we can defer saving/restoring the
> latter, move them into their own function.
> 
> We also take this chance to rename the function saving/restoring the
> remaining system register to make it clear this function deals with
> the EL1 system registers.
> 
> No functional change.
> 
> Reviewed-by: Andrew Jones <drjones at redhat.com>
> Signed-off-by: Christoffer Dall <christoffer.dall at linaro.org>
> ---
>   arch/arm64/kvm/hyp/sysreg-sr.c | 46 +++++++++++++++++++++++++++++++-----------
>   1 file changed, 34 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm64/kvm/hyp/sysreg-sr.c b/arch/arm64/kvm/hyp/sysreg-sr.c
> index 848a46eb33bf..99dd50ce483b 100644
> --- a/arch/arm64/kvm/hyp/sysreg-sr.c
> +++ b/arch/arm64/kvm/hyp/sysreg-sr.c
> @@ -34,18 +34,27 @@ static void __hyp_text __sysreg_do_nothing(struct kvm_cpu_context *ctxt) { }
>   
>   static void __hyp_text __sysreg_save_common_state(struct kvm_cpu_context *ctxt)
>   {
> -	ctxt->sys_regs[ACTLR_EL1]	= read_sysreg(actlr_el1);

I am a bit confused, the comment on top of the function says the host 
must save ACTLR_EL1 in the VHE case. But AFAICT, after this patch the 
register will not get saved in the host context. Did I miss anything?

Cheers,

-- 
Julien Grall



More information about the linux-arm-kernel mailing list