提交 2c80b01b 编写于 作者: J Jeremy Fitzhardinge 提交者: Linus Torvalds

xen: mask _PAGE_PCD from ptes

_PAGE_PCD maps a page with caching disabled, which is typically used for
mapping harware registers.  Xen never allows it to be set on a mapping, and
unprivileged guests never need it since they can't see the real underlying
hardware.  However, some uncached mappings are made early when probing the
(non-existent) APIC, and its OK to mask off the PCD flag in these cases.

This became necessary because Xen started checking for this bit, rather
than silently masking it off.
Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 c06869d6
...@@ -244,6 +244,8 @@ pte_t xen_make_pte(unsigned long long pte) ...@@ -244,6 +244,8 @@ pte_t xen_make_pte(unsigned long long pte)
if (pte & 1) if (pte & 1)
pte = phys_to_machine(XPADDR(pte)).maddr; pte = phys_to_machine(XPADDR(pte)).maddr;
pte &= ~_PAGE_PCD;
return (pte_t){ pte, pte >> 32 }; return (pte_t){ pte, pte >> 32 };
} }
...@@ -291,6 +293,8 @@ pte_t xen_make_pte(unsigned long pte) ...@@ -291,6 +293,8 @@ pte_t xen_make_pte(unsigned long pte)
if (pte & _PAGE_PRESENT) if (pte & _PAGE_PRESENT)
pte = phys_to_machine(XPADDR(pte)).maddr; pte = phys_to_machine(XPADDR(pte)).maddr;
pte &= ~_PAGE_PCD;
return (pte_t){ pte }; return (pte_t){ pte };
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册