[PATCH v6 09/12] KVM: arm64: Initialize trap registers for protected VMs

Andrew Jones drjones at redhat.com
Tue Oct 5 23:56:38 PDT 2021


On Wed, Sep 22, 2021 at 01:47:01PM +0100, Fuad Tabba wrote:
> Protected VMs have more restricted features that need to be
> trapped. Moreover, the host should not be trusted to set the
> appropriate trapping registers and their values.
> 
> Initialize the trapping registers, i.e., hcr_el2, mdcr_el2, and
> cptr_el2 at EL2 for protected guests, based on the values of the
> guest's feature id registers.
> 
> No functional change intended as trap handlers introduced in the
> previous patch are still not hooked in to the guest exit
> handlers.
> 
> Signed-off-by: Fuad Tabba <tabba at google.com>
> ---
>  arch/arm64/include/asm/kvm_asm.h       |   1 +
>  arch/arm64/include/asm/kvm_host.h      |   2 +
>  arch/arm64/kvm/arm.c                   |   8 ++
>  arch/arm64/kvm/hyp/include/nvhe/pkvm.h |  14 ++
>  arch/arm64/kvm/hyp/nvhe/Makefile       |   2 +-
>  arch/arm64/kvm/hyp/nvhe/hyp-main.c     |  10 ++
>  arch/arm64/kvm/hyp/nvhe/pkvm.c         | 186 +++++++++++++++++++++++++
>  7 files changed, 222 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm64/kvm/hyp/include/nvhe/pkvm.h
>  create mode 100644 arch/arm64/kvm/hyp/nvhe/pkvm.c

Regarding the approach, LGTM

Reviewed-by: Andrew Jones <drjones at redhat.com>

Thanks,
drew




More information about the linux-arm-kernel mailing list