Skip to contentSkip to conversation

KVM: MMU: use page table level macro

PATCH Applied Davidlohr Bueso 2 participants 2 messages Apr 18, 2012 – Apr 19, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: MMU: use page table level macro

From: Davidlohr Bueso <[email protected]>

Its much cleaner to use PT_PAGE_TABLE_LEVEL than its numeric value.

---
 arch/x86/kvm/mmu.c         |    2 +-
 arch/x86/kvm/paging_tmpl.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/mmu.c +1 -1
index 4cb1642..163a008 100644
@@ -3554,7 +3554,7 @@ static bool detect_write_flooding(struct kvm_mmu_page *sp)
 	 * Skip write-flooding detected for the sp whose level is 1, because
 	 * it can become unsync, then the guest page is not write-protected.
 	 */
-	if (sp->role.level == 1)
+	if (sp->role.level == PT_PAGE_TABLE_LEVEL)
 		return false;
 
 	return ++sp->write_flooding_count >= 3;
arch/x86/kvm/paging_tmpl.h +1 -1
index df5a703..34f9709 100644
@@ -658,7 +658,7 @@ static gpa_t FNAME(get_level1_sp_gpa)(struct kvm_mmu_page *sp)
 {
 	int offset = 0;
 
-	WARN_ON(sp->role.level != 1);
+	WARN_ON(sp->role.level != PT_PAGE_TABLE_LEVEL);
 
 	if (PTTYPE == 32)
 		offset = sp->role.quadrant << PT64_LEVEL_BITS;
Signature · 1 line
1.7.4.1