diff options
-rw-r--r-- | arch/ia64/kernel/traps.c | 26 | ||||
-rw-r--r-- | include/asm-ia64/thread_info.h | 4 |
2 files changed, 22 insertions, 8 deletions
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c index d3e0ecb56d62..55391901b013 100644 --- a/arch/ia64/kernel/traps.c +++ b/arch/ia64/kernel/traps.c | |||
@@ -530,12 +530,15 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, | |||
530 | if (fsys_mode(current, ®s)) { | 530 | if (fsys_mode(current, ®s)) { |
531 | extern char __kernel_syscall_via_break[]; | 531 | extern char __kernel_syscall_via_break[]; |
532 | /* | 532 | /* |
533 | * Got a trap in fsys-mode: Taken Branch Trap and Single Step trap | 533 | * Got a trap in fsys-mode: Taken Branch Trap |
534 | * need special handling; Debug trap is not supposed to happen. | 534 | * and Single Step trap need special handling; |
535 | * Debug trap is ignored (we disable it here | ||
536 | * and re-enable it in the lower-privilege trap). | ||
535 | */ | 537 | */ |
536 | if (unlikely(vector == 29)) { | 538 | if (unlikely(vector == 29)) { |
537 | die("Got debug trap in fsys-mode---not supposed to happen!", | 539 | set_thread_flag(TIF_DB_DISABLED); |
538 | ®s, 0); | 540 | ia64_psr(®s)->db = 0; |
541 | ia64_psr(®s)->lp = 1; | ||
539 | return; | 542 | return; |
540 | } | 543 | } |
541 | /* re-do the system call via break 0x100000: */ | 544 | /* re-do the system call via break 0x100000: */ |
@@ -589,10 +592,19 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, | |||
589 | case 34: | 592 | case 34: |
590 | if (isr & 0x2) { | 593 | if (isr & 0x2) { |
591 | /* Lower-Privilege Transfer Trap */ | 594 | /* Lower-Privilege Transfer Trap */ |
595 | |||
596 | /* If we disabled debug traps during an fsyscall, | ||
597 | * re-enable them here. | ||
598 | */ | ||
599 | if (test_thread_flag(TIF_DB_DISABLED)) { | ||
600 | clear_thread_flag(TIF_DB_DISABLED); | ||
601 | ia64_psr(®s)->db = 1; | ||
602 | } | ||
603 | |||
592 | /* | 604 | /* |
593 | * Just clear PSR.lp and then return immediately: all the | 605 | * Just clear PSR.lp and then return immediately: |
594 | * interesting work (e.g., signal delivery is done in the kernel | 606 | * all the interesting work (e.g., signal delivery) |
595 | * exit path). | 607 | * is done in the kernel exit path. |
596 | */ | 608 | */ |
597 | ia64_psr(®s)->lp = 0; | 609 | ia64_psr(®s)->lp = 0; |
598 | return; | 610 | return; |
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h index 653bb7f9a753..1d6518fe1f02 100644 --- a/include/asm-ia64/thread_info.h +++ b/include/asm-ia64/thread_info.h | |||
@@ -93,6 +93,7 @@ struct thread_info { | |||
93 | #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 93 | #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
94 | #define TIF_MEMDIE 17 | 94 | #define TIF_MEMDIE 17 |
95 | #define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */ | 95 | #define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */ |
96 | #define TIF_DB_DISABLED 19 /* debug trap disabled for fsyscall */ | ||
96 | 97 | ||
97 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 98 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
98 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) | 99 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
@@ -100,9 +101,10 @@ struct thread_info { | |||
100 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 101 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
101 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | 102 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
102 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | 103 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
103 | #define _TIF_SIGDELAYED (1 << TIF_SIGDELAYED) | 104 | #define _TIF_SIGDELAYED (1 << TIF_SIGDELAYED) |
104 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | 105 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) |
105 | #define _TIF_MCA_INIT (1 << TIF_MCA_INIT) | 106 | #define _TIF_MCA_INIT (1 << TIF_MCA_INIT) |
107 | #define _TIF_DB_DISABLED (1 << TIF_DB_DISABLED) | ||
106 | 108 | ||
107 | /* "work to do on user-return" bits */ | 109 | /* "work to do on user-return" bits */ |
108 | #define TIF_ALLWORK_MASK (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SIGDELAYED) | 110 | #define TIF_ALLWORK_MASK (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SIGDELAYED) |