2010-03-02 01:46:56 +01:00
|
|
|
Index: xen-4.0.0-testing/xen/arch/ia64/linux-xen/smp.c
|
|
|
|
===================================================================
|
|
|
|
--- xen-4.0.0-testing.orig/xen/arch/ia64/linux-xen/smp.c
|
|
|
|
+++ xen-4.0.0-testing/xen/arch/ia64/linux-xen/smp.c
|
2010-01-16 01:12:54 +01:00
|
|
|
@@ -189,7 +189,7 @@ handle_IPI (int irq, void *dev_id, struc
|
2008-09-12 17:57:53 +02:00
|
|
|
* At this point the structure may be gone unless
|
|
|
|
* wait is true.
|
|
|
|
*/
|
|
|
|
- (*func)(info);
|
|
|
|
+ (*func)(info ?: regs);
|
|
|
|
|
|
|
|
/* Notify the sending CPU that the task is done. */
|
|
|
|
mb();
|
2010-03-02 01:46:56 +01:00
|
|
|
Index: xen-4.0.0-testing/xen/arch/x86/smp.c
|
|
|
|
===================================================================
|
|
|
|
--- xen-4.0.0-testing.orig/xen/arch/x86/smp.c
|
|
|
|
+++ xen-4.0.0-testing/xen/arch/x86/smp.c
|
2010-04-02 17:57:59 +02:00
|
|
|
@@ -395,7 +395,7 @@ static void __smp_call_function_interrup
|
2008-09-12 17:57:53 +02:00
|
|
|
|
2010-01-16 01:12:54 +01:00
|
|
|
if ( call_data.wait )
|
2008-09-12 17:57:53 +02:00
|
|
|
{
|
|
|
|
- (*func)(info);
|
2010-01-16 01:12:54 +01:00
|
|
|
+ (*func)(info ?: get_irq_regs());
|
2008-09-12 17:57:53 +02:00
|
|
|
mb();
|
2010-01-16 01:12:54 +01:00
|
|
|
atomic_inc(&call_data.finished);
|
2008-09-12 17:57:53 +02:00
|
|
|
}
|
2010-04-02 17:57:59 +02:00
|
|
|
@@ -403,7 +403,7 @@ static void __smp_call_function_interrup
|
2008-09-12 17:57:53 +02:00
|
|
|
{
|
|
|
|
mb();
|
2010-01-16 01:12:54 +01:00
|
|
|
atomic_inc(&call_data.started);
|
2008-09-12 17:57:53 +02:00
|
|
|
- (*func)(info);
|
2010-01-16 01:12:54 +01:00
|
|
|
+ (*func)(info ?: get_irq_regs());
|
2008-09-12 17:57:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
irq_exit();
|
2010-03-02 01:46:56 +01:00
|
|
|
Index: xen-4.0.0-testing/xen/common/keyhandler.c
|
|
|
|
===================================================================
|
|
|
|
--- xen-4.0.0-testing.orig/xen/common/keyhandler.c
|
|
|
|
+++ xen-4.0.0-testing/xen/common/keyhandler.c
|
2010-04-02 17:57:59 +02:00
|
|
|
@@ -71,20 +71,45 @@ static struct keyhandler show_handlers_k
|
2010-01-16 01:12:54 +01:00
|
|
|
.desc = "show this message"
|
|
|
|
};
|
2008-09-12 17:57:53 +02:00
|
|
|
|
|
|
|
-static void __dump_execstate(void *unused)
|
2010-04-02 17:57:59 +02:00
|
|
|
+static cpumask_t dump_execstate_mask;
|
|
|
|
+
|
2008-09-12 17:57:53 +02:00
|
|
|
+static void __dump_execstate(void *_regs)
|
|
|
|
{
|
|
|
|
- dump_execution_state();
|
|
|
|
- printk("*** Dumping CPU%d guest state: ***\n", smp_processor_id());
|
|
|
|
+ struct cpu_user_regs *regs = _regs;
|
|
|
|
+ unsigned int cpu = smp_processor_id();
|
|
|
|
+
|
|
|
|
+ if ( !guest_mode(regs) )
|
|
|
|
+ {
|
|
|
|
+ printk("\n*** Dumping CPU%u host state: ***\n", cpu);
|
|
|
|
+ show_execution_state(regs);
|
|
|
|
+ }
|
|
|
|
if ( is_idle_vcpu(current) )
|
|
|
|
- printk("No guest context (CPU is idle).\n");
|
|
|
|
+ printk("No guest context (CPU%u is idle).\n", cpu);
|
|
|
|
else
|
|
|
|
+ {
|
|
|
|
+ printk("*** Dumping CPU%u guest state (d%d:v%d): ***\n",
|
|
|
|
+ smp_processor_id(), current->domain->domain_id,
|
|
|
|
+ current->vcpu_id);
|
|
|
|
show_execution_state(guest_cpu_user_regs());
|
2010-04-02 17:57:59 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ cpu = cycle_cpu(cpu, dump_execstate_mask);
|
|
|
|
+ if ( cpu < NR_CPUS )
|
|
|
|
+ {
|
|
|
|
+ cpu_clear(cpu, dump_execstate_mask);
|
|
|
|
+ on_selected_cpus(cpumask_of(cpu), __dump_execstate, NULL, 0);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ printk("\n");
|
|
|
|
+
|
|
|
|
+ console_end_sync();
|
|
|
|
+ watchdog_enable();
|
2008-09-12 17:57:53 +02:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dump_registers(unsigned char key, struct cpu_user_regs *regs)
|
2010-04-02 17:57:59 +02:00
|
|
|
{
|
|
|
|
- unsigned int cpu;
|
|
|
|
-
|
|
|
|
/* We want to get everything out that we possibly can. */
|
|
|
|
watchdog_disable();
|
|
|
|
console_start_sync();
|
|
|
|
@@ -92,21 +117,9 @@ static void dump_registers(unsigned char
|
2008-09-12 17:57:53 +02:00
|
|
|
printk("'%c' pressed -> dumping registers\n", key);
|
|
|
|
|
|
|
|
/* Get local execution state out immediately, in case we get stuck. */
|
|
|
|
- printk("\n*** Dumping CPU%d host state: ***\n", smp_processor_id());
|
|
|
|
- __dump_execstate(NULL);
|
2010-04-02 17:57:59 +02:00
|
|
|
-
|
|
|
|
- for_each_online_cpu ( cpu )
|
|
|
|
- {
|
|
|
|
- if ( cpu == smp_processor_id() )
|
|
|
|
- continue;
|
2008-09-12 17:57:53 +02:00
|
|
|
- printk("\n*** Dumping CPU%d host state: ***\n", cpu);
|
2010-04-02 17:57:59 +02:00
|
|
|
- on_selected_cpus(cpumask_of(cpu), __dump_execstate, NULL, 1);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- printk("\n");
|
|
|
|
-
|
|
|
|
- console_end_sync();
|
|
|
|
- watchdog_enable();
|
|
|
|
+ cpus_andnot(dump_execstate_mask, cpu_online_map,
|
|
|
|
+ cpumask_of_cpu(smp_processor_id()));
|
|
|
|
+ __dump_execstate(regs);
|
|
|
|
}
|
2008-09-12 17:57:53 +02:00
|
|
|
|
2010-04-02 17:57:59 +02:00
|
|
|
static struct keyhandler dump_registers_keyhandler = {
|
2010-03-02 01:46:56 +01:00
|
|
|
Index: xen-4.0.0-testing/xen/include/asm-ia64/linux-xen/asm/ptrace.h
|
|
|
|
===================================================================
|
|
|
|
--- xen-4.0.0-testing.orig/xen/include/asm-ia64/linux-xen/asm/ptrace.h
|
|
|
|
+++ xen-4.0.0-testing/xen/include/asm-ia64/linux-xen/asm/ptrace.h
|
2008-09-12 17:57:53 +02:00
|
|
|
@@ -278,7 +278,7 @@ struct switch_stack {
|
|
|
|
# define ia64_task_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1)
|
|
|
|
# define ia64_psr(regs) ((struct ia64_psr *) &(regs)->cr_ipsr)
|
|
|
|
#ifdef XEN
|
|
|
|
-# define guest_mode(regs) (ia64_psr(regs)->cpl != 0)
|
|
|
|
+# define guest_mode(regs) (ia64_psr(regs)->cpl && !ia64_psr(regs)->vm)
|
|
|
|
# define guest_kernel_mode(regs) (ia64_psr(regs)->cpl == CONFIG_CPL0_EMUL)
|
|
|
|
# define vmx_guest_kernel_mode(regs) (ia64_psr(regs)->cpl == 0)
|
|
|
|
# define regs_increment_iip(regs) \
|