Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix int1 recursion and hard system lockup #232

Closed
wants to merge 37 commits into from
Closed
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
dd6c246
Merge pull request #1 from torvalds/master
jeffmerkey Nov 19, 2015
d45bb00
Merge pull request #2 from torvalds/master
jeffmerkey Nov 20, 2015
c41420a
Merge pull request #3 from torvalds/master
jeffmerkey Nov 21, 2015
28aedc0
Merge pull request #4 from torvalds/master
jeffmerkey Nov 23, 2015
9d18291
Merge branch 'master' of https://github.com/jeffmerkey/linux
jeffmerkey Nov 26, 2015
2379237
Merge pull request #1 from torvalds/master
jeffmerkey Nov 26, 2015
feb340f
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Nov 28, 2015
fda8cf4
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Nov 29, 2015
cc93f9d
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Nov 29, 2015
ea2ab4c
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Nov 30, 2015
b3d2dd6
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 1, 2015
4f6b990
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 1, 2015
4eafb28
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 2, 2015
6675053
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 3, 2015
d7af06e
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 4, 2015
4fa09a6
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 4, 2015
aa1231b
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 4, 2015
7b38acb
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 4, 2015
95fb7da
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
jeffmerkey Dec 5, 2015
4e62eca
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 6, 2015
d02d732
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 6, 2015
85aeff5
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 6, 2015
79deeea
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 7, 2015
e713b32
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 8, 2015
978c5c7
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 9, 2015
ef96f8a
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 9, 2015
11350d1
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 10, 2015
0c9e187
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 10, 2015
b34a1f9
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 11, 2015
2ce9105
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 11, 2015
3947c31
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 12, 2015
136fbb6
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 12, 2015
bf8ae21
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 12, 2015
0e955ef
Merge branch 'master' of https://github.com/torvalds/linux
jeffmerkey Dec 13, 2015
4ae78e5
Merge pull request #2 from torvalds/master
jeffmerkey Dec 13, 2015
aa24cb5
Merge pull request #3 from torvalds/master
jeffmerkey Dec 13, 2015
e1d3c76
fix INT1 recursion and system hard hang.
jeffmerkey Dec 13, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions arch/x86/kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ EXPORT_SYMBOL_GPL(hw_breakpoint_restore);
static int hw_breakpoint_handler(struct die_args *args)
{
int i, cpu, rc = NOTIFY_STOP;
struct perf_event *bp;
struct perf_event *bp = NULL;
unsigned long dr7, dr6;
unsigned long *dr6_p;

Expand Down Expand Up @@ -475,6 +475,13 @@ static int hw_breakpoint_handler(struct die_args *args)
for (i = 0; i < HBP_NUM; ++i) {
if (likely(!(dr6 & (DR_TRAP0 << i))))
continue;
/*
* check if we got an execute breakpoint
* from the dr7 register. if we did, set
* the resume flag to avoid int1 recursion.
*/
if ((dr7 & (3 << ((i * 4) + 16))) == 0)
args->regs->flags |= X86_EFLAGS_RF;

/*
* The counter may be concurrently released but that can only
Expand Down Expand Up @@ -503,7 +510,9 @@ static int hw_breakpoint_handler(struct die_args *args)

/*
* Set up resume flag to avoid breakpoint recursion when
* returning back to origin.
* returning back to origin. Perform the check
* twice in case the event handler altered the
* system flags.
*/
if (bp->hw.info.type == X86_BREAKPOINT_EXECUTE)
args->regs->flags |= X86_EFLAGS_RF;
Expand All @@ -519,6 +528,18 @@ static int hw_breakpoint_handler(struct die_args *args)
(dr6 & (~DR_TRAP_BITS)))
rc = NOTIFY_DONE;

/*
* if we are about to signal to
* do_debug() to stop further processing
* and we have not ascertained the source
* of the breakpoint, log it as spurious.
*/
if (rc == NOTIFY_STOP && !bp) {
printk_ratelimited(KERN_INFO
"INFO: spurious INT1 exception dr6: 0x%lX dr7: 0x%lX\n",
dr6, dr7);
}

set_debugreg(dr7, 7);
put_cpu();

Expand Down