From: Eric Chan <ericchancf@google.com>
To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
"Paul E . McKenney" <paulmck@kernel.org>,
Mark Brown <broonie@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Mukesh Ojha <quic_mojha@quicinc.com>,
Josh Poimboeuf <jpoimboe@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Eric Chan <ericchancf@google.com>
Subject: [PATCH] arm64: Fix 'lock held when returning to user space' lockdep warning
Date: Fri, 26 May 2023 18:48:23 +0000 [thread overview]
Message-ID: <20230526184823.1230974-1-ericchancf@google.com> (raw)
The arm64 architecture lacks support for CONFIG_GENERIC_ENTRY, resulting
in the failure to report the lockdep warning
"lock held when returning to user space" when lockdep is enabled.
Rename the function to align with exit_to_user_mode_prepare in
kernel/entry/common.c to improve readability.
Signed-off-by: Eric Chan <ericchancf@google.com>
---
arch/arm64/kernel/entry-common.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c
index 3af3c01c93a6..9d6827201b6c 100644
--- a/arch/arm64/kernel/entry-common.c
+++ b/arch/arm64/kernel/entry-common.c
@@ -126,7 +126,7 @@ static __always_inline void __exit_to_user_mode(void)
lockdep_hardirqs_on(CALLER_ADDR0);
}
-static __always_inline void prepare_exit_to_user_mode(struct pt_regs *regs)
+static __always_inline void exit_to_user_mode_prepare(struct pt_regs *regs)
{
unsigned long flags;
@@ -135,11 +135,13 @@ static __always_inline void prepare_exit_to_user_mode(struct pt_regs *regs)
flags = read_thread_flags();
if (unlikely(flags & _TIF_WORK_MASK))
do_notify_resume(regs, flags);
+
+ lockdep_sys_exit();
}
static __always_inline void exit_to_user_mode(struct pt_regs *regs)
{
- prepare_exit_to_user_mode(regs);
+ exit_to_user_mode_prepare(regs);
mte_check_tfsr_exit();
__exit_to_user_mode();
}
--
2.41.0.rc0.172.g3f132b7071-goog
next reply other threads:[~2023-05-26 18:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 18:48 Eric Chan [this message]
2023-05-30 9:46 ` [PATCH] arm64: Fix 'lock held when returning to user space' lockdep warning Mark Rutland
2023-05-31 8:47 ` Eric Chan
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=20230526184823.1230974-1-ericchancf@google.com \
--to=ericchancf@google.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=frederic@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=paulmck@kernel.org \
--cc=quic_mojha@quicinc.com \
--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