We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d742db7 commit 9d3004bCopy full SHA for 9d3004b
include/xen/arm/page.h
@@ -76,7 +76,11 @@ static inline unsigned long bfn_to_pfn(unsigned long bfn)
76
#define bfn_to_local_pfn(bfn) bfn_to_pfn(bfn)
77
78
/* VIRT <-> GUEST conversion */
79
-#define virt_to_gfn(v) (pfn_to_gfn(virt_to_phys(v) >> XEN_PAGE_SHIFT))
+#define virt_to_gfn(v) \
80
+ ({ \
81
+ WARN_ON_ONCE(!virt_addr_valid(v)); \
82
+ pfn_to_gfn(virt_to_phys(v) >> XEN_PAGE_SHIFT); \
83
+ })
84
#define gfn_to_virt(m) (__va(gfn_to_pfn(m) << XEN_PAGE_SHIFT))
85
86
/* Only used in PV code. But ARM guests are always HVM. */
0 commit comments