kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Tianyu Lan <Tianyu.Lan@microsoft.com>
Cc: "rkrcmar@redhat.com" <rkrcmar@redhat.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] KVM/MMU: Simplify __kvm_sync_page() function
Date: Wed, 18 Jul 2018 13:29:53 +0200	[thread overview]
Message-ID: <c24fa468-37c1-1a37-1674-5fdebb55f319@redhat.com> (raw)
In-Reply-To: <20180718061103.61920-1-Tianyu.Lan@microsoft.com>

On 18/07/2018 08:12, Tianyu Lan wrote:
> Merge check of "sp->role.cr4_pae != !!is_pae(vcpu))" and "vcpu->
> arch.mmu.sync_page(vcpu, sp) == 0". kvm_mmu_prepare_zap_page()
> is called under both these conditions.
> 
> Signed-off-by: Lan Tianyu <Tianyu.Lan@microsoft.com>
> ---
>  arch/x86/kvm/mmu.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index d594690d8b95..c2c1fd66fb36 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -2117,12 +2117,8 @@ static void kvm_mmu_commit_zap_page(struct kvm *kvm,
>  static bool __kvm_sync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
>  			    struct list_head *invalid_list)
>  {
> -	if (sp->role.cr4_pae != !!is_pae(vcpu)) {
> -		kvm_mmu_prepare_zap_page(vcpu->kvm, sp, invalid_list);
> -		return false;
> -	}
> -
> -	if (vcpu->arch.mmu.sync_page(vcpu, sp) == 0) {
> +	if (sp->role.cr4_pae != !!is_pae(vcpu)
> +	    || vcpu->arch.mmu.sync_page(vcpu, sp) == 0) {
>  		kvm_mmu_prepare_zap_page(vcpu->kvm, sp, invalid_list);
>  		return false;
>  	}
> 

Queued, thanks.

Paolo

      reply	other threads:[~2018-07-18 11:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18  6:12 [PATCH] KVM/MMU: Simplify __kvm_sync_page() function Tianyu Lan
2018-07-18 11:29 ` Paolo Bonzini [this message]

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=c24fa468-37c1-1a37-1674-5fdebb55f319@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).