Message ID | 20231201184226.16749-1-bp@alien8.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1337979vqy; Fri, 1 Dec 2023 10:42:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGiwZlw+ruw+el0X3Gta2GFRsjnS/d2tXmF9P1+0H+t5oWIWIdv2akkWii87egO0jEHCG9P X-Received: by 2002:a17:903:2311:b0:1cc:32df:8eb5 with SMTP id d17-20020a170903231100b001cc32df8eb5mr30274075plh.6.1701456173511; Fri, 01 Dec 2023 10:42:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701456173; cv=none; d=google.com; s=arc-20160816; b=TLTBwB9LGDi3E5tvC/8u68vsEVgv6VcOITp4FX8Yl+bIw+5IqP7U+tv29ClAkxp5EP m3RcesSMvR6YrBoXtm3f3q+/wGqMiGDeygTFS7APK9vRPkMwGdkZXIQwIZk29bAjMwAc +Siw4tkaBrLSel28p9mukaceKZZivmL69oxd7+LcmScS57DAjhq2NQX2D3jAuCv6w+Zr BtCkSuOu39eyhYYAcGvCiTd7PS2dR6oBkFPRSlCrV8H8kjd4F8QoawuioKl1IfYs/d5t vY0v6/AEJAtYqBODRucP49EbCMHr1mBGd29dGb7CpxjnSuMNaSi1WGJpyT1Wd7Dy0aPA en2Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Od4NwO5tC+YuKtIxXGT6BCUhNXd9aiv8VdlRyAp6Q/4=; fh=yRofEPOsMYSFYi/7/f3tXB782BWAy0107oR1j5aafGk=; b=QOvfoYPXUWMpdza0DAFP7mny+SrpUjVGDaCmosbJMws0srNX7MCMpImBQbmhGu3WGO OKeyXBoB5TRKWudod3b+wKNWKFDVmgkxMnnp4I/yENfZ4oR19WZlmSV6D2g+4Hu7uD7Q a86kcScHWXK+ShrWSEKSDFJsWBaCkq+9sngCzjvvp4uNCAYQy99h2yjA10PUK6r0JMM1 6GStv4fYiAY42ZzSe9QGq8mapZSZofe2V8MUhJKlspTB7GrIdQCgKD76CgUEZ6PYDW2v rVHi0ECmEjpi40GCJY1ErwP3qOn1+EgLxpAeem9AWlEP6bCwJAlrKbrjrAHmxoNFv6Eg Uo8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=gT2RpaCJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id y23-20020a1709027c9700b001cfd66f31ccsi3690730pll.55.2023.12.01.10.42.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 10:42:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=gT2RpaCJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 92DF6831413A; Fri, 1 Dec 2023 10:42:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379224AbjLASmj (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Fri, 1 Dec 2023 13:42:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230207AbjLASmh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 1 Dec 2023 13:42:37 -0500 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27A9EEE for <linux-kernel@vger.kernel.org>; Fri, 1 Dec 2023 10: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 5A82840E025A; Fri, 1 Dec 2023 18: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 dPMV77SPVAIt; Fri, 1 Dec 2023 18:42:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1701456157; bh=nphy73heotHESjgWYM7KNLZwEMvJWDEfBY+tKnZJzkc=; h=From:To:Cc:Subject:Date:From; b=gT2RpaCJ5K7cFl2aIaYaf+m/zXF2vNijONCjCXJOexroeNDMI8OzTa5Hl4sTemOQz MhwLBCGOA4JbZyO+BSHzSQ3MrX9zNTKUTHJv01DvPhx/PDyEMdT8YgD6Gi0a0ii8kX q3a2J/JYSOeS5vScTsz8J95LgCR/IItx5KhpzcTTT45IjfT1abuSF8wyeqgbI8OTEy jAy0vPhKOOZoFhtTSDjHwfCPDBpYOP+2MPbImjUlwbIz3jQ/oAQRCWSBM1C/0CnxiP pWDuPY0TY2E7VPWwB7HOASLxpOSafrI6esniJ/WhPff6kSxfFm6EWBST81zCuqUhM2 9sn18TwqqfMPpd6LDrr283AUKX6EpcUSJjIS3Hc4nRCAMS1A2OPODP9UY2Tv89KLQe +Qpo6YvS4sODkpiTJ7qSdj77jlEpinvNT96NaRFi9uLTx5DTwytQuVEJ6/l2AjnDHo t08EU2SNoeZKxmCFltSBqPCZIcAqcSLqFQszaNN14nh6Pk/ppB6lTp3lJZBAfoWN5e bJgInyTcJNo5DhX397Al06wPZPv11a627UHKci6O2dRoDWKLI2DC/nhf8QHqsS8KCj 1Y0DIp5FyOhn30vJtU6JiMU7WPqr58G32jfuMsaPKWeJVvZ49hAy3lsZg+ITrd94r9 X08Xz2KmjtZNQCe8iwIkrm4I= 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 1D7FB40E0030; Fri, 1 Dec 2023 18:42:35 +0000 (UTC) From: Borislav Petkov <bp@alien8.de> To: X86 ML <x86@kernel.org> Cc: LKML <linux-kernel@vger.kernel.org> Subject: [PATCH] x86/CPU/AMD: Check vendor in the AMD microcode callback Date: Fri, 1 Dec 2023 19:42:26 +0100 Message-ID: <20231201184226.16749-1-bp@alien8.de> X-Mailer: git-send-email 2.42.0.rc0.25.ga82fb66fed25 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 pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 01 Dec 2023 10:42:47 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784106108219199770 X-GMAIL-MSGID: 1784106108219199770 |
Series |
x86/CPU/AMD: Check vendor in the AMD microcode callback
|
|
Commit Message
Borislav Petkov
Dec. 1, 2023, 6:42 p.m. UTC
From: "Borislav Petkov (AMD)" <bp@alien8.de> Commit in Fixes added an AMD-specific microcode callback. However, it didn't check the CPU vendor the kernel runs on explicitly. The only reason the Zenbleed check in it didn't run on other x86 vendors hardware was pure coincidental luck: if (!cpu_has_amd_erratum(c, amd_zenbleed)) gives true on other vendors because they don't have those families and models. However, with the removal of the cpu_has_amd_erratum() in 05f5f73936fa ("x86/CPU/AMD: Drop now unused CPU erratum checking function") that coincidental condition is gone, leading to the zenbleed check getting executed on other vendors too. Add the explicit vendor check for the whole callback as it should've been done in the first place. Fixes: 522b1d69219d ("x86/cpu/amd: Add a Zenbleed fix") Cc: <stable@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> --- arch/x86/kernel/cpu/amd.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index a7eab05e5f29..f322ebd053a9 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -1320,6 +1320,9 @@ static void zenbleed_check_cpu(void *unused) void amd_check_microcode(void) { + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) + return; + on_each_cpu(zenbleed_check_cpu, NULL, 1); }