Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756084AbbFOUsz (ORCPT ); Mon, 15 Jun 2015 16:48:55 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:33772 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751864AbbFOUsp (ORCPT ); Mon, 15 Jun 2015 16:48:45 -0400 MIME-Version: 1.0 In-Reply-To: <20150615202856.GA13273@gmail.com> References: <1434188955-31397-1-git-send-email-mingo@kernel.org> <20150613185828.GA32376@redhat.com> <20150614075943.GA810@gmail.com> <20150614200623.GB19582@redhat.com> <87bnghit74.fsf@tassilo.jf.intel.com> <20150615202856.GA13273@gmail.com> From: Andy Lutomirski Date: Mon, 15 Jun 2015 13:48:23 -0700 Message-ID: Subject: Re: why do we need vmalloc_sync_all? To: Ingo Molnar Cc: Andi Kleen , Oleg Nesterov , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Andrew Morton , Denys Vlasenko , Brian Gerst , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , Linus Torvalds , Thomas Gleixner , Waiman Long Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1872 Lines: 48 On Mon, Jun 15, 2015 at 1:28 PM, Ingo Molnar wrote: > > * Andy Lutomirski wrote: > >> On Sun, Jun 14, 2015 at 7:47 PM, Andi Kleen wrote: >> > Oleg Nesterov writes: >> >> >> >> But again, the kernel no longer does this? do_page_fault() does >> >> vmalloc_fault() without notify_die(). If it fails, I do not see how/why a >> >> modular DIE_OOPS handler could try to resolve this problem and trigger >> >> another fault. >> > >> > The same problem can happen from NMI handlers or machine check handlers. It's >> > not necessarily tied to page faults only. >> >> AIUI, the point of the one and only vmalloc_sync_all call is to prevent >> infinitely recursive faults when we call a notify_die callback. The only thing >> that it could realistically protect is module text or static non-per-cpu module >> data, since that's the only thing that's reliably already in the init pgd. I'm >> with Oleg: I don't see how that can happen, since do_page_fault fixes up vmalloc >> faults before it calls notify_die. > > Yes, but what I meant is that it can happen if due to an unrelated kernel bug and > unlucky timing we have installed this new handler just when that other unrelated > kernel bug triggers: say a #GPF crash in kernel code. I still don't see the problem. CPU A: crash and start executing do_page_fault CPU B: register_die_notifier CPU A: notify_die now we get a vmalloc fault, fix it up, and return to do_page_fault and print the oops. > > In any case it should all be mooted with the removal of lazy PGD instantiation. Agreed. --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/