public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jack Wang <jinpu.wang@ionos.com>
Cc: sashal@kernel.org, stable@vger.kernel.org,
	Sean Christopherson <seanjc@google.com>,
	Yu Zhang <yu.c.zhang@intel.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] KVM: x86/mmu: Remove the defunct update_pte() paging hook
Date: Fri, 14 May 2021 16:21:25 +0200	[thread overview]
Message-ID: <YJ6HZfCvpt3ucpOO@kroah.com> (raw)
In-Reply-To: <20210514113853.37957-1-jinpu.wang@ionos.com>

On Fri, May 14, 2021 at 01:38:53PM +0200, Jack Wang wrote:
> From: Sean Christopherson <seanjc@google.com>
> 
> commit c5e2184d1544f9e56140791eff1a351bea2e63b9 upstream
> 
> Remove the update_pte() shadow paging logic, which was obsoleted by
> commit 4731d4c7a077 ("KVM: MMU: out of sync shadow core"), but never
> removed.  As pointed out by Yu, KVM never write protects leaf page
> tables for the purposes of shadow paging, and instead marks their
> associated shadow page as unsync so that the guest can write PTEs at
> will.
> 
> The update_pte() path, which predates the unsync logic, optimizes COW
> scenarios by refreshing leaf SPTEs when they are written, as opposed to
> zapping the SPTE, restarting the guest, and installing the new SPTE on
> the subsequent fault.  Since KVM no longer write-protects leaf page
> tables, update_pte() is unreachable and can be dropped.
> 
> Reported-by: Yu Zhang <yu.c.zhang@intel.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> Message-Id: <20210115004051.4099250-1-seanjc@google.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> (jwang: backport to 5.4 to fix a warning on AMD nested Virtualization)
> Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
> ---
> We hit a warning in  WARNING: CPU: 62 PID: 29302 at arch/x86/kvm/mmu.c:2250 nonpaging_update_pte+0x5/0x10 [kvm]
> on AMD Opteron(tm) Processor 6386 SE with kernel 5.4.113, it seems nested L2 is running, I notice a similar bug
> report on https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1884058.
> 
> I did test with kvm-unit-tests on both Intel Broadwell/Skylake, AMD Opteron, no
> regression, basic VM tests work fine too on 5.4 kernel.
> the commit c5e2184d1544f9e56140791eff1a351bea2e63b9 can be cherry-picked cleanly
> to kernel 5.10+.

Now queued up, thanks.

greg k-h

  reply	other threads:[~2021-05-14 14:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 11:38 [PATCH] KVM: x86/mmu: Remove the defunct update_pte() paging hook Jack Wang
2021-05-14 14:21 ` Greg KH [this message]
2021-05-17 17:13   ` Sean Christopherson
2021-05-17 17:17     ` Jinpu Wang

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=YJ6HZfCvpt3ucpOO@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=jinpu.wang@ionos.com \
    --cc=pbonzini@redhat.com \
    --cc=sashal@kernel.org \
    --cc=seanjc@google.com \
    --cc=stable@vger.kernel.org \
    --cc=yu.c.zhang@intel.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