Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Davidlohr Bueso and committed by
Marcelo Tosatti
f71fa31f a0c9a822

+2 -2
+1 -1
arch/x86/kvm/mmu.c
··· 3618 3618 * Skip write-flooding detected for the sp whose level is 1, because 3619 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 3622 return false; 3623 3623 3624 3624 return ++sp->write_flooding_count >= 3;
+1 -1
arch/x86/kvm/paging_tmpl.h
··· 658 658 { 659 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 663 if (PTTYPE == 32) 664 664 offset = sp->role.quadrant << PT64_LEVEL_BITS;