diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 8fa29d5c8b..0fe14faa5f 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -956,14 +956,17 @@ get_page_from_l1e( flip = _PAGE_RW; } - switch ( l1f & PAGE_CACHE_ATTRS ) + switch ( 0xFF & (XEN_MSR_PAT >> (8 * pte_flags_to_cacheattr(l1f))) ) { - case 0: /* WB */ - flip |= _PAGE_PWT | _PAGE_PCD; + case X86_MT_UC: + case X86_MT_UCM: + case X86_MT_WC: + /* not cacheable, allow */ break; - case _PAGE_PWT: /* WT */ - case _PAGE_PWT | _PAGE_PAT: /* WP */ - flip |= _PAGE_PCD | (l1f & _PAGE_PAT); + + default: + /* potentially cacheable, force to UC */ + flip |= ((l1f & PAGE_CACHE_ATTRS) ^ _PAGE_UC); break; }