KVM: x86/mmu: Optimize not-present/MMIO SPTE check in get_mmio_spte()
mainline inclusion from mainline-v5.11-rc3 commit 9aa41879 category: feature bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I7S3VQ CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9aa418792f5f11ef5d6f72265e1f8ae07efd5784 ---------------------------------------------------------------------- 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> conflict: arch/x86/kvm/mmu/mmu.c Signed-off-by:
Yu Zhang <yu.c.zhang@linux.intel.com>
Loading
Please sign in to comment