From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C843FC282CE for ; Tue, 4 Jun 2019 21:53:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D9C72070B for ; Tue, 4 Jun 2019 21:53:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ovLdSL4i" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726559AbfFDVxb (ORCPT ); Tue, 4 Jun 2019 17:53:31 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48004 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbfFDVxb (ORCPT ); Tue, 4 Jun 2019 17:53:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=G3wca+SCAKCdsPgfUllmpTtM4KBQO++LAonxpdM2SmA=; b=ovLdSL4iAcKuZnniUJB1ElA5+ Fp9dAaModSnLLv5ULQEvzleUTmQu7HgDtfC2fAIoa1LMTHd9ib5dojCWOJUplVR6ywN5ZoFGG4MTj JIp7a8O8J4FCD6qCx/6PrsasyG/i0qdRuVMdJc+uYmunn0avLzwQslZ9VN/CzGhOnT3leHlCOorb7 lIvlTdJJrBdQr+7tCEtwVJ3E8w7qIMdthjNLVE5X6Ptegt1KFF3ysvR6dz+kEQNsZdt4KbX5Ib2eI p7eYeJdAxvXE/Vp6/tR4T9J4wFmvruI6CcaAzJz2y7BwsMz6KVhYHtjrH+oOiEvXSF06g15/gCY3H 9/zgjJpEA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYHN0-0006qf-6V; Tue, 04 Jun 2019 21:53:26 +0000 Date: Tue, 4 Jun 2019 14:53:26 -0700 From: Matthew Wilcox To: Anshuman Khandual Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, Andrew Morton , Michal Hocko , Mark Rutland , Christophe Leroy , Stephen Rothwell , Andrey Konovalov , Michael Ellerman , Paul Mackerras , Russell King , Catalin Marinas , Will Deacon , Tony Luck , Fenghua Yu , Martin Schwidefsky , Heiko Carstens , Yoshinori Sato , "David S. Miller" , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Andy Lutomirski , Dave Hansen Subject: Re: [RFC V2] mm: Generalize notify_page_fault() Message-ID: <20190604215325.GA2025@bombadil.infradead.org> References: <1559630046-12940-1-git-send-email-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1559630046-12940-1-git-send-email-anshuman.khandual@arm.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 04, 2019 at 12:04:06PM +0530, Anshuman Khandual wrote: > +++ b/arch/x86/mm/fault.c > @@ -46,23 +46,6 @@ kmmio_fault(struct pt_regs *regs, unsigned long addr) > return 0; > } > > -static nokprobe_inline int kprobes_fault(struct pt_regs *regs) > -{ ... > -} > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 0e8834a..c5a8dcf 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -1778,6 +1778,7 @@ static inline int pte_devmap(pte_t pte) > } > #endif > > +int notify_page_fault(struct pt_regs *regs, unsigned int trap); Why is it now out-of-line? > +++ b/mm/memory.c > +int __kprobes notify_page_fault(struct pt_regs *regs, unsigned int trap) > +{ > + int ret = 0; > + > + /* > + * To be potentially processing a kprobe fault and to be allowed > + * to call kprobe_running(), we have to be non-preemptible. > + */ > + if (kprobes_built_in() && !preemptible() && !user_mode(regs)) { > + if (kprobe_running() && kprobe_fault_handler(regs, trap)) > + ret = 1; > + } > + return ret; > +} > + I would argue this should be in kprobes.h as a static nokprobe_inline.