Skip to content

Commit f71fa31

Browse files
Davidlohr Buesomatosatti
authored andcommitted
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>
1 parent a0c9a82 commit f71fa31

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎arch/x86/kvm/mmu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3618,7 +3618,7 @@ static bool detect_write_flooding(struct kvm_mmu_page *sp)
36183618
* Skip write-flooding detected for the sp whose level is 1, because
36193619
* it can become unsync, then the guest page is not write-protected.
36203620
*/
3621-
if (sp->role.level == 1)
3621+
if (sp->role.level == PT_PAGE_TABLE_LEVEL)
36223622
return false;
36233623

36243624
return ++sp->write_flooding_count >= 3;

‎arch/x86/kvm/paging_tmpl.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ static gpa_t FNAME(get_level1_sp_gpa)(struct kvm_mmu_page *sp)
658658
{
659659
int offset = 0;
660660

661-
WARN_ON(sp->role.level != 1);
661+
WARN_ON(sp->role.level != PT_PAGE_TABLE_LEVEL);
662662

663663
if (PTTYPE == 32)
664664
offset = sp->role.quadrant << PT64_LEVEL_BITS;

0 commit comments

Comments
 (0)