# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1190994691 21600
# Node ID be065a274674c792a2bd5787c635d972d65770b7
# Parent 35f418758a773a5727bde40b87897a5497e81f5d
[IA64] Xenification of IA64 Kexec/kdump
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
---
arch/ia64/kernel/crash.c | 11 +++++------
arch/ia64/kernel/relocate_kernel.S | 32 ++++++++++++++++++++++++++++++++
arch/ia64/kernel/setup.c | 12 ++++++++++++
arch/ia64/xen/xcom_hcall.c | 31 +++++++++++++++++++++++++++++++
include/asm-ia64/hypercall.h | 7 +++++++
include/asm-ia64/xen/xcom_hcall.h | 2 ++
6 files changed, 89 insertions(+), 6 deletions(-)
diff -r 35f418758a77 -r be065a274674 arch/ia64/kernel/crash.c
--- a/arch/ia64/kernel/crash.c Thu Sep 27 13:47:38 2007 -0600
+++ b/arch/ia64/kernel/crash.c Fri Sep 28 09:51:31 2007 -0600
@@ -160,7 +160,6 @@ static int
static int
kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data)
{
- struct ia64_mca_notify_die *nd;
struct die_args *args = data;
if (!kdump_on_init)
@@ -172,11 +171,11 @@ kdump_init_notifier(struct notifier_bloc
val != DIE_MCA_MONARCH_LEAVE)
return NOTIFY_DONE;
- nd = (struct ia64_mca_notify_die *)args->err;
- /* Reason code 1 means machine check rendezous*/
- if ((val == DIE_INIT_MONARCH_ENTER || DIE_INIT_SLAVE_ENTER) &&
- nd->sos->rv_rc == 1)
- return NOTIFY_DONE;
+ /* There really ought to be a check here to see if this
+ * is a machine check rendevous. The kexec code that
+ * was merged around 2.6.20-rc1 includes such a check.
+ * But the check relies on infastructure that is not
+ * available in 2.6.16. */
switch (val) {
case DIE_INIT_MONARCH_ENTER:
diff -r 35f418758a77 -r be065a274674 arch/ia64/kernel/relocate_kernel.S
--- a/arch/ia64/kernel/relocate_kernel.S Thu Sep 27 13:47:38 2007 -0600
+++ b/arch/ia64/kernel/relocate_kernel.S Fri Sep 28 09:51:31 2007 -0600
@@ -20,7 +20,11 @@
*/
GLOBAL_ENTRY(relocate_new_kernel)
.prologue
+#ifdef CONFIG_XEN
+ alloc r31=ar.pfs,7,0,0,0
+#else
alloc r31=ar.pfs,4,0,0,0
+#endif
.body
.reloc_entry:
{
@@ -33,7 +37,11 @@ GLOBAL_ENTRY(relocate_new_kernel)
srlz.i
}
;;
+#ifdef CONFIG_XEN
+ dep r2=0,r2,60,4 //to physical address
+#else
dep r2=0,r2,61,3 //to physical address
+#endif
;;
//first switch to physical mode
add r3=1f-.reloc_entry, r2
@@ -57,11 +65,19 @@ 1:
1:
//physical mode code begin
mov b6=in1
+#ifdef CONFIG_XEN
+ dep r28=0,in2,60,4 //to physical address
+#else
dep r28=0,in2,61,3 //to physical address
+#endif
// purge all TC entries
#define O(member) IA64_CPUINFO_##member##_OFFSET
+#ifdef CONFIG_XEN
+ mov r2=in4 // load phys addr of cpu_info into r2
+#else
GET_THIS_PADDR(r2, cpu_info) // load phys addr of cpu_info into r2
+#endif
;;
addl r17=O(PTCE_STRIDE),r2
addl r2=O(PTCE_BASE),r2
@@ -95,7 +111,11 @@ 4:
srlz.i
;;
//purge TR entry for kernel text and data
+#ifdef CONFIG_XEN
+ mov r16=in5
+#else
movl r16=KERNEL_START
+#endif
mov r18=KERNEL_TR_PAGE_SHIFT<<2
;;
ptr.i r16, r18
@@ -126,7 +146,11 @@ 4:
mov r16=IA64_KR(CURRENT_STACK)
;;
shl r16=r16,IA64_GRANULE_SHIFT
+#ifdef CONFIG_XEN
+ mov r19=in6
+#else
movl r19=PAGE_OFFSET
+#endif
;;
add r16=r19,r16
mov r18=IA64_GRANULE_SHIFT<<2
@@ -183,10 +207,18 @@ 1:
.align 32
memory_stack:
+#ifdef CONFIG_XEN
+ .fill 4096, 1, 0
+#else
.fill 8192, 1, 0
+#endif
memory_stack_end:
register_stack:
+#ifdef CONFIG_XEN
+ .fill 4096, 1, 0
+#else
.fill 8192, 1, 0
+#endif
register_stack_end:
relocate_new_kernel_end:
END(relocate_new_kernel)
diff -r 35f418758a77 -r be065a274674 arch/ia64/kernel/setup.c
--- a/arch/ia64/kernel/setup.c Thu Sep 27 13:47:38 2007 -0600
+++ b/arch/ia64/kernel/setup.c Fri Sep 28 09:51:31 2007 -0600
@@ -307,6 +307,15 @@ reserve_memory (void)
{
char *from = strstr(saved_command_line, "crashkernel=");
unsigned long base, size;
+#ifdef CONFIG_XEN
+ if (is_initial_xendomain()) {
+ if (from)
+ printk("Ignoring crashkernel command line, "
+ "parameter will be supplied by xen\n");
+ xen_machine_kexec_setup_resources();
+ }
+ else {
+#endif
if (from) {
size = memparse(from + 12, &from);
if (size) {
@@ -324,6 +333,9 @@ reserve_memory (void)
}
}
}
+#ifdef CONFIG_XEN
+ }
+#endif
efi_memmap_res.start = ia64_boot_param->efi_memmap;
efi_memmap_res.end = efi_memmap_res.start +
ia64_boot_param->efi_memmap_size;
diff -r 35f418758a77 -r be065a274674 arch/ia64/xen/xcom_hcall.c
--- a/arch/ia64/xen/xcom_hcall.c Thu Sep 27 13:47:38 2007 -0600
+++ b/arch/ia64/xen/xcom_hcall.c Fri Sep 28 09:51:31 2007 -0600
@@ -39,6 +39,7 @@
#include <xen/interface/hvm/params.h>
#include <xen/interface/xenoprof.h>
#include <xen/interface/vcpu.h>
+#include <xen/interface/kexec.h>
#include <asm/hypervisor.h>
#include <asm/page.h>
#include <asm/uaccess.h>
@@ -630,3 +631,33 @@ xencomm_hypercall_fpswa_revision(unsigne
return xencomm_arch_hypercall_fpswa_revision(desc);
}
EXPORT_SYMBOL_GPL(xencomm_hypercall_fpswa_revision);
+
+int
+xencomm_hypercall_kexec_op(int cmd, void *arg)
+{
+ unsigned int argsize;
+ struct xencomm_handle *desc;
+
+ switch (cmd) {
+ case KEXEC_CMD_kexec_get_range:
+ argsize = sizeof(xen_kexec_range_t);
+ break;
+ case KEXEC_CMD_kexec_load:
+ case KEXEC_CMD_kexec_unload:
+ argsize = sizeof(xen_kexec_load_t);
+ break;
+ case KEXEC_CMD_kexec:
+ argsize = sizeof(xen_kexec_exec_t);
+ break;
+ default:
+ printk("%s:%d cmd %d isn't supported\n",
+ __func__, __LINE__, cmd);
+ BUG();
+ }
+
+ desc = xencomm_map_no_alloc(arg, argsize);
+ if (desc == NULL)
+ return -EINVAL;
+
+ return xencomm_arch_hypercall_kexec_op(cmd, desc);
+}
diff -r 35f418758a77 -r be065a274674 include/asm-ia64/hypercall.h
--- a/include/asm-ia64/hypercall.h Thu Sep 27 13:47:38 2007 -0600
+++ b/include/asm-ia64/hypercall.h Fri Sep 28 09:51:31 2007 -0600
@@ -424,6 +424,12 @@ HYPERVISOR_add_io_space(unsigned long ph
{
return _hypercall4(int, ia64_dom0vp_op, IA64_DOM0VP_add_io_space,
phys_base, sparse, space_number);
+}
+
+static inline int
+xencomm_arch_hypercall_kexec_op(int cmd, struct xencomm_handle *arg)
+{
+ return _hypercall2(int, kexec_op, cmd, arg);
}
// for balloon driver
@@ -444,6 +450,7 @@ HYPERVISOR_add_io_space(unsigned long ph
#define HYPERVISOR_suspend xencomm_hypercall_suspend
#define HYPERVISOR_vcpu_op xencomm_hypercall_vcpu_op
#define HYPERVISOR_opt_feature xencomm_hypercall_opt_feature
+#define HYPERVISOR_kexec_op xencomm_hypercall_kexec_op
/* to compile gnttab_copy_grant_page() in drivers/xen/core/gnttab.c */
#define HYPERVISOR_mmu_update(req, count, success_count, domid) ({BUG();0;})
diff -r 35f418758a77 -r be065a274674 include/asm-ia64/xen/xcom_hcall.h
--- a/include/asm-ia64/xen/xcom_hcall.h Thu Sep 27 13:47:38 2007 -0600
+++ b/include/asm-ia64/xen/xcom_hcall.h Fri Sep 28 09:51:31 2007 -0600
@@ -62,4 +62,6 @@ extern int privcmd_hypercall(struct priv
extern int xen_foreign_p2m_expose(struct privcmd_hypercall *hypercall);
+extern int xencomm_hypercall_kexec_op(int cmd, void *arg);
+
#endif /* _LINUX_XENCOMM_HCALL_H_ */
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|