Re: [PATCH v2 5/8] x86/debug: Simplify #DB signal code

2020-08-24 Thread Andy Lutomirski
On Mon, Aug 24, 2020 at 4:05 AM wrote: > > On Sun, Aug 23, 2020 at 04:09:42PM -0700, Andy Lutomirski wrote: > > On Fri, Aug 21, 2020 at 3:21 AM Peter Zijlstra wrote: > > > > > > Get rid of the two variables, avoid computing si_code when not needed > > > and be consistent about which dr6 value is

Re: [PATCH v2 5/8] x86/debug: Simplify #DB signal code

2020-08-24 Thread Andy Lutomirski
On Mon, Aug 24, 2020 at 4:26 AM Andrew Cooper wrote: > > On 24/08/2020 12:05, pet...@infradead.org wrote: > > On Sun, Aug 23, 2020 at 04:09:42PM -0700, Andy Lutomirski wrote: > >> On Fri, Aug 21, 2020 at 3:21 AM Peter Zijlstra > >> wrote: > >>> Get rid of the two variables, avoid computing

Re: [PATCH v2 5/8] x86/debug: Simplify #DB signal code

2020-08-24 Thread peterz
On Mon, Aug 24, 2020 at 12:26:01PM +0100, Andrew Cooper wrote: > > INT1 is a trap, > > instruction breakpoint is a fault > > > > So if you have: > > > > INT1 > > 1: some-instr > > > > and set an X breakpoint on 1, we'll loose the INT1, right? > > You should get two.  First with a dr6 of 0

Re: [PATCH v2 5/8] x86/debug: Simplify #DB signal code

2020-08-24 Thread Andrew Cooper
On 24/08/2020 12:05, pet...@infradead.org wrote: > On Sun, Aug 23, 2020 at 04:09:42PM -0700, Andy Lutomirski wrote: >> On Fri, Aug 21, 2020 at 3:21 AM Peter Zijlstra wrote: >>> Get rid of the two variables, avoid computing si_code when not needed >>> and be consistent about which dr6 value is

Re: [PATCH v2 5/8] x86/debug: Simplify #DB signal code

2020-08-24 Thread peterz
On Sun, Aug 23, 2020 at 04:09:42PM -0700, Andy Lutomirski wrote: > On Fri, Aug 21, 2020 at 3:21 AM Peter Zijlstra wrote: > > > > Get rid of the two variables, avoid computing si_code when not needed > > and be consistent about which dr6 value is used. > > > > > - if (tsk->thread.debugreg6

Re: [PATCH v2 5/8] x86/debug: Simplify #DB signal code

2020-08-23 Thread Andy Lutomirski
On Fri, Aug 21, 2020 at 3:21 AM Peter Zijlstra wrote: > > Get rid of the two variables, avoid computing si_code when not needed > and be consistent about which dr6 value is used. > > - if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp) > - send_sigtrap(regs,

[PATCH v2 5/8] x86/debug: Simplify #DB signal code

2020-08-21 Thread Peter Zijlstra
Get rid of the two variables, avoid computing si_code when not needed and be consistent about which dr6 value is used. This makes it easier to shuffle code around later. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/kernel/traps.c | 24 1 file changed, 12