Re: [PATCH] mm/kprobes: Add generic kprobe_fault_handler() fallback definition
flat view
From: Anshuman Khandual <hidden>
Date: 2019-07-11 09:57:51
Also in:
linux-arm-kernel, linux-mips, linux-mm, linux-s390, linux-sh, lkml, sparclinux
On 07/05/2019 11:00 AM, Anshuman Khandual wrote:
Architectures like parisc enable CONFIG_KROBES without having a definition for kprobe_fault_handler() which results in a build failure. Arch needs to provide kprobe_fault_handler() as it is platform specific and cannot have a generic working alternative. But in the event when platform lacks such a definition there needs to be a fallback. This adds a stub kprobe_fault_handler() definition which not only prevents a build failure but also makes sure that kprobe_page_fault() if called will always return negative in absence of a sane platform specific alternative. While here wrap kprobe_page_fault() in CONFIG_KPROBES. This enables stud definitions for generic kporbe_fault_handler() and kprobes_built_in() can just be dropped. Only on x86 it needs to be added back locally as it gets used in a !CONFIG_KPROBES function do_general_protection(). Cc: Vineet Gupta <redacted> Cc: Russell King <linux@armlinux.org.uk> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <redacted> Cc: Ralf Baechle <redacted> Cc: Paul Burton <redacted> Cc: James Hogan <jhogan@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <redacted> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Heiko Carstens <redacted> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Christian Borntraeger <redacted> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Rich Felker <dalias@libc.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Thomas Gleixner <redacted> Cc: Ingo Molnar <mingo@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: "Naveen N. Rao" <redacted> Cc: Anil S Keshavamurthy <redacted> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Allison Randal <redacted> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Enrico Weigelt <info@metux.net> Cc: Richard Fontana <redacted> Cc: Kate Stewart <redacted> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Guenter Roeck <linux@roeck-us.net> Cc: x86@kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-ia64@vger.kernel.org Cc: linux-mips@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-s390@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: sparclinux@vger.kernel.org Signed-off-by: Anshuman Khandual <redacted> ---
Any updates or suggestions on this patch ? Currently there is a build failure on parisc architecture due to the lack of a kprobe_fault_handler() definition when CONFIG_KPROBES is enabled and this build failure needs to be fixed. This patch solves the build problem. But otherwise I am also happy to just define a stub definition for kprobe_fault_handler() on parisc arch when CONFIG_KPROBES is enabled, which will avoid the build failure. Please suggest.