From nobody Mon Jun 8 08:30:46 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 836B618BC3B; Thu, 4 Jun 2026 15:57:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780588672; cv=none; b=g4bLE7gQqfRkEHXqsOHQnRFhN2l29RBNTg/nwPQsRrQDeYIPB83gYeJCXgMEV9u5bBlbl/iJcrVLDJprJLICsQY09bf7prCXk0ZV86/qRgYbVAWujN2rVNplhFKyAhVXVpQym+ROXjGc+dW099TcW2IKkqeFw+09COjwrJynlU8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780588672; c=relaxed/simple; bh=MWZjpaY1pnz51NCEAQtFtOikz0fTHCHdrza+K7JTDgI=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=dP4xnUCWyy+EtmvYcEYsQx3F2hWz2VB6q/r+GClPb+kgYdihNAS6hA4yVjcY0nqLXYb6+dsXmv9oTuK0PSHxWjpoHiSA+tgTk/Jg3RD5QUifZeuDrwLKQGeiryqNpgvfii7cnggbWYHoa/yHj9snkOF7SiIyDeDgTX3/ODA5frM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=cP/PP2KQ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=NOD+eK3Q; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="cP/PP2KQ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NOD+eK3Q" Date: Thu, 04 Jun 2026 15:57:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1780588669; 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; bh=M+HCp5GPArrEjEqez2OGpOVrF4EbwZZOXKn27wuO8bI=; b=cP/PP2KQhU85r9AJgaSewdnH+AQUdKD8ZBsnrI+XLvV4vuZWKclkO7lL0MPF/FtYkPoCLT f8FaaGYkdaaaMbu4dXEE7Ml9/fA4dpC9ZrtaMh6/2A0BfwmxmrGcyjfyzFilFpNF9Fy4cQ 32qZH2E17T4AZDFm8y3dZN/fZ8eIgzkD0rB7xej5iIG6a8FVhkQGraSVT1sL7hHJ8rQImc K3z/QPFbtuzYewi4CouN43atOvOLRiKnyAEPAqhLeJZ6pbyhAclRsXbbZWW77gxKg2r+in j7ieXDygEzTVUf2YZXupLFj9g3Rs6NXMMG7TAE8/4fx8TtOBhSM9wm56++na9g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1780588669; 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; bh=M+HCp5GPArrEjEqez2OGpOVrF4EbwZZOXKn27wuO8bI=; b=NOD+eK3QzPOn+5LvreCXSxhgeE3NbJgQXoIbDwv7v7YWcMS5nmqhzsMqS/ZsUYK2BCe5RU d1x6V8tnMW5ZLRAQ== 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/microcode] x86/microcode/AMD: Move the no-revision fixup to get_patch_level() Cc: "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178058866804.710.4773888401625251905.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/microcode branch of tip: Commit-ID: 098bcea71b8d257d80b0037b97b66070806600a5 Gitweb: https://git.kernel.org/tip/098bcea71b8d257d80b0037b97b660708= 06600a5 Author: Borislav Petkov (AMD) AuthorDate: Fri, 29 May 2026 17:27:24 -07:00 Committer: Borislav Petkov (AMD) CommitterDate: Thu, 04 Jun 2026 08:55:58 -07:00 x86/microcode/AMD: Move the no-revision fixup to get_patch_level() On machines which don't have microcode applied yet, the revision is 0. However, this doesn't work with the Zen family/model/stepping patch arithmetic. So move the fixup to the patch level getter function and this way make sure the patch level is always proper and thus the arithmetic always works. And now that it can be called on any family, make this Zen-only. Assisted-by: claude/claude-opus-4-6 Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20260530024213.86137-1-bp@kernel.org --- arch/x86/kernel/cpu/microcode/amd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/micr= ocode/amd.c index e533881..b90af74 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -233,11 +233,6 @@ static bool need_sha_check(u32 cur_rev) { u32 cutoff; =20 - if (!cur_rev) { - cur_rev =3D cpuid_to_ucode_rev(bsp_cpuid_1_eax); - pr_info_once("No current revision, generating the lowest one: 0x%x\n", c= ur_rev); - } - cutoff =3D get_cutoff_revision(cur_rev); if (cutoff) return cur_rev <=3D cutoff; @@ -338,6 +333,13 @@ static u32 get_patch_level(void) } =20 native_rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy); + if (!rev) { + if (x86_family(bsp_cpuid_1_eax) < 0x17) + return rev; + + rev =3D cpuid_to_ucode_rev(bsp_cpuid_1_eax); + pr_info_once("No current revision, generating the lowest one: 0x%x\n", r= ev); + } =20 return rev; }