Received: by 10.192.165.148 with SMTP id m20csp832204imm; Fri, 27 Apr 2018 08:12:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqiKcSUpjtNBk9bFeAZJy95+joIvVq8EnjFtJhVCY2UWxBG42CkuqNqx6tA9F+gwCgA1Car X-Received: by 2002:a17:902:8ec5:: with SMTP id x5-v6mr2651344plo.57.1524841948638; Fri, 27 Apr 2018 08:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524841948; cv=none; d=google.com; s=arc-20160816; b=VVxPOgy5ldIV5LbvpZhZVpImV/q+14eNFGKZFm9Qai0i9+GBMdxhZKLRYzXV6ti3UT 2iVQjKc9gg015wxR+zUy+iZA8v7m38crw95wB0t/t0D+2R++qQpniKcSJVgY1Q01n9oA ZVW6+x/9V9ye3FVvm9oQ89W56CN6yr9XL1p0hZIau6AKMDjqJv5y4WSgIsE0XG6wjrmG 2tyII6Hb2ffvnUFNQUOvIT4rgcU7T9ASuxCWjP+ShoQtExHsNfUxWF31CUrsb7MmMI/R /fWJefZhzJfFLwyQs57K0JpEXnCq4IHLPmlb9N1bpZzdvWP2W47ZqMdx2Du5OGuKxMKq Wf6Q== 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:dmarc-filter :arc-authentication-results; bh=eL1HpxQvJOp6Rv4fz49YgPKCj9v4GFcFhNeQmN/nNUg=; b=ODBUHiCGrNMuHrGYkUvIPsb3Gsrfhm6iznPVuQWQmk0k3d7uzoi27wQAhXnzEdcnZd fUO+GCbIz/u4ZfdVGPktURN1i4IxTjuCK1tAvVGEcuoyRZBsXahtD68592YoIZBcPKQM P/M6N59YcRc3eZ6CBfyobkKE7rQoRquIck/ysUm6m0uU4W2oiVCb803kzzzXvtpuc/P2 OYfU/f63x3q8T4wTvy6E04z2cY3LQCZLgS7T7uiLTsjwnFzVBwtrjWkBJAaM80PB2gZ5 XGNHa4vMua+Ahea9WGg5Xpt7HOC11rOeKJE/CSwCEitZgU0rRL+fyr2JiWMS2UpW+0Nt 6xQw== 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 t15-v6si1431397plr.188.2018.04.27.08.12.14; Fri, 27 Apr 2018 08:12:28 -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 S933806AbeD0PLK (ORCPT + 99 others); Fri, 27 Apr 2018 11:11:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:50586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933669AbeD0OEN (ORCPT ); Fri, 27 Apr 2018 10:04:13 -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 BC46E21890; Fri, 27 Apr 2018 14:04:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC46E21890 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Schwidefsky Subject: [PATCH 4.9 41/74] s390: move nobp parameter functions to nospec-branch.c Date: Fri, 27 Apr 2018 15:58:31 +0200 Message-Id: <20180427135711.625886806@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135709.899303463@linuxfoundation.org> References: <20180427135709.899303463@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.9-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 @@ -59,11 +59,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 obj-y += entry.o reipl.o relocate_kernel.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 @@ -14,29 +14,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 @@ -3,6 +3,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); @@ -99,3 +124,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 */