From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anshuman Khandual Date: Mon, 10 Jun 2019 02:35:15 +0000 Subject: Re: [RFC V3] mm: Generalize and rename notify_page_fault() as kprobe_page_fault() Message-Id: <632eae55-92f5-1bfc-bfe4-24673558e1d8@arm.com> List-Id: References: <1559903655-5609-1-git-send-email-anshuman.khandual@arm.com> <20190607220326.1e21fc9c@canb.auug.org.au> In-Reply-To: <20190607220326.1e21fc9c@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Stephen Rothwell Cc: Mark Rutland , Michal Hocko , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Dave Hansen , Will Deacon , linux-mm@kvack.org, Paul Mackerras , sparclinux@vger.kernel.org, linux-s390@vger.kernel.org, Yoshinori Sato , Michael Ellerman , x86@kernel.org, Russell King , Matthew Wilcox , Ingo Molnar , Fenghua Yu , Andrey Konovalov , Andy Lutomirski , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Tony Luck , Heiko Carstens , linux-kernel@vger.kernel.org, Martin Schwidefsky , Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S. Miller" 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.