Skip to contentSkip to conversation

x86/microcode: Make update_lock raw

PATCH Applied Scott Wood 3 participants 3 messages May 24, 2018 – May 27, 2018

Subsystems (2)
lore
Share & tools
lore

Scott Wood

author
#0 lore raw

PATCH 1/1 x86/microcode: Make update_lock raw

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

---
 arch/x86/kernel/cpu/microcode/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/cpu/microcode/core.c +3 -3
index 77e201301528..08286269fd24 100644
@@ -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) {
Signature · 1 line
2.17.0
maintainer Applied
#1 lore raw
Quoted 7 lines · Scott Wood

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

---
 arch/x86/kernel/cpu/microcode/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#2 lore raw

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

In reply to Scott Wood
x86/microcode: Make the late update update_lock a raw lock for RT
Commit-ID:  ff987fcf011d20c53b3a613edf6e2055ea48e26e
Gitweb:     https://git.kernel.org/tip/ff987fcf011d20c53b3a613edf6e2055ea48e26e
Author:     Scott Wood <[email protected]>
AuthorDate: Thu, 24 May 2018 10:44:20 -0500
Committer:  Thomas Gleixner <[email protected]>
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.

---
 arch/x86/kernel/cpu/microcode/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/cpu/microcode/core.c +3 -3
index 77e201301528..08286269fd24 100644
@@ -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) {