Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2574358ybb; Sun, 5 Apr 2020 10:57:22 -0700 (PDT) X-Google-Smtp-Source: APiQypLz0ijyeV/1lNanYQwYMM7vcj2nIsAFqpGIEgqYJJ+gfErZ6R6OA+GvuBXnxVSdYvF2M60o X-Received: by 2002:aca:5d04:: with SMTP id r4mr9848683oib.94.1586109442244; Sun, 05 Apr 2020 10:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586109442; cv=none; d=google.com; s=arc-20160816; b=0/flrt7wfVR01AbD/6uvHy3aw6fPu+zbTVozsV7C82fj3OF3fw2RoOk8m3MXdgQTJp Q0xZIt1nqIVfByi6PaxcY2Em6EW0UML9fPEvd3416r4vqajjDK5mPr2j4L3ZeRhsa5yO XPS4Rg31zx6M+uxvxevAFRQEUIxfSaHN/UsiyeBXwjccfPVB8xUlGKPJeMcE5g08EeB6 68jWBvKU7c0wCDZb420MfDUo3t8ffKAhVzSRwSl+9uIYE7YCjtWA9KIvnWXhx5goklAS MM8jCJ51/PiSHr+EwMAyOq7D/93Kz9y7AVB1nrAdWHbyQs3D+H3OYXNaMhcSIPc2v9pC c8nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=9KvxZF0NJ1djyzKEWLsEBPQl38pgAHPtJyUllkNivxo=; b=i/C6TpHkfDgis7RC6LCKV7C1lBPKw9/GpESYiWH/z/+XYHf7V1HQwwB/4JbEdaObOl pm0yPeH6T6F3h/LkO59ixDpCM5v9j6bmxKf9NI0kT7pq8wj5roBuf8lNxXKDKjAQ8d/0 P7xSCJb6tAiqdxmj9lznvorSdo+3BEM+Dgf5yRuUqbMclF+U4BxwBKmAKYVVOPCHQzCZ p6IzKS+md7MDXinEvjZgszp+f6jIx1XUAjzDkwkB3mppDMIqT8wjZmsZIVC2YJOb5o6P usNHLl6khYf5VmfK1MLymgSU2AJFmbWITuSUxZ/v2hkPEfIzN1hLVYPEDim6F5OmAPNG daKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=QSD7230r; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si6640426oom.84.2020.04.05.10.57.10; Sun, 05 Apr 2020 10:57:22 -0700 (PDT) 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=@c-s.fr header.s=mail header.b=QSD7230r; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727934AbgDERpI (ORCPT + 99 others); Sun, 5 Apr 2020 13:45:08 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:34909 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727837AbgDERon (ORCPT ); Sun, 5 Apr 2020 13:44:43 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48wLdz4Q0Cz9ty3d; Sun, 5 Apr 2020 19:44:39 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=QSD7230r; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id l6_ueIiV2GDV; Sun, 5 Apr 2020 19:44:39 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48wLdz3MrRz9ty2y; Sun, 5 Apr 2020 19:44:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1586108679; bh=9KvxZF0NJ1djyzKEWLsEBPQl38pgAHPtJyUllkNivxo=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=QSD7230rL5+rqQDDMVmc5uBt231EnAPhx7iz1THtCaseCk4Pog9uGx9PLqa2ry7Fx YuDe+TpE/K6cjTpbCL/JwOIKY8aAtAF6QGX9N9il1fazyYB2PwvFmF90ZxFzhBNbet 4vttXw6R0ouIWwAvaqRLbQK8Wkvn0eQ+iScKysZo= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0FE328B783; Sun, 5 Apr 2020 19:44:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id I6E058I0cnlN; Sun, 5 Apr 2020 19:44:42 +0200 (CEST) Received: from pc16570vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 954CA8B774; Sun, 5 Apr 2020 19:44:42 +0200 (CEST) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 694736571C; Sun, 5 Apr 2020 17:44:42 +0000 (UTC) Message-Id: In-Reply-To: <029e1064b1ad738785718221ea468c9cfc282457.1586108649.git.christophe.leroy@c-s.fr> References: <029e1064b1ad738785718221ea468c9cfc282457.1586108649.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [RFC PATCH v2 07/13] powerpc/syscall: Use is_compat_task() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , npiggin@gmail.com, msuchanek@suse.de Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Sun, 5 Apr 2020 17:44:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of hard comparing task flags with _TIF_32BIT, use is_compat_task(). The advantage is that it returns 0 on PPC32 allthough _TIF_32BIT is always set. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/syscall.c b/arch/powerpc/kernel/syscall.c index 28bd43db8755..4674cfd2916d 100644 --- a/arch/powerpc/kernel/syscall.c +++ b/arch/powerpc/kernel/syscall.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include + #include #include #include @@ -92,7 +94,7 @@ notrace long system_call_exception(long r3, long r4, long r5, /* May be faster to do array_index_nospec? */ barrier_nospec(); - if (unlikely(ti_flags & _TIF_32BIT)) { + if (is_compat_task()) { f = (void *)compat_sys_call_table[r0]; r3 &= 0x00000000ffffffffULL; -- 2.25.0