ia64/xen-unstable

changeset 5997:c8279f7c14e2

Fix SMP save/restore for 1 vcpu by adding suspend/resume functions for SMP.
We have to free_irq the irq vectors for the SMP ipi vectors.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Tue Aug 02 19:08:28 2005 +0000 (2005-08-02)
parents 64639ab26b92
children 3cde4433ecda
files linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c	Tue Aug 02 19:06:10 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c	Tue Aug 02 19:08:28 2005 +0000
     1.3 @@ -1529,7 +1529,7 @@ void __init smp_cpus_done(unsigned int m
     1.4  extern irqreturn_t smp_reschedule_interrupt(int, void *, struct pt_regs *);
     1.5  extern irqreturn_t smp_call_function_interrupt(int, void *, struct pt_regs *);
     1.6  
     1.7 -void __init smp_intr_init(void)
     1.8 +void smp_intr_init(void)
     1.9  {
    1.10  	int cpu = smp_processor_id();
    1.11  
    1.12 @@ -1546,3 +1546,24 @@ void __init smp_intr_init(void)
    1.13  	                   smp_call_function_interrupt,
    1.14  	                   SA_INTERRUPT, callfunc_name[cpu], NULL));
    1.15  }
    1.16 +
    1.17 +static void smp_intr_exit(void)
    1.18 +{
    1.19 +	int cpu = smp_processor_id();
    1.20 +
    1.21 +	free_irq(per_cpu(resched_irq, cpu), NULL);
    1.22 +	unbind_ipi_from_irq(RESCHEDULE_VECTOR);
    1.23 +
    1.24 +	free_irq(per_cpu(callfunc_irq, cpu), NULL);
    1.25 +	unbind_ipi_from_irq(CALL_FUNCTION_VECTOR);
    1.26 +}
    1.27 +
    1.28 +void smp_suspend(void)
    1.29 +{
    1.30 +	smp_intr_exit();
    1.31 +}
    1.32 +
    1.33 +void smp_resume(void)
    1.34 +{
    1.35 +	smp_intr_init();
    1.36 +}
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Aug 02 19:06:10 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Aug 02 19:08:28 2005 +0000
     2.3 @@ -91,6 +91,10 @@ static void __do_suspend(void)
     2.4  #define gnttab_resume()  do{}while(0)
     2.5  #endif
     2.6  
     2.7 +#ifdef CONFIG_SMP
     2.8 +    extern void smp_suspend(void);
     2.9 +    extern void smp_resume(void);
    2.10 +#endif
    2.11      extern void time_suspend(void);
    2.12      extern void time_resume(void);
    2.13      extern unsigned long max_pfn;
    2.14 @@ -115,6 +119,10 @@ static void __do_suspend(void)
    2.15  
    2.16      time_suspend();
    2.17  
    2.18 +#ifdef CONFIG_SMP
    2.19 +    smp_suspend();
    2.20 +#endif
    2.21 +
    2.22      xenbus_suspend();
    2.23  
    2.24      ctrl_if_suspend();
    2.25 @@ -158,6 +166,10 @@ static void __do_suspend(void)
    2.26  
    2.27      xenbus_resume();
    2.28  
    2.29 +#ifdef CONFIG_SMP
    2.30 +    smp_resume();
    2.31 +#endif
    2.32 +
    2.33      time_resume();
    2.34  
    2.35      blkdev_resume();