--- /dev/null
+#ifndef XTF_X86_MM_H
+#define XTF_X86_MM_H
+
+#include <stdint.h>
+
+#include <arch/x86/config.h>
+#include <arch/x86/page.h>
+
+#include <xen/xen.h>
+
+/*
+ * XTF memory layout.
+ *
+ * Wherever possible, identity layout for simplicity.
+ *
+ * PV guests: VIRT_OFFSET is 0 which causes all linked virtual addresses to be
+ * contiguous in the pagetables created by the domain builder. Therefore,
+ * virt == pfn << PAGE_SHIFT for any pfn constructed by the domain builder.
+ */
+
+#if defined(CONFIG_ENV_pv)
+
+#define m2p ((unsigned long *)MACH2PHYS_VIRT_START)
+
+static inline void *mfn_to_virt(unsigned long mfn)
+{
+ return (void *)(m2p[mfn] << PAGE_SHIFT);
+}
+
+#undef m2p
+
+#endif /* CONFIG_ENV_pv */
+
+#endif /* XTF_X86_MM_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--- /dev/null
+#ifndef XEN_PUBLIC_ARCH_X86_XEN_X86_32_H
+#define XEN_PUBLIC_ARCH_X86_XEN_X86_32_H
+
+#define MACH2PHYS_VIRT_START 0xF5800000UL
+
+#endif /* XEN_PUBLIC_ARCH_X86_XEN_X86_32_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--- /dev/null
+#ifndef XEN_PUBLIC_ARCH_X86_XEN_X86_64_H
+#define XEN_PUBLIC_ARCH_X86_XEN_X86_64_H
+
+#define MACH2PHYS_VIRT_START 0xFFFF800000000000UL
+
+#endif /* XEN_PUBLIC_ARCH_X86_XEN_X86_64_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
#ifndef XEN_PUBLIC_ARCH_X86_XEN_H
#define XEN_PUBLIC_ARCH_X86_XEN_H
+#if defined (__i386__)
+# include "xen-x86_32.h"
+#elif defined (__x86_64__)
+# include "xen-x86_64.h"
+#else
+# error Bad architecture
+#endif
+
#ifndef __ASSEMBLY__
typedef unsigned long xen_pfn_t;
#endif