Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1955493imm; Thu, 24 May 2018 03:33:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoCn/pfih5xAlCwo+2BRR7hTzJdVG8L/dA7GPnkKQ7Cw7Q88xBG0YAHc4ofwTsvjuvSeeZ9 X-Received: by 2002:a17:902:9a95:: with SMTP id w21-v6mr6584063plp.168.1527158028741; Thu, 24 May 2018 03:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527158028; cv=none; d=google.com; s=arc-20160816; b=vEJGTwWTlACIzPrASmrfs7yyikItYjFaqa9dTDHhhvBAzP0a7YZdTz66vCZ40X42QJ ULPtvlDE4crXsen2ZbcvI08VYrK2vms7kFlPiW3EoQStETjPWAKrJvrF86itGRaln5ue 759RZePkXjrNH+13WiLmYU/xIFkns92ycYkBF7Mw5Fgu9lyIUT/MQJ4qQc93gTrWW7lZ +WzWG0jaGx2Ng9119XzdUIQ3Ys3PJEZhr8zGictMOo4dary6PBwfQmmmVRQeEz9AkC0p Li15UeI90Lgr/j9Hmiyy3tsLlau4dh4QjeRfUgRAfW3ElVWN4yHlUADy4EkOLOk1PUA0 EE3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=NZItv4NQK09Zc+1uiP0zSaCDf5uRfp9jNgP/OGhiC4M=; b=pybx8NfFmWYvtiyqKlaHuCfSPjSWQ14D31soi73M7T9SDqpxs8552FcV7o83hB2fHv EIM7GcCInQ2viATR/eaABogDxgYd3jvJqIY9mOWp2sUsbJJ8wYwglLh8zYEMtiVpvAGK EwE8vuQHZQ1GT2BTzaEIqMndZAVkEl7b2xjLFz5aj5erlO6g6CV4b32YZ14VdUAm/ixv pY6+Xq/cf0MsCYKwuqUUnyYP6bvA6t7sK7Hkc07jyEtOkLMNXAhWrcFE2W4IxOX/kHUP 5aYnO2SQFBB4c8eiOnoZGZfOhjj3Zdhno0EOwQRvurTFI4sn39dVo1ybep4UbawNK2S+ HMfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fdQjYXQl; 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 e1-v6si21488849pln.445.2018.05.24.03.33.34; Thu, 24 May 2018 03:33: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=fdQjYXQl; 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 S1032165AbeEXKbs (ORCPT + 99 others); Thu, 24 May 2018 06:31:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:45200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030864AbeEXKBD (ORCPT ); Thu, 24 May 2018 06:01:03 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 84C0D20899; Thu, 24 May 2018 10:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156061; bh=E6/TXhz2tAbAJXYYMd9FNfYcjTv9foPnPPkItvdpvHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fdQjYXQlOt6ubC4m3vdGFXgRt4ZGCqYd2hQmq9xtMlNZiJKhzJptXkGIUURr+ElkD WAp2RHWpiM3HVSaSkSBCnyu/S7WPkF65v30akaF7tNxnRt34EALGjtOmxuyhrG5mx/ lyyBJdqt/zbKURh5awBp+UV8WEtKy6sqVIDn4m6E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Martin Schwidefsky Subject: [PATCH 4.16 049/161] s390: move nobp parameter functions to nospec-branch.c Date: Thu, 24 May 2018 11:37:54 +0200 Message-Id: <20180524093024.328567832@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Martin Schwidefsky [ Upstream commit b2e2f43a01bace1a25bdbae04c9f9846882b727a ] Keep the code for the nobp parameter handling with the code for expolines. Both are related to the spectre v2 mitigation. Signed-off-by: Martin Schwidefsky Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/Makefile | 4 ++-- arch/s390/kernel/alternative.c | 23 ----------------------- arch/s390/kernel/nospec-branch.c | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 25 deletions(-) --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile @@ -61,11 +61,11 @@ obj-y += debug.o irq.o ipl.o dis.o diag. obj-y += sysinfo.o jump_label.o lgr.o os_info.o machine_kexec.o pgm_check.o obj-y += runtime_instr.o cache.o fpu.o dumpstack.o guarded_storage.o sthyi.o obj-y += entry.o reipl.o relocate_kernel.o kdebugfs.o alternative.o +obj-y += nospec-branch.o extra-y += head.o head64.o vmlinux.lds -obj-$(CONFIG_EXPOLINE) += nospec-branch.o -CFLAGS_REMOVE_expoline.o += $(CC_FLAGS_EXPOLINE) +CFLAGS_REMOVE_nospec-branch.o += $(CC_FLAGS_EXPOLINE) obj-$(CONFIG_MODULES) += module.o obj-$(CONFIG_SMP) += smp.o --- a/arch/s390/kernel/alternative.c +++ b/arch/s390/kernel/alternative.c @@ -15,29 +15,6 @@ static int __init disable_alternative_in early_param("noaltinstr", disable_alternative_instructions); -static int __init nobp_setup_early(char *str) -{ - bool enabled; - int rc; - - rc = kstrtobool(str, &enabled); - if (rc) - return rc; - if (enabled && test_facility(82)) - __set_facility(82, S390_lowcore.alt_stfle_fac_list); - else - __clear_facility(82, S390_lowcore.alt_stfle_fac_list); - return 0; -} -early_param("nobp", nobp_setup_early); - -static int __init nospec_setup_early(char *str) -{ - __clear_facility(82, S390_lowcore.alt_stfle_fac_list); - return 0; -} -early_param("nospec", nospec_setup_early); - struct brcl_insn { u16 opc; s32 disp; --- a/arch/s390/kernel/nospec-branch.c +++ b/arch/s390/kernel/nospec-branch.c @@ -2,6 +2,31 @@ #include #include +static int __init nobp_setup_early(char *str) +{ + bool enabled; + int rc; + + rc = kstrtobool(str, &enabled); + if (rc) + return rc; + if (enabled && test_facility(82)) + __set_facility(82, S390_lowcore.alt_stfle_fac_list); + else + __clear_facility(82, S390_lowcore.alt_stfle_fac_list); + return 0; +} +early_param("nobp", nobp_setup_early); + +static int __init nospec_setup_early(char *str) +{ + __clear_facility(82, S390_lowcore.alt_stfle_fac_list); + return 0; +} +early_param("nospec", nospec_setup_early); + +#ifdef CONFIG_EXPOLINE + int nospec_call_disable = IS_ENABLED(CONFIG_EXPOLINE_OFF); int nospec_return_disable = !IS_ENABLED(CONFIG_EXPOLINE_FULL); @@ -98,3 +123,5 @@ void __init nospec_init_branches(void) nospec_call_revert(__nospec_call_start, __nospec_call_end); nospec_return_revert(__nospec_return_start, __nospec_return_end); } + +#endif /* CONFIG_EXPOLINE */