From: Len Brown <lenb@kernel.org>
To: peterz@infradead.org, x86@kernel.org
Cc: rafael@kernel.org, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org, Len Brown <len.brown@intel.com>,
stable@vger.kernel.org
Subject: [PATCH backport to 6.10] x86/cpu: Add INTEL_FAM6_LUNARLAKE_M to X86_BUG_MONITOR
Date: Fri, 8 Nov 2024 08:49:30 -0500 [thread overview]
Message-ID: <20241108135206.435793-2-lenb@kernel.org> (raw)
In-Reply-To: <20241108135206.435793-1-lenb@kernel.org>
From: Len Brown <len.brown@intel.com>
Under some conditions, MONITOR wakeups on Lunar Lake processors
can be lost, resulting in significant user-visible delays.
Add LunarLake to X86_BUG_MONITOR so that wake_up_idle_cpu()
always sends an IPI, avoiding this potential delay.
Update the X86_BUG_MONITOR workaround to handle
the new smp_kick_mwait_play_dead() path.
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219364
Cc: stable@vger.kernel.org # 6.10
Signed-off-by: Len Brown <len.brown@intel.com>
---
This is a backport of the upstream patch to Linux-6.10 and earlier
---
arch/x86/kernel/cpu/intel.c | 3 ++-
arch/x86/kernel/smpboot.c | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 3ef4e0137d21..e6f4c16c0267 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -583,7 +583,8 @@ static void init_intel(struct cpuinfo_x86 *c)
set_cpu_bug(c, X86_BUG_CLFLUSH_MONITOR);
if (c->x86 == 6 && boot_cpu_has(X86_FEATURE_MWAIT) &&
- ((c->x86_model == INTEL_FAM6_ATOM_GOLDMONT)))
+ ((c->x86_model == INTEL_FAM6_ATOM_GOLDMONT) ||
+ (c->x86_model == INTEL_FAM6_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 0c35207320cb..ca9358acc626 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1376,6 +1376,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 MWAIT unreliable, send IPI */
+ if (boot_cpu_has_bug(X86_BUG_MONITOR))
+ __apic_send_IPI(cpu, RESCHEDULE_VECTOR);
udelay(5);
}
--
2.43.0
next prev parent reply other threads:[~2024-11-08 13:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 13:49 [PATCh 0/2] Add Intel Lunarlake to X86_BUG_MONITOR Len Brown
2024-11-08 13:49 ` Len Brown [this message]
2024-11-12 1:07 ` [PATCH backport to 6.10] x86/cpu: Add INTEL_FAM6_LUNARLAKE_M " Thomas Gleixner
2024-11-08 13:49 ` [PATCH] x86/cpu: Add INTEL_LUNARLAKE_M " Len Brown
2024-11-08 14:34 ` Rafael J. Wysocki
2024-11-11 16:23 ` Peter Zijlstra
2024-11-12 0:27 ` Thomas Gleixner
2024-11-12 5:28 ` [PATCH 0/1 v2] " Len Brown
2024-11-12 5:28 ` [PATCH 1/1] " Len Brown
2024-11-12 11:44 ` Rafael J. Wysocki
[not found] ` <CAJvTdKnRpDQKUVNJ4Gp7r+WaHo0y-Wume3ay7toHU+Xz0gv2Zw@mail.gmail.com>
2024-11-12 13:14 ` Rafael J. Wysocki
[not found] ` <CAJvTdK=SnRqwjR5fUatP0CzaXD_CpZ-1cc+2yX0D8_XM_3oJUw@mail.gmail.com>
2024-11-12 15:02 ` Rafael J. Wysocki
2024-11-11 20:20 ` [PATCH] " Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241108135206.435793-2-lenb@kernel.org \
--to=lenb@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=stable@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).