]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86: use 64 bit mask when masking away mfn bits
authorJuergen Gross <jgross@suse.com>
Thu, 30 Mar 2017 13:11:24 +0000 (15:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 30 Mar 2017 13:11:24 +0000 (15:11 +0200)
When using _PAGE_PSE_PAT as base for a negated bit mask make sure it is
propagated to 64 bits when applied to a 64 bit value.

There seems to be only one place where this is a problem, so fix this
by casting _PAGE_PSE_PAT to 64 bits there.

Not doing so will probably lead to problems on hosts with more than
16 TB of memory.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/mm/p2m-pt.c

index 07e2ccda5eab27a9924f4036bad90b687011b6c0..268b2320a1b44098de8ffd51a320460982fde62b 100644 (file)
@@ -450,7 +450,7 @@ static int do_recalc(struct p2m_domain *p2m, unsigned long gfn)
                      mfn |= _PAGE_PSE_PAT >> PAGE_SHIFT;
                 }
                 else
-                     mfn &= ~(_PAGE_PSE_PAT >> PAGE_SHIFT);
+                     mfn &= ~((unsigned long)_PAGE_PSE_PAT >> PAGE_SHIFT);
                 flags |= _PAGE_PSE;
             }
             e = l1e_from_pfn(mfn, flags);