Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14222
b: refs/heads/master
c: 9e43e1b
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Nov 15, 2005
1 parent c3f5e81 commit dbc152d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 66 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ffd10a2b77bca50dd05ba26acd5a6e68bcc8f61f
refs/heads/master: 9e43e1b7c7c9872da032442d8e4bb112a02d16f4
3 changes: 3 additions & 0 deletions trunk/Documentation/x86_64/boot-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ Debugging

kstack=N Print that many words from the kernel stack in oops dumps.

pagefaulttrace Dump all page faults. Only useful for extreme debugging
and will create a lot of output.

Misc

noreplacement Don't replace instructions with more appropiate ones
Expand Down
9 changes: 0 additions & 9 deletions trunk/arch/x86_64/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ menu "Kernel hacking"

source "lib/Kconfig.debug"

# !SMP for now because the context switch early causes GPF in segment reloading
# and the GS base checking does the wrong thing then, causing a hang.
config CHECKING
bool "Additional run-time checks"
depends on DEBUG_KERNEL && !SMP
help
Enables some internal consistency checks for kernel debugging.
You should normally say N.

config INIT_DEBUG
bool "Debug __init statements"
depends on DEBUG_KERNEL
Expand Down
40 changes: 0 additions & 40 deletions trunk/arch/x86_64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,6 @@ static void __kprobes do_trap(int trapnr, int signr, char *str,
{
conditional_sti(regs);

#ifdef CONFIG_CHECKING
{
unsigned long gs;
struct x8664_pda *pda = cpu_pda + safe_smp_processor_id();
rdmsrl(MSR_GS_BASE, gs);
if (gs != (unsigned long)pda) {
wrmsrl(MSR_GS_BASE, pda);
printk("%s: wrong gs %lx expected %p rip %lx\n", str, gs, pda,
regs->rip);
}
}
#endif

if (user_mode(regs)) {
struct task_struct *tsk = current;

Expand Down Expand Up @@ -513,20 +500,6 @@ asmlinkage void __kprobes do_general_protection(struct pt_regs * regs,
{
conditional_sti(regs);

#ifdef CONFIG_CHECKING
{
unsigned long gs;
struct x8664_pda *pda = cpu_pda + safe_smp_processor_id();
rdmsrl(MSR_GS_BASE, gs);
if (gs != (unsigned long)pda) {
wrmsrl(MSR_GS_BASE, pda);
oops_in_progress++;
printk("general protection handler: wrong gs %lx expected %p\n", gs, pda);
oops_in_progress--;
}
}
#endif

if (user_mode(regs)) {
struct task_struct *tsk = current;

Expand Down Expand Up @@ -665,19 +638,6 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,
struct task_struct *tsk = current;
siginfo_t info;

#ifdef CONFIG_CHECKING
{
/* RED-PEN interaction with debugger - could destroy gs */
unsigned long gs;
struct x8664_pda *pda = cpu_pda + safe_smp_processor_id();
rdmsrl(MSR_GS_BASE, gs);
if (gs != (unsigned long)pda) {
wrmsrl(MSR_GS_BASE, pda);
printk("debug handler: wrong gs %lx expected %p\n", gs, pda);
}
}
#endif

get_debugreg(condition, 6);

if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
Expand Down
19 changes: 7 additions & 12 deletions trunk/arch/x86_64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,18 +308,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
unsigned long flags;
siginfo_t info;

#ifdef CONFIG_CHECKING
{
unsigned long gs;
struct x8664_pda *pda = cpu_pda + stack_smp_processor_id();
rdmsrl(MSR_GS_BASE, gs);
if (gs != (unsigned long)pda) {
wrmsrl(MSR_GS_BASE, pda);
printk("page_fault: wrong gs %lx expected %p\n", gs, pda);
}
}
#endif

/* get the address */
__asm__("movq %%cr2,%0":"=r" (address));
if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
Expand Down Expand Up @@ -571,3 +559,10 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
force_sig_info(SIGBUS, &info, tsk);
return;
}

static int __init enable_pagefaulttrace(char *str)
{
page_fault_trace = 1;
return 0;
}
__setup("pagefaulttrace", enable_pagefaulttrace);
4 changes: 0 additions & 4 deletions trunk/arch/x86_64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,6 @@ extern int exception_trace, page_fault_trace;
static ctl_table debug_table2[] = {
{ 99, "exception-trace", &exception_trace, sizeof(int), 0644, NULL,
proc_dointvec },
#ifdef CONFIG_CHECKING
{ 100, "page-fault-trace", &page_fault_trace, sizeof(int), 0644, NULL,
proc_dointvec },
#endif
{ 0, }
};

Expand Down

0 comments on commit dbc152d

Please sign in to comment.