]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86: use 64 bit mask when masking away mfn bits
authorJuergen Gross <jgross@suse.com>
Tue, 4 Apr 2017 12:55:55 +0000 (14:55 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 4 Apr 2017 12:55:55 +0000 (14:55 +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>
master commit: 4edb1a42e3320757e3559f17edf6903bc1777de3
master date: 2017-03-30 15:11:24 +0200

xen/arch/x86/mm/p2m-pt.c

index 3b025d569b373e962709440ae4a4763d4f2ffa3a..9e246b6877788c5a0a3ca9a2a88b9dba5e0d7074 100644 (file)
@@ -452,7 +452,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);