[PATCH v4 04/10] kvm: arm64: Remove __hyp_this_cpu_read

Will Deacon will at kernel.org
Tue Sep 29 13:30:53 EDT 2020


On Tue, Sep 22, 2020 at 09:49:04PM +0100, David Brazdil wrote:
> this_cpu_ptr is meant for use in kernel proper because it selects between
> TPIDR_EL1/2 based on nVHE/VHE. __hyp_this_cpu_ptr was used in hyp to always
> select TPIDR_EL2. Unify all users behind this_cpu_ptr and friends by
> selecting _EL2 register under __KVM_NVHE_HYPERVISOR__. VHE continues
> selecting the register using alternatives.
> 
> Under CONFIG_DEBUG_PREEMPT, the kernel helpers perform a preemption check
> which is omitted by the hyp helpers. Preserve the behavior for nVHE by
> overriding the corresponding macros under __KVM_NVHE_HYPERVISOR__. Extend
> the checks into VHE hyp code.
> 
> Acked-by: Andrew Scull <ascull at google.com>
> Signed-off-by: David Brazdil <dbrazdil at google.com>
> ---
>  arch/arm64/include/asm/kvm_asm.h          | 20 ----------------
>  arch/arm64/include/asm/percpu.h           | 28 +++++++++++++++++++++--
>  arch/arm64/kvm/hyp/include/hyp/debug-sr.h |  4 ++--
>  arch/arm64/kvm/hyp/include/hyp/switch.h   |  8 +++----
>  arch/arm64/kvm/hyp/nvhe/switch.c          |  2 +-
>  arch/arm64/kvm/hyp/vhe/switch.c           |  2 +-
>  arch/arm64/kvm/hyp/vhe/sysreg-sr.c        |  4 ++--
>  7 files changed, 36 insertions(+), 32 deletions(-)

Looks good, thanks for the respin!

Acked-by: Will Deacon <will at kernel.org>

Will



More information about the linux-arm-kernel mailing list