Received: by 10.192.165.148 with SMTP id m20csp803909imm; Fri, 27 Apr 2018 07:47:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqkt//Z2JCcpED1bchjWEpWyYxclFchf2p7dw2VMyAhIaAk88Djcwg8kfPlc4L0vPKf8ayI X-Received: by 2002:a63:6ac6:: with SMTP id f189-v6mr777931pgc.308.1524840440324; Fri, 27 Apr 2018 07:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524840440; cv=none; d=google.com; s=arc-20160816; b=NA3tv7Vf3AeRwHwhAyLBlQlmi0mRW5A/uf7IIQl90h4vS1KoOZ+TUEyXF9Yz6kUzg2 ZH7mz0E2txMK+pAAb2O9JjoNHZmCZTrA24eYT6l2c+LZXjJf0Qu6pyh64Nx94lNrGZgp m/yR2JviACCpV7jVcHkZgqzuxoxuBgeDFiieqbaI1oo05uIeoxC0xGPMVCCBTnbYJvO2 wEjqw1XpkSI5KyIvsg6i6zNsmoztrQ4Wa8Kxpu7xxeYncHWYpVVOKRNFxAM1y5Bpol4V ihISL6OBLHg4tXBeZK6R+DoPwBQeSOOIlhgdili0OHeMpUEtmxUAGTRw+BIaiaFiHquH 10Ig== 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=QENMuo+tkAU/bX5rIzeEuVSiTHrQaqBlGv9YWRVh6uY=; b=hWf628g4i2t35tMHMKXfIny9TRquC+yR8hW8RXUBzTj5/Eci5tVIv7lN4UsH0WFZ74 BhUuTqND5hK8XAqjn1QDj43kK/L7sKWrRNkd7IUXp1bJlg4f9X9++BNW8LwCpVi7OUPC VduAONNikI5gNwta3ifpEmhewu7rEnL1ubuVw9FXu3JUVdwYQxrqsNwIgE3LS74CVCkq BHFgCigvrDPEDqRTVLRGZ3dTlzwHxhmJAO91sI5mZOVV7pFA381g0lGpShoTgLCQbN35 SPJtsfuAWbSHeTR6Df5xHeufsONwXl4RpCuX4GK2jr9jL7VetOmXB8AjO34SpcewFmYB hBUQ== 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 o2-v6si1357350pls.307.2018.04.27.07.47.06; Fri, 27 Apr 2018 07:47:20 -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 S934526AbeD0OqL (ORCPT + 99 others); Fri, 27 Apr 2018 10:46:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:53778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933960AbeD0OIG (ORCPT ); Fri, 27 Apr 2018 10:08:06 -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 878A721892; Fri, 27 Apr 2018 14:08:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 878A721892 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.14 55/80] s390: move nobp parameter functions to nospec-branch.c Date: Fri, 27 Apr 2018 15:58:48 +0200 Message-Id: <20180427135735.731178755@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135732.928644313@linuxfoundation.org> References: <20180427135732.928644313@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.14-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 guarded_storage.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 @@ -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 */