x86: use 64 bit mask when masking away mfn bits

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: 4edb1a42e3
master date: 2017-03-30 15:11:24 +0200
This commit is contained in:
Juergen Gross authored and Jan Beulich committed 2017-04-04 14:55:55 +02:00
1 parent 06403aa5f2
commit ec7f9e1df2
1 file changed
+1 -1
+1 -1
View 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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.