KVM: x86/mmu: Use raw level to index into MMIO walks' sptes array
mainline inclusion from mainline-v5.11-rc3 commit dde81f94 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=dde81f9477d018a96fba991c5928c6ab8cc109f8 ---------------------------------------------------------------------- Bump the size of the sptes array by one and use the raw level of the SPTE to index into the sptes array. Using the SPTE level directly improves readability by eliminating the need to reason out why the level is being adjusted when indexing the array. The array is on the stack and is not explicitly initialized; bumping its size is nothing more than a superficial adjustment to the stack frame. Signed-off-by:Sean Christopherson <seanjc@google.com> Message-Id: <20201218003139.2167891-4-seanjc@google.com> Reviewed-by:
Vitaly Kuznetsov <vkuznets@redhat.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