mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Borislav Petkov <bp@alien8.de>,
	Mario Limonciello <mario.limonciello@amd.com>,
	x86@kernel.org, Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86/cpu/amd: Correct the microcode table for Zenbleed
Date: Wed, 26 Nov 2025 11:33:43 +0000	[thread overview]
Message-ID: <133ac0c0-8cbb-4c75-a81f-5e2823e1b9dc@citrix.com> (raw)
In-Reply-To: <20251126112655.874792-1-andrew.cooper3@citrix.com>

On 26/11/2025 11:26 am, Andrew Cooper wrote:
> The good revisions are tied to exact steppings, meaning it's not valid to
> match on model number alone, let alone a range.
>
> This is probably only a latent issue.  From public microcode archives, the
> followin CPUs exist 17-30-00, 17-60-00, 17-70-00 and would be captured by the
> model ranges.  They're likely pre-production steppings, and likely didn't get
> Zenbleed microcode, but it's still incorrect to compare them to a different
> stepping's revision.
>
> Either way, convert the logic to use x86_match_min_microcode_rev(), which is
> the preferred mechanism.
>
> Fixes: 522b1d69219d ("x86/cpu/amd: Add a Zenbleed fix")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Borislav Petkov <bp@alien8.de>
> CC: Mario Limonciello <mario.limonciello@amd.com>
> CC: x86@kernel.org
> CC: linux-kernel@vger.kernel.org
> ---
>  arch/x86/kernel/cpu/amd.c | 29 ++++++++---------------------
>  1 file changed, 8 insertions(+), 21 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> index 5d46709c58d0..9721d24727e9 100644
> --- a/arch/x86/kernel/cpu/amd.c
> +++ b/arch/x86/kernel/cpu/amd.c
> @@ -951,26 +951,13 @@ static void init_amd_zen1(struct cpuinfo_x86 *c)
>  	}
>  }
>  
> -static bool cpu_has_zenbleed_microcode(void)
> -{
> -	u32 good_rev = 0;
> -
> -	switch (boot_cpu_data.x86_model) {
> -	case 0x30 ... 0x3f: good_rev = 0x0830107b; break;
> -	case 0x60 ... 0x67: good_rev = 0x0860010c; break;
> -	case 0x68 ... 0x6f: good_rev = 0x08608107; break;
> -	case 0x70 ... 0x7f: good_rev = 0x08701033; break;
> -	case 0xa0 ... 0xaf: good_rev = 0x08a00009; break;
> -
> -	default:
> -		return false;
> -	}
> -
> -	if (boot_cpu_data.microcode < good_rev)
> -		return false;
> -
> -	return true;
> -}
> +static const struct x86_cpu_id amd_zenbleed_microcode[] = {
> +	ZEN_MODEL_STEP_UCODE(0x17, 0x31, 0x0, 0x0830107b),
> +	ZEN_MODEL_STEP_UCODE(0x17, 0x60, 0x1, 0x0860010c),
> +	ZEN_MODEL_STEP_UCODE(0x17, 0x68, 0x1, 0x08608107),
> +	ZEN_MODEL_STEP_UCODE(0x17, 0x71, 0x0, 0x08701033),
> +	ZEN_MODEL_STEP_UCODE(0x17, 0xa0, 0x0, 0x08a00009),
> +};

Sorry, this needs a {} terminator to be correct.  I'll send out a v2 in
a bit, assuming there are no other comments.

~Andrew

  reply	other threads:[~2025-11-26 11:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26 11:26 Andrew Cooper
2025-11-26 11:33 ` Andrew Cooper [this message]
2025-11-26 12:44   ` Borislav Petkov
2025-11-26 13:00     ` Andrew Cooper
2025-11-26 14:42     ` david laight
2025-11-26 13:03 ` [PATCH v2] " Andrew Cooper
2025-12-15  7:18   ` [tip: x86/cpu] " tip-bot2 for Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=133ac0c0-8cbb-4c75-a81f-5e2823e1b9dc@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®