Received: by 10.213.65.68 with SMTP id h4csp148869imn; Thu, 15 Mar 2018 12:20:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELt3iq0ChQSFW2U6ZXXWIDvOv8BS/RvCW3b/MjuGX03vSZXnW/aGLI7VqqFIilSfN40KDxjh X-Received: by 2002:a17:902:1c5:: with SMTP id b63-v6mr9156164plb.311.1521141645051; Thu, 15 Mar 2018 12:20:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521141645; cv=none; d=google.com; s=arc-20160816; b=wLj3S6J2BrPTV593VnWgaNSI6oJPNRTYHPNnMqtLpunZAkI6gZ7UgRn1bJRXeVIuqo BG2wZiyMpzkxBbdEwa9+0MjMSCZjN8/mpSL6KUMXjdm6UmCUSMo1V1R1i1b9r6VcHRo3 KSd26QptVzPjoCkdd+D6ccLA521mvQQE69TSQdIfSObzdaeMdmE7MRDMgzVskhqC9xRP 66NiJZ/J3WVU5gsPH8Y4MGRWPmmSGG33mDh4f0ZgS4Un8aGyosLIwUYxJn6Y6CQaZGe2 ufsJwIRVat6ctB66i2dRG2NONUEOKsHr1qmPSvsz+LDmtOGaASOFU106Id30XE8lWLDg R2TA== 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=qW8AeD6kDGKwWr8ly3e0aQrtosgHOGyFvl9sbHVbNUs=; b=Hh2nnGPprivpTTzscu8QIIpwUIq9RAHhH8rS5iPQ8qRID1Js0JUtkog8/o+VIOgSkO 5Kh8SbwJZTNd7ZdQQon5L3u5WW3/TXgLZ0FP8Em4U1IcHZXUaTKShRqsVJ5NU81/cjvI v0hRjrEc6yOCSHf3npKPct3JIPiS1wyq7qSyJhHFrKS9NRW/Z6Qnlqu0+FDA1D9tJLtQ zOAfJuWUCt8lc5lX6D+QJNfVkLNAJG7yRDgnh8PsMkwSUeRhlfBwQKYsfVJSY3HqDYye k4qABLvq3CoSSDH7KBmImYohpYmOxsysRuhnNDFxFCab47F6Qic+/U65/m6hASVeS+Bs R+ow== 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 v3-v6si4533804plb.522.2018.03.15.12.20.30; Thu, 15 Mar 2018 12:20:45 -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 S932678AbeCOTR5 (ORCPT + 99 others); Thu, 15 Mar 2018 15:17:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:45205 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752943AbeCOTQX (ORCPT ); Thu, 15 Mar 2018 15:16:23 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A3790AED2; Thu, 15 Mar 2018 19:16:22 +0000 (UTC) From: Michal Suchanek To: linuxppc-dev@lists.ozlabs.org Cc: Kate Stewart , Madhavan Srinivasan , Paul Mackerras , Michael Neuling , "Bryant G. Ly" , Mahesh Salgaonkar , "Naveen N. Rao" , Daniel Axtens , Nicholas Piggin , Al Viro , David Gibson , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Sergey Senozhatsky , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Masami Hiramatsu , Andrew Donnellan , Philippe Ombredanne , Joe Perches , Oliver O'Halloran , Andrew Morton , "Tobin C. Harding" , Michal Suchanek Subject: [PATCH RFC rebase 4/9] powerpc/64s: Use barrier_nospec in RFI_FLUSH_SLOT Date: Thu, 15 Mar 2018 20:15:53 +0100 Message-Id: <89e52fff32b76d01d5c0c961f6558dade0676f7a.1521141122.git.msuchanek@suse.de> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: <20180313200108.GA4082@hirez.programming.kicks-ass.net> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The RFI flush support patches the speculation barrier into RFI_FLUSH_SLOT as part of the RFI flush. Use separate barrier_nospec instead. Signed-off-by: Michal Suchanek --- arch/powerpc/include/asm/exception-64s.h | 2 +- arch/powerpc/lib/feature-fixups.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h index 471b2274fbeb..bb5a3052b29b 100644 --- a/arch/powerpc/include/asm/exception-64s.h +++ b/arch/powerpc/include/asm/exception-64s.h @@ -81,9 +81,9 @@ * L1-D cache when returning to userspace or a guest. */ #define RFI_FLUSH_SLOT \ + barrier_nospec_asm; \ RFI_FLUSH_FIXUP_SECTION; \ nop; \ - nop; \ nop #define RFI_TO_KERNEL \ diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c index 35f80ab7cbd8..4cc2f0c5c863 100644 --- a/arch/powerpc/lib/feature-fixups.c +++ b/arch/powerpc/lib/feature-fixups.c @@ -119,7 +119,7 @@ void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end) #ifdef CONFIG_PPC_BOOK3S_64 void do_rfi_flush_fixups(enum l1d_flush_type types) { - unsigned int instrs[3], *dest; + unsigned int instrs[2], *dest; long *start, *end; int i; @@ -128,15 +128,13 @@ void do_rfi_flush_fixups(enum l1d_flush_type types) instrs[0] = 0x60000000; /* nop */ instrs[1] = 0x60000000; /* nop */ - instrs[2] = 0x60000000; /* nop */ if (types & L1D_FLUSH_FALLBACK) - /* b .+16 to fallback flush */ - instrs[0] = 0x48000010; + /* b .+12 to fallback flush */ + instrs[0] = 0x4800000c; i = 0; if (types & L1D_FLUSH_ORI) { - instrs[i++] = 0x63ff0000; /* ori 31,31,0 speculation barrier */ instrs[i++] = 0x63de0000; /* ori 30,30,0 L1d flush*/ } @@ -150,7 +148,6 @@ void do_rfi_flush_fixups(enum l1d_flush_type types) patch_instruction(dest, instrs[0]); patch_instruction(dest + 1, instrs[1]); - patch_instruction(dest + 2, instrs[2]); } printk(KERN_DEBUG "rfi-flush: patched %d locations (%s flush)\n", i, -- 2.13.6