x86, microcode, AMD: Fix patch level reporting for family15h
PATCH v2 1/1 x86, microcode, AMD: Fix patch level reporting for family15h
From: Suravee Suthikulpanit <[email protected]>
On AMD family15h, applying microcode patch on the a core (core0) would also affect the other core (core1) in the same compute unit. The driver would skip applying the patch on core1, but it still need to update kernel structures to reflect the proper patch level.
The current logic is not updating the struct ucode_cpu_info.cpu_sig.rev of the skipped core. This causes the /sys/devices/system/cpu/cpu1/microcode/version to report incorrect patch level as shown below:
$ grep . cpu?/microcode/version cpu0/microcode/version:0x600063d cpu1/microcode/version:0x6000626 cpu2/microcode/version:0x600063d cpu3/microcode/version:0x6000626 cpu4/microcode/version:0x600063d
---
Changes from V1:
- Update commit log as suggested by Boris.
arch/x86/kernel/microcode_amd.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/kernel/microcode_amd.c +1 -0
@@ -216,6 +216,7 @@ int apply_microcode_amd(int cpu)/* need to apply patch? */ if (rev >= mc_amd->hdr.patch_id) { c->microcode = rev; + uci->cpu_sig.rev = rev;return 0 ; }
Signature · 1 line
1.8.1.2
Quoted 31 lines · On Wed, Sep 29, 2010 at 07:27:12PM -0500, [email protected] wrote:
From: Suravee Suthikulpanit <[email protected]>
On AMD family15h, applying microcode patch on the a core (core0) would also affect the other core (core1) in the same compute unit. The driver would skip applying the patch on core1, but it still need to update kernel structures to reflect the proper patch level.
The current logic is not updating the struct ucode_cpu_info.cpu_sig.rev of the skipped core. This causes the
/sys/devices/system/cpu/cpu1/microcode/versionto report incorrect patch level as shown below:$ grep . cpu?/microcode/version cpu0/microcode/version:0x600063d cpu1/microcode/version:0x6000626 cpu2/microcode/version:0x600063d cpu3/microcode/version:0x6000626 cpu4/microcode/version:0x600063dSigned-off-by Suravee Suthikulpanit <[email protected]>---
Changes from V1:
- Update commit log as suggested by Boris.arch/x86/kernel/microcode_amd.c | 1 + 1 file changed, 1 insertion(+)arch/x86/kernel/microcode_amd.c +0
-0
arch/x86/kernel/microcode_amd.c int apply_microcode_amd(int cpu) · line 221
Quoted 6 lines
arch/x86/kernel/microcode_amd.c +1
-0@@ -216,6 +216,7 @@ int apply_microcode_amd(int cpu)/* need to apply patch? */ if (rev >= mc_amd->hdr.patch_id) { c->microcode = rev; + uci->cpu_sig.rev = rev;return 0 ; }
Signature · 5 lines
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--tip-bot for Suravee Suthikulpanit
merge bot[tip:x86/urgent] x86/microcode/AMD: Fix patch level reporting for family 15h
In reply to [email protected]x86/microcode/AMD: Fix patch level reporting for family 15h
Commit-ID: accd1e823ed1d5980106dd522a4c535084400830 Gitweb: http://git.kernel.org/tip/accd1e823ed1d5980106dd522a4c535084400830 Author: Suravee Suthikulpanit <[email protected]> AuthorDate: Wed, 29 Sep 2010 19:27:12 -0500 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 27 Sep 2013 09:29:27 +0200
x86/microcode/AMD: Fix patch level reporting for family 15h
On AMD family 14h, applying microcode patch on the a core (core0) would also affect the other core (core1) in the same compute unit. The driver would skip applying the patch on core1, but it still need to update kernel structures to reflect the proper patch level.
The current logic is not updating the struct ucode_cpu_info.cpu_sig.rev of the skipped core. This causes the /sys/devices/system/cpu/cpu1/microcode/version to report incorrect patch level as shown below:
$ grep . cpu?/microcode/version cpu0/microcode/version:0x600063d cpu1/microcode/version:0x6000626 cpu2/microcode/version:0x600063d cpu3/microcode/version:0x6000626 cpu4/microcode/version:0x600063d
--- arch/x86/kernel/microcode_amd.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/kernel/microcode_amd.c +1 -0
@@ -216,6 +216,7 @@ int apply_microcode_amd(int cpu)/* need to apply patch? */ if (rev >= mc_amd->hdr.patch_id) { c->microcode = rev; + uci->cpu_sig.rev = rev;return 0 ; }