Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104362
b: refs/heads/master
c: 9781f39
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Petazzoni authored and Ingo Molnar committed Jul 18, 2008
1 parent 1708e7c commit 8a12854
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 146 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: 7edf8891ad7aef5f4e97991fed6fb0e605e96ea0
refs/heads/master: 9781f39fd209cd93ab98b669814191acc67f32fd
3 changes: 1 addition & 2 deletions trunk/arch/x86/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ config CPA_DEBUG

config OPTIMIZE_INLINING
bool "Allow gcc to uninline functions marked 'inline'"
depends on BROKEN
help
This option determines if the kernel forces gcc to inline the functions
developers have marked 'inline'. Doing so takes away freedom from gcc to
Expand All @@ -297,7 +298,5 @@ config OPTIMIZE_INLINING
become the default in the future, until then this option is there to
test gcc for this.

If unsure, say N.

endmenu

5 changes: 4 additions & 1 deletion trunk/arch/x86/kernel/apic_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,9 @@ int apic_version[MAX_APICS];

int __init APIC_init_uniprocessor(void)
{
if (disable_apic)
clear_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);

if (!smp_found_config && !cpu_has_apic)
return -1;

Expand Down Expand Up @@ -1697,7 +1700,7 @@ early_param("lapic", parse_lapic);
static int __init parse_nolapic(char *arg)
{
disable_apic = 1;
setup_clear_cpu_cap(X86_FEATURE_APIC);
clear_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);
return 0;
}
early_param("nolapic", parse_nolapic);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/apic_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ early_param("apic", apic_set_verbosity);
static __init int setup_disableapic(char *str)
{
disable_apic = 1;
setup_clear_cpu_cap(X86_FEATURE_APIC);
clear_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);
return 0;
}
early_param("disableapic", setup_disableapic);
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/x86/kernel/cpu/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
extern void vide(void);
__asm__(".align 4\nvide: ret");

int force_mwait __cpuinitdata;

static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
{
if (cpuid_eax(0x80000000) >= 0x80000007) {
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/x86/kernel/cpu/common_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
c->x86_capability[2] = cpuid_edx(0x80860001);
}

c->extended_cpuid_level = cpuid_eax(0x80000000);
if (c->extended_cpuid_level >= 0x80000007)
c->x86_power = cpuid_edx(0x80000007);

Expand All @@ -323,6 +324,10 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
cpu_devs[c->x86_vendor]->c_early_init(c);

validate_pat_support(c);

/* early_param could clear that, but recall get it set again */
if (disable_apic)
clear_cpu_cap(c, X86_FEATURE_APIC);
}

/*
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ unsigned long idle_nomwait;
EXPORT_SYMBOL(idle_nomwait);

struct kmem_cache *task_xstate_cachep;
static int force_mwait __cpuinitdata;

int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
{
Expand Down
118 changes: 65 additions & 53 deletions trunk/arch/x86/kernel/traps_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
#include <asm/nmi.h>
#include <asm/smp.h>
#include <asm/io.h>
#include <asm/traps.h>

#include "mach_traps.h"

Expand All @@ -78,6 +77,26 @@ char ignore_fpu_irq;
gate_desc idt_table[256]
__attribute__((__section__(".data.idt"))) = { { { { 0, 0 } } }, };

asmlinkage void divide_error(void);
asmlinkage void debug(void);
asmlinkage void nmi(void);
asmlinkage void int3(void);
asmlinkage void overflow(void);
asmlinkage void bounds(void);
asmlinkage void invalid_op(void);
asmlinkage void device_not_available(void);
asmlinkage void coprocessor_segment_overrun(void);
asmlinkage void invalid_TSS(void);
asmlinkage void segment_not_present(void);
asmlinkage void stack_segment(void);
asmlinkage void general_protection(void);
asmlinkage void page_fault(void);
asmlinkage void coprocessor_error(void);
asmlinkage void simd_coprocessor_error(void);
asmlinkage void alignment_check(void);
asmlinkage void spurious_interrupt_bug(void);
asmlinkage void machine_check(void);

int panic_on_unrecovered_nmi;
int kstack_depth_to_print = 24;
static unsigned int code_bytes = 64;
Expand Down Expand Up @@ -237,7 +256,7 @@ static const struct stacktrace_ops print_trace_ops = {

static void
show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
unsigned long *stack, unsigned long bp, char *log_lvl)
unsigned long *stack, unsigned long bp, char *log_lvl)
{
dump_trace(task, regs, stack, bp, &print_trace_ops, log_lvl);
printk("%s =======================\n", log_lvl);
Expand Down Expand Up @@ -364,54 +383,6 @@ int is_valid_bugaddr(unsigned long ip)
return ud2 == 0x0b0f;
}

static raw_spinlock_t die_lock = __RAW_SPIN_LOCK_UNLOCKED;
static int die_owner = -1;
static unsigned int die_nest_count;

unsigned __kprobes long oops_begin(void)
{
unsigned long flags;

oops_enter();

if (die_owner != raw_smp_processor_id()) {
console_verbose();
raw_local_irq_save(flags);
__raw_spin_lock(&die_lock);
die_owner = smp_processor_id();
die_nest_count = 0;
bust_spinlocks(1);
} else {
raw_local_irq_save(flags);
}
die_nest_count++;
return flags;
}

void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
{
bust_spinlocks(0);
die_owner = -1;
add_taint(TAINT_DIE);
__raw_spin_unlock(&die_lock);
raw_local_irq_restore(flags);

if (!regs)
return;

if (kexec_should_crash(current))
crash_kexec(regs);

if (in_interrupt())
panic("Fatal exception in interrupt");

if (panic_on_oops)
panic("Fatal exception");

oops_exit();
do_exit(signr);
}

int __kprobes __die(const char *str, struct pt_regs *regs, long err)
{
unsigned short ss;
Expand Down Expand Up @@ -452,9 +423,31 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
*/
void die(const char *str, struct pt_regs *regs, long err)
{
unsigned long flags = oops_begin();
static struct {
raw_spinlock_t lock;
u32 lock_owner;
int lock_owner_depth;
} die = {
.lock = __RAW_SPIN_LOCK_UNLOCKED,
.lock_owner = -1,
.lock_owner_depth = 0
};
unsigned long flags;

oops_enter();

if (die.lock_owner != raw_smp_processor_id()) {
console_verbose();
raw_local_irq_save(flags);
__raw_spin_lock(&die.lock);
die.lock_owner = smp_processor_id();
die.lock_owner_depth = 0;
bust_spinlocks(1);
} else {
raw_local_irq_save(flags);
}

if (die_nest_count < 3) {
if (++die.lock_owner_depth < 3) {
report_bug(regs->ip, regs);

if (__die(str, regs, err))
Expand All @@ -463,7 +456,26 @@ void die(const char *str, struct pt_regs *regs, long err)
printk(KERN_EMERG "Recursive die() failure, output suppressed\n");
}

oops_end(flags, regs, SIGSEGV);
bust_spinlocks(0);
die.lock_owner = -1;
add_taint(TAINT_DIE);
__raw_spin_unlock(&die.lock);
raw_local_irq_restore(flags);

if (!regs)
return;

if (kexec_should_crash(current))
crash_kexec(regs);

if (in_interrupt())
panic("Fatal exception in interrupt");

if (panic_on_oops)
panic("Fatal exception");

oops_exit();
do_exit(SIGSEGV);
}

static inline void
Expand Down
48 changes: 30 additions & 18 deletions trunk/arch/x86/kernel/traps_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,30 @@
#include <asm/pgalloc.h>
#include <asm/proto.h>
#include <asm/pda.h>
#include <asm/traps.h>

#include <mach_traps.h>

asmlinkage void divide_error(void);
asmlinkage void debug(void);
asmlinkage void nmi(void);
asmlinkage void int3(void);
asmlinkage void overflow(void);
asmlinkage void bounds(void);
asmlinkage void invalid_op(void);
asmlinkage void device_not_available(void);
asmlinkage void double_fault(void);
asmlinkage void coprocessor_segment_overrun(void);
asmlinkage void invalid_TSS(void);
asmlinkage void segment_not_present(void);
asmlinkage void stack_segment(void);
asmlinkage void general_protection(void);
asmlinkage void page_fault(void);
asmlinkage void coprocessor_error(void);
asmlinkage void simd_coprocessor_error(void);
asmlinkage void alignment_check(void);
asmlinkage void spurious_interrupt_bug(void);
asmlinkage void machine_check(void);

int panic_on_unrecovered_nmi;
int kstack_depth_to_print = 12;
static unsigned int code_bytes = 64;
Expand Down Expand Up @@ -335,24 +355,17 @@ static const struct stacktrace_ops print_trace_ops = {
.address = print_trace_address,
};

static void
show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
unsigned long *stack, unsigned long bp, char *log_lvl)
{
printk("\nCall Trace:\n");
dump_trace(task, regs, stack, bp, &print_trace_ops, log_lvl);
printk("\n");
}

void show_trace(struct task_struct *task, struct pt_regs *regs,
unsigned long *stack, unsigned long bp)
{
show_trace_log_lvl(task, regs, stack, bp, "");
printk("\nCall Trace:\n");
dump_trace(task, regs, stack, bp, &print_trace_ops, NULL);
printk("\n");
}

static void
show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
unsigned long *sp, unsigned long bp, char *log_lvl)
_show_stack(struct task_struct *task, struct pt_regs *regs,
unsigned long *sp, unsigned long bp)
{
unsigned long *stack;
int i;
Expand Down Expand Up @@ -386,12 +399,12 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
printk(" %016lx", *stack++);
touch_nmi_watchdog();
}
show_trace_log_lvl(task, regs, sp, bp, log_lvl);
show_trace(task, regs, sp, bp);
}

void show_stack(struct task_struct *task, unsigned long *sp)
{
show_stack_log_lvl(task, NULL, sp, 0, "");
_show_stack(task, NULL, sp, 0);
}

/*
Expand Down Expand Up @@ -441,8 +454,7 @@ void show_registers(struct pt_regs *regs)
u8 *ip;

printk("Stack: ");
show_stack_log_lvl(NULL, regs, (unsigned long *)sp,
regs->bp, "");
_show_stack(NULL, regs, (unsigned long *)sp, regs->bp);
printk("\n");

printk(KERN_EMERG "Code: ");
Expand Down Expand Up @@ -506,7 +518,7 @@ unsigned __kprobes long oops_begin(void)
}

void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
{
{
die_owner = -1;
bust_spinlocks(0);
die_nest_count--;
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-x86/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,6 @@ static inline void __sti_mwait(unsigned long eax, unsigned long ecx)

extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx);

extern int force_mwait;

extern void select_idle_routine(const struct cpuinfo_x86 *c);

extern unsigned long boot_option_idle_override;
Expand Down
Loading

0 comments on commit 8a12854

Please sign in to comment.