@@ -45,13 +45,20 @@
#undef page_to_mfn
#define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
=20
-/* We may store INVALID_MFN in l1 PTEs. We need to clip this
- * to avoid trampling over higher-order bits (NX, p2m type, IOMMU flags). =
We
- * seem to not need to unclip on the return path, as callers are concerned=
only
- * with p2m type in such cases.=20
+/*
+ * We may store INVALID_MFN in PTEs. We need to clip this to avoid trampl=
ing
+ * over higher-order bits (NX, p2m type, IOMMU flags). We seem to not nee=
d
+ * to unclip on the read path, as callers are concerned only with p2m type=
in
+ * such cases.
*/
#define p2m_l1e_from_pfn(pfn, flags) \
l1e_from_pfn((pfn) & (PADDR_MASK >> PAGE_SHIFT), (flags))
+#define p2m_l2e_from_pfn(pfn, flags) \
+ l2e_from_pfn((pfn) & ((PADDR_MASK & ~(_PAGE_PSE_PAT | 0UL)) \
+ >> PAGE_SHIFT), (flags) | _PAGE_PSE)
+#define p2m_l3e_from_pfn(pfn, flags) \