Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2004-03-15 05:25:01 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-03-15 05:25:01 -0800
commitc8c41d00824f3ab4f4968be865b2d91d1288a24e (patch)
treebe88b37ce84a47a37ce8918ea57135cc3070e9b1
parenta1f846e817146e22701d8fc5744267ad52c01ee6 (diff)
[PATCH] Fix CONFIG_DEBUG build on x86-64 & small cleanup
This fixes the CONFIG_DEBUG_INFO build on x86-64 (there were missing .cfi_endprocs) Also some minor cleanup in the exception stack handling.
-rw-r--r--arch/x86_64/kernel/entry.S13
-rw-r--r--arch/x86_64/kernel/traps.c28
2 files changed, 23 insertions, 18 deletions
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 7f73e3a1d628..141211f7d994 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -803,9 +803,6 @@ ENTRY(debug)
pushq $0
CFI_ADJUST_CFA_OFFSET 8
paranoidentry do_debug
-paranoid_stack_switch:
- testq %rax,%rax
- jz paranoid_exit
/* switch back to process stack to restore the state ptrace touched */
movq %rax,%rsp
jmp paranoid_exit
@@ -870,8 +867,11 @@ ENTRY(reserved)
/* runs on exception stack */
ENTRY(double_fault)
+ CFI_STARTPROC
paranoidentry do_double_fault
- jmp paranoid_stack_switch
+ movq %rax,%rsp
+ jmp paranoid_exit
+ CFI_ENDPROC
ENTRY(invalid_TSS)
errorentry do_invalid_TSS
@@ -881,8 +881,11 @@ ENTRY(segment_not_present)
/* runs on exception stack */
ENTRY(stack_segment)
+ CFI_STARTPROC
paranoidentry do_stack_segment
- jmp paranoid_stack_switch
+ movq %rax,%rsp
+ jmp paranoid_exit
+ CFI_ENDPROC
ENTRY(general_protection)
errorentry do_general_protection
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 963baab39f26..5afe235c0474 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -477,15 +477,17 @@ DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, get_cr
DO_ERROR(18, SIGSEGV, "reserved", reserved)
#define DO_ERROR_STACK(trapnr, signr, str, name) \
-asmlinkage unsigned long do_##name(struct pt_regs * regs, long error_code) \
+asmlinkage void *do_##name(struct pt_regs * regs, long error_code) \
{ \
struct pt_regs *pr = ((struct pt_regs *)(current->thread.rsp0))-1; \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) == NOTIFY_BAD) \
- return 0; \
- if (regs->cs & 3) \
+ return regs; \
+ if (regs->cs & 3) { \
memcpy(pr, regs, sizeof(struct pt_regs)); \
+ regs = pr; \
+ } \
do_trap(trapnr, signr, str, regs, error_code, NULL); \
- return (regs->cs & 3) ? (unsigned long)pr : 0; \
+ return regs; \
}
DO_ERROR_STACK(12, SIGBUS, "stack segment", stack_segment)
@@ -605,16 +607,18 @@ asmlinkage void default_do_nmi(struct pt_regs * regs)
}
/* runs on IST stack. */
-asmlinkage unsigned long do_debug(struct pt_regs * regs, unsigned long error_code)
+asmlinkage void *do_debug(struct pt_regs * regs, unsigned long error_code)
{
- struct pt_regs *processregs;
+ struct pt_regs *pr;
unsigned long condition;
struct task_struct *tsk = current;
siginfo_t info;
- processregs = (struct pt_regs *)(current->thread.rsp0)-1;
- if (regs->cs & 3)
- memcpy(processregs, regs, sizeof(struct pt_regs));
+ pr = (struct pt_regs *)(current->thread.rsp0)-1;
+ if (regs->cs & 3) {
+ memcpy(pr, regs, sizeof(struct pt_regs));
+ regs = pr;
+ }
#ifdef CONFIG_CHECKING
{
@@ -673,8 +677,7 @@ asmlinkage unsigned long do_debug(struct pt_regs * regs, unsigned long error_cod
clear_dr7:
asm volatile("movq %0,%%db7"::"r"(0UL));
notify_die(DIE_DEBUG, "debug", regs, condition, 1, SIGTRAP);
-out:
- return (regs->cs & 3) ? (unsigned long)processregs : 0;
+ return regs;
clear_TF_reenable:
printk("clear_tf_reenable\n");
@@ -685,8 +688,7 @@ clear_TF:
if (notify_die(DIE_DEBUG, "debug2", regs, condition, 1, SIGTRAP)
!= NOTIFY_BAD)
regs->eflags &= ~TF_MASK;
-
- goto out;
+ return regs;
}
/*