mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH V2] x86, microcode, AMD: Fix patch level reporting for family15h
@ 2010-09-30  0:27 suravee.suthikulpanit
  2013-09-26 23:38 ` Borislav Petkov
  2013-09-27 11:02 ` [tip:x86/urgent] x86/microcode/AMD: Fix patch level reporting for family 15h tip-bot for Suravee Suthikulpanit
  0 siblings, 2 replies; 3+ messages in thread
From: suravee.suthikulpanit @ 2010-09-30  0:27 UTC (permalink / raw)
  To: herrmann.der.user
  Cc: bp, jacob.w.shin, linux-kernel, x86, Suravee Suthikulpanit

From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>

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

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
Changes from V1:
	- Update commit log as suggested by Boris.

 arch/x86/kernel/microcode_amd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 7123b5d..af99f71 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -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;
 	}
 
-- 
1.8.1.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] x86, microcode, AMD: Fix patch level reporting for family15h
  2010-09-30  0:27 [PATCH V2] x86, microcode, AMD: Fix patch level reporting for family15h suravee.suthikulpanit
@ 2013-09-26 23:38 ` Borislav Petkov
  2013-09-27 11:02 ` [tip:x86/urgent] x86/microcode/AMD: Fix patch level reporting for family 15h tip-bot for Suravee Suthikulpanit
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2013-09-26 23:38 UTC (permalink / raw)
  To: suravee.suthikulpanit; +Cc: herrmann.der.user, jacob.w.shin, linux-kernel, x86

On Wed, Sep 29, 2010 at 07:27:12PM -0500, suravee.suthikulpanit@amd.com wrote:
> From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> 
> 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
> 
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
> Changes from V1:
> 	- Update commit log as suggested by Boris.
> 
>  arch/x86/kernel/microcode_amd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
> index 7123b5d..af99f71 100644
> --- a/arch/x86/kernel/microcode_amd.c
> +++ b/arch/x86/kernel/microcode_amd.c
> @@ -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;
>  	}

Acked-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/urgent] x86/microcode/AMD: Fix patch level reporting for family 15h
  2010-09-30  0:27 [PATCH V2] x86, microcode, AMD: Fix patch level reporting for family15h suravee.suthikulpanit
  2013-09-26 23:38 ` Borislav Petkov
@ 2013-09-27 11:02 ` tip-bot for Suravee Suthikulpanit
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Suravee Suthikulpanit @ 2013-09-27 11:02 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, bp, suravee.suthikulpanit,
	jacob.w.shin, herrmann.der.user, tglx, bp

Commit-ID:  accd1e823ed1d5980106dd522a4c535084400830
Gitweb:     http://git.kernel.org/tip/accd1e823ed1d5980106dd522a4c535084400830
Author:     Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
AuthorDate: Wed, 29 Sep 2010 19:27:12 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
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

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: <bp@alien8.de>
Cc: <jacob.w.shin@gmail.com>
Cc: <herrmann.der.user@googlemail.com>
Link: http://lkml.kernel.org/r/1285806432-1995-1-git-send-email-suravee.suthikulpanit@amd.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/microcode_amd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 7123b5d..af99f71 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -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;
 	}
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-27 11:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-30  0:27 [PATCH V2] x86, microcode, AMD: Fix patch level reporting for family15h suravee.suthikulpanit
2013-09-26 23:38 ` Borislav Petkov
2013-09-27 11:02 ` [tip:x86/urgent] x86/microcode/AMD: Fix patch level reporting for family 15h tip-bot for Suravee Suthikulpanit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome