aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index ca07ed083b59..a20fd613acfe 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -423,8 +423,8 @@ static int *slot_largepage_idx(gfn_t gfn,
423{ 423{
424 unsigned long idx; 424 unsigned long idx;
425 425
426 idx = (gfn / KVM_PAGES_PER_HPAGE(level)) - 426 idx = (gfn >> KVM_HPAGE_GFN_SHIFT(level)) -
427 (slot->base_gfn / KVM_PAGES_PER_HPAGE(level)); 427 (slot->base_gfn >> KVM_HPAGE_GFN_SHIFT(level));
428 return &slot->lpage_info[level - 2][idx].write_count; 428 return &slot->lpage_info[level - 2][idx].write_count;
429} 429}
430 430
@@ -528,8 +528,8 @@ static unsigned long *gfn_to_rmap(struct kvm *kvm, gfn_t gfn, int level)
528 if (likely(level == PT_PAGE_TABLE_LEVEL)) 528 if (likely(level == PT_PAGE_TABLE_LEVEL))
529 return &slot->rmap[gfn - slot->base_gfn]; 529 return &slot->rmap[gfn - slot->base_gfn];
530 530
531 idx = (gfn / KVM_PAGES_PER_HPAGE(level)) - 531 idx = (gfn >> KVM_HPAGE_GFN_SHIFT(level)) -
532 (slot->base_gfn / KVM_PAGES_PER_HPAGE(level)); 532 (slot->base_gfn >> KVM_HPAGE_GFN_SHIFT(level));
533 533
534 return &slot->lpage_info[level - 2][idx].rmap_pde; 534 return &slot->lpage_info[level - 2][idx].rmap_pde;
535} 535}