]> xenbits.xensource.com Git - people/larsk/xen.git/commitdiff
x86/HVM: relax shadow mode check in hvm_set_cr3()
authorJan Beulich <jbeulich@suse.com>
Wed, 18 Sep 2019 13:19:08 +0000 (15:19 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 18 Sep 2019 13:19:08 +0000 (15:19 +0200)
There's no need to re-obtain a page reference if only bits not affecting
the address change.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/hvm.c

index 977934a56cad73dd81869b2fb3779c2a46165ee3..fdb1e17f59c45931eaab0ef043cf5fa5e46faa54 100644 (file)
@@ -2323,7 +2323,7 @@ int hvm_set_cr3(unsigned long value, bool may_defer)
     }
 
     if ( hvm_paging_enabled(v) && !paging_mode_hap(v->domain) &&
-         (value != v->arch.hvm.guest_cr[3]) )
+         ((value ^ v->arch.hvm.guest_cr[3]) >> PAGE_SHIFT) )
     {
         /* Shadow-mode CR3 change. Check PDBR and update refcounts. */
         HVM_DBG_LOG(DBG_LEVEL_VMMU, "CR3 value = %lx", value);