From: "Jan Beulich" Subject: Re: [PATCH 1/3] x86/irq: local_irq_restore() should not blindly popf Date: Mon, 21 Oct 2013 15:42:07 +0100 Message-ID: <5265595F02000078000FC78E@nat28.tlf.novell.com> References: <1382362893-12603-1-git-send-email-andrew.cooper3@citrix.com> <1382362893-12603-2-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VYGgO-0006Ss-Pu for xen-devel@lists.xenproject.org; Mon, 21 Oct 2013 14:42:12 +0000 In-Reply-To: <1382362893-12603-2-git-send-email-andrew.cooper3@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 21.10.13 at 15:41, Andrew Cooper wrote: > --- a/xen/include/asm-x86/system.h > +++ b/xen/include/asm-x86/system.h > @@ -159,8 +159,10 @@ static always_inline unsigned long __cmpxchg( > #define local_irq_restore(x) \ > ({ \ > BUILD_BUG_ON(sizeof(x) != sizeof(long)); \ > - asm volatile ( "push" __OS " %0 ; popf" __OS \ > - : : "g" (x) : "memory", "cc" ); \ > + if ( x & X86_EFLAGS_IF ) \ > + local_irq_enable(); \ > + else \ > + local_irq_disable(); \ _If_ you're going to re-do this using the mask-and-merge approach I suggested in the other reply, may I ask that you also replace the open coded (1<<9) a few lines down with X86_EFLAGS_IF (at once making the comment there superfluous)? Jan