Re: [PATCH] tools/turbostat: fix microcode patch level reading for AMD/Hygon
From: Len Brown
Date: Wed Feb 25 2026 - 13:53:37 EST
Thanks for noticing and reporting this issue!
Since the MSR is common, my vote is to keep a single MSR read and
setting of ucode_patch_valid for all vendors,
and just check the vendor to tweak the "ucode_patch" variable for printing.
On Tue, Feb 24, 2026 at 10:35 PM K Prateek Nayak <kprateek.nayak@xxxxxxx> wrote:
>
> Hello Serhii,
>
> On 2/24/2026 7:40 PM, Serhii wrote:
> > Yes, the only essential change is shift.
> > However, I believe that handling the two paths separately is better
> > because (a) using different constants better highlights the semantic
> > difference of the values stored and (b) AMD currently reserves upper
> > bits, which could require handling in the future making separate paths
> > more appropriate.
> > What do you think, is it still better to merge back into a single path
> > with conditional shift for Intel?
>
> I'll let Len answer which one he prefers but having 2 paths is more
> code duplication for error handling when we are essentially doing the
> same thing.
>
> --
> Thanks and Regards,
> Prateek
>
--
Len Brown, Intel Open Source Technology Center