From: Dmitry Vyukov <dvyukov@google.com>
To: john.garry@huawei.com, will@kernel.org
Cc: acme@kernel.org, elver@google.com, gor@linux.ibm.com,
hca@linux.ibm.com, leo.yan@linaro.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
mark.rutland@arm.com, sumanthk@linux.ibm.com,
svens@linux.ibm.com, tmricht@linux.ibm.com
Subject: Test 73 Sig_trap fails on arm64
Date: Mon, 31 Jan 2022 18:55:26 +0100 [thread overview]
Message-ID: <20220131175526.1777801-1-dvyukov@google.com> (raw)
In-Reply-To: <bfa0af18-04ac-857d-d3d8-ad9290f912c8@huawei.com>
> On 18/01/2022 12:43, Leo Yan wrote:
>
> Hi Will,
>
> Can you kindly check below the question from Leo on this issue?
>
> You were cc'ed earlier in this thread so should be able to find more
> context, if needed.
Hi Will, John,
I wonder if PSTATE.D flag can be used to resolve this
(similar to x86's use of EFLAGS.RF)?
I naively tried to do:
void OnSigtrap(int sig, siginfo_t* info, void* uctx) {
auto& mctx = static_cast<ucontext_t*>(uctx)->uc_mcontext;
mctx.pstate |= PSR_D_BIT;
}
But then I got a SIGSEGV from kernel.
But I wasn't able to track yet what part of the kernel did
not like setting of D bit.
> Cheers,
> John
>
> > On Tue, Jan 18, 2022 at 12:40:04PM +0100, Marco Elver wrote:
> >
> > [...]
> >
> >>> Both Arm and Arm64 platforms cannot support signal handler with
> >>> breakpoint, please see the details in [1]. So I think we need
> >>> something like below:
> >>>
> >>> static int test__sigtrap(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
> >>> {
> >>> ...
> >>>
> >>> if (!BP_SIGNAL_IS_SUPPORTED) {
> >>> pr_debug("Test not supported on this architecture");
> >>> return TEST_SKIP;
> >>> }
> >>>
> >>> ...
> >>> }
> >>>
> >>> Since we have defined BP_SIGNAL_IS_SUPPORTED, I think we can reuse it at
> >>> here.
> >>>
> >>> [1]https://lore.kernel.org/lkml/157169993406.29376.12473771029179755767.tip-bot2@tip-bot2/
> >> Does this limitation also exist for address watchpoints? The sigtrap
> >> test does not make use of instruction breakpoints, but instead just
> >> sets up a watchpoint on access to a data address.
> > Yes, after reading the code, the flow for either instrution breakpoint
> > or watchpoint both use the single step [1], thus the signal handler will
> > take the single step execution and lead to the infinite loop.
> >
> > I am not the best person to answer this question; @Will, could you
> > confirm for this? Thanks!
> >
> > Leo
> >
> > [1]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/kernel/hw_breakpoint.c
next prev parent reply other threads:[~2022-01-31 17:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-16 15:14 [PATCH] perf test: Test 73 Sig_trap fails on s390 Thomas Richter
2021-12-16 15:48 ` Marco Elver
2022-01-17 15:39 ` John Garry
2022-01-18 9:18 ` Leo Yan
2022-01-18 10:20 ` John Garry
2022-01-18 11:18 ` Leo Yan
2022-01-18 11:40 ` Marco Elver
2022-01-18 12:43 ` Leo Yan
2022-01-24 9:19 ` Test 73 Sig_trap fails on arm64 (was Re: [PATCH] perf test: Test 73 Sig_trap fails on s390) John Garry
2022-01-31 17:55 ` Dmitry Vyukov [this message]
2022-02-01 10:03 ` Test 73 Sig_trap fails on arm64 Dmitry Vyukov
2022-02-15 11:16 ` Test 73 Sig_trap fails on arm64 (was Re: [PATCH] perf test: Test 73 Sig_trap fails on s390) John Garry
2022-02-15 14:35 ` Will Deacon
2022-02-16 11:46 ` John Garry
2022-02-16 11:54 ` Dmitry Vyukov
2022-02-16 13:13 ` Leo Yan
2022-02-17 9:53 ` John Garry
2022-02-17 11:04 ` Leo Yan
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=20220131175526.1777801-1-dvyukov@google.com \
--to=dvyukov@google.com \
--cc=acme@kernel.org \
--cc=elver@google.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=john.garry@huawei.com \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=sumanthk@linux.ibm.com \
--cc=svens@linux.ibm.com \
--cc=tmricht@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).