Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2723983ybi; Sun, 9 Jun 2019 19:24:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyO99VHHSQ/gQ3oN+YVZtCmM5irImxvqZUreM+Ee33f3SHXT6Qu0lOYCCHMXaX0TtSl1b+E X-Received: by 2002:a65:4086:: with SMTP id t6mr13339946pgp.155.1560133474784; Sun, 09 Jun 2019 19:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560133474; cv=none; d=google.com; s=arc-20160816; b=BjG0watygdIS3Y5/VI+8zIyBpNHFN1sDxcLwhXGpKxK4UMuN32wlbbO8Umm0KUuUpM tm3PYtfUhnfdbcmOlIttKD17c2x7x7UYq7Omll9fOpEpCLslPYujjTOUrUUEhm+Gc7iQ GGxDKsZuWBZl5KSxczfBI8NlLSCmEmyDqZEZNm19/GH9HbwcMMDuXkJIW/7o+ZYNfQ10 WMsj9uY8I39CYKWJylp8MEmUYk6y7HLSNzSYpflKl5ujMUg6lvMMenX2wYtg3HEHi30B yl+5eAapg2EKcmROXhbQTlTmCR8yCSoPxKcdpy3eqF8vpVwpjs4+E4UkM8j/g2AKtLRk m1Vg== 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:from:references:cc:to:subject; bh=Cw3jMaawpERIzFx9V/izJtDBjK0NX3WzIA7lubamf2M=; b=GJPZ4bPbwJAe58BhHO0T9mNVf6Z+muTS3V6Hoilydl2oZDuWaat0t+pCi3bV96B2a0 +85Ox+MJ9EWoNXUBRZzOkV1Ujs8tPAkfTGd3yJgzW0TDvYfmXBiivuN210wdVDIgUqJy tqNMshkblOHCPv6GsQwmfFptpasuigVwBbh5782vJrmCsRddtUL83soM+SOXzgnYN/C6 jb4eCflOV45Ntmm8VGEtIeM1zjkdKFzruGqiS58q4f4sNG/rsEdpF2L1FuLuPqOA+ViF Vcm9qgXG24W74mtH3HNHm6JwwGD9YLGrKDalYoeAX1BlzoCzfOt1SCq5qZmosgdOSYHF g8bQ== 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 e22si8474686pgj.184.2019.06.09.19.24.17; Sun, 09 Jun 2019 19:24:34 -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 S2387429AbfFJCXH (ORCPT + 99 others); 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.