@@ -96,7 +96,14 @@
* Host IA32_CR_PAT value to cover all memory types. This is not the default
* MSR_PAT value, and is an ABI with PV guests.
*/
-#define XEN_MSR_PAT _AC(0x050100070406, ULL)
+#define XEN_MSR_PAT ((_AC(X86_MT_WB, ULL) << 0x00) | \
+ (_AC(X86_MT_WT, ULL) << 0x08) | \
+ (_AC(X86_MT_UCM, ULL) << 0x10) | \
+ (_AC(X86_MT_UC, ULL) << 0x18) | \
+ (_AC(X86_MT_WC, ULL) << 0x20) | \
+ (_AC(X86_MT_WP, ULL) << 0x28) | \
+ (_AC(X86_MT_UC, ULL) << 0x30) | \
+ (_AC(X86_MT_UC, ULL) << 0x38))
#ifndef __ASSEMBLY__
@@ -6352,6 +6352,17 @@ unsigned long get_upper_mfn_bound(void)
return min(max_mfn, 1UL << (paddr_bits - PAGE_SHIFT)) - 1;
}
+static void __init __maybe_unused build_assertions(void)
+{
+ /*
+ * If this trips, any guest that blindly rely on the public API in xen.h
+ * (instead of reading the PAT from Xen, as Linux 3.19+ does) will be
+ * broken. Furthermore, live migration of PV guests between Xen versions
+ * using different PATs will not work.
+ */
+ BUILD_BUG_ON(XEN_MSR_PAT != 0x050100070406ULL);
+}
+
/*
* Local variables:
* mode: C