]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Use raw level to index into MMIO walks' sptes array
authorSean Christopherson <seanjc@google.com>
Fri, 18 Dec 2020 00:31:38 +0000 (16:31 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 7 Jan 2021 23:00:26 +0000 (18:00 -0500)
commit09566347ac50af27908a9ce184702960740cf55b
tree161eb96575e80fd778af00b5cd92c265d6765c6c
parentd8aa415f9e8b727a5db23c1dbdc2131874ff8e12
KVM: x86/mmu: Use raw level to index into MMIO walks' sptes array

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>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/tdp_mmu.c