From patchwork Fri Aug 18 10:59:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 136196 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp2190660vqi; Sat, 19 Aug 2023 13:49:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyqO0cFiWeSqcL45pmQS85zy8ObrmVf4bv/WYkRijL5f1SgJy6BOcDLg+frSLBZULmXca1 X-Received: by 2002:a05:6358:8a5:b0:135:615a:309d with SMTP id m37-20020a05635808a500b00135615a309dmr3144411rwj.7.1692478145422; Sat, 19 Aug 2023 13:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692478145; cv=none; d=google.com; s=arc-20160816; b=USdjplmvhl4WvTAhx1yfTh9vt8f1ET5S5SINJuVD1KZoqs0U1zbSlehY70trMwPFHm tR5+oumHmlrHZ++EoHDJ6n4G4T94Yge4Sns4PFRTRWeCYLDLNoK06KyT6ujWj0fA0d7a bJJMsboEjojOK3iIsCjeOaZcc73nsg2JUepKd8j2IKq9aOwt4X07z8D9hGQNB7CDTw9g mvwYMPQuSol5pbuYxTxHPNQFqWh/02NJ09//9fDWkSKz1M6Tm+xn7rM/LPJC3mvUphjV LxUR2Iud0ov7ojY1BQmWicLt8khFvajOWlNC5JFlF9LA27Mu4K4bBdxVcu138L7O5Km0 E62w== 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=qTv4pFh/msj/e8MHpeG2kjzzvgaMDjvc24xN0c1e9qg=; fh=mTQMNyT0vGToqZZfrqe5aaSbWeFKQ6wlmoJ/ERBFmAc=; b=kygVN1IfrohkeNNXX7gHcR/GUPTOqKBSTm1EFaxUKsQp4hFsUgtfjouSN7bBppm84o KVLbrgIFsv7KzBO32wWXgjxthVQ4IOix2FmiX4mhWky3TG8t4iBl22O6X1cWWYhXJnDh bkPdymhVldDCmYEsh1ytYfMmwYxvGhfDWgqHGV4bgTsQHlZw2nbNC+jrxjDlr7nBmeX1 YrVzI92ISES8/rvhKJNdy4+zU0YQ7TZ0xTo7g2JUfZMu/biSrwVq7J2m+RpkdTGvw2SQ QJHLTt+YbIODF5ffBkeyo7g/MtEhl2F4ydV2SGOA5TUPkzZBMlthMY8ZM+7PaxobtKNq N8Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qWsFXKM5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Fp3RXWFY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b21-20020a639315000000b00564f803b104si4035726pge.519.2023.08.19.13.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 13:49:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qWsFXKM5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Fp3RXWFY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 76D05B5A33; Sat, 19 Aug 2023 01:42:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376512AbjHRK7y (ORCPT + 99 others); Fri, 18 Aug 2023 06:59:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376503AbjHRK7n (ORCPT ); Fri, 18 Aug 2023 06:59:43 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5578B2708; Fri, 18 Aug 2023 03:59:42 -0700 (PDT) Date: Fri, 18 Aug 2023 10:59:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1692356380; 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=qTv4pFh/msj/e8MHpeG2kjzzvgaMDjvc24xN0c1e9qg=; b=qWsFXKM5MC+Cx4VGLBTmhI9tmvLDsXnMOYvnhUYI7/aYB5FZDpnq/Kd1zKGXU5iJc88PW3 iyDOo0UUOO4QSyBZnuuf/HhgINrWx3jDEbuo8DmeHZ28aK8UFrU0BKJ9Hc2oiVRhhhylFX ++MteJ8+EcNfO3ZMeb8greHdvtQtjprFxysm0GTcBQ32QYbxD6HSq8JdE0LQnuPMNRJ0i/ HpCP5skskLCAHabS5YEPqV9Erw6R8iSJoO79Z0NNXR5/rcnATt3wtGJgc0okGrmR5mYYP4 fTakhP//+5n9pJkZMTxi6UJTBNcgJ2jsw5zP5LOancnRzHVYjw3nIyZ1aMWBCg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1692356380; 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=qTv4pFh/msj/e8MHpeG2kjzzvgaMDjvc24xN0c1e9qg=; b=Fp3RXWFY46FvVC6veohOLS0749HkOise8lQ68uzROF0mHxEB3n3A0FsxNaRMLCUetEHP7S L+wgHCehxGrp5uCA== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/srso: Correct the mitigation status when SMT is disabled Cc: Josh Poimboeuf , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230814200813.p5czl47zssuej7nv@treble> References: <20230814200813.p5czl47zssuej7nv@treble> MIME-Version: 1.0 Message-ID: <169235637927.27769.12345029773512843447.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774362950134478461 X-GMAIL-MSGID: 1774691963695459578 The following commit has been merged into the x86/urgent branch of tip: Commit-ID: 6405b72e8d17bd1875a56ae52d23ec3cd51b9d66 Gitweb: https://git.kernel.org/tip/6405b72e8d17bd1875a56ae52d23ec3cd51b9d66 Author: Borislav Petkov (AMD) AuthorDate: Tue, 15 Aug 2023 11:53:13 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Fri, 18 Aug 2023 12:43:10 +02:00 x86/srso: Correct the mitigation status when SMT is disabled Specify how is SRSO mitigated when SMT is disabled. Also, correct the SMT check for that. Fixes: e9fbc47b818b ("x86/srso: Disable the mitigation on unaffected configurations") Suggested-by: Josh Poimboeuf Signed-off-by: Borislav Petkov (AMD) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20230814200813.p5czl47zssuej7nv@treble --- arch/x86/kernel/cpu/bugs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 9026e3f..f081d26 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2428,8 +2428,7 @@ static void __init srso_select_mitigation(void) * Zen1/2 with SMT off aren't vulnerable after the right * IBPB microcode has been applied. */ - if ((boot_cpu_data.x86 < 0x19) && - (!cpu_smt_possible() || (cpu_smt_control == CPU_SMT_DISABLED))) { + if (boot_cpu_data.x86 < 0x19 && !cpu_smt_possible()) { setup_force_cpu_cap(X86_FEATURE_SRSO_NO); return; } @@ -2714,7 +2713,7 @@ static ssize_t retbleed_show_state(char *buf) static ssize_t srso_show_state(char *buf) { if (boot_cpu_has(X86_FEATURE_SRSO_NO)) - return sysfs_emit(buf, "Not affected\n"); + return sysfs_emit(buf, "Mitigation: SMT disabled\n"); return sysfs_emit(buf, "%s%s\n", srso_strings[srso_mitigation],