From: Heiko Carstens <hca@linux.ibm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Sven Schnelle <svens@linux.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [GIT pull] locking/urgent for v5.10-rc6
Date: Wed, 2 Dec 2020 14:46:04 +0100 [thread overview]
Message-ID: <20201202134604.GC6202@osiris> (raw)
In-Reply-To: <20201202111605.GA63790@C02TD0UTHF1T.local>
On Wed, Dec 02, 2020 at 11:16:05AM +0000, Mark Rutland wrote:
> On Wed, Dec 02, 2020 at 11:56:49AM +0100, Heiko Carstens wrote:
> > From 7bd86fb3eb039a4163281472ca79b9158e726526 Mon Sep 17 00:00:00 2001
> > From: Heiko Carstens <hca@linux.ibm.com>
> > Date: Wed, 2 Dec 2020 11:46:01 +0100
> > Subject: [PATCH] s390: fix irq state tracing
> >
> > With commit 58c644ba512c ("sched/idle: Fix arch_cpu_idle() vs
> > tracing") common code calls arch_cpu_idle() with a lockdep state that
> > tells irqs are on.
> >
> > This doesn't work very well for s390: psw_idle() will enable interrupts
> > to wait for an interrupt. As soon as an interrupt occurs the interrupt
> > handler will verify if the old context was psw_idle(). If that is the
> > case the interrupt enablement bits in the old program status word will
> > be cleared.
> >
> > A subsequent test in both the external as well as the io interrupt
> > handler checks if in the old context interrupts were enabled. Due to
> > the above patching of the old program status word it is assumed the
> > old context had interrupts disabled, and therefore a call to
> > TRACE_IRQS_OFF (aka trace_hardirqs_off_caller) is skipped. Which in
> > turn makes lockdep incorrectly "think" that interrupts are enabled
> > within the interrupt handler.
> >
> > Fix this by unconditionally calling TRACE_IRQS_OFF when entering
> > interrupt handlers. Also call unconditionally TRACE_IRQS_ON when
> > leaving interrupts handlers.
> >
> > This leaves the special psw_idle() case, which now returns with
> > interrupts disabled, but has an "irqs on" lockdep state. So callers of
> > psw_idle() must adjust the state on their own, if required. This is
> > currently only __udelay_disabled().
> >
> > Fixes: 58c644ba512c ("sched/idle: Fix arch_cpu_idle() vs tracing")
> > Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
>
> FWIW, this makes sense to me from what I had to chase on the arm64 side,
> and this seems happy atop v5.10-rc6 with all the lockdep and RCU debug
> options enabled when booting to userspace under QEMU.
>
> Thanks,
> Mark.
Thanks a lot for having a look and testing this!
next prev parent reply other threads:[~2020-12-02 13:47 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-29 13:37 [GIT pull] irq/urgent for v5.10-rc6 Thomas Gleixner
2020-11-29 13:38 ` [GIT pull] locking/urgent " Thomas Gleixner
2020-11-29 19:31 ` Linus Torvalds
2020-11-30 0:29 ` Paul E. McKenney
2020-11-30 7:56 ` Peter Zijlstra
2020-11-30 8:23 ` Sven Schnelle
2020-11-30 12:31 ` Sven Schnelle
2020-11-30 12:52 ` Peter Zijlstra
2020-11-30 13:03 ` Peter Zijlstra
2020-11-30 18:04 ` Linus Torvalds
2020-11-30 19:31 ` Christian Borntraeger
2020-12-01 8:07 ` Peter Zijlstra
2020-12-01 11:07 ` Peter Zijlstra
2020-12-01 14:46 ` Paul E. McKenney
2020-12-01 14:55 ` Peter Zijlstra
2020-12-01 16:53 ` Paul E. McKenney
2020-12-01 18:15 ` Peter Zijlstra
2020-12-01 18:48 ` Peter Zijlstra
2020-12-01 18:57 ` Mark Rutland
2020-12-01 19:14 ` Peter Zijlstra
2020-12-01 19:18 ` Heiko Carstens
2020-12-02 9:21 ` Peter Zijlstra
2020-12-02 10:56 ` Heiko Carstens
2020-12-02 11:16 ` Mark Rutland
2020-12-02 13:46 ` Heiko Carstens [this message]
2020-12-02 12:27 ` Peter Zijlstra
2020-12-01 7:48 ` Sven Schnelle
2020-12-02 7:54 ` Heiko Carstens
2020-12-02 9:38 ` Peter Zijlstra
2020-12-02 10:52 ` Heiko Carstens
2020-11-30 8:36 ` Peter Zijlstra
2020-11-30 17:55 ` Linus Torvalds
2020-12-01 7:39 ` Peter Zijlstra
2020-12-01 7:56 ` Peter Zijlstra
2020-12-01 19:45 ` Linus Torvalds
2020-12-02 7:53 ` Peter Zijlstra
2020-11-29 20:06 ` pr-tracker-bot
2020-11-29 20:06 ` [GIT pull] irq/urgent " pr-tracker-bot
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=20201202134604.GC6202@osiris \
--to=hca@linux.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=svens@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.