diff options
author | Davidlohr Bueso <dave@gnu.org> | 2012-04-18 06:24:29 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-04-18 22:35:01 -0400 |
commit | f71fa31f9f7ac33cba12b8897983f950ad2c7a5b (patch) | |
tree | e245e0752e2b028d724b448fdc0542d2e5108888 | |
parent | a0c9a822bf37e6282eb6006b407ec5aec22e08fb (diff) |
KVM: MMU: use page table level macro
Its much cleaner to use PT_PAGE_TABLE_LEVEL than its numeric value.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r-- | arch/x86/kvm/mmu.c | 2 | ||||
-rw-r--r-- | arch/x86/kvm/paging_tmpl.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 29ad6f9c58a5..07424cf60434 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -3618,7 +3618,7 @@ static bool detect_write_flooding(struct kvm_mmu_page *sp) | |||
3618 | * Skip write-flooding detected for the sp whose level is 1, because | 3618 | * Skip write-flooding detected for the sp whose level is 1, because |
3619 | * it can become unsync, then the guest page is not write-protected. | 3619 | * it can become unsync, then the guest page is not write-protected. |
3620 | */ | 3620 | */ |
3621 | if (sp->role.level == 1) | 3621 | if (sp->role.level == PT_PAGE_TABLE_LEVEL) |
3622 | return false; | 3622 | return false; |
3623 | 3623 | ||
3624 | return ++sp->write_flooding_count >= 3; | 3624 | return ++sp->write_flooding_count >= 3; |
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index df5a70311be8..34f970937ef1 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -658,7 +658,7 @@ static gpa_t FNAME(get_level1_sp_gpa)(struct kvm_mmu_page *sp) | |||
658 | { | 658 | { |
659 | int offset = 0; | 659 | int offset = 0; |
660 | 660 | ||
661 | WARN_ON(sp->role.level != 1); | 661 | WARN_ON(sp->role.level != PT_PAGE_TABLE_LEVEL); |
662 | 662 | ||
663 | if (PTTYPE == 32) | 663 | if (PTTYPE == 32) |
664 | offset = sp->role.quadrant << PT64_LEVEL_BITS; | 664 | offset = sp->role.quadrant << PT64_LEVEL_BITS; |