]> git.baikalelectronics.ru Git - kernel.git/commit
x86/debug: Fix DR6 handling
authorPeter Zijlstra <peterz@infradead.org>
Thu, 28 Jan 2021 21:16:27 +0000 (22:16 +0100)
committerBorislav Petkov <bp@suse.de>
Mon, 1 Feb 2021 14:49:02 +0000 (15:49 +0100)
commita53b1f657c025c06a3a8d4d9dd9128532751c8d3
treeca4f050b7d46ff042c6ce685eb25066a5a808812
parent001459ef05ec4e177de8a4d0ed6a7b360cfa4a17
x86/debug: Fix DR6 handling

Tom reported that one of the GDB test-cases failed, and Boris bisected
it to commit:

  786130a3cc7f ("x86/debug: Change thread.debugreg6 to thread.virtual_dr6")

The debugging session led us to commit:

  691dac81b734 ("x86: Ignore trap bits on single step exceptions")

It turns out that TF and data breakpoints are both traps and will be
merged, while instruction breakpoints are faults and will not be merged.
This means 691dac81b734 is wrong, only TF and instruction breakpoints
need to be excluded while TF and data breakpoints can be merged.

 [ bp: Massage commit message. ]

Fixes: 786130a3cc7f ("x86/debug: Change thread.debugreg6 to thread.virtual_dr6")
Fixes: 691dac81b734 ("x86: Ignore trap bits on single step exceptions")
Reported-by: Tom de Vries <tdevries@suse.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/YBMAbQGACujjfz%2Bi@hirez.programming.kicks-ass.net
Link: https://lkml.kernel.org/r/20210128211627.GB4348@worktop.programming.kicks-ass.net
arch/x86/kernel/hw_breakpoint.c