linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/microcode: Make update_lock raw
@ 2018-05-24 15:44 Scott Wood
  2018-05-25  8:36 ` Borislav Petkov
  2018-05-27 19:55 ` [tip:x86/microcode] x86/microcode: Make the late update update_lock a raw lock for RT tip-bot for Scott Wood
  0 siblings, 2 replies; 3+ messages in thread
From: Scott Wood @ 2018-05-24 15:44 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: linux-kernel, Pei Zhang, Clark Williams, x86, Scott Wood

__reload_late() is called from stop_machine context and thus
cannot acquire a non-raw spinlock on PREEMPT_RT.

Signed-off-by: Scott Wood <swood@redhat.com>
---
 arch/x86/kernel/cpu/microcode/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 77e201301528..08286269fd24 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -70,7 +70,7 @@ static DEFINE_MUTEX(microcode_mutex);
 /*
  * Serialize late loading so that CPUs get updated one-by-one.
  */
-static DEFINE_SPINLOCK(update_lock);
+static DEFINE_RAW_SPINLOCK(update_lock);
 
 struct ucode_cpu_info		ucode_cpu_info[NR_CPUS];
 
@@ -560,9 +560,9 @@ static int __reload_late(void *info)
 	if (__wait_for_cpus(&late_cpus_in, NSEC_PER_SEC))
 		return -1;
 
-	spin_lock(&update_lock);
+	raw_spin_lock(&update_lock);
 	apply_microcode_local(&err);
-	spin_unlock(&update_lock);
+	raw_spin_unlock(&update_lock);
 
 	/* siblings return UCODE_OK because their engine got updated already */
 	if (err > UCODE_NFOUND) {
-- 
2.17.0

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

* Re: [PATCH] x86/microcode: Make update_lock raw
  2018-05-24 15:44 [PATCH] x86/microcode: Make update_lock raw Scott Wood
@ 2018-05-25  8:36 ` Borislav Petkov
  2018-05-27 19:55 ` [tip:x86/microcode] x86/microcode: Make the late update update_lock a raw lock for RT tip-bot for Scott Wood
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2018-05-25  8:36 UTC (permalink / raw)
  To: Scott Wood; +Cc: linux-kernel, Pei Zhang, Clark Williams, x86

On Thu, May 24, 2018 at 10:44:20AM -0500, Scott Wood wrote:
> __reload_late() is called from stop_machine context and thus
> cannot acquire a non-raw spinlock on PREEMPT_RT.
> 
> Signed-off-by: Scott Wood <swood@redhat.com>
> ---
>  arch/x86/kernel/cpu/microcode/core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

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

* [tip:x86/microcode] x86/microcode: Make the late update update_lock a raw lock for RT
  2018-05-24 15:44 [PATCH] x86/microcode: Make update_lock raw Scott Wood
  2018-05-25  8:36 ` Borislav Petkov
@ 2018-05-27 19:55 ` tip-bot for Scott Wood
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Scott Wood @ 2018-05-27 19:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: williams, linux-kernel, tglx, bp, ashok.raj, mingo, x86, pezhang,
	swood, hpa

Commit-ID:  ff987fcf011d20c53b3a613edf6e2055ea48e26e
Gitweb:     https://git.kernel.org/tip/ff987fcf011d20c53b3a613edf6e2055ea48e26e
Author:     Scott Wood <swood@redhat.com>
AuthorDate: Thu, 24 May 2018 10:44:20 -0500
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sun, 27 May 2018 21:50:09 +0200

x86/microcode: Make the late update update_lock a raw lock for RT

__reload_late() is called from stop_machine context and thus cannot
acquire a non-raw spinlock on PREEMPT_RT.

Signed-off-by: Scott Wood <swood@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Pei Zhang <pezhang@redhat.com>
Cc: x86-ml <x86@kernel.org>
Link: http://lkml.kernel.org/r/20180524154420.24455-1-swood@redhat.com
---
 arch/x86/kernel/cpu/microcode/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index 77e201301528..08286269fd24 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -70,7 +70,7 @@ static DEFINE_MUTEX(microcode_mutex);
 /*
  * Serialize late loading so that CPUs get updated one-by-one.
  */
-static DEFINE_SPINLOCK(update_lock);
+static DEFINE_RAW_SPINLOCK(update_lock);
 
 struct ucode_cpu_info		ucode_cpu_info[NR_CPUS];
 
@@ -560,9 +560,9 @@ static int __reload_late(void *info)
 	if (__wait_for_cpus(&late_cpus_in, NSEC_PER_SEC))
 		return -1;
 
-	spin_lock(&update_lock);
+	raw_spin_lock(&update_lock);
 	apply_microcode_local(&err);
-	spin_unlock(&update_lock);
+	raw_spin_unlock(&update_lock);
 
 	/* siblings return UCODE_OK because their engine got updated already */
 	if (err > UCODE_NFOUND) {

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

end of thread, other threads:[~2018-05-27 19:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-24 15:44 [PATCH] x86/microcode: Make update_lock raw Scott Wood
2018-05-25  8:36 ` Borislav Petkov
2018-05-27 19:55 ` [tip:x86/microcode] x86/microcode: Make the late update update_lock a raw lock for RT tip-bot for Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).