linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ben Gardon <bgardon@google.com>
Subject: Re: [PATCH] KVM: x86/mmu: Skip !MMU-present SPTEs when removing SP in exclusive mode
Date: Wed, 10 Mar 2021 10:08:05 +0100	[thread overview]
Message-ID: <07cf7833-c74a-9ae0-6895-d74708b97f68@redhat.com> (raw)
In-Reply-To: <20210310003029.1250571-1-seanjc@google.com>

On 10/03/21 01:30, Sean Christopherson wrote:
> diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
> index 50ef757c5586..f0c99fa04ef2 100644
> --- a/arch/x86/kvm/mmu/tdp_mmu.c
> +++ b/arch/x86/kvm/mmu/tdp_mmu.c
> @@ -323,7 +323,18 @@ static void handle_removed_tdp_mmu_page(struct kvm *kvm, u64 *pt,
>   				cpu_relax();
>   			}
>   		} else {
> +			/*
> +			 * If the SPTE is not MMU-present, there is no backing
> +			 * page associated with the SPTE and so no side effects
> +			 * that need to be recorded, and exclusive ownership of
> +			 * mmu_lock ensures the SPTE can't be made present.
> +			 * Note, zapping MMIO SPTEs is also unnecessary as they
> +			 * are guarded by the memslots generation, not by being
> +			 * unreachable.
> +			 */
>   			old_child_spte = READ_ONCE(*sptep);
> +			if (!is_shadow_present_pte(old_child_spte))
> +				continue;
>   
>   			/*
>   			 * Marking the SPTE as a removed SPTE is not

Ben, do you plan to make this path take mmu_lock for read?  If so, this 
wouldn't be too useful IIUC.

Paolo


  reply	other threads:[~2021-03-10  9:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10  0:30 [PATCH] KVM: x86/mmu: Skip !MMU-present SPTEs when removing SP in exclusive mode Sean Christopherson
2021-03-10  9:08 ` Paolo Bonzini [this message]
2021-03-10 21:13   ` Sean Christopherson
2021-03-10 22:24     ` Ben Gardon
2021-03-12 18:12       ` 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=07cf7833-c74a-9ae0-6895-d74708b97f68@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bgardon@google.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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;
as well as URLs for NNTP newsgroup(s).