From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FDFFC43331 for ; Fri, 3 Apr 2020 07:16:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02EBF206F6 for ; Fri, 3 Apr 2020 07:16:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B+j0ye36" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388780AbgDCHQv (ORCPT ); Fri, 3 Apr 2020 03:16:51 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34422 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732205AbgDCHQv (ORCPT ); Fri, 3 Apr 2020 03:16:51 -0400 Received: by mail-pf1-f196.google.com with SMTP id v23so163950pfm.1; Fri, 03 Apr 2020 00:16:50 -0700 (PDT) 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=/Min6FGvBBhn5d4HChhwbbt9mp9eJSWu4vYPC1VQ1bY=; b=B+j0ye362hcPnhZvtHnMeAMi7Fq/7tt9Ul0Z/nqH/1E7RzI235255HyBwfcMANOo5B iqZf6D3D5aDpQ1HZwmyaEOJXVPYejenKImr0QoaKpsS0LA490f2TUAjg8jUcR+XG68gP J0c8NqwMaRwCsbVn0D9L+hgcykeyUrEEUSZl4QLkLVXk9A3aExcW5R7YC+t7Wu4AP61v c89J31eelZaffV4YhP9kRx+wKrNFGX7eJFJQ7KD6cgnYrj79ppY5Uh4R2PoX76fftjzl //1+w85/olJJkRfJke3aecSd8VRSVDP6KlJcDsyjmPBoPbc/M3FFoAlte1+7fS5NFt5K +KlA== 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=/Min6FGvBBhn5d4HChhwbbt9mp9eJSWu4vYPC1VQ1bY=; b=W9R7kCeEUJIF7ipft5nReMZwBDJjNkqVAXT1mpRV0Gs/xt+/svjmL3lFiMIfmQ70dh DINirmUr+M8AvkSYGEtmlAK6z1GHgF5+q2yxhEuqr3twWz+GzeDwtuKb/PUa+TWXv/I+ ZdBV2MHKaZOHqpCHjWjsct9No65xgLLSLyxwquK/GqqicE7EGERjn3CDlGOtjyIYplOF C5TC+sf02skoNqaymk21+NOduVbLO+9GFIOYyw1Mq8jc2phHkWE/kzBDru2PtkJx5Ngk N6FgNsEOrZkbtB3f+oDskAI4sjzckx7XWzDAKoQijoFvK6jBFbfGumfJGvBSC1pyZpDX P2xg== X-Gm-Message-State: AGi0PuYAhYUdkngGYCyLq4YoU1JtHCNfRJG/XUIUF5qibg5vBo/5mMCX 8grWhx6DKLQIzxx+arYek4A= X-Google-Smtp-Source: APiQypI29WpLJ7yRRLDxGnJ1qIIkGrkN4zERLo3YJfqcNCW07ekUordv1tE/e0nwGNZDivwYK5G7qA== X-Received: by 2002:aa7:97a7:: with SMTP id d7mr7097386pfq.194.1585898209651; Fri, 03 Apr 2020 00:16:49 -0700 (PDT) Received: from localhost (60-241-117-97.tpgi.com.au. [60.241.117.97]) by smtp.gmail.com with ESMTPSA id b70sm5265916pfb.6.2020.04.03.00.16.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 00:16:48 -0700 (PDT) Date: Fri, 03 Apr 2020 17:16:43 +1000 From: Nicholas Piggin Subject: Re: [PATCH v11 5/8] powerpc/64: make buildable without CONFIG_COMPAT To: Michal =?iso-8859-1?q?Such=E1nek?= Cc: Arnaldo Carvalho de Melo , Alexander Shishkin , Allison Randal , Andy Shevchenko , Arnd Bergmann , Thiago Jung Bauermann , Sebastian Andrzej Siewior , Claudio Carvalho , "David S. Miller" , "Eric W. Biederman" , Eric Richter , Greg Kroah-Hartman , Gustavo Luiz Duarte , Hari Bathini , Jordan Niethe , Jiri Olsa , Jonathan Cameron , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Mark Rutland , Masahiro Yamada , Mauro Carvalho Chehab , Michael Neuling , Ingo Molnar , Namhyung Kim , Nayna Jain , Paul Mackerras , Peter Zijlstra , Rob Herring , Thomas Gleixner , Valentin Schneider , Alexander Viro References: <20200225173541.1549955-1-npiggin@gmail.com> <4b7058eb0f5558fb7e2cee1b8f7cf99ebd03084e.1584620202.git.msuchanek@suse.de> <1585039733.dm1rivvych.astroid@bobo.none> <20200324193055.GG25468@kitsune.suse.cz> In-Reply-To: <20200324193055.GG25468@kitsune.suse.cz> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1585898018.8y4vw9c8hc.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 Such=C3=A1nek's on March 25, 2020 5:30 am: > On Tue, Mar 24, 2020 at 06:54:20PM +1000, Nicholas Piggin wrote: >> Michal Suchanek's on March 19, 2020 10:19 pm: >> > diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal= .c >> > index 4b0152108f61..a264989626fd 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 >>=20 >> Unnecessary? >>=20 >> > diff --git a/arch/powerpc/kernel/syscall_64.c b/arch/powerpc/kernel/sy= scall_64.c >> > index 87d95b455b83..2dcbfe38f5ac 100644 >> > --- a/arch/powerpc/kernel/syscall_64.c >> > +++ b/arch/powerpc/kernel/syscall_64.c >> > @@ -24,7 +24,6 @@ notrace 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_IRQ_SOFT_MASK_DEBUG)) >> > @@ -68,8 +67,7 @@ notrace long system_call_exception(long r3, long r4,= long r5, >> > =20 >> > local_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 >> > @@ -94,7 +92,7 @@ notrace long system_call_exception(long r3, long r4,= long r5, >> > /* May be faster to do array_index_nospec? */ >> > barrier_nospec(); >> > =20 >> > - if (unlikely(ti_flags & _TIF_32BIT)) { >> > + if (unlikely(is_32bit_task())) { >>=20 >> Problem is, does this allow the load of ti_flags to be used for both >> tests, or does test_bit make it re-load? >>=20 >> This could maybe be fixed by testing if(IS_ENABLED(CONFIG_COMPAT) && > Both points already discussed here: Agh, I'm hopeless. I don't think it really resolves this issue. But probably don't have time to look at generated asm, and might never because it won't really hit LE unless we add a 32-bit ABI. It's pretty minor though either way. Sorry for being difficult, I really do like your patches :) Thanks, Nick =