]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tools/power/turbostat: Fix microcode patch level output for AMD/Hygon
authorSerhii Pievniev <spevnev16@gmail.com>
Wed, 25 Feb 2026 23:16:03 +0000 (18:16 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Apr 2026 11:30:34 +0000 (13:30 +0200)
commitd0ba807f99b320a9caeaf73ba5e0ee901c7dca52
treeec45c1d790be2d6386972edbc9f78b596da0f4c4
parent979d6b2d2c439ba31d16f2b5ffab1f32a0268b92
tools/power/turbostat: Fix microcode patch level output for AMD/Hygon

[ Upstream commit a444083286434ec1fd127c5da11a3091e6013008 ]

turbostat always used the same logic to read the microcode patch level,
which is correct for Intel but not for AMD/Hygon.
While Intel stores the patch level in the upper 32 bits of MSR, AMD
stores it in the lower 32 bits, which causes turbostat to report the
microcode version as 0x0 on AMD/Hygon.

Fix by shifting right by 32 for non-AMD/Hygon, preserving the existing
behavior for Intel and unknown vendors.

Fixes: 3e4048466c39 ("tools/power turbostat: Add --no-msr option")
Signed-off-by: Serhii Pievniev <spevnev16@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/power/x86/turbostat/turbostat.c