Received: by 10.213.65.68 with SMTP id h4csp173466imn; Thu, 15 Mar 2018 22:20:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELtPwVf/EytKhxYLq12EsiLusdEGdKpZxqWOSl3Zt9AwM2dw/21Mev9N0ZKDdC54SbLuGnml X-Received: by 10.99.124.7 with SMTP id x7mr433395pgc.356.1521177634673; Thu, 15 Mar 2018 22:20:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521177634; cv=none; d=google.com; s=arc-20160816; b=Y2N6o7ELwhQrkfx0QJ2jG/jaGiaLnTf+TP4HdkqhH5T26lnqn5Cq1j0tAbw0UWxxBv 6OsMjM2ezQ/cD4q0lN/rkfiHtc8S9W7N+zTdkQs9xNx0wlWvOYRVFck4eR1Zdxr+v+jE oDL6MbkURp4mPehyuRBtxjJ6S86Imty7IvXvVcMiOR6d39/itMuvyQ1a7plEb9FaY675 F3DK7NjGAVLcem/RuGGlV70jHlPPJ+E0kl6G1CqCbBfvsF4/9QHvQpenQ6Q87qVzS3vD szoqln1EN9FV0BoIwSNI3wAjLg3o5pkd/BgqbPcwZkCACZQawZ5HpkPT2d4bzTV5k3PP U+oA== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature:arc-authentication-results; bh=cHenr9AUA0PPmScRH3/JvSRgnmIJAmINdRc1wTO85Lw=; b=j2Lnd9IS/aNCEhdM4GvjAQ8fIJ/HrTGZWpuLsE2uTdoswLOLHBP95QRwpKN22q948z 3QS+IO8QZON5Pquqx6d7RO+U7vkOi1I4u3Fw8U2hr2AMHrif8y7u4im5W7qviLMi5cdQ SwD1w/f/D5pQQP9NW2+kTJNusY0U/nkVXMTxzcRUdFrKtf9X2Q8wUz5pN9yIBR89fuec pAFcKhBH2cpIagSZXDadrSeEVjBf6PyJNr+MVcx2/IVa3Op9YeUdWf69Qzc6aRIrTIH5 WIN/LWKqARt5pPFtsqkdNA8uhma3vl3bMgCk/OYGRfh4+/xsQEZ07LuFCpa2KXpKP2Vi U/fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EK+9dIpG; 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 n14si4574407pgu.110.2018.03.15.22.20.09; Thu, 15 Mar 2018 22:20:34 -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=@gmail.com header.s=20161025 header.b=EK+9dIpG; 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 S1751855AbeCPFSk (ORCPT + 99 others); Fri, 16 Mar 2018 01:18:40 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:41904 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750842AbeCPFSj (ORCPT ); Fri, 16 Mar 2018 01:18:39 -0400 Received: by mail-pl0-f68.google.com with SMTP id b7-v6so1208818plr.8 for ; Thu, 15 Mar 2018 22:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=cHenr9AUA0PPmScRH3/JvSRgnmIJAmINdRc1wTO85Lw=; b=EK+9dIpG/QA7mPtoQC0H2VqlA1McIATCOsqMwiKypIexDmF7RH+Aio80JwyFfyNkDh soJwrsKlioIQJFFnlBv7XJtxvB5tCIVMkzex4UUAtO1yEff998ZrkwpH2n1WOJGYCrWD 31/Rc2WnWrskYeykWl3gnq4eSYpCMxj/fL7AUmrUtmztEIvse+k+N7JP7gTg+5AlEIE1 jS0hQIJrLCcXjs7Z166cZt4uiB423pu1wAkqgn1VULKlQNKlKDpS0AWKWVLvn3Bipo4H yQY84XWKFwfIO78aZqF/pzCbC+5k5Yy+Ma+nNskzrLsrGnGJyfZYmz7QGiGwY70gnQXN buMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=cHenr9AUA0PPmScRH3/JvSRgnmIJAmINdRc1wTO85Lw=; b=gkycaRiA76kieAa4viBfl0V3DyE+r9xCqCUKgfCdwrdem3vQoXMXGD18YmC82ocPew cgpT/4WPgMhq+Uo6xlOUYWNAvGP8Lh0rm+ZUcO3ZNeevyE1JBNEM4aLQJh+XbcgvlrAf hz1niECJDrJ4zQ+e4IdXhQ/EPcE6hTQLJN7YL5UFYkoqGKhPx5OdgY3YAIdo+OlCgnEN 5y0slcGDAHfPPKDD4+DysWCfmznUIXRIvuHBVGg3FcStqiqXI1qa6pzv2bYnVrcAj4JY UyJiNdQzagm9dIjLopoBo6vDQFQLjHiE4OsaePwrQJ46WrW6NLtbWSXNv9cM5E5A/Sje k72Q== X-Gm-Message-State: AElRT7GvxF41t/N7UJ6B70BQSte7s6KsDXmiL+lD3o3sYkaZScFZAgqS x6OSQy82mnZNI+Qv/s32e9I= X-Received: by 2002:a17:902:143:: with SMTP id 61-v6mr608543plb.345.1521177518882; Thu, 15 Mar 2018 22:18:38 -0700 (PDT) Received: from roar.ozlabs.ibm.com (115-64-218-172.tpgi.com.au. [115.64.218.172]) by smtp.gmail.com with ESMTPSA id d15sm13919365pfj.121.2018.03.15.22.18.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Mar 2018 22:18:37 -0700 (PDT) Date: Fri, 16 Mar 2018 15:18:23 +1000 From: Nicholas Piggin To: Michal Suchanek Cc: linuxppc-dev@lists.ozlabs.org, Kate Stewart , Madhavan Srinivasan , Paul Mackerras , Michael Neuling , "Bryant G. Ly" , Mahesh Salgaonkar , "Naveen N. Rao" , Daniel Axtens , Al Viro , David Gibson , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Sergey Senozhatsky , =?UTF-8?B?Q8OpZHJpYw==?= Le Goater , Masami Hiramatsu , Andrew Donnellan , Philippe Ombredanne , Joe Perches , Oliver O'Halloran , Andrew Morton , "Tobin C. Harding" Subject: Re: [PATCH RFC rebase 3/9] powerpc/64: Use barrier_nospec in syscall entry Message-ID: <20180316151823.2f28d5ea@roar.ozlabs.ibm.com> In-Reply-To: References: <20180313200108.GA4082@hirez.programming.kicks-ass.net> Organization: IBM X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Mar 2018 20:15:52 +0100 Michal Suchanek wrote: > On powerpc syscall entry is done in assembly so patch in an explicit > barrier_nospec. Same comment as Linus for this -- the barriers are before the branch here, so is it possible the branch instruction can be speculative while the index is used to load the syscall table? Thanks, Nick > > Signed-off-by: Michal Suchanek > --- > arch/powerpc/kernel/entry_64.S | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S > index 2cb5109a7ea3..7bfc4cf48af2 100644 > --- a/arch/powerpc/kernel/entry_64.S > +++ b/arch/powerpc/kernel/entry_64.S > @@ -36,6 +36,7 @@ > #include > #include > #include > +#include > #include > #ifdef CONFIG_PPC_BOOK3S > #include > @@ -159,6 +160,7 @@ system_call: /* label this so stack traces look sane */ > andi. r11,r10,_TIF_SYSCALL_DOTRACE > bne .Lsyscall_dotrace /* does not return */ > cmpldi 0,r0,NR_syscalls > + barrier_nospec > bge- .Lsyscall_enosys > > .Lsyscall: > @@ -319,6 +321,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) > ld r10,TI_FLAGS(r10) > > cmpldi r0,NR_syscalls > + barrier_nospec > blt+ .Lsyscall > > /* Return code is already in r3 thanks to do_syscall_trace_enter() */