提交 f71fa31f 编写于 作者: D Davidlohr Bueso 提交者: Marcelo Tosatti

KVM: MMU: use page table level macro

Its much cleaner to use PT_PAGE_TABLE_LEVEL than its numeric value.
Signed-off-by: NDavidlohr Bueso <dave@gnu.org>
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
上级 a0c9a822
...@@ -3618,7 +3618,7 @@ static bool detect_write_flooding(struct kvm_mmu_page *sp) ...@@ -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 * Skip write-flooding detected for the sp whose level is 1, because
* it can become unsync, then the guest page is not write-protected. * 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 false;
return ++sp->write_flooding_count >= 3; return ++sp->write_flooding_count >= 3;
......
...@@ -658,7 +658,7 @@ static gpa_t FNAME(get_level1_sp_gpa)(struct kvm_mmu_page *sp) ...@@ -658,7 +658,7 @@ static gpa_t FNAME(get_level1_sp_gpa)(struct kvm_mmu_page *sp)
{ {
int offset = 0; int offset = 0;
WARN_ON(sp->role.level != 1); WARN_ON(sp->role.level != PT_PAGE_TABLE_LEVEL);
if (PTTYPE == 32) if (PTTYPE == 32)
offset = sp->role.quadrant << PT64_LEVEL_BITS; offset = sp->role.quadrant << PT64_LEVEL_BITS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册