summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2007-05-09 19:26:16 +0900
committerSimon Horman <horms@verge.net.au>2007-10-17 12:17:28 +0900
commitd955779f2aec43e9926866f2c9d2b1ba5b989c79 (patch)
tree4b979afdeeae77e3d024aad5a653845a65f014ba
parent6dfe4858e2db01b49d52a4cf2bb0dce18324d787 (diff)
Set alternate location for /proc/iomem on ia64 xen
Use /proc/iomem_machine for ia64 xen where pysical and machine efi maps differ. Without this kexec gets a very jaded view of the world, and /proc/vmcore after a kdump will only have a partial memory dump. Requires a companion patch to kexec-tools. Signed-off-by: Simon Horman <horms@verge.net.au> kexec/arch/ia64/Makefile | 1 + kexec/arch/ia64/kexec-iomem.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) 1e7eca377b0b84a638c49eae614103b5e6fa7b42
-rw-r--r--kexec/arch/ia64/Makefile1
-rw-r--r--kexec/arch/ia64/kexec-iomem.c23
2 files changed, 24 insertions, 0 deletions
diff --git a/kexec/arch/ia64/Makefile b/kexec/arch/ia64/Makefile
index 9aacb4b..a8a94fe 100644
--- a/kexec/arch/ia64/Makefile
+++ b/kexec/arch/ia64/Makefile
@@ -1,6 +1,7 @@
#
# kexec ia64 (linux booting linux)
#
+KEXEC_C_SRCS+= kexec/arch/ia64/kexec-iomem.c
KEXEC_C_SRCS+= kexec/arch/ia64/kexec-ia64.c
KEXEC_C_SRCS+= kexec/arch/ia64/kexec-elf-ia64.c
KEXEC_C_SRCS+= kexec/arch/ia64/kexec-elf-rel-ia64.c
diff --git a/kexec/arch/ia64/kexec-iomem.c b/kexec/arch/ia64/kexec-iomem.c
new file mode 100644
index 0000000..97f7730
--- /dev/null
+++ b/kexec/arch/ia64/kexec-iomem.c
@@ -0,0 +1,23 @@
+#include <stdint.h>
+#include <stdio.h>
+#include "../../kexec.h"
+#include "../../crashdump.h"
+
+static const char proc_iomem_str[]= "/proc/iomem";
+static const char proc_iomem_machine_str[]= "/proc/iomem_machine";
+
+/*
+ * On IA64 XEN the EFI tables are virtualised.
+ * For this reason on such systems /proc/iomem_machine is provided,
+ * which is based on the hypervisor's (machine's) EFI tables.
+ * If Xen is in use, then /proc/iomem is used for memory regions relating
+ * to the currently running dom0 kernel, and /proc/iomem_machine is used
+ * for regions relating to the machine itself or the hypervisor.
+ * If Xen is not in used, then /proc/iomem is always used.
+ */
+const char *proc_iomem(int machine)
+{
+ if (machine && xen_present())
+ return proc_iomem_machine_str;
+ return proc_iomem_str;
+}