Re: [PATCH] KVM: x86: extend usage of RET_MMIO_PF_* constants

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

 



2017-10-10 11:10+0200, Paolo Bonzini:
> The x86 MMU if full of code that returns 0 and 1 for retry/emulate.  Use
> the existing RET_MMIO_PF_RETRY/RET_MMIO_PF_EMULATE enum, renaming it to
> drop the MMIO part.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> ---
> diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
> @@ -788,7 +788,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, u32 error_code,
>  
>  	if (try_async_pf(vcpu, prefault, walker.gfn, addr, &pfn, write_fault,
>  			 &map_writable))
> -		return 0;
> +		return RET_PF_RETRY;
>  
>  	if (handle_abnormal_pfn(vcpu, addr, walker.gfn, pfn, walker.pte_access, &r))
>  		return r;
> @@ -833,7 +833,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, u32 error_code,
>  out_unlock:
>  	spin_unlock(&vcpu->kvm->mmu_lock);
>  	kvm_release_pfn_clean(pfn);
> -	return 0;
> +	return RET_PF_EMULATE;

A direct conversion would return RET_PF_RETRY, is this some
optimization?

Apart from that,

Reviewed-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>

Thanks.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux