Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp536795ybi; Thu, 13 Jun 2019 22:16:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQlYMAlqqzYCfOi91IbjHl25VSNw4MpQG+5XJfm4x12yt5HgT25FQLLuK6i4JpHMx1k9Ht X-Received: by 2002:a63:e250:: with SMTP id y16mr33105472pgj.392.1560489419688; Thu, 13 Jun 2019 22:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560489419; cv=none; d=google.com; s=arc-20160816; b=t60OsKihApIO68g9gfVFPxlc2k1fRoAb2OFGXh+o3uUml0wIDz83BMymZOD4Y74JDm dthVYjUegd4ci5ftbcYnnLBEPKpYDkt5LMfKq2e80u9LNVvPq+7CeQCDJ7pN55lob5NL zoXN075Iaz/yJovgS2RtyWVp7Ra1GFGpuNPijLy6qnRBwYf/BGcDZa/hTqtH8n5dlkPK YqoCTxsYkgcNvo9qo/qFxBNObLM/U8NOwgqhkqrDRs0nFbnseNpU8Mmu/FVzt8vnurir lfR/iJarwSzgkpG/kR5+nxtLzivlNQktwRFnwsRPdzmhBGqUZZNHZNFwLs3OhWAGLNeV PVwA== 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=cOyMxqTgBIbrD61iKN0GlHtb83ZM3YbYYmlYOy36+O4=; b=PqfF1sdKcgps+9g+k/AEBNYG7T9CDF11M8mZrjmUQUiCMFl0F+kPXMHxaEvlNadMOX 73wC1KdhPTh653bwWibkX8nVJN1hRd8ssC7HUvdXXWP8n7eyTV7HAQFbbvupxHJmzLmy c6a4tWJDseROI6q/tvD8u2k9L/Z7Nclh7Yv6a+d2r9ek9T9rmoa+wQ1V0Aq/fPeQvt0B XOfl8OslPsyyqhTXujOBVFNEt/SO4lDaVR8sEb8Pa2piW5qN9t0D6T7JKY+DwZMG3VoL TBek+akID7IDvYkyRu/3v/R9G+go0XcM2yJEhk1azj1sD0vNs0xDPoPFo9NMNn61zRij v2XA== 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 j6si1269519plk.120.2019.06.13.22.16.44; Thu, 13 Jun 2019 22:16:59 -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 S1726047AbfFNFPj (ORCPT + 99 others); Fri, 14 Jun 2019 01:15:39 -0400 Received: from foss.arm.com ([217.140.110.172]:54888 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbfFNFPi (ORCPT ); Fri, 14 Jun 2019 01:15:38 -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 29721367; Thu, 13 Jun 2019 22:15:37 -0700 (PDT) Received: from [10.162.41.168] (p8cg001049571a15.blr.arm.com [10.162.41.168]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B446E3F246; Thu, 13 Jun 2019 22:15:25 -0700 (PDT) From: Anshuman Khandual Subject: Re: [PATCH] mm: Generalize and rename notify_page_fault() as kprobe_page_fault() To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-mips@vger.kernel.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, Michal Hocko , Matthew Wilcox , 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 , Vineet Gupta , James Hogan , Paul Burton , Ralf Baechle References: <1560420444-25737-1-git-send-email-anshuman.khandual@arm.com> <20190613130408.3091869d8e50d0524157523f@linux-foundation.org> Message-ID: Date: Fri, 14 Jun 2019 10:45:44 +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: <20190613130408.3091869d8e50d0524157523f@linux-foundation.org> 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 On 06/14/2019 01:34 AM, Andrew Morton wrote: > On Thu, 13 Jun 2019 15:37:24 +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()") >> >> ... >> >> --- a/arch/arm/mm/fault.c >> +++ b/arch/arm/mm/fault.c >> @@ -30,28 +30,6 @@ >> >> #ifdef CONFIG_MMU >> >> -#ifdef CONFIG_KPROBES >> -static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr) > > Some architectures make this `static inline'. Others make it > `nokprobes_inline', others make it `static inline __kprobes'. The > latter seems weird - why try to put an inline function into > .kprobes.text? > > So.. what's the best thing to do here? You chose `static > nokprobe_inline' - is that the best approach, if so why? Does > kprobe_page_fault() actually need to be inlined? Matthew had suggested that (nokprobe_-inline) based on current x86 implementation. But every architecture already had an inlined definition which I did not want to deviate from. > > Also, some architectures had notify_page_fault returning int, others > bool. You chose bool and that seems appropriate and all callers are OK > with that. I would believe so. No one has complained yet :)