WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 2 of 7] KEXEC BUG: nmi_shootdown_cpus doesn't loo

To: Jan Beulich <JBeulich@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2 of 7] KEXEC BUG: nmi_shootdown_cpus doesn't look after the interrupt flag
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Tue, 14 Jun 2011 10:46:25 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 14 Jun 2011 02:47:14 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:cc:message-id :thread-topic:thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=04EMwj+V4ssEFGhuUJsN0UCW0aX5BoihCHrqDydb3V8=; b=GBk1wMafZgLtJE8NA7R85qYqw95MA0LrLYbpn7ARu7fG4uHgToZaA4EfUUxknqhvz4 b4sE7dzAb6PdGkdcGarzWk81ds8P0mYArt5PNMci6g7pZPXr5JIA16yI85hcf2qtShCy erm5XqJnxF1kElgfsRCF6lj0JV6gjjox1Pyz0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=tf0ShN/syHxih59kMnZNkCrkjMAhV3fLdKbcrWM/g9s2yrSYWzcfG+Tw5u4RujucHV mpIPUTah6xL7ETG99oD6iqLlU+qjIPp7IjZ/wH7JIadHp+tjPzvYbh2p3adJWlIVIBl+ UHEV4SpDFPNsGNuyWG0I9BAzPEkndya7svgc4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DF73C0E0200007800046F65@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acwqd+zYAxdY6C5QFk2stfEwLMlzQw==
Thread-topic: [Xen-devel] [PATCH 2 of 7] KEXEC BUG: nmi_shootdown_cpus doesn't look after the interrupt flag
User-agent: Microsoft-Entourage/12.29.0.110113
On 14/06/2011 09:46, "Jan Beulich" <JBeulich@xxxxxxxxxx> 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?
> 
>> Therefore, use save/restore in preference to disable/enable.
> 
> I.e. wouldn't just removing the stray local_irq_enable() suffice?

I'd say that the caller should local_irq_disable(). The function itself
should at most BUG_ON(local_irq_is_enabled()).

 -- Keir

> Jan
> 
>> 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
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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

<Prev in Thread] Current Thread [Next in Thread>