]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Remove the defunct update_pte() paging hook
authorSean Christopherson <seanjc@google.com>
Fri, 15 Jan 2021 00:40:51 +0000 (16:40 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Feb 2021 10:27:17 +0000 (05:27 -0500)
commitbbe9bd5213a0972a39ef74ceb8f25fc0cf50b468
tree66e25896fddf9f472fa38e243ac554b1b4c955a1
parent0664fb9e8075ef8e20815526cbbd629f81c33ff4
KVM: x86/mmu: Remove the defunct update_pte() paging hook

Remove the update_pte() shadow paging logic, which was obsoleted by
commit f77b71643299 ("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>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/x86.c