From: David Woodhouse <dwmw2@infradead.org>
To: Boqun Feng <boqun.feng@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Waiman Long <longman@redhat.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v3] lockdep: add lockdep_cleanup_dead_cpu()
Date: Thu, 26 Sep 2024 15:34:57 +0100 [thread overview]
Message-ID: <53d3d2e143eac428312ea74c8e6209aef1737a63.camel@infradead.org> (raw)
In-Reply-To: <ZvVUuOq7dLd6_f09@boqun-archlinux>
[-- Attachment #1: Type: text/plain, Size: 2472 bytes --]
On Thu, 2024-09-26 at 05:34 -0700, Boqun Feng wrote:
> On Thu, Sep 26, 2024 at 01:16:32PM +0100, David Woodhouse wrote:
> > On Thu, 2024-09-26 at 05:09 -0700, Boqun Feng wrote:
> > >
> > >
> > > I think this is already fixed by:
> > >
> > > 9bb69ba4c177 ("ACPI: processor_idle: use raw_safe_halt() in acpi_idle_play_dead()")
> > >
> > > , no?
> >
> > That patch fixed the bug.
> >
> > *This* patch fixes the fact that lockdep didn't *tell* us about the bug.
>
> But I thought along with the above commit, Peter also made it possible
> that objtool can detect leaving noinstr section in the offline path? Do
> you have a case where you can alter hardirqs_enabled flag in offline
> path but don't hit the objtool warning?
I do not recall such. Peter?
IIRC the bug fixed by commit 9bb69ba4c177 only showed up under real
Xen, as QEMU doesn't expose processor C-states. So I reintroduced the
equivalent bug by doing this instead:
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1390,7 +1390,7 @@ void __noreturn hlt_play_dead(void)
wbinvd();
while (1)
- native_halt();
+ safe_halt();
}
Without this patch, I get a triple-fault on bringing the CPU back
online as before. With it, as intended, I get a warning, but success:
[root@localhost ~]# echo 0 > /sys/devices/system/cpu/cpu1/online
[ 42.090839] smpboot: CPU 1 is now offline
[ 42.091989] CPU 1 left hardirqs enabled!
[ 42.091997] irq event stamp: 144559
[ 42.094155] hardirqs last enabled at (144559): [<ffffffff89098b2e>] hlt_play_dead+0x1e/0x30
[ 42.096196] hardirqs last disabled at (144558): [<ffffffff891800ee>] do_idle+0xae/0x260
[ 42.098062] softirqs last enabled at (144530): [<ffffffff89107260>] __irq_exit_rcu+0xb0/0xd0
[ 42.100056] softirqs last disabled at (144519): [<ffffffff89107260>] __irq_exit_rcu+0xb0/0xd0
[root@localhost ~]# echo 1 > /sys/devices/system/cpu/cpu1/online
[ 47.480889] installing Xen timer for CPU 1
[ 47.485308] smpboot: Booting Node 0 Processor 1 APIC 0x1
[ 47.491569] cpu 1 spinlock event irq 35
So I think the patch is still applicable.
> Anyway, the commit log needs a rework.
Sure. Other than to refer to commit 9bb69ba4c177 instead of the mailing
list message, is there anything else that needs changing? I suppose I
should drop the word 'recently' from '...was recently observed'? :)
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5965 bytes --]
next prev parent reply other threads:[~2024-09-26 14:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-28 11:14 [PATCH] " David Woodhouse
2023-10-28 14:13 ` Thomas Gleixner
2023-10-28 17:14 ` kernel test robot
2023-10-28 19:24 ` [PATCH v2] " David Woodhouse
2023-10-29 10:05 ` kernel test robot
2023-10-29 17:33 ` Thomas Gleixner
2023-10-29 17:47 ` David Woodhouse
2023-10-30 8:45 ` [PATCH v3] " David Woodhouse
2024-09-24 14:20 ` David Woodhouse
2024-09-26 12:09 ` Boqun Feng
2024-09-26 12:16 ` David Woodhouse
2024-09-26 12:34 ` Boqun Feng
2024-09-26 14:34 ` David Woodhouse [this message]
2024-09-26 15:13 ` Boqun Feng
2024-09-26 15:38 ` David Woodhouse
2023-10-30 16:37 ` [PATCH v2] " kernel test robot
2023-10-30 11:17 ` [PATCH] " Peter Zijlstra
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=53d3d2e143eac428312ea74c8e6209aef1737a63.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=boqun.feng@gmail.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=will@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
all inboxes | Powered by JetHome®