[PATCH v2 5/5] KVM: arm64: uapi: Add kvm_debug_exit_arch.hsr_high

Marc Zyngier maz at kernel.org
Thu Apr 21 05:58:52 PDT 2022


On Thu, 21 Apr 2022 11:05:47 +0100,
Alexandru Elisei <alexandru.elisei at arm.com> wrote:
> 
> diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c
> index 93d92130d36c..fd5b6773e3a2 100644
> --- a/arch/arm64/kvm/handle_exit.c
> +++ b/arch/arm64/kvm/handle_exit.c
> @@ -121,6 +121,8 @@ static int kvm_handle_guest_debug(struct kvm_vcpu *vcpu)
>  
>  	run->exit_reason = KVM_EXIT_DEBUG;
>  	run->debug.arch.hsr = lower_32_bits(esr);
> +	run->debug.arch.hsr_high = upper_32_bits(esr);
> +	run->flags |= KVM_DEBUG_ARCH_HSR_HIGH_VALID;

Who will eventually clear this flag? I'm concerned that it could be
misinterpreted by other userspace paths, as once you get a debug exit
on this vcpu, it will always be set.

Probably only a matter of clearing flags on all the other exit paths.

Also, please document the flag in the API file (only a couple of x86
flags are there so far).

Thanks,

	M.

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



More information about the linux-arm-kernel mailing list