From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com ([217.140.110.172]:44468 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725771AbfF3Eks (ORCPT ); Sun, 30 Jun 2019 00:40:48 -0400 From: Anshuman Khandual Subject: Re: [PATCH] mm: Generalize and rename notify_page_fault() as kprobe_page_fault() References: <1560420444-25737-1-git-send-email-anshuman.khandual@arm.com> <20190629145009.GA28613@roeck-us.net> Message-ID: <78863cd0-8cb5-c4fd-ed06-b1136bdbb6ef@arm.com> Date: Sun, 30 Jun 2019 10:11:03 +0530 MIME-Version: 1.0 In-Reply-To: <20190629145009.GA28613@roeck-us.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-s390-owner@vger.kernel.org List-ID: To: Guenter Roeck Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mark Rutland , Michal Hocko , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Dave Hansen , Will Deacon , Paul Mackerras , sparclinux@vger.kernel.org, Stephen Rothwell , linux-s390@vger.kernel.org, Yoshinori Sato , Michael Ellerman , x86@kernel.org, Russell King , Matthew Wilcox , Ingo Molnar , James Hogan , linux-snps-arc@lists.infradead.org, Fenghua Yu , Andrey Konovalov , Andy Lutomirski , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Tony Luck , Heiko Carstens , Vineet Gupta , linux-mips@vger.kernel.org, Ralf Baechle , Paul Burton , Martin Schwidefsky , Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Hello Guenter, On 06/29/2019 08:20 PM, Guenter Roeck wrote: > Hi, > > On Thu, Jun 13, 2019 at 03:37:24PM +0530, Anshuman Khandual wrote: >> Architectures which support kprobes have very similar boilerplate around >> calling kprobe_fault_handler(). Use a helper function in kprobes.h to unify >> them, based on the x86 code. >> >> This changes the behaviour for other architectures when preemption is >> enabled. Previously, they would have disabled preemption while calling the >> kprobe handler. However, preemption would be disabled if this fault was >> due to a kprobe, so we know the fault was not due to a kprobe handler and >> can simply return failure. >> >> This behaviour was introduced in the commit a980c0ef9f6d ("x86/kprobes: >> Refactor kprobes_fault() like kprobe_exceptions_notify()") >> > > With this patch applied, parisc:allmodconfig images no longer build. > > In file included from arch/parisc/mm/fixmap.c:8: > include/linux/kprobes.h: In function 'kprobe_page_fault': > include/linux/kprobes.h:477:9: error: > implicit declaration of function 'kprobe_fault_handler'; did you mean 'kprobe_page_fault'? Yikes.. Arch parisc does not even define (unlike mips which did but never exported) now required function kprobe_fault_handler() when CONFIG_KPROBES is enabled. I believe rather than defining one stub version only for parsic it would be better to have an weak symbol generic stub definition for kprobe_fault_handler() in file include/linux/kprobes.h when CONFIG_KPROBES is enabled along side the other stub definition when !CONFIG_KPROBES. But arch which wants to use kprobe_page_fault() cannot use stub kprobe_fault_handler() definition and will have to provide one. I will probably add a comment regarding this. > > Reverting the patch fixes the problem. > > Guenter > Thanks for reporting the problem.