The XEN_VIRT_START constant was changed in Xen4, so it can no longer be a
simple define. Initialize it to its correct value depending on the Xen major
version.
Signed-off-by: Petr Tesarik <ptesarik(a)suse.cz>
---
xen_hyper.c | 7 +++++++
xen_hyper_defs.h | 5 ++++-
2 files changed, 11 insertions(+), 1 deletion(-)
--- a/xen_hyper.c
+++ b/xen_hyper.c
@@ -42,6 +42,13 @@
long member_offset;
#endif
+#ifdef X86_64
+ if (xen_major_version() >= 4)
+ xht->xen_virt_start = 0xffff82c480000000;
+ else
+ xht->xen_virt_start = 0xffff828c80000000;
+#endif
+
if (machine_type("X86_64") &&
symbol_exists("xen_phys_start") && !xen_phys_start())
error(WARNING,
--- a/xen_hyper_defs.h
+++ b/xen_hyper_defs.h
@@ -65,7 +65,7 @@
#define DIRECTMAP_VIRT_START (0xffff830000000000)
#define DIRECTMAP_VIRT_END (0xffff840000000000)
#define PAGE_OFFSET_XEN_HYPER DIRECTMAP_VIRT_START
-#define XEN_VIRT_START (0xffff828c80000000)
+#define XEN_VIRT_START (xht->xen_virt_start)
#define XEN_VIRT_ADDR(vaddr) \
(((vaddr) >= XEN_VIRT_START) && ((vaddr) < DIRECTMAP_VIRT_START))
#endif
@@ -408,6 +408,9 @@
int percpu_shift;
int idle_vcpu_size;
ulong *idle_vcpu_array;
+#ifdef X86_64
+ ulong xen_virt_start;
+#endif
};
struct xen_hyper_dumpinfo_context {