Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1703203

Re: [PATCH v3 0/5] ARM64: disable irq between breakpoint and step exception

From James Morse <james.morse@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 0/5] ARM64: disable irq between breakpoint and step exception
Date 2017-08-03 17:30 +0200
Message-ID <uaqev-1Q1-31@gated-at.bofh.it> (permalink)
References <u9gqR-5by-7@gated-at.bofh.it> <u9mwj-Ac-29@gated-at.bofh.it> <u9wOZ-6U8-3@gated-at.bofh.it> <ua5to-4lS-19@gated-at.bofh.it> <ua6Su-5de-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH v3 0/5] ARM64: disable irq between breakpoint and step  exception James Morse <james.morse@arm.com> - 2017-07-31 19:20 +0200
  Re: [PATCH v3 0/5] ARM64: disable irq between breakpoint and step  exception Pratyush Anand <panand@redhat.com> - 2017-08-01 06:20 +0200
    Re: [PATCH v3 0/5] ARM64: disable irq between breakpoint and step  exception James Morse <james.morse@arm.com> - 2017-08-02 19:20 +0200
      Re: [PATCH v3 0/5] ARM64: disable irq between breakpoint and step  exception Pratyush Anand <panand@redhat.com> - 2017-08-02 20:50 +0200
        Re: [PATCH v3 0/5] ARM64: disable irq between breakpoint and step  exception James Morse <james.morse@arm.com> - 2017-08-03 17:30 +0200

csiph-web