From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tycho Andersen Subject: Re: [RFC PATCH v9 02/13] x86: always set IF before oopsing from page fault Date: Wed, 3 Apr 2019 19:42:39 -0600 Message-ID: <20190404013956.GA3365@cisco> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Andy Lutomirski Cc: Mark Rutland , marco.antonio.780-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Michal Hocko , LKML , Greg KH , Boris Ostrovsky , Catalin Marinas , alexander.h.duyck-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, Amir Goldstein , X86 ML , Keith Busch , Dave Hansen , Khalid Aziz , deepa.srinivasan-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, steven.sistare-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, cpandya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, Borislav Petkov , Joao Martins , Christoph Hellwig , Michal Hocko , LSM List , Andi Kleen , "H. Peter Anvin" , "Michael S. Tsirkin" , Jonathan Corbet an List-Id: iommu@lists.linux-foundation.org On Wed, Apr 03, 2019 at 05:12:56PM -0700, Andy Lutomirski wrote: > On Wed, Apr 3, 2019 at 10:36 AM Khalid Aziz wrote: > > > > From: Tycho Andersen > > > > Oopsing might kill the task, via rewind_stack_do_exit() at the bottom, and > > that might sleep: > > > > > > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c > > index 9d5c75f02295..7891add0913f 100644 > > --- a/arch/x86/mm/fault.c > > +++ b/arch/x86/mm/fault.c > > @@ -858,6 +858,12 @@ no_context(struct pt_regs *regs, unsigned long error_code, > > /* Executive summary in case the body of the oops scrolled away */ > > printk(KERN_DEFAULT "CR2: %016lx\n", address); > > > > + /* > > + * We're about to oops, which might kill the task. Make sure we're > > + * allowed to sleep. > > + */ > > + flags |= X86_EFLAGS_IF; > > + > > oops_end(flags, regs, sig); > > } > > > > > NAK. If there's a bug in rewind_stack_do_exit(), please fix it in > rewind_stack_do_exit(). [I trimmed the CC list since google rejected it with E2BIG :)] I guess the problem is really that do_exit() (or really exit_signals()) might sleep. Maybe we should put an irq_enable() at the beginning of do_exit() instead and fix this problem for all arches? Tycho