[PATCH v3 02/18] KVM: arm64: Remove hyp_panic arguments

Marc Zyngier maz at kernel.org
Mon Sep 7 06:21:08 EDT 2020


Hi Andrew,

On Thu, 03 Sep 2020 14:52:51 +0100,
Andrew Scull <ascull at google.com> wrote:
> 
> hyp_panic is able to find all the context it needs from within itself so
> remove the argument. The __hyp_panic wrapper becomes redundant so is
> also removed.
> 
> Signed-off-by: Andrew Scull <ascull at google.com>
> ---
>  arch/arm64/include/asm/kvm_hyp.h        | 2 +-
>  arch/arm64/kvm/hyp/hyp-entry.S          | 7 +------
>  arch/arm64/kvm/hyp/include/hyp/switch.h | 4 +---
>  arch/arm64/kvm/hyp/nvhe/switch.c        | 4 +++-
>  arch/arm64/kvm/hyp/vhe/switch.c         | 4 +++-
>  5 files changed, 9 insertions(+), 12 deletions(-)
>

[...]

> diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c
> index 3c9c065b3264..1e8a31b7c94c 100644
> --- a/arch/arm64/kvm/hyp/nvhe/switch.c
> +++ b/arch/arm64/kvm/hyp/nvhe/switch.c
> @@ -242,11 +242,13 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu)
>  	return exit_code;
>  }
>  
> -void __noreturn hyp_panic(struct kvm_cpu_context *host_ctxt)
> +void __noreturn hyp_panic(void)
>  {
>  	u64 spsr = read_sysreg_el2(SYS_SPSR);
>  	u64 elr = read_sysreg_el2(SYS_ELR);
>  	u64 par = read_sysreg(par_el1);
> +	struct kvm_cpu_context *host_ctxt =
> +		&__hyp_this_cpu_ptr(kvm_host_data)->host_ctxt;

nit: Please keep assignments on a single line. If that's too long,
just move it outside of the declaration block. No need to respin the
series for that though.

	M.

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



More information about the linux-arm-kernel mailing list