Re: [PATCH] tools/turbostat: fix microcode patch level reading for AMD/Hygon
From: K Prateek Nayak
Date: Mon Feb 23 2026 - 22:31:06 EST
On 2/24/2026 8:07 AM, Serhii Pievniev wrote:
> @@ -9139,7 +9150,7 @@ void process_cpuid()
> if (!quiet) {
> fprintf(outf, "CPUID(1): family:model:stepping 0x%x:%x:%x (%d:%d:%d)", family, model, stepping, family, model, stepping);
> if (ucode_patch_valid)
> - fprintf(outf, " microcode 0x%x", (unsigned int)((ucode_patch >> 32) & 0xFFFFFFFF));
Since "MSR_IA32_UCODE_REV" and "MSR_AMD64_PATCH_LEVEL" are the same,
all that essentially changes is the shift.
Can't we just 0 the shift for "authentic_amd || hygon_genuine"?
> + fprintf(outf, " microcode 0x%llx", ucode_patch);
> fputc('\n', outf);
>
> fprintf(outf, "CPUID(0x80000000): max_extended_levels: 0x%x\n", max_extended_level);
--
Thanks and Regards,
Prateek