Message ID | 392b0783-adf7-d3b3-8ed2-65fa2c537e98@suse.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | XSA-292 follow-up | expand |
On Wed, Sep 11, 2019 at 05:25:18PM +0200, Jan Beulich wrote: > 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> Thanks, Roger.
--- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -2326,7 +2326,7 @@ int hvm_set_cr3(unsigned long value, boo } if ( hvm_paging_enabled(v) && !paging_mode_hap(currd) && - (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);
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>