Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2125058rdb; Mon, 20 Nov 2023 02:44:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2IvAghnLUEAWvWU8/OkCQgRvnhDg+z0LVxFmlwZVvgnrZIqhiLxs0FL0ekQFFJGt+WSPw X-Received: by 2002:a05:6a20:958a:b0:189:b35b:3f2 with SMTP id iu10-20020a056a20958a00b00189b35b03f2mr5986936pzb.35.1700477042821; Mon, 20 Nov 2023 02:44:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700477042; cv=none; d=google.com; s=arc-20160816; b=JljJwYJgGnW8OYBC2WCLpxjxBNmP9+30q+VplrWgL0xWQB0FOmu5dKc/Q6rWLuWFX8 bDWxlCgsuIPqZVSt3cQCCA2XyQwS3XzZtmRP6qN1aakbL4ZqEz9dUgDhOjrIVBbfmWaM 26SCnccoaCvCiM74+C8nQVFXXPJxYJacEJA4jLNZjAM+RUL4vuAeiDx2t/eP7Bb/Jk91 Ee6ldtZ7GBuK/evoSjX440hh29DaN999erxwmSK3seV6A1oxmwvLXgpkS5RA0k+3OaXn HPBvE/RPB1LV9WRRtxQjEYzkAV2ixnTZFbXQvbIYKwbvPQZ4Q53sxTeAHCvWtrc8RQ0j XXDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jPFtjk7r51xBiI0/Edjl0ep/mcpxYCy7X3x+9OJBFt0=; fh=yRofEPOsMYSFYi/7/f3tXB782BWAy0107oR1j5aafGk=; b=mgpnFNo93zATADVepBbYM/GFVp1iAw6GgYgFgzzSpUJhA224Y0a1w4wFFudS5nOhcb pIFt3Qj+NyCRdZKI3mDSSgmWiRdzDufxyiN2dmONAQKRuHKNC1YT2VvH9RcuKapsvVGD ttVIxRbK7kl50B7nOZ/xzrqDRk8c8jkhIz5IorxWqusUauMnKZilIHfJyFJQzIOqZzy7 zQGvBLzYL/8GHo84eM+0hnYZdupGUp8CaDCyC0jEIE9uLlbvYfhgjo4fMl/xLUvlwIcG 8wzqMlpJa/Ma5syq4aOAQ7+t3baKPaTKxbt+VCSL164zKB0+wdA4wEx/UFOjO7v7DTFD EnpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=MHmkJR56; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i6-20020a170902eb4600b001c755810f80si7575709pli.28.2023.11.20.02.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 02:44:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=MHmkJR56; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 58A928046462; Mon, 20 Nov 2023 02:43:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233290AbjKTKnm (ORCPT + 99 others); Mon, 20 Nov 2023 05:43:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233241AbjKTKnG (ORCPT ); Mon, 20 Nov 2023 05:43:06 -0500 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25B911704 for ; Mon, 20 Nov 2023 02:42:43 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 9466E40E01BF; Mon, 20 Nov 2023 10:42:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=fail (4096-bit key) reason="fail (body has been altered)" header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id FkM5rZcHIeIX; Mon, 20 Nov 2023 10:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1700476951; bh=Ai/81xa1PmMbh8PDFy1HNfT8wal2Kj9G4K1sJJ+j/1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MHmkJR561JRO5EFxWvGUcPpCt/Td0n0L4xwqHkt2ivnALHtY0aOZ9F6NlAr4UcRVl 21z+Z0HBnA9gqiaBefkoWqwjPQPVmTUk3jiGio73nFXjxbJfbMcahrK/XEIp7fAnTU 33rwO0RGG/TZIy5V5j5xH1T9JO1EnasThcDfpXH8IGvGMMWsqzZ57oDODe8UexwG/h HzDRk7PKaMiTbcVMQs4kPYVs4Tmv5XF54ZaFe4/I5EjrfCIoZAe7viEXSg0/CIe2zS bGHI0eadkREGOJLuZ+bHoCtt9ZyrxaPcGXp3XHOlBFFm4Dt9oUStmMGmC4vXMHMEst N6KnE2sYO82noJrlQotkHczXmyfvkwFVZJ1qiG62alOFWFNnAMsD75GJmn6Y/0YWRY qtS/uRXOrH6yyMGnduwVfwHrea8LGKz0H4QatQhUJ4szdSpqJTV1y9UQplaGgPTkNO 0vtAuX4/96PnkjGqMX4p8o0HO/Vrt6Fgi6P68zelj5Ap3cDlGqWBzh0Ot+p+uKOPmW oOK2kRaps2t9wIi8fL/DQolVAste9dlsBSGwyDYbf/V+jVFba7izNqBq6/+XwbnUSC 27tYr0Nhc4CPgiuoazxXmxevXqdVMOGRX8I3w7/p0w0ggyx2pR8lRJ6xiPrGLOGbtg wp3X00QHqmtC8YV7+3yJ/QMc= Received: from zn.tnic (pd95304da.dip0.t-ipconnect.de [217.83.4.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id A72D340E0030; Mon, 20 Nov 2023 10:42:29 +0000 (UTC) From: Borislav Petkov To: X86 ML Cc: LKML Subject: [PATCH 08/13] x86/CPU/AMD: Move the DIV0 bug detection to the Zen1 init function Date: Mon, 20 Nov 2023 11:41:47 +0100 Message-ID: <20231120104152.13740-9-bp@alien8.de> X-Mailer: git-send-email 2.42.0.rc0.25.ga82fb66fed25 In-Reply-To: <20231120104152.13740-1-bp@alien8.de> References: <20231120104152.13740-1-bp@alien8.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 02:43:59 -0800 (PST) From: "Borislav Petkov (AMD)" No functional changes. Signed-off-by: Borislav Petkov (AMD) --- arch/x86/kernel/cpu/amd.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 7cbb108afaf4..43d6a6da7591 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -70,10 +70,6 @@ static const int amd_erratum_383[] =3D static const int amd_erratum_1054[] =3D AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x17, 0, 0, 0x2f, 0xf)); =20 -static const int amd_div0[] =3D - AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x17, 0x00, 0x0, 0x2f, 0xf), - AMD_MODEL_RANGE(0x17, 0x50, 0x0, 0x5f, 0xf)); - static const int amd_erratum_1485[] =3D AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x19, 0x10, 0x0, 0x1f, 0xf), AMD_MODEL_RANGE(0x19, 0x60, 0x0, 0xaf, 0xf)); @@ -1031,6 +1027,8 @@ static void init_amd_zen(struct cpuinfo_x86 *c) set_cpu_cap(c, X86_FEATURE_CPB); } =20 + pr_notice_once("AMD Zen1 DIV0 bug detected. Disable SMT for full protec= tion.\n"); + setup_force_cpu_bug(X86_BUG_DIV0); } =20 static bool cpu_has_zenbleed_microcode(void) @@ -1219,11 +1217,6 @@ static void init_amd(struct cpuinfo_x86 *c) cpu_has(c, X86_FEATURE_AUTOIBRS)) WARN_ON_ONCE(msr_set_bit(MSR_EFER, _EFER_AUTOIBRS)); =20 - if (cpu_has_amd_erratum(c, amd_div0)) { - pr_notice_once("AMD Zen1 DIV0 bug detected. Disable SMT for full prote= ction.\n"); - setup_force_cpu_bug(X86_BUG_DIV0); - } - if (!cpu_has(c, X86_FEATURE_HYPERVISOR) && cpu_has_amd_erratum(c, amd_erratum_1485)) msr_set_bit(MSR_ZEN4_BP_CFG, MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT); --=20 2.42.0.rc0.25.ga82fb66fed25