Received: by 10.213.65.68 with SMTP id h4csp520269imn; Tue, 13 Mar 2018 11:39:01 -0700 (PDT) X-Google-Smtp-Source: AG47ELsry5IHY+92ZBLBxOuzOWrNVL0a5CarJM9qlpNgv4j7i8BEWbI62OEpzFvU9wSXCP7G4y4j X-Received: by 2002:a17:902:680c:: with SMTP id h12-v6mr1514024plk.46.1520966341603; Tue, 13 Mar 2018 11:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520966341; cv=none; d=google.com; s=arc-20160816; b=kk+hld4eMFmMztRuXQjMU7lr5BAnJFCoCIrGYWQa7M/kRae/hluwreF2scajJQ0OUH 0KKS1rD62tDbGZle9G+Z+JRdy1eTupqjeFuwYk1xoPop8axlSuiofbk0Mw+0TJv0iL3D GGjKWDjFCceNunX66+SoY+ZvPaB5/SgZ7PU8gy0eweKW8di88bjX19ZbknoO9RTfzBVV IDa47fsenPBet5NtzL9Tm//UZ6/6TCRtmFrpYfhJ1CrvZdAmmPwAHCI5Dvg8o/Efs2IX MgQJPNJZ5eWFqElY4NyGuU84nJSSEA7uPh+2y01OSGRP4n0H0ueG0abyUvrXbpQ6t+PB TqAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=CN2Hm4f5djlUFuxMhAT1GFUgEANS34LJuCBgen3LaDw=; b=mkrfV0e9K7sce/za5pvtZ0VYRI79S5tASFsc7INKQUC+EARsJxhDPDtZfyeD66EsNK v19SeE0FTfXchrS1VFyo4e1ZZAiRm2m5Sqe+N3PufGO93rWrliNllHT8THtUkbJfC9Uv 4JiSaXNUfcEQ8CgtWBxN2z1pbvie655kD0coj7Q49maL4zBNEZtmeQwiBokYRovRgTzT lhFpQcVmpkGtOT7JnEud54mZcafaffzcm3idpSSRZdgothEiPHfCOlPKdyb/e7Q3o3D7 RlZ/2OeIX/U2OYIUCj8lFlficzTB2HJ4OxtgePKAzww6z9OjEcBgfhmfNWDwEVuty+ao j0cg== ARC-Authentication-Results: i=1; mx.google.com; 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 w31-v6si507255pla.315.2018.03.13.11.38.47; Tue, 13 Mar 2018 11:39:01 -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; 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 S932122AbeCMSdx (ORCPT + 99 others); Tue, 13 Mar 2018 14:33:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:53470 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751529AbeCMSdv (ORCPT ); Tue, 13 Mar 2018 14:33:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 98C4AAF47; Tue, 13 Mar 2018 18:33:49 +0000 (UTC) From: Michal Suchanek To: linuxppc-dev@lists.ozlabs.org Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Peter Zijlstra , Michal Suchanek , Kate Stewart , Greg Kroah-Hartman , Philippe Ombredanne , Nicholas Piggin , "Tobin C. Harding" , Mahesh Salgaonkar , David Gibson , Al Viro , Michael Neuling , "Oliver O'Halloran" , "Naveen N. Rao" , Madhavan Srinivasan , Masami Hiramatsu , Andrew Morton , Balbir Singh , Sergey Senozhatsky , Christophe Leroy , Andrew Donnellan , Daniel Axtens , Russell Currey , Joe Perches , "Bryant G. Ly" , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , linux-kernel@vger.kernel.org Subject: [PATCH RFC 1/8] powerpc: Add barrier_nospec Date: Tue, 13 Mar 2018 19:32:59 +0100 Message-Id: X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Copypasta from original gmb() and rfi implementation Signed-off-by: Michal Suchanek --- arch/powerpc/include/asm/barrier.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/include/asm/barrier.h b/arch/powerpc/include/asm/barrier.h index 10daa1d56e0a..8e47b3abe405 100644 --- a/arch/powerpc/include/asm/barrier.h +++ b/arch/powerpc/include/asm/barrier.h @@ -75,6 +75,15 @@ do { \ ___p1; \ }) +/* TODO: add patching so this can be disabled */ +/* Prevent speculative execution past this barrier. */ +#define barrier_nospec_asm ori 31,31,0 +#ifdef __ASSEMBLY__ +#define barrier_nospec barrier_nospec_asm +#else +#define barrier_nospec() __asm__ __volatile__ (stringify_in_c(barrier_nospec_asm) : : :) +#endif + #include #endif /* _ASM_POWERPC_BARRIER_H */ -- 2.13.6