From: Peter Zijlstra <peterz@infradead•org>
To: Anshuman Khandual <anshuman.khandual@arm•com>
Cc: Mark Rutland <mark.rutland@arm•com>,
Michal Hocko <mhocko@suse•com>,
linux-ia64@vger•kernel.org, linux-sh@vger•kernel.org,
Catalin Marinas <catalin.marinas@arm•com>,
Dave Hansen <dave.hansen@linux•intel.com>,
Will Deacon <will.deacon@arm•com>,
linux-mm@kvack•org, Paul Mackerras <paulus@samba•org>,
sparclinux@vger•kernel.org, linux-s390@vger•kernel.org,
Yoshinori Sato <ysato@users•sourceforge.jp>,
Michael Ellerman <mpe@ellerman•id.au>,
x86@kernel•org, Russell King <linux@armlinux•org.uk>,
Matthew Wilcox <willy@infradead•org>,
Ingo Molnar <mingo@redhat•com>, Fenghua Yu <fenghua.yu@intel•com>,
Stephen Rothwell <sfr@canb•auug.org.au>,
Andrey Konovalov <andreyknvl@google•com>,
Andy Lutomirski <luto@kernel•org>,
Thomas Gleixner <tglx@linutronix•de>,
linux-arm-kernel@lists•infradead.org,
Christophe Leroy <christophe.leroy@c-s•fr>,
Tony Luck <tony.luck@intel•com>,
Heiko Carstens <heiko.carstens@de•ibm.com>,
linux-kernel@vger•kernel.org,
Martin Schwidefsky <schwidefsky@de•ibm.com>,
Andrew Morton <akpm@linux-foundation•org>,
linuxppc-dev@lists•ozlabs.org,
"David S. Miller" <davem@davemloft•net>
Subject: Re: [RFC V2] mm: Generalize notify_page_fault()
Date: Tue, 4 Jun 2019 08:54:01 +0200 [thread overview]
Message-ID: <20190604065401.GE3402@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1559630046-12940-1-git-send-email-anshuman.khandual@arm.com>
On Tue, Jun 04, 2019 at 12:04:06PM +0530, Anshuman Khandual wrote:
> diff --git a/mm/memory.c b/mm/memory.c
> index ddf20bd..b6bae8f 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -52,6 +52,7 @@
> #include <linux/pagemap.h>
> #include <linux/memremap.h>
> #include <linux/ksm.h>
> +#include <linux/kprobes.h>
> #include <linux/rmap.h>
> #include <linux/export.h>
> #include <linux/delayacct.h>
> @@ -141,6 +142,21 @@ static int __init init_zero_pfn(void)
> core_initcall(init_zero_pfn);
>
>
> +int __kprobes notify_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;
> +}
That thing should be called kprobe_page_fault() or something,
notify_page_fault() is a horribly crap name for this function.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-06-04 6:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 6:34 [RFC V2] mm: Generalize notify_page_fault() Anshuman Khandual
2019-06-04 6:54 ` Peter Zijlstra [this message]
2019-06-04 8:12 ` Anshuman Khandual
2019-06-04 21:53 ` Matthew Wilcox
2019-06-06 2:03 ` Anshuman Khandual
2019-06-05 11:19 ` Michael Ellerman
2019-06-05 11:23 ` Matthew Wilcox
2019-06-06 2:40 ` Anshuman Khandual
2019-06-06 2:34 ` Anshuman Khandual
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190604065401.GE3402@hirez.programming.kicks-ass.net \
--to=peterz@infradead$(echo .)org \
--cc=akpm@linux-foundation$(echo .)org \
--cc=andreyknvl@google$(echo .)com \
--cc=anshuman.khandual@arm$(echo .)com \
--cc=catalin.marinas@arm$(echo .)com \
--cc=christophe.leroy@c-s$(echo .)fr \
--cc=dave.hansen@linux$(echo .)intel.com \
--cc=davem@davemloft$(echo .)net \
--cc=fenghua.yu@intel$(echo .)com \
--cc=heiko.carstens@de$(echo .)ibm.com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-ia64@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-mm@kvack$(echo .)org \
--cc=linux-s390@vger$(echo .)kernel.org \
--cc=linux-sh@vger$(echo .)kernel.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=luto@kernel$(echo .)org \
--cc=mark.rutland@arm$(echo .)com \
--cc=mhocko@suse$(echo .)com \
--cc=mingo@redhat$(echo .)com \
--cc=mpe@ellerman$(echo .)id.au \
--cc=paulus@samba$(echo .)org \
--cc=schwidefsky@de$(echo .)ibm.com \
--cc=sfr@canb$(echo .)auug.org.au \
--cc=sparclinux@vger$(echo .)kernel.org \
--cc=tglx@linutronix$(echo .)de \
--cc=tony.luck@intel$(echo .)com \
--cc=will.deacon@arm$(echo .)com \
--cc=willy@infradead$(echo .)org \
--cc=x86@kernel$(echo .)org \
--cc=ysato@users$(echo .)sourceforge.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox