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 <vgu...@synopsys.com>
> Cc: Russell King <li...@armlinux.org.uk>
> Cc: Catalin Marinas <catalin.mari...@arm.com>
> Cc: Will Deacon <w...@kernel.org>
> Cc: Tony Luck <tony.l...@intel.com>
> Cc: Fenghua Yu <fenghua...@intel.com>
> Cc: Ralf Baechle <r...@linux-mips.org>
> Cc: Paul Burton <paul.bur...@mips.com>
> Cc: James Hogan <jho...@kernel.org>
> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
> Cc: Paul Mackerras <pau...@samba.org>
> Cc: Michael Ellerman <m...@ellerman.id.au>
> Cc: Heiko Carstens <heiko.carst...@de.ibm.com>
> Cc: Vasily Gorbik <g...@linux.ibm.com>
> Cc: Christian Borntraeger <borntrae...@de.ibm.com>
> Cc: Yoshinori Sato <ys...@users.sourceforge.jp>
> Cc: Rich Felker <dal...@libc.org>
> Cc: "David S. Miller" <da...@davemloft.net>
> Cc: Thomas Gleixner <t...@linutronix.de>
> Cc: Ingo Molnar <mi...@redhat.com>
> Cc: Borislav Petkov <b...@alien8.de>
> Cc: "H. Peter Anvin" <h...@zytor.com>
> Cc: "Naveen N. Rao" <naveen.n....@linux.ibm.com>
> Cc: Anil S Keshavamurthy <anil.s.keshavamur...@intel.com>
> Cc: Masami Hiramatsu <mhira...@kernel.org>
> Cc: Allison Randal <alli...@lohutok.net>
> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
> Cc: Enrico Weigelt <i...@metux.net>
> Cc: Richard Fontana <rfont...@redhat.com>
> Cc: Kate Stewart <kstew...@linuxfoundation.org>
> Cc: Mark Rutland <mark.rutl...@arm.com>
> Cc: Andrew Morton <a...@linux-foundation.org>
> Cc: Guenter Roeck <li...@roeck-us.net>
> Cc: x...@kernel.org
> Cc: linux-snps-...@lists.infradead.org
> Cc: linux-ker...@vger.kernel.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-i...@vger.kernel.org
> Cc: linux-m...@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-s...@vger.kernel.org
> Cc: linux...@vger.kernel.org
> Cc: sparcli...@vger.kernel.org
>
> Signed-off-by: Anshuman Khandual <anshuman.khand...@arm.com>
> ---
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.