public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: extend usage of RET_MMIO_PF_* constants
Date: Tue, 10 Oct 2017 21:16:15 +0200	[thread overview]
Message-ID: <20171010191614.GC28763@flask> (raw)
In-Reply-To: <1507626659-28195-1-git-send-email-pbonzini@redhat.com>

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@redhat.com>
> ---
> 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@redhat.com>

Thanks.

  reply	other threads:[~2017-10-10 19:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10  9:10 [PATCH] KVM: x86: extend usage of RET_MMIO_PF_* constants Paolo Bonzini
2017-10-10 19:16 ` Radim Krčmář [this message]
2017-10-11  6:08   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171010191614.GC28763@flask \
    --to=rkrcmar@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox