Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp699563ybi; Sat, 29 Jun 2019 21:41:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgCmM0y9lK/uWE7/F+wRr9N9sMf8MuaoOF0I8CliqX6gVDV01gwezuB8fGd5wVxsqig1X3 X-Received: by 2002:a63:6b07:: with SMTP id g7mr18182047pgc.325.1561869683270; Sat, 29 Jun 2019 21:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561869683; cv=none; d=google.com; s=arc-20160816; b=DtkXZYAwF4cFjgU5uvvRKm00nqHDfMIvf1xLW6UNvTWqYY2yENsDNz7VZp/8dG+SuR 7JuVwbrtfF1CHi94scgbRXAV8H6wz3oHU/jFKo8qbjDADh5M+1Kt9hZv89l8VjGGA+AU ByFwVyNyQW8pOhPGyHaUyftvKzyeHqSfecM7w6o/h1w28D5QM6RUkKArrkqgJzi0r1oi Tpa+xwKTJCUkFAfAjqGBx1sO0d4mixbaoBDtlX3ULcLj8lowZFdQy22a0R5MLe+k0YU4 qW3OilGjp2QsWOo3QWFU+0kScrEE26OgySkDfXOOy2a5rZAxvuAzyZspa9KkTtvIcbJw m/HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=tuWaEnwN9yE4g1QwgaGCgWIC2IM105I5Nc4PIF0YlVI=; b=Ihec/f8TaD/rr4Pz3LKj3C4e+fynH9sMmvhtCraFBlAU5e5Z1+g4HRqMgPhcZTrKjT f1gsB1E10Qz6vX2aUZgBrxbuy748bgjfvjnvzY1vI6mjbGt3V1uU6PaRoDlzLbhzzdd5 D3O1r957elXDu9zBD8w9xI0FZPwgFgozi7pDCL90Y5j2buUW46UfAXSTwH3jO2SJICHN o2v5GFU5Cs+gtoYGxEZ7oDghZKkMUlRdY1pE3dpi88+aPZ0cTV27VWjEHe2w823VeL6M oJuJeMUKTMa9jIh9wiQ6k+xR6csevLGbZ6ELSxXIlMga++irTUq6j8MNwRnML5YGx8M9 8jKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g129si7873690pfb.1.2019.06.29.21.40.55; Sat, 29 Jun 2019 21:41:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726513AbfF3Ekt (ORCPT + 99 others); Sun, 30 Jun 2019 00:40:49 -0400 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 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5A8E728; Sat, 29 Jun 2019 21:40:47 -0700 (PDT) Received: from [192.168.0.129] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5ECD73F706; Sat, 29 Jun 2019 21:40:37 -0700 (PDT) From: Anshuman Khandual Subject: Re: [PATCH] mm: Generalize and rename notify_page_fault() as kprobe_page_fault() 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" 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.