Re: [PATCH] KVM: arm64: Avoid rewinding the PC for trapped SMCs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andrew,

On 14/07/2020 10:45, Andrew Scull wrote:
> When handling a guest's SError that was identified in __guest_exit, it
> is injected back into the guest at the instruction that caused the
> switch into hyp. A trapped SMC does not advance the PC so no adjustment
> needs to be made to the PC.

Oops!

Reviewed-by: James Morse <james.morse@xxxxxxx>


Thanks,

James


> Fixes: ddb3d07cfe90 ("arm64: KVM: Inject a Virtual SError if it was pending")
> Signed-off-by: Andrew Scull <ascull@xxxxxxxxxx>
> ---
>  arch/arm64/kvm/handle_exit.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c
> index 98ab33139982..7d9e198ebdf2 100644
> --- a/arch/arm64/kvm/handle_exit.c
> +++ b/arch/arm64/kvm/handle_exit.c
> @@ -244,12 +244,11 @@ int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
>  		u8 esr_ec = ESR_ELx_EC(kvm_vcpu_get_esr(vcpu));
>  
>  		/*
> -		 * HVC/SMC already have an adjusted PC, which we need
> +		 * HVC already has an adjusted PC, which we need
>  		 * to correct in order to return to after having
>  		 * injected the SError.
>  		 */
> -		if (esr_ec == ESR_ELx_EC_HVC32 || esr_ec == ESR_ELx_EC_HVC64 ||
> -		    esr_ec == ESR_ELx_EC_SMC32 || esr_ec == ESR_ELx_EC_SMC64) {
> +		if (esr_ec == ESR_ELx_EC_HVC32 || esr_ec == ESR_ELx_EC_HVC64) {
>  			u32 adj =  kvm_vcpu_trap_il_is32bit(vcpu) ? 4 : 2;
>  			*vcpu_pc(vcpu) -= adj;
>  		}
> 

_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux