All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] x86/microcode/intel: replace sync_core() with native_cpuid_reg(eax)
@ 2020-04-22  8:17 Evalds Iodzevics
  2020-04-22  8:27 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Evalds Iodzevics @ 2020-04-22  8:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, tglx, ben, bp, Evalds Iodzevics, stable

On Intel it is required to do CPUID(1) before reading the microcode
revision MSR. Current code in 4.4 an 4.9 relies on sync_core() to call
CPUID, unfortunately on 32 bit machines code inside sync_core() always
jumps past CPUID instruction as it depends on data structure boot_cpu_data
witch are not populated correctly so early in boot sequence.

It depends on:
commit 5dedade6dfa2 ("x86/CPU: Add native CPUID variants returning a single
datum")

This patch is for 4.4 but also should apply to 4.9

Signed-off-by: Evalds Iodzevics <evalds.iodzevics@gmail.com>
Cc: stable@vger.kernel.org
---
 arch/x86/include/asm/microcode_intel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h
index 90343ba50485..92ce9c8a508b 100644
--- a/arch/x86/include/asm/microcode_intel.h
+++ b/arch/x86/include/asm/microcode_intel.h
@@ -60,7 +60,7 @@ static inline u32 intel_get_microcode_revision(void)
 	native_wrmsrl(MSR_IA32_UCODE_REV, 0);
 
 	/* As documented in the SDM: Do a CPUID 1 here */
-	sync_core();
+	native_cpuid_eax(1);
 
 	/* get the current revision from MSR 0x8B */
 	native_rdmsr(MSR_IA32_UCODE_REV, dummy, rev);
-- 
2.17.4


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

* Re: [PATCH v2] x86/microcode/intel: replace sync_core() with native_cpuid_reg(eax)
  2020-04-22  8:17 [PATCH v2] x86/microcode/intel: replace sync_core() with native_cpuid_reg(eax) Evalds Iodzevics
@ 2020-04-22  8:27 ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2020-04-22  8:27 UTC (permalink / raw)
  To: Evalds Iodzevics; +Cc: linux-kernel, tglx, ben, bp, stable

On Wed, Apr 22, 2020 at 11:17:59AM +0300, Evalds Iodzevics wrote:
> On Intel it is required to do CPUID(1) before reading the microcode
> revision MSR. Current code in 4.4 an 4.9 relies on sync_core() to call
> CPUID, unfortunately on 32 bit machines code inside sync_core() always
> jumps past CPUID instruction as it depends on data structure boot_cpu_data
> witch are not populated correctly so early in boot sequence.
> 
> It depends on:
> commit 5dedade6dfa2 ("x86/CPU: Add native CPUID variants returning a single
> datum")
> 
> This patch is for 4.4 but also should apply to 4.9
> 
> Signed-off-by: Evalds Iodzevics <evalds.iodzevics@gmail.com>
> Cc: stable@vger.kernel.org
> ---
>  arch/x86/include/asm/microcode_intel.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, much better, now queued up.

greg k-h

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

* [PATCH v2] x86/microcode/intel: replace sync_core() with native_cpuid_reg(eax)
  2020-04-20 12:00 [PATCH] " Evalds Iodzevics
@ 2020-04-21  8:53 ` Evalds Iodzevics
  2020-04-21  5:59   ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Evalds Iodzevics @ 2020-04-21  8:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, tglx, ben, Evalds Iodzevics

On Intel it is required to do CPUID(1) before reading the microcode
revision MSR. Current code in 4.4 an 4.9 relies on sync_core() to call
CPUID, unfortunately on 32 bit machines code inside sync_core() always
jumps past CPUID instruction as it depends on data structure boot_cpu_data
witch are not populated correctly so early in boot sequence.

It depends on:
commit 5dedade6dfa2 ("x86/CPU: Add native CPUID variants returning a single
datum")

This patch is for 4.4 but also should apply to 4.9

Signed-off-by: Evalds Iodzevics <evalds.iodzevics@gmail.com>
---
 arch/x86/include/asm/microcode_intel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h
index 90343ba50485..92ce9c8a508b 100644
--- a/arch/x86/include/asm/microcode_intel.h
+++ b/arch/x86/include/asm/microcode_intel.h
@@ -60,7 +60,7 @@ static inline u32 intel_get_microcode_revision(void)
 	native_wrmsrl(MSR_IA32_UCODE_REV, 0);
 
 	/* As documented in the SDM: Do a CPUID 1 here */
-	sync_core();
+	native_cpuid_eax(1);
 
 	/* get the current revision from MSR 0x8B */
 	native_rdmsr(MSR_IA32_UCODE_REV, dummy, rev);
-- 
2.17.4


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

* Re: [PATCH v2] x86/microcode/intel: replace sync_core() with native_cpuid_reg(eax)
  2020-04-21  6:41     ` Evalds Iodzevics
@ 2020-04-21  7:19       ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2020-04-21  7:19 UTC (permalink / raw)
  To: Evalds Iodzevics; +Cc: linux-kernel, Thomas Gleixner, Ben Hutchings

On Tue, Apr 21, 2020 at 09:41:42AM +0300, Evalds Iodzevics wrote:
> On Tue, Apr 21, 2020 at 8:59 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Tue, Apr 21, 2020 at 11:53:44AM +0300, Evalds Iodzevics wrote:
> > > On Intel it is required to do CPUID(1) before reading the microcode
> > > revision MSR. Current code in 4.4 an 4.9 relies on sync_core() to call
> > > CPUID, unfortunately on 32 bit machines code inside sync_core() always
> > > jumps past CPUID instruction as it depends on data structure boot_cpu_data
> > > witch are not populated correctly so early in boot sequence.
> > >
> > > It depends on:
> > > commit 5dedade6dfa2 ("x86/CPU: Add native CPUID variants returning a single
> > > datum")
> > >
> > > This patch is for 4.4 but also should apply to 4.9
> > >
> > > Signed-off-by: Evalds Iodzevics <evalds.iodzevics@gmail.com>
> > > ---
> > >  arch/x86/include/asm/microcode_intel.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > Why are you not sending this to the stable mailing list like I have
> > pointed out numerous times by sending you a link to _how_ to get a patch
> > into the stable kernel trees?
> >
> > Again, here it is:
> >     https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> >
> > Please follow that so that we can do this correctly.
> >
> > thanks,
> >
> > greg k-h
> Sorry, I might sound dumb here but should i just send it to
> stable@vger.kernel.org or try to tag it Cc: stable... in sign-off
> area, its quite confusing for newcomer.

Yes, be sure to cc: the stable@vger.kernel.org list when you send
patches that you want to have applied to a stable kernel tree.

thanks,

greg k-h

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

* Re: [PATCH v2] x86/microcode/intel: replace sync_core() with native_cpuid_reg(eax)
  2020-04-21  5:59   ` Greg KH
@ 2020-04-21  6:41     ` Evalds Iodzevics
  2020-04-21  7:19       ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Evalds Iodzevics @ 2020-04-21  6:41 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Thomas Gleixner, Ben Hutchings

On Tue, Apr 21, 2020 at 8:59 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Apr 21, 2020 at 11:53:44AM +0300, Evalds Iodzevics wrote:
> > On Intel it is required to do CPUID(1) before reading the microcode
> > revision MSR. Current code in 4.4 an 4.9 relies on sync_core() to call
> > CPUID, unfortunately on 32 bit machines code inside sync_core() always
> > jumps past CPUID instruction as it depends on data structure boot_cpu_data
> > witch are not populated correctly so early in boot sequence.
> >
> > It depends on:
> > commit 5dedade6dfa2 ("x86/CPU: Add native CPUID variants returning a single
> > datum")
> >
> > This patch is for 4.4 but also should apply to 4.9
> >
> > Signed-off-by: Evalds Iodzevics <evalds.iodzevics@gmail.com>
> > ---
> >  arch/x86/include/asm/microcode_intel.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Why are you not sending this to the stable mailing list like I have
> pointed out numerous times by sending you a link to _how_ to get a patch
> into the stable kernel trees?
>
> Again, here it is:
>     https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
>
> Please follow that so that we can do this correctly.
>
> thanks,
>
> greg k-h
Sorry, I might sound dumb here but should i just send it to
stable@vger.kernel.org or try to tag it Cc: stable... in sign-off
area, its quite confusing for newcomer.
Thanks for patience!

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

* Re: [PATCH v2] x86/microcode/intel: replace sync_core() with native_cpuid_reg(eax)
  2020-04-21  8:53 ` [PATCH v2] " Evalds Iodzevics
@ 2020-04-21  5:59   ` Greg KH
  2020-04-21  6:41     ` Evalds Iodzevics
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2020-04-21  5:59 UTC (permalink / raw)
  To: Evalds Iodzevics; +Cc: linux-kernel, tglx, ben

On Tue, Apr 21, 2020 at 11:53:44AM +0300, Evalds Iodzevics wrote:
> On Intel it is required to do CPUID(1) before reading the microcode
> revision MSR. Current code in 4.4 an 4.9 relies on sync_core() to call
> CPUID, unfortunately on 32 bit machines code inside sync_core() always
> jumps past CPUID instruction as it depends on data structure boot_cpu_data
> witch are not populated correctly so early in boot sequence.
> 
> It depends on:
> commit 5dedade6dfa2 ("x86/CPU: Add native CPUID variants returning a single
> datum")
> 
> This patch is for 4.4 but also should apply to 4.9
> 
> Signed-off-by: Evalds Iodzevics <evalds.iodzevics@gmail.com>
> ---
>  arch/x86/include/asm/microcode_intel.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Why are you not sending this to the stable mailing list like I have
pointed out numerous times by sending you a link to _how_ to get a patch
into the stable kernel trees?

Again, here it is:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

Please follow that so that we can do this correctly.

thanks,

greg k-h

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

end of thread, other threads:[~2020-04-22  8:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22  8:17 [PATCH v2] x86/microcode/intel: replace sync_core() with native_cpuid_reg(eax) Evalds Iodzevics
2020-04-22  8:27 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2020-04-20 12:00 [PATCH] " Evalds Iodzevics
2020-04-21  8:53 ` [PATCH v2] " Evalds Iodzevics
2020-04-21  5:59   ` Greg KH
2020-04-21  6:41     ` Evalds Iodzevics
2020-04-21  7:19       ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.