Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2445069yba; Mon, 15 Apr 2019 11:46:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyb78z7Rd9v1msMbc2gzm1sWXpNhlon5Fcwb8bQkkB4wvF4WDjbucSK4MPvDPwlxXhFpKXW X-Received: by 2002:a65:6389:: with SMTP id h9mr72183024pgv.398.1555354008390; Mon, 15 Apr 2019 11:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555354008; cv=none; d=google.com; s=arc-20160816; b=gouTJi2hwG60e9fg0xsQi2Wgra7oojTFEbMUpy4XmvMiQR9/c5wQV8L+WwjAyPm9K1 P+HcV7xksMyRdFtgv8G6GvzVVwV0Cdruc4umEdw+7SdCpjQhNwyWS0TQRGXZf0hFozQL MAaQs9K7cKlv9e007ZT0NZx6NPh/g8LNrtVYSbfhMjZVCpEvvb8ubL1gcfpBIyww4f83 PpyXcVuC4S6gXiV3H78W29ku6PvKlI1ZxwR2V+kgPzsv5AHIof27WmtTqSGDLb0eBk7z 6U6mXg8xvNAcE4/z6CL6zxvWWmjuwr5aVdTblqy/NaYhvDOUJGxbu+Hp1Q0Hhi6AgM7J l8yA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gHYJVeHDczw/dkzkayjl/Y39oAx/xSBbWq1VhLPHBt0=; b=cLq9iJJ4hYwrVsBtpWp1I7WbEu76iM2VGlb/hZDK3VMFWoZXCswU6ALlimJYzW0cyI PnwUu1xt3yj0QBZllEvJiisbmTFdzRIKtmtYJTJHFq/B67J0lRW/pSV8fnYkuzGBGMIT utyDLu5F1+a+QeATKt7bNJOjiXMpWp5UhLQF/ZX9TfVpMkpZ5b3vIkXronskxl70xSlr sj3o9W0jqMePun/S7C/0HS9kFx9rTAlwwL6hwEzHRDpLy8emDTayzvVg53Zw+oxMwKZ0 C+HChkSvsG4J8qbPhCzJQ1i8NlukMx68Qgx+DsuNTAn+FKYnJDF7Fm5RR15QZm1X+6QS Vjwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bLhyjSCM; 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 t16si17971261pgi.518.2019.04.15.11.46.32; Mon, 15 Apr 2019 11:46:48 -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=@kernel.org header.s=default header.b=bLhyjSCM; 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 S1728402AbfDOSpe (ORCPT + 99 others); Mon, 15 Apr 2019 14:45:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:47940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728393AbfDOSpb (ORCPT ); Mon, 15 Apr 2019 14:45:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 641EB2073F; Mon, 15 Apr 2019 18:45:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555353930; bh=jvdnfx7i1BZOSc0nVxbkv8tDOtMDTq7xv2YEYUFs0K0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bLhyjSCMCSwmX6unKz8ZpLNTrZbhNsadfqLzlGz8C2LgSoSI7wsLNqSV1n1pBVNM/ fZQc+CSN8qupvNxTDHcTKTl5IIUDT3Tfkh11/T1D0No7ReyPb3CGXQbD/m8/SjgaZV ndQMoFsQebU7im0IOUYmF6q/PzdXEchVsplCNrvE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Diana Craciun , Michael Ellerman , Sasha Levin Subject: [PATCH 4.9 23/76] powerpc/64: Call setup_barrier_nospec() from setup_arch() Date: Mon, 15 Apr 2019 20:43:47 +0200 Message-Id: <20190415183713.834205881@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183707.712011689@linuxfoundation.org> References: <20190415183707.712011689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit af375eefbfb27cbb5b831984e66d724a40d26b5c upstream. Currently we require platform code to call setup_barrier_nospec(). But if we add an empty definition for the !CONFIG_PPC_BARRIER_NOSPEC case then we can call it in setup_arch(). Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/setup.h | 4 ++++ arch/powerpc/kernel/setup-common.c | 2 ++ arch/powerpc/platforms/powernv/setup.c | 1 - arch/powerpc/platforms/pseries/setup.c | 1 - 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h index 38525bd2ed65..d3e9da62d029 100644 --- a/arch/powerpc/include/asm/setup.h +++ b/arch/powerpc/include/asm/setup.h @@ -51,7 +51,11 @@ enum l1d_flush_type { void setup_rfi_flush(enum l1d_flush_type, bool enable); void do_rfi_flush_fixups(enum l1d_flush_type types); +#ifdef CONFIG_PPC_BARRIER_NOSPEC void setup_barrier_nospec(void); +#else +static inline void setup_barrier_nospec(void) { }; +#endif void do_barrier_nospec_fixups(bool enable); extern bool barrier_nospec_enabled; diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index bf0f712ac0e0..d5a128f54537 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -918,6 +918,8 @@ void __init setup_arch(char **cmdline_p) if (ppc_md.setup_arch) ppc_md.setup_arch(); + setup_barrier_nospec(); + paging_init(); /* Initialize the MMU context management stuff. */ diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index eb5464648810..17203abf38e8 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c @@ -123,7 +123,6 @@ static void pnv_setup_rfi_flush(void) security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV)); setup_rfi_flush(type, enable); - setup_barrier_nospec(); } static void __init pnv_setup_arch(void) diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 2b2759c98c7e..91ade7755823 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -525,7 +525,6 @@ void pseries_setup_rfi_flush(void) security_ftr_enabled(SEC_FTR_L1D_FLUSH_PR); setup_rfi_flush(types, enable); - setup_barrier_nospec(); } static void __init pSeries_setup_arch(void) -- 2.19.1