summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2022-09-13 11:54:52 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2022-11-09 20:31:14 +0300
commit3adbdf81038801ee84367845e78bb1a3b36bde39 (patch)
treea42e03e6836b29d8848402609f19ef76d5794676
parentfa3e42037ef53c2aea85faf51d6f947e16dd8fc5 (diff)
downloadlinux-3adbdf81038801ee84367845e78bb1a3b36bde39.tar.xz
KVM: x86/mmu: use helper macro SPTE_ENT_PER_PAGE
Use helper macro SPTE_ENT_PER_PAGE to get the number of spte entries per page. Minor readability improvement. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Sean Christopherson <seanjc@google.com> Message-Id: <20220913085452.25561-1-linmiaohe@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/mmu/mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 639ac64a4e8c..2640871bdcf1 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -1645,7 +1645,7 @@ static int is_empty_shadow_page(u64 *spt)
u64 *pos;
u64 *end;
- for (pos = spt, end = pos + PAGE_SIZE / sizeof(u64); pos != end; pos++)
+ for (pos = spt, end = pos + SPTE_ENT_PER_PAGE; pos != end; pos++)
if (is_shadow_present_pte(*pos)) {
printk(KERN_ERR "%s: %p %llx\n", __func__,
pos, *pos);