Skip to content

Commit

Permalink
KVM: MMU: use page table level macro
Browse files Browse the repository at this point in the history
Its much cleaner to use PT_PAGE_TABLE_LEVEL than its numeric value.

Signed-off-by: Davidlohr Bueso <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
Davidlohr Bueso authored and matosatti committed Apr 19, 2012
1 parent a0c9a82 commit f71fa31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3618,7 +3618,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;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kvm/paging_tmpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f71fa31

Please sign in to comment.