Commit a257cacc authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman
Browse files

asm-generic: Define CONFIG_HAVE_FUNCTION_DESCRIPTORS



Replace HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR by a config option
named CONFIG_HAVE_FUNCTION_DESCRIPTORS and use it instead of
'dereference_function_descriptor' macro to know whether an
arch has function descriptors.

To limit churn in one of the following patches, use
an #ifdef/#else construct with empty first part
instead of an #ifndef in asm-generic/sections.h

On powerpc, make sure the config option matches the ABI used
by the compiler with a BUILD_BUG_ON() and add missing _CALL_ELF=2
when calling 'sparse' so that sparse sees the same piece of
code as GCC.

And include a helper to check whether an arch has function
descriptors or not : have_function_descriptors()

Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
Acked-by: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/4a0f11fb0ea74a3197bc44dd7ba25e53a24fd03d.1644928018.git.christophe.leroy@csgroup.eu
parent 41a88b45
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -205,6 +205,9 @@ config HAVE_FUNCTION_ERROR_INJECTION
config HAVE_NMI
	bool

config HAVE_FUNCTION_DESCRIPTORS
	bool

config TRACE_IRQFLAGS_SUPPORT
	bool

+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ config IA64
	select HAVE_SETUP_PER_CPU_AREA
	select TTY
	select HAVE_ARCH_TRACEHOOK
	select HAVE_FUNCTION_DESCRIPTORS
	select HAVE_VIRT_CPU_ACCOUNTING
	select HUGETLB_PAGE_SIZE_VARIABLE if HUGETLB_PAGE
	select VIRT_TO_BUS
+0 −2
Original line number Diff line number Diff line
@@ -27,8 +27,6 @@ extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_b
extern char __start_unwind[], __end_unwind[];
extern char __start_ivt_text[], __end_ivt_text[];

#define HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR 1

#undef dereference_function_descriptor
static inline void *dereference_function_descriptor(void *ptr)
{
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ config PARISC
	select HAVE_DYNAMIC_FTRACE_WITH_REGS
	select HAVE_SOFTIRQ_ON_OWN_STACK if IRQSTACKS
	select TRACE_IRQFLAGS_SUPPORT
	select HAVE_FUNCTION_DESCRIPTORS if 64BIT

	help
	  The PA-RISC microprocessor is designed by Hewlett-Packard and used
+0 −2
Original line number Diff line number Diff line
@@ -9,8 +9,6 @@ extern char __alt_instructions[], __alt_instructions_end[];

#ifdef CONFIG_64BIT

#define HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR 1

#undef dereference_function_descriptor
void *dereference_function_descriptor(void *);

Loading