From: James Morse <james.morse@arm.com>
To: Pratyush Anand <panand@redhat.com>
Cc: mark.rutland@arm.com,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
will.deacon@arm.com, linux-kernel@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@kernel.org>,
takahiro.akashi@linaro.org, Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
huawei.libin@huawei.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 0/5] ARM64: disable irq between breakpoint and step exception
Date: Thu, 03 Aug 2017 16:25:19 +0100 [thread overview]
Message-ID: <5983405F.4010002@arm.com> (raw)
In-Reply-To: <883651ba-2178-b5cf-7f6c-bfb2f6999a01@redhat.com>
Hi Pratyush,
On 02/08/17 19:46, Pratyush Anand wrote:
> In my understanding problems are:
> (1) Single stepping of unwanted instruction (ie. instruction next to enable_dbg
> from el1_irq)
> (2) We do not have memory at the end of el1_irq, so that we can set watchpoint
> exception generating instruction for single stepping.
Yes, for (2) the PSTATE.SS bit is saved in SPSR.SS when we take the irq, but it
isn't restored because we ERET from the irq handler with PSTATE.D clear.
> I think, we can find a way to take care for (2), but not sure how (1) can be
> taken care, without the approach I am taking.
We can fix (1) by making 'enable_dbg' inherit the debug state of the interrupted
EL1, unless the SPSR.SS bit is set, in which case we interrupted a
single-stepped instruction and shouldn't re-enable debug because we know must
MDSCR_EL1.SS be set.
This way a synchronous data-abort from a single-stepped instruction with
interrupts unmasked can unmask interrupts in el1_sync but keep debug disabled.
This should give us the least surprises if we call core-code.
I've posted a series that (in addition to your perf/watchpoint patches) fixes
all the issues I saw with your example. Can you test it fixes the
single-step:interrupt interaction on your platform?
Thanks,
James
next prev parent reply other threads:[~2017-08-03 15:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-31 10:40 [PATCH v3 0/5] ARM64: disable irq between breakpoint and step exception Pratyush Anand
2017-07-31 10:40 ` [PATCH v3 1/5] hw_breakpoint: Add step_needed event attribute Pratyush Anand
2017-08-01 8:18 ` Peter Zijlstra
2017-07-31 10:40 ` [PATCH v3 2/5] arm64: use hw_breakpoint_needs_single_step() to decide if step is needed Pratyush Anand
2017-07-31 10:40 ` [PATCH v3 3/5] register_wide_hw_breakpoint(): modify to accept step_needed arg Pratyush Anand
2017-07-31 10:40 ` [PATCH v3 4/5] arm64: disable irq between breakpoint and step exception Pratyush Anand
2017-07-31 10:40 ` [PATCH v3 5/5] arm64: fault: re-enable irq if it was disabled for single stepping Pratyush Anand
2017-07-31 17:15 ` [PATCH v3 0/5] ARM64: disable irq between breakpoint and step exception James Morse
2017-08-01 4:18 ` Pratyush Anand
2017-08-02 17:13 ` James Morse
2017-08-02 18:46 ` Pratyush Anand
2017-08-03 15:25 ` James Morse [this message]
2017-08-01 8:14 ` AKASHI Takahiro
2017-08-01 8:32 ` Pratyush Anand
2017-08-25 6:05 ` Pratyush Anand
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=5983405F.4010002@arm.com \
--to=james.morse@arm.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=huawei.libin@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=panand@redhat.com \
--cc=peterz@infradead.org \
--cc=takahiro.akashi@linaro.org \
--cc=will.deacon@arm.com \
/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