Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1332559ybc; Tue, 12 Nov 2019 19:05:30 -0800 (PST) X-Google-Smtp-Source: APXvYqx9ZtOREa/tX9O24DfRJwPxGQ8Wl6XXYA522nPg1egve17U2J6TUSr5qBuMm7m75X08smvz X-Received: by 2002:a05:6402:138c:: with SMTP id b12mr1254738edv.28.1573614329998; Tue, 12 Nov 2019 19:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573614329; cv=none; d=google.com; s=arc-20160816; b=iRfvcQs8tLD5fhby+nuJeGNIdm+PO/gUFxacYrMlydOG0zpCQr0Ic9Mo0XhiXuGRy2 eChbuNE/nPcKaLdq4qbSHoTZI0fU5qQioB2L44YK3BSWZALZQ7831I1ms/ODBYYFmrct PAxYdMeLDABFZlchgu7L+2xSizankGUvThapWW7UM2IJkVRH5ro1Hrrf5PJshNoMaYkV y5V1TQahYPV6XZBAUoPiW9MyM0DEPdufGNZsUVRB8Vr6Jr2VJeDc0YATcRlYkZz8gJhy OpcqjJE5RTc05daJeon1D6R2SKPvnlRRi3tTs26zf8rdQPYs3UqErTfqpemoKh6t4NDB tZdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id :user-agent:mime-version:in-reply-to:references:cc:to:subject:from :date:dkim-signature; bh=Dpd5uTeG1GRO8WYQOMFdyd5CNMfNTlaCpN0JYUg6WgU=; b=pFxofZgdvmZOLh3zR3ysTckPtrMKhB3teNDlG9yJDKRe+0KzLOEIoy449QPDo8NqNY fmD9eDD/gl6EuWN1C4CV+MdmYtmiiD/mES5uZs89bopfcNVrNyGte1x4VqBIJplhKSmZ wDIlRQvCSUWzyV6VDFTmbA3bN+YMaYfvcXYaJoPvvTLmYYWr0K5IoRpALmI693Q0JCK8 Xm5JmMtZ6Z0FqAHlHgPuIOsutTheBkSsYA34Wlo1aOZNFcA2tndWf6IbHXVyVEeVADBT Shf/gM3YQoI4s9OZTRhVRwuA8epbnnsvFZlWjljwzhardXHTfO4q+a24YOQuwhqgj5vB JjwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uQuJAcSC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f37si429848ede.11.2019.11.12.19.05.05; Tue, 12 Nov 2019 19:05:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uQuJAcSC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727399AbfKMDCC (ORCPT + 99 others); Tue, 12 Nov 2019 22:02:02 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36084 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbfKMDCB (ORCPT ); Tue, 12 Nov 2019 22:02:01 -0500 Received: by mail-pg1-f193.google.com with SMTP id k13so401980pgh.3 for ; Tue, 12 Nov 2019 19:02:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :user-agent:message-id:content-transfer-encoding; bh=Dpd5uTeG1GRO8WYQOMFdyd5CNMfNTlaCpN0JYUg6WgU=; b=uQuJAcSCKkmH97BvEde5l2uvPlhaRpfqm8mmjpU2h+l4i5KrHKi++xUWoJALJ+5fJC W3C68IYE5j3bYB4eE7/42fRYqxdRYl4f/hcnj7NelRFeSkkSJSGGVG9GJu5OYQ46HMYF 3rXOyPknbJGQ9ODH1AlNp6lfCaKSkgayIewo5pfkqinaTc9fmjqU2G4HqzZs8PZseEIy ugGHCtBKSPdxliOUJbl7Z2dAeVLk3rFVWsmrol/pBtJAx7c10dkYeGoZLv5RE85eeiUb 0UJsxPOnUoB7yUN/kgF/nxgNR/TGMat/TF2HHGjCWIrzbzlC5x2HoDmiVB3p/UTg0QB7 1M+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:user-agent:message-id:content-transfer-encoding; bh=Dpd5uTeG1GRO8WYQOMFdyd5CNMfNTlaCpN0JYUg6WgU=; b=ntJZzJPk5M51qoSdV8JX3Fc/4UVTL57xZ+2Tp4gWAG5PrJKz2kbO6QgSvTiU0JU34X nmMbMlTmWM7qMs4bdvVJltGYlo/PKBdVSdC6VehY875bS3bjeoC4NCkAenrkqZl98bws YQqLpz/7tvG05M8IsoQn9oGJ10HWY8urc4OZQuFfU5EQaFb5wj3+MzsNx1c6b3sQ4eJK Yw8/iv//CfPaTMTDo357AugAU2h2spNlKG2RMdM2FT7mVfbytfTefpdslRR51vNmfKqn T1W9lrNXDUl0WtkAt9yLjVT25ZX9yhTxFPhgoBqi4dB26ZdJhd2GIYU5tTw/ONsn/47a vWAQ== X-Gm-Message-State: APjAAAWRW14ADP8VNzgGXKtCWZxndmPUSbcsRvz7TUAS+vLxxlZ2Jd7A xwnpl3UO5zNV7Ayo8gENqGQ= X-Received: by 2002:a63:6c4:: with SMTP id 187mr974149pgg.421.1573614120606; Tue, 12 Nov 2019 19:02:00 -0800 (PST) Received: from localhost (193-116-100-125.tpgi.com.au. [193.116.100.125]) by smtp.gmail.com with ESMTPSA id s2sm400490pgv.48.2019.11.12.19.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 19:02:00 -0800 (PST) Date: Wed, 13 Nov 2019 13:02:34 +1000 From: Nicholas Piggin Subject: Re: [PATCH 31/33] powerpc/64: make buildable without CONFIG_COMPAT To: linuxppc-dev@lists.ozlabs.org, Michal Suchanek Cc: Andrew Morton , Allison Randal , Andrew Donnellan , Arnd Bergmann , Benjamin Herrenschmidt , Brajeswar Ghosh , Claudio Carvalho , Christian Brauner , Christophe Leroy , David Hildenbrand , David Howells , Diana Craciun , Daniel Axtens , Dmitry Vyukov , "Eric W. Biederman" , Firoz Khan , Geert Uytterhoeven , Greg Kroah-Hartman , Gustavo Romero , Hari Bathini , Heiko Carstens , Jagadeesh Pagadala , Breno Leitao , linux-kernel@vger.kernel.org, Madhavan Srinivasan , Mahesh Salgaonkar , Mathieu Malaterre , Michael Neuling , Michael Ellerman , "Naveen N. Rao" , Nicolai Stange , Oleg Nesterov , Paul Mackerras , Steven Rostedt , Russell Currey , Thomas Gleixner , Valentin Schneider , Alexander Viro , Masahiro Yamada References: <13fa324dc879a7f325290bf2e131b87eb491cd7b.1573576649.git.msuchanek@suse.de> In-Reply-To: <13fa324dc879a7f325290bf2e131b87eb491cd7b.1573576649.git.msuchanek@suse.de> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1573613683.ylw9dz9mlc.astroid@bobo.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michal Suchanek's on November 13, 2019 2:52 am: > There are numerous references to 32bit functions in generic and 64bit > code so ifdef them out. >=20 > Signed-off-by: Michal Suchanek For the most part these seem okay to me. > diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile > index 45f1d5e54671..35874119b398 100644 > --- a/arch/powerpc/kernel/Makefile > +++ b/arch/powerpc/kernel/Makefile > @@ -44,16 +44,16 @@ CFLAGS_btext.o +=3D -DDISABLE_BRANCH_PROFILING > endif > =20 > obj-y :=3D cputable.o ptrace.o syscalls.o \ > - irq.o align.o signal_32.o pmc.o vdso.o \ > + irq.o align.o signal_$(BITS).o pmc.o vdso.o \ > process.o systbl.o idle.o \ > signal.o sysfs.o cacheinfo.o time.o \ > prom.o traps.o setup-common.o \ > udbg.o misc.o io.o misc_$(BITS).o \ > of_platform.o prom_parse.o > -obj-$(CONFIG_PPC64) +=3D setup_64.o sys_ppc32.o \ > - signal_64.o ptrace32.o \ > +obj-$(CONFIG_PPC64) +=3D setup_64.o \ > paca.o nvram_64.o firmware.o note.o \ > syscall_64.o > +obj-$(CONFIG_COMPAT) +=3D sys_ppc32.o ptrace32.o signal_32.o > obj-$(CONFIG_VDSO32) +=3D vdso32/ > obj-$(CONFIG_PPC_WATCHDOG) +=3D watchdog.o > obj-$(CONFIG_HAVE_HW_BREAKPOINT) +=3D hw_breakpoint.o > diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_6= 4.S > index 00173cc904ef..c339a984958f 100644 > --- a/arch/powerpc/kernel/entry_64.S > +++ b/arch/powerpc/kernel/entry_64.S > @@ -52,8 +52,10 @@ > SYS_CALL_TABLE: > .tc sys_call_table[TC],sys_call_table > =20 > +#ifdef CONFIG_COMPAT > COMPAT_SYS_CALL_TABLE: > .tc compat_sys_call_table[TC],compat_sys_call_table > +#endif > =20 > /* 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..61678cb0e6a1 100644 > --- a/arch/powerpc/kernel/signal.c > +++ b/arch/powerpc/kernel/signal.c > @@ -247,7 +247,6 @@ static void do_signal(struct task_struct *tsk) > sigset_t *oldset =3D sigmask_to_save(); > struct ksignal ksig =3D { .sig =3D 0 }; > int ret; > - int is32 =3D is_32bit_task(); > =20 > BUG_ON(tsk !=3D current); > =20 > @@ -277,7 +276,7 @@ static void do_signal(struct task_struct *tsk) > =20 > rseq_signal_deliver(&ksig, tsk->thread.regs); > =20 > - if (is32) { > + if (is_32bit_task()) { > if (ksig.ka.sa.sa_flags & SA_SIGINFO) > ret =3D handle_rt_signal32(&ksig, oldset, tsk); > else This is just a clean up I guess. > diff --git a/arch/powerpc/kernel/syscall_64.c b/arch/powerpc/kernel/sysca= ll_64.c > index d00cfc4a39a9..319ebd4f494d 100644 > --- a/arch/powerpc/kernel/syscall_64.c > +++ b/arch/powerpc/kernel/syscall_64.c > @@ -17,7 +17,6 @@ typedef long (*syscall_fn)(long, long, long, long, long= , long); > =20 > long system_call_exception(long r3, long r4, long r5, long r6, long r7, = long r8, unsigned long r0, struct pt_regs *regs) > { > - unsigned long ti_flags; > syscall_fn f; > =20 > if (IS_ENABLED(CONFIG_PPC_BOOK3S)) > @@ -64,8 +63,7 @@ long system_call_exception(long r3, long r4, long r5, l= ong r6, long r7, long r8, > =20 > __hard_irq_enable(); > =20 > - ti_flags =3D current_thread_info()->flags; > - if (unlikely(ti_flags & _TIF_SYSCALL_DOTRACE)) { > + if (unlikely(current_thread_info()->flags & _TIF_SYSCALL_DOTRACE)) { > /* > * We use the return value of do_syscall_trace_enter() as the > * syscall number. If the syscall was rejected for any reason > @@ -81,7 +79,7 @@ long system_call_exception(long r3, long r4, long r5, l= ong r6, long r7, long r8, > /* May be faster to do array_index_nospec? */ > barrier_nospec(); > =20 > - if (unlikely(ti_flags & _TIF_32BIT)) { > + if (unlikely(is_32bit_task())) { > f =3D (void *)compat_sys_call_table[r0]; > =20 > r3 &=3D 0x00000000ffffffffULL; I guess this is okay, I did want to be careful about where ti_flags was loaded exactly, but I think DOTRACE and 32BIT are not volatile. Is it possible to define _TIF_32BIT to zero for 64-bit !compat case and have the original branch eliminated, or does that cause other problems? Thanks, Nick =