[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2 of 7] KEXEC BUG: nmi_shootdown_cpus doesn't look after the interrupt flag




On 14/06/11 09:46, Jan Beulich wrote:
>>>> On 13.06.11 at 19:02, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>> nmi_shootdown_cpus is part of the kexec path, coming from a panic, and
>> as such can be called both with interrupts enabled or disabled. We
>> really dont want to accidentally set IF.
> Can interrupts really be enabled when entering this function?
It is unlikely, but I believe there are a few codepaths which could
enter this function with interrupts enabled.  Either way, the last thing
we need is the usual occurrence of leaving this function with interrupts
enabled
>> Therefore, use save/restore in preference to disable/enable.
> I.e. wouldn't just removing the stray local_irq_enable() suffice?
>
> Jan
I was trying to go for minimal changes to the Linux code.  I would agree
that a single disable right at the top of the crash path might be a
better solution.

~Andrew
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>
>> diff -r 076c3034c8c7 -r 1c3d2e4d06fe xen/arch/x86/crash.c
>> --- a/xen/arch/x86/crash.c   Mon Jun 13 17:45:43 2011 +0100
>> +++ b/xen/arch/x86/crash.c   Mon Jun 13 17:45:43 2011 +0100
>> @@ -55,9 +55,9 @@ static int crash_nmi_callback(struct cpu
>>  
>>  static void nmi_shootdown_cpus(void)
>>  {
>> -    unsigned long msecs;
>> +    unsigned long msecs, flags;
>>  
>> -    local_irq_disable();
>> +    local_irq_save(flags);
>>  
>>      crashing_cpu = smp_processor_id();
>>      local_irq_count(crashing_cpu) = 0;
>> @@ -80,7 +80,7 @@ static void nmi_shootdown_cpus(void)
>>      __stop_this_cpu();
>>      disable_IO_APIC();
>>  
>> -    local_irq_enable();
>> +    local_irq_restore(flags);
>>  }
>>  
>>  void machine_crash_shutdown(void)
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@xxxxxxxxxxxxxxxxxxx 
>> http://lists.xensource.com/xen-devel 
>
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.