Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp996119pxb; Wed, 6 Apr 2022 06:18:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdvpYt2VrKYsXz/5Ijrb1IkRbo1Edyy5VP3DA3hYCOYebO5M5vrSVHrqcIfJ4TDXuIycZ+ X-Received: by 2002:a63:7701:0:b0:382:7f20:5f83 with SMTP id s1-20020a637701000000b003827f205f83mr6957085pgc.163.1649251106046; Wed, 06 Apr 2022 06:18:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649251106; cv=none; d=google.com; s=arc-20160816; b=UNWdtnEeQpQFZe3PHtjHqzwaKFoKa+xohA6PGZELoOiWWVpg+upT5oxXVfL7K/dwac darOKlN9KKj70HCoQB2pgOCoXaIDpYt0xbIB1Mh6wLiec0wCwOeMfap1boX9EO5ytduW Rt0fCElcBANq8hJGHAl9VnFxWLc9xmPV4n55iUAqyAPfc8MwU7Sd7IkHnKJjZNw10rBc Eehfnywq7pBtQcN5prZgjW4B7gBcMMzrjKKx7BkU/qNPSSR0xW6WxdWleNIHhgoA1skm Ea9puQN433H9g5WTtXVFvrx/+oNinWA7kqQkXe69yfHHi9kU83191K1rJftQflOEciPj IJ6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=UgLzDdhreQ+Hp0Qdc8LWg04tmX4e8gJx2x/idoElhgE=; b=OSeL6w5V0H2oXejPHd+7bPmKEWSKBfortLy+sPbt4odlvLcmA7Mgu/c1c8jLU9XxXk xpaERZfytGqxZKSovW46XYXVNEEcxlwstjgk8hGGN8TH28lqJ7Gd0qwNX0LeKVOP2xFe eOwCNfl1c4ZVXmEUCg5RvaTkMWziAM1gUOQBJZDyU6tcjGTmnru5eMqDENAH2HW+aqkj /a+eP2WQjCMJtEs6cqmwm/O3zsZoId+YH0NswMhc0XgoD6IBYClRN/fcL8PdR/CbZwfJ zGPetELi2y5ponOKtwPK3hN5S1KNd57qLZTbApPHYtlhKG/EeU5xbXuz9jWtSoq15l8w oe/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qLeVRlQg; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=+SBGeY3+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p6-20020a170902e74600b001569eedd2dasi10440650plf.408.2022.04.06.06.18.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:18:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qLeVRlQg; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=+SBGeY3+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 182F76BDFB9; Wed, 6 Apr 2022 03:55:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1849545AbiDFCin (ORCPT + 99 others); Tue, 5 Apr 2022 22:38:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442824AbiDEWTp (ORCPT ); Tue, 5 Apr 2022 18:19:45 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBB4114FFF3; Tue, 5 Apr 2022 13:57:13 -0700 (PDT) Date: Tue, 05 Apr 2022 20:57:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1649192230; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UgLzDdhreQ+Hp0Qdc8LWg04tmX4e8gJx2x/idoElhgE=; b=qLeVRlQg2X9aJ243MX96Zvf1wLwbzCZEb3qjCAP2wVRBvMBcvVQcQo+ZJVgTQRp1wqmQJ9 QD2HtlJOyq1WEE4A7gNREB30SWb2rB1sYriHYV8g9cXCywcMU65zP7k5fKjm7ibzr/0lVn 58S21+ndzDdWsrjbCDWixtLdKLMJhWWs+IjrfgBz+RJ05VQFKNHeKjD4MIk2+nEPgKCo3U 3kzdvOaAmoXKd6VFmrDoKLV4rXFheymANM75SChVh1XnNjcA67+ggOMEpdptq7QQwObwnF +HkT+Y/wI1wdrxl+QGnOIiyZkN/WAmC/nugJUZojY+Uil0HEJr6Y6IRsulIrxg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1649192230; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UgLzDdhreQ+Hp0Qdc8LWg04tmX4e8gJx2x/idoElhgE=; b=+SBGeY3+Kccqb2ETVxyB16Jef9O41UBvRpd+uNxIUvRscefEsz5zm6yFrEDa7qAczRXQ9E AuJb3pk7WjcIW6DQ== From: tip-bot2 for Ricardo =?utf-8?q?Ca=C3=B1uelo?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/speculation/srbds: Do not try to turn mitigation off when not supported Cc: Pawan Gupta , ricardo.canuelo@collabora.com, Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220401074517.1848264-1-ricardo.canuelo@collabora.com> References: <20220401074517.1848264-1-ricardo.canuelo@collabora.com> MIME-Version: 1.0 Message-ID: <164919222889.389.6325233463959483512.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 0205f8a738ab9e62d849e88e543cfa6ce4c13163 Gitweb: https://git.kernel.org/tip/0205f8a738ab9e62d849e88e543cfa6ce4c= 13163 Author: Ricardo Ca=C3=B1uelo AuthorDate: Fri, 01 Apr 2022 09:45:17 +02:00 Committer: Borislav Petkov CommitterDate: Tue, 05 Apr 2022 21:55:57 +02:00 x86/speculation/srbds: Do not try to turn mitigation off when not supported When SRBDS is mitigated by TSX OFF, update_srbds_msr() will still read and write to MSR_IA32_MCU_OPT_CTRL even when that MSR is not supported due to not having loaded the appropriate microcode. Check for X86_FEATURE_SRBDS_CTRL which is set only when the respective microcode which adds MSR_IA32_MCU_OPT_CTRL is loaded. Based on a patch by Thadeu Lima de Souza Cascardo . [ bp: Massage commit message. ] Suggested-by: Pawan Gupta Signed-off-by: Ricardo Ca=C3=B1uelo Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220401074517.1848264-1-ricardo.canuelo@coll= abora.com --- arch/x86/kernel/cpu/bugs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 6296e1e..d879a6c 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -446,6 +446,13 @@ void update_srbds_msr(void) if (srbds_mitigation =3D=3D SRBDS_MITIGATION_UCODE_NEEDED) return; =20 + /* + * A MDS_NO CPU for which SRBDS mitigation is not needed due to TSX + * being disabled and it hasn't received the SRBDS MSR microcode. + */ + if (!boot_cpu_has(X86_FEATURE_SRBDS_CTRL)) + return; + rdmsrl(MSR_IA32_MCU_OPT_CTRL, mcu_ctrl); =20 switch (srbds_mitigation) {