From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com [209.85.213.179]) by kanga.kvack.org (Postfix) with ESMTP id B84F76B00A2 for ; Sat, 28 Feb 2015 19:41:41 -0500 (EST) Received: by igal13 with SMTP id l13so8561917iga.1 for ; Sat, 28 Feb 2015 16:41:41 -0800 (PST) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com. [2607:f8b0:4001:c05::22c]) by mx.google.com with ESMTPS id k126si6970573ioe.102.2015.02.28.16.41.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Feb 2015 16:41:41 -0800 (PST) Received: by igqa13 with SMTP id a13so9218075igq.0 for ; Sat, 28 Feb 2015 16:41:41 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1425164559.4645.157.camel@kernel.crashing.org> References: <1422361485.6648.71.camel@opensuse.org> <54C78756.9090605@suse.cz> <1422364084.6648.82.camel@opensuse.org> <1422836637.17302.9.camel@au1.ibm.com> <1425107567.4645.108.camel@kernel.crashing.org> <1425158083.4645.139.camel@kernel.crashing.org> <1425161796.4645.149.camel@kernel.crashing.org> <1425164559.4645.157.camel@kernel.crashing.org> Date: Sat, 28 Feb 2015 16:41:41 -0800 Message-ID: Subject: Re: Generic page fault (Was: libsigsegv ....) From: Linus Torvalds Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Benjamin Herrenschmidt Cc: "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-mm On Sat, Feb 28, 2015 at 3:02 PM, Benjamin Herrenschmidt wrote: > > Anyway, here's the current patch: Ok, I think I like this approach better. Your FAULT_FLAG_EXEC handling is wrong, though. It shouldn't check VM_WRITE, it should check VM_EXEC. A bit too much copy-paste ;) Btw, it's quite possible that we could just do all the PF_PROT handling at the x86 level, before even calling the generic fault handler. It's not like we even need the vma or the mm semaphore: if it's a non-write protection fault, we always SIGSEGV. So why even bother getting the locks and looking up the page tables etc? Now, that PF_PROT handling isn't exactly performance-critical, but it might help to remove the odd x86 special case from the generic code. Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org