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)
commitdde81f9477d018a96fba991c5928c6ab8cc109f8
tree161eb96575e80fd778af00b5cd92c265d6765c6c
parent39b4d43e6003cee51cd119596d3c33d0449eb44c
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