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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 42B85C28EBD for ; Mon, 10 Jun 2019 02:23:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1839120820 for ; Mon, 10 Jun 2019 02:23:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387435AbfFJCXH (ORCPT ); Sun, 9 Jun 2019 22:23:07 -0400 Received: from foss.arm.com ([217.140.110.172]:35064 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387400AbfFJCXG (ORCPT ); Sun, 9 Jun 2019 22:23:06 -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 7520A337; Sun, 9 Jun 2019 19:23:05 -0700 (PDT) Received: from [10.162.42.131] (p8cg001049571a15.blr.arm.com [10.162.42.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 19D773F557; Sun, 9 Jun 2019 19:22:56 -0700 (PDT) Subject: Re: [RFC V3] mm: Generalize and rename notify_page_fault() as kprobe_page_fault() To: Stephen Rothwell 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 , Matthew Wilcox , Mark Rutland , Christophe Leroy , 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 References: <1559903655-5609-1-git-send-email-anshuman.khandual@arm.com> <20190607220326.1e21fc9c@canb.auug.org.au> From: Anshuman Khandual Message-ID: <632eae55-92f5-1bfc-bfe4-24673558e1d8@arm.com> Date: Mon, 10 Jun 2019 07:53:15 +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: <20190607220326.1e21fc9c@canb.auug.org.au> Content-Type: text/plain; charset=windows-1252 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/07/2019 05:33 PM, Stephen Rothwell wrote: > Hi Anshuman, > > On Fri, 7 Jun 2019 16:04:15 +0530 Anshuman Khandual wrote: >> >> +static nokprobe_inline bool kprobe_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; >> +} > > Since this is now declared as "bool" (thanks for that), you should make > "ret" be bool and use true and false; Sure, done.