Message ID | 20241108135206.435793-3-lenb@kernel.org |
---|---|
State | New |
Headers | show |
Series | Add Intel Lunarlake to X86_BUG_MONITOR | expand |
On Fri, Nov 08, 2024 at 08:49:31AM -0500, Len Brown wrote: > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c > index 766f092dab80..910cb2d72c13 100644 > --- a/arch/x86/kernel/smpboot.c > +++ b/arch/x86/kernel/smpboot.c > @@ -1377,6 +1377,9 @@ void smp_kick_mwait_play_dead(void) > for (i = 0; READ_ONCE(md->status) != newstate && i < 1000; i++) { > /* Bring it out of mwait */ > WRITE_ONCE(md->control, newstate); > + /* If MONITOR unreliable, send IPI */ > + if (boot_cpu_has_bug(X86_BUG_MONITOR)) > + __apic_send_IPI(cpu, RESCHEDULE_VECTOR); > udelay(5); > } Going over that code again, mwait_play_dead() is doing __mwait(.exc=0) with IRQs disabled. So that IPI you're trying to send there won't do no nothing :-/ Now that comment there says MCE/NMI/SMI are still open (non-maskable etc.) so perhaps prod it on the NMI vector? This does seem to suggest the above code path wasn't actually tested. Perhaps mark your local machine with BUG_MONITOR, remove the md->control WRITE_ONCE() and try kexec to test it? Thomas, any other thoughts?
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index e7656cbef68d..aa63f5f780a0 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -586,7 +586,8 @@ static void init_intel(struct cpuinfo_x86 *c) c->x86_vfm == INTEL_WESTMERE_EX)) set_cpu_bug(c, X86_BUG_CLFLUSH_MONITOR); - if (boot_cpu_has(X86_FEATURE_MWAIT) && c->x86_vfm == INTEL_ATOM_GOLDMONT) + if (boot_cpu_has(X86_FEATURE_MWAIT) && + (c->x86_vfm == INTEL_ATOM_GOLDMONT || c->x86_vfm == INTEL_LUNARLAKE_M)) set_cpu_bug(c, X86_BUG_MONITOR); #ifdef CONFIG_X86_64 diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 766f092dab80..910cb2d72c13 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1377,6 +1377,9 @@ void smp_kick_mwait_play_dead(void) for (i = 0; READ_ONCE(md->status) != newstate && i < 1000; i++) { /* Bring it out of mwait */ WRITE_ONCE(md->control, newstate); + /* If MONITOR unreliable, send IPI */ + if (boot_cpu_has_bug(X86_BUG_MONITOR)) + __apic_send_IPI(cpu, RESCHEDULE_VECTOR); udelay(5); }