]> 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)
commitcca8ccaefbbd360efe2b8fbb8d675c4eb1d9a79e
tree161eb96575e80fd778af00b5cd92c265d6765c6c
parentda7876918d2c148959fecc46477d6903daa06300
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