Skip to content

Commit

Permalink
xen: mask _PAGE_PCD from ptes
Browse files Browse the repository at this point in the history
_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: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jeremy Fitzhardinge authored and Linus Torvalds committed Nov 29, 2007
1 parent c06869d commit 2c80b01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/xen/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ pte_t xen_make_pte(unsigned long long pte)
if (pte & 1)
pte = phys_to_machine(XPADDR(pte)).maddr;

pte &= ~_PAGE_PCD;

return (pte_t){ pte, pte >> 32 };
}

Expand Down Expand Up @@ -291,6 +293,8 @@ pte_t xen_make_pte(unsigned long pte)
if (pte & _PAGE_PRESENT)
pte = phys_to_machine(XPADDR(pte)).maddr;

pte &= ~_PAGE_PCD;

return (pte_t){ pte };
}

Expand Down

0 comments on commit 2c80b01

Please sign in to comment.