]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Optimize not-present/MMIO SPTE check in get_mmio_spte()
authorSean Christopherson <seanjc@google.com>
Fri, 18 Dec 2020 00:31:39 +0000 (16:31 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 7 Jan 2021 23:00:27 +0000 (18:00 -0500)
commit35b8b63c4802bc0c60c2cecbda939d1ba8e0c1d3
treef4910d7c94b78d005d90f51aaac3d772950a5866
parentcca8ccaefbbd360efe2b8fbb8d675c4eb1d9a79e
KVM: x86/mmu: Optimize not-present/MMIO SPTE check in get_mmio_spte()

Check only the terminal leaf for a "!PRESENT || MMIO" SPTE when looking
for reserved bits on valid, non-MMIO SPTEs.  The get_walk() helpers
terminate their walks if a not-present or MMIO SPTE is encountered, i.e.
the non-terminal SPTEs have already been verified to be regular SPTEs.
This eliminates an extra check-and-branch in a relatively hot loop.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20201218003139.2167891-5-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c