[PATCH v3 3/4] powerpc/64: make buildable without CONFIG_COMPAT

Christoph Hellwig hch at infradead.org
Thu Aug 29 16:46:24 AEST 2019


On Wed, Aug 28, 2019 at 06:43:50PM +0200, Michal Suchanek wrote:
> +ifdef CONFIG_COMPAT
> +obj-y				+= sys_ppc32.o ptrace32.o signal_32.o
> +endif

This should be:

obj-$(CONFIG_COMPAT)		+= sys_ppc32.o ptrace32.o signal_32.o

>  /* This value is used to mark exception frames on the stack. */
>  exception_marker:
> diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
> index 60436432399f..73d0f53ffc1a 100644
> --- a/arch/powerpc/kernel/signal.c
> +++ b/arch/powerpc/kernel/signal.c
> @@ -277,7 +277,7 @@ static void do_signal(struct task_struct *tsk)
>  
>  	rseq_signal_deliver(&ksig, tsk->thread.regs);
>  
> -	if (is32) {
> +	if ((IS_ENABLED(CONFIG_PPC32) || IS_ENABLED(CONFIG_COMPAT)) && is32) {

I think we should fix the is_32bit_task definitions instead so that
callers don't need this mess.  I'd suggest something like:

#ifdef CONFIG_COMPAT
#define is_32bit_task()		test_thread_flag(TIF_32BIT)
#else
#define is_32bit_task()		IS_ENABLED(CONFIG_PPC32)
#endif


More information about the Linuxppc-dev mailing list