Merge branch 'linus' into stackprotector
Ingo Molnar [Wed, 15 Oct 2008 11:46:29 +0000 (13:46 +0200)]
Conflicts:
arch/x86/kernel/Makefile
include/asm-x86/pda.h

15 files changed:
1  2 
arch/x86/Kconfig
arch/x86/Kconfig.debug
arch/x86/Makefile
arch/x86/kernel/Makefile
arch/x86/kernel/process_64.c
arch/x86/mm/fault.c
include/asm-x86/pda.h
include/asm-x86/system.h
include/linux/magic.h
include/linux/sched.h
init/main.c
kernel/exit.c
kernel/fork.c
kernel/panic.c
kernel/sched.c

Simple merge
Simple merge
Simple merge
@@@ -13,21 -20,21 +20,22 @@@ endi
  nostackp := $(call cc-option, -fno-stack-protector)
  CFLAGS_vsyscall_64.o  := $(PROFILING) -g0 $(nostackp)
  CFLAGS_hpet.o         := $(nostackp)
- CFLAGS_tsc_64.o               := $(nostackp)
+ CFLAGS_tsc.o          := $(nostackp)
 +CFLAGS_paravirt.o     := $(nostackp)
  
  obj-y                 := process_$(BITS).o signal_$(BITS).o entry_$(BITS).o
- obj-y                 += traps_$(BITS).o irq_$(BITS).o
+ obj-y                 += traps.o irq_$(BITS).o dumpstack_$(BITS).o
  obj-y                 += time_$(BITS).o ioport.o ldt.o
- obj-y                 += setup_$(BITS).o i8259_$(BITS).o setup.o
+ obj-y                 += setup.o i8259.o irqinit_$(BITS).o setup_percpu.o
+ obj-$(CONFIG_X86_VISWS)       += visws_quirks.o
+ obj-$(CONFIG_X86_32)  += probe_roms_32.o
  obj-$(CONFIG_X86_32)  += sys_i386_32.o i386_ksyms_32.o
  obj-$(CONFIG_X86_64)  += sys_x86_64.o x8664_ksyms_64.o
- obj-$(CONFIG_X86_64)  += syscall_64.o vsyscall_64.o setup64.o
- obj-y                 += bootflag.o e820_$(BITS).o
+ obj-$(CONFIG_X86_64)  += syscall_64.o vsyscall_64.o
+ obj-y                 += bootflag.o e820.o
  obj-y                 += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o
  obj-y                 += alternative.o i8253.o pci-nommu.o
- obj-$(CONFIG_X86_64)  += bugs_64.o
- obj-y                 += tsc_$(BITS).o io_delay.o rtc.o
+ obj-y                 += tsc.o io_delay.o rtc.o
  
  obj-$(CONFIG_X86_TRAMPOLINE)  += trampoline.o
  obj-y                         += process.o
@@@ -147,27 -102,13 +103,24 @@@ static inline void play_dead(void
  void cpu_idle(void)
  {
        current_thread_info()->status |= TS_POLLING;
 +
 +      /*
 +       * If we're the non-boot CPU, nothing set the PDA stack
 +       * canary up for us - and if we are the boot CPU we have
 +       * a 0 stack canary. This is a good place for updating
 +       * it, as we wont ever return from this function (so the
 +       * invalid canaries already on the stack wont ever
 +       * trigger):
 +       */
 +      boot_init_stack_canary();
 +
        /* endless idle loop with no priority at all */
        while (1) {
-               tick_nohz_stop_sched_tick();
+               tick_nohz_stop_sched_tick(1);
                while (!need_resched()) {
-                       void (*idle)(void);
  
                        rmb();
-                       idle = pm_idle;
-                       if (!idle)
-                               idle = default_idle;
                        if (cpu_is_offline(smp_processor_id()))
                                play_dead();
                        /*
@@@ -648,11 -634,13 +646,12 @@@ __switch_to(struct task_struct *prev_p
         */
        prev->usersp = read_pda(oldrsp);
        write_pda(oldrsp, next->usersp);
-       write_pda(pcurrent, next_p); 
+       write_pda(pcurrent, next_p);
  
        write_pda(kernelstack,
-       (unsigned long)task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET);
+                 (unsigned long)task_stack_page(next_p) +
+                 THREAD_SIZE - PDA_STACKOFFSET);
  #ifdef CONFIG_CC_STACKPROTECTOR
 -      write_pda(stack_canary, next_p->stack_canary);
        /*
         * Build time only check to make sure the stack_canary is at
         * offset 40 in the pda; this is a gcc ABI requirement
Simple merge
@@@ -19,7 -19,11 +19,9 @@@ struct x8664_pda 
        unsigned long stack_canary;     /* 40 stack canary value */
                                        /* gcc-ABI: this canary MUST be at
                                           offset 40!!! */
 -#endif
        char *irqstackptr;
+       short nodenumber;               /* number of current node (32k max) */
+       short in_bootmem;               /* pda lives in bootmem */
        unsigned int __softirq_pending;
        unsigned int __nmi_count;       /* number of NMI on this CPUs */
        short mmu_state;
@@@ -131,5 -134,4 +132,6 @@@ do {                                                                       
  
  #define PDA_STACKOFFSET (5*8)
  
 +#define refresh_stack_canary() write_pda(stack_canary, current->stack_canary)
- #endif
++
+ #endif /* ASM_X86__PDA_H */
Simple merge
Simple merge
@@@ -1968,21 -1965,15 +1964,28 @@@ static inline unsigned long *end_of_sta
  
  #endif
  
+ static inline int object_is_on_stack(void *obj)
+ {
+       void *stack = task_stack_page(current);
+       return (obj >= stack) && (obj < (stack + THREAD_SIZE));
+ }
  extern void thread_info_cache_init(void);
  
 +#ifdef CONFIG_DEBUG_STACK_USAGE
 +static inline unsigned long stack_not_used(struct task_struct *p)
 +{
 +      unsigned long *n = end_of_stack(p);
 +
 +      do {    /* Skip over canary */
 +              n++;
 +      } while (!*n);
 +
 +      return (unsigned long)n - (unsigned long)end_of_stack(p);
 +}
 +#endif
 +
  /* set thread flags in other task's structures
   * - see asm/thread_info.h for TIF_xxxx flags available
   */
diff --cc init/main.c
Simple merge
diff --cc kernel/exit.c
Simple merge
diff --cc kernel/fork.c
Simple merge
diff --cc kernel/panic.c
Simple merge
diff --cc kernel/sched.c
Simple merge