Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8097426imu; Tue, 4 Dec 2018 02:58:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/UfCx8HYjvZ7sJr2mxQYQJvJmXDoXOWa9PW9HHN3KRbpMKdS3zhSLNfpo7YnFBknCkUxfrJ X-Received: by 2002:a17:902:7791:: with SMTP id o17mr19218217pll.60.1543921096265; Tue, 04 Dec 2018 02:58:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543921096; cv=none; d=google.com; s=arc-20160816; b=GD6R65G+wO+InxN3/hLNeqsoSxptzJDDxogG7ozCJyuuKFuI0/pJXWXnfn7vqETjQG Fl+GCxAUH0VB3JtsF5Ef6C7do6VTCkJEGVNRlIYxlQlJ32Svr4p3CeZWY4wIGcFf26XJ oxr/OXtFVL7XQi9WEbNbGzeGYZbNyQu+Gpb/7g9akne37WuGkIKu+8RVQq1FjF9zDy2J VRLvzsWj9ywi2hWYqLobdkVbNSIVV9ub0fXAOElLlI7Q05qhHt3TjWJfdlU/hFlpX1r1 Bt9BGPUMkXRogTOutYSrBbmajY/maP7oHNXOWvWlNlHdXa/7QnMDZsR93NLzANtfnaVe LTrQ== 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=0bpkE945tsng1HcaVPeUbYoFDUXQWuCjVJill4iOn94=; b=X5EdmDqsb1fEmYbGX1jML2j0GZizcyUO9qT/qpXlwWCDzqXZoMU5AiAhXXP/cSFuTy Tjjl54AcftlxA2zR6AxZAtM/67f43Gj/Etd0rKK6gRfjN8T3PWcrppmwOggiVV3DOEGd Pjb8Qp+QNqsU8/aQx/y+mN9G8504UJgDUM7wFUN3KasUaTnB38A9jgrr1utWoHr4U0S+ MmyI50laUlUEzdsvDblQTgb69WMZ6CRbUnaLzcd7oZxtrwDbPyo5ne3A6k3gwFAMloEi iOhXBEeiaaHUrSibtpDQkT0s+npseEpltsTEV0wzgZliG/G5kaoz/g2jubg9XavshPhZ Hm0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Wrbxncv+; 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 u184si15736720pgd.262.2018.12.04.02.58.01; Tue, 04 Dec 2018 02:58:16 -0800 (PST) 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=Wrbxncv+; 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 S1726590AbeLDK4t (ORCPT + 99 others); Tue, 4 Dec 2018 05:56:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:40222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726575AbeLDK4r (ORCPT ); Tue, 4 Dec 2018 05:56:47 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 2C2FB2146D; Tue, 4 Dec 2018 10:56:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543921005; bh=vapd6V+4KnaTEBNn6ApDWbq8EkT9cK+1oyNrHglgXHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wrbxncv+mEpnN0gAYIn695MkajB9ZJJ8kv4+lIGoSt6USyLMv74KIwddrA1dN/gsA sqzLzvUC5Fi/egT88sz7OgXTZ1Do7A2dA9QUbOVfIADqXdGD4pWOPpy3FfasRnIWxU 0QJWYaJ5723gG2ufNSNndAHl3J28sBcBB8lySXGQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tim Chen , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Linus Torvalds , Jiri Kosina , Tom Lendacky , Josh Poimboeuf , Andrea Arcangeli , David Woodhouse , Andi Kleen , Dave Hansen , Casey Schaufler , Asit Mallick , Arjan van de Ven , Jon Masters , Waiman Long , Dave Stewart , Kees Cook Subject: [PATCH 4.19 037/139] x86/speculation: Disable STIBP when enhanced IBRS is in use Date: Tue, 4 Dec 2018 11:48:38 +0100 Message-Id: <20181204103651.511586938@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tim Chen tim.c.chen@linux.intel.com commit 34bce7c9690b1d897686aac89604ba7adc365556 upstream If enhanced IBRS is active, STIBP is redundant for mitigating Spectre v2 user space exploits from hyperthread sibling. Disable STIBP when enhanced IBRS is used. Signed-off-by: Tim Chen Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Cc: Peter Zijlstra Cc: Andy Lutomirski Cc: Linus Torvalds Cc: Jiri Kosina Cc: Tom Lendacky Cc: Josh Poimboeuf Cc: Andrea Arcangeli Cc: David Woodhouse Cc: Andi Kleen Cc: Dave Hansen Cc: Casey Schaufler Cc: Asit Mallick Cc: Arjan van de Ven Cc: Jon Masters Cc: Waiman Long Cc: Greg KH Cc: Dave Stewart Cc: Kees Cook Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20181125185003.966801480@linutronix.de Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/bugs.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -320,6 +320,10 @@ static bool stibp_needed(void) if (spectre_v2_enabled == SPECTRE_V2_NONE) return false; + /* Enhanced IBRS makes using STIBP unnecessary. */ + if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED) + return false; + if (!boot_cpu_has(X86_FEATURE_STIBP)) return false; @@ -844,6 +848,9 @@ static ssize_t l1tf_show_state(char *buf static char *stibp_state(void) { + if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED) + return ""; + if (x86_spec_ctrl_base & SPEC_CTRL_STIBP) return ", STIBP"; else