]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'x86/urgent' into x86/core
authorIngo Molnar <mingo@elte.hu>
Thu, 5 Mar 2009 20:48:31 +0000 (21:48 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 5 Mar 2009 20:48:50 +0000 (21:48 +0100)
Conflicts:
arch/x86/include/asm/fixmap_64.h
Semantic merge:
arch/x86/include/asm/fixmap.h

Signed-off-by: Ingo Molnar <mingo@elte.hu>
1  2 
Makefile
arch/x86/include/asm/fixmap.h
arch/x86/kernel/efi.c
arch/x86/kernel/efi_64.c
arch/x86/kernel/reboot.c
arch/x86/kernel/setup.c
include/linux/sched.h
init/main.c
kernel/sched.c

diff --combined Makefile
index 27fb890a2bffe029236a2199637518bdaf951c6c,d04ee0ad1dccce7ea2503637ffbe6d8753074ffe..c40d83aedebef6cddffa500c6c97271340a79a21
+++ b/Makefile
@@@ -1,7 -1,7 +1,7 @@@
  VERSION = 2
  PATCHLEVEL = 6
  SUBLEVEL = 29
- EXTRAVERSION = -rc6
+ EXTRAVERSION = -rc7
  NAME = Erotic Pickled Herring
  
  # *DOCUMENTATION*
@@@ -533,9 -533,8 +533,9 @@@ KBUILD_CFLAGS += $(call cc-option,-Wfra
  endif
  
  # Force gcc to behave correct even for buggy distributions
 -# Arch Makefiles may override this setting
 +ifndef CONFIG_CC_STACKPROTECTOR
  KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
 +endif
  
  ifdef CONFIG_FRAME_POINTER
  KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
index dca8f03da5b29574af570717c435ea3a5320f22e,23696d44a0af85fb2d3bf407d8b44def4874bf81..63a79c77d220058f74eb81a70e70e3f3721be76d
 +/*
 + * fixmap.h: compile-time virtual memory allocation
 + *
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
 + * for more details.
 + *
 + * Copyright (C) 1998 Ingo Molnar
 + *
 + * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
 + * x86_32 and x86_64 integration by Gustavo F. Padovan, February 2009
 + */
 +
  #ifndef _ASM_X86_FIXMAP_H
  #define _ASM_X86_FIXMAP_H
  
- #ifdef CONFIG_EFI
- #include <asm/efi.h>
- #endif
 +#ifndef __ASSEMBLY__
 +#include <linux/kernel.h>
 +#include <asm/acpi.h>
 +#include <asm/apicdef.h>
 +#include <asm/page.h>
 +#ifdef CONFIG_X86_32
 +#include <linux/threads.h>
 +#include <asm/kmap_types.h>
 +#else
 +#include <asm/vsyscall.h>
 +#endif
 +
 +/*
 + * We can't declare FIXADDR_TOP as variable for x86_64 because vsyscall
 + * uses fixmaps that relies on FIXADDR_TOP for proper address calculation.
 + * Because of this, FIXADDR_TOP x86 integration was left as later work.
 + */
 +#ifdef CONFIG_X86_32
 +/* used by vmalloc.c, vsyscall.lds.S.
 + *
 + * Leave one empty page between vmalloc'ed areas and
 + * the start of the fixmap.
 + */
 +extern unsigned long __FIXADDR_TOP;
 +#define FIXADDR_TOP   ((unsigned long)__FIXADDR_TOP)
 +
 +#define FIXADDR_USER_START     __fix_to_virt(FIX_VDSO)
 +#define FIXADDR_USER_END       __fix_to_virt(FIX_VDSO - 1)
 +#else
 +#define FIXADDR_TOP   (VSYSCALL_END-PAGE_SIZE)
 +
 +/* Only covers 32bit vsyscalls currently. Need another set for 64bit. */
 +#define FIXADDR_USER_START    ((unsigned long)VSYSCALL32_VSYSCALL)
 +#define FIXADDR_USER_END      (FIXADDR_USER_START + PAGE_SIZE)
 +#endif
 +
 +
 +/*
 + * Here we define all the compile-time 'special' virtual
 + * addresses. The point is to have a constant address at
 + * compile time, but to set the physical address only
 + * in the boot process.
 + * for x86_32: We allocate these special addresses
 + * from the end of virtual memory (0xfffff000) backwards.
 + * Also this lets us do fail-safe vmalloc(), we
 + * can guarantee that these special addresses and
 + * vmalloc()-ed addresses never overlap.
 + *
 + * These 'compile-time allocated' memory buffers are
 + * fixed-size 4k pages (or larger if used with an increment
 + * higher than 1). Use set_fixmap(idx,phys) to associate
 + * physical memory with fixmap indices.
 + *
 + * TLB entries of such buffers will not be flushed across
 + * task switches.
 + */
 +enum fixed_addresses {
  #ifdef CONFIG_X86_32
 -# include "fixmap_32.h"
 +      FIX_HOLE,
 +      FIX_VDSO,
  #else
 -# include "fixmap_64.h"
 +      VSYSCALL_LAST_PAGE,
 +      VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE
 +                          + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1,
 +      VSYSCALL_HPET,
  #endif
- #ifdef CONFIG_X86_64
- #ifdef CONFIG_EFI
-       FIX_EFI_IO_MAP_LAST_PAGE,
-       FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE
-                                 + MAX_EFI_IO_PAGES - 1,
- #endif
- #endif
 +      FIX_DBGP_BASE,
 +      FIX_EARLYCON_MEM_BASE,
 +#ifdef CONFIG_X86_LOCAL_APIC
 +      FIX_APIC_BASE,  /* local (CPU) APIC) -- required for SMP or not */
 +#endif
 +#ifdef CONFIG_X86_IO_APIC
 +      FIX_IO_APIC_BASE_0,
 +      FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
 +#endif
 +#ifdef CONFIG_X86_VISWS_APIC
 +      FIX_CO_CPU,     /* Cobalt timer */
 +      FIX_CO_APIC,    /* Cobalt APIC Redirection Table */
 +      FIX_LI_PCIA,    /* Lithium PCI Bridge A */
 +      FIX_LI_PCIB,    /* Lithium PCI Bridge B */
 +#endif
 +#ifdef CONFIG_X86_F00F_BUG
 +      FIX_F00F_IDT,   /* Virtual mapping for IDT */
 +#endif
 +#ifdef CONFIG_X86_CYCLONE_TIMER
 +      FIX_CYCLONE_TIMER, /*cyclone timer register*/
 +#endif
 +#ifdef CONFIG_X86_32
 +      FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
 +      FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
 +#ifdef CONFIG_PCI_MMCONFIG
 +      FIX_PCIE_MCFG,
 +#endif
 +#endif
 +#ifdef CONFIG_PARAVIRT
 +      FIX_PARAVIRT_BOOTMAP,
 +#endif
 +      __end_of_permanent_fixed_addresses,
 +#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
 +      FIX_OHCI1394_BASE,
 +#endif
 +      /*
 +       * 256 temporary boot-time mappings, used by early_ioremap(),
 +       * before ioremap() is functional.
 +       *
 +       * We round it up to the next 256 pages boundary so that we
 +       * can have a single pgd entry and a single pte table:
 +       */
 +#define NR_FIX_BTMAPS         64
 +#define FIX_BTMAPS_SLOTS      4
 +      FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
 +                      (__end_of_permanent_fixed_addresses & 255),
 +      FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
 +#ifdef CONFIG_X86_32
 +      FIX_WP_TEST,
 +#endif
 +      __end_of_fixed_addresses
 +};
 +
 +
 +extern void reserve_top_address(unsigned long reserve);
 +
 +#define FIXADDR_SIZE  (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
 +#define FIXADDR_BOOT_SIZE     (__end_of_fixed_addresses << PAGE_SHIFT)
 +#define FIXADDR_START         (FIXADDR_TOP - FIXADDR_SIZE)
 +#define FIXADDR_BOOT_START    (FIXADDR_TOP - FIXADDR_BOOT_SIZE)
  
  extern int fixmaps_set;
  
@@@ -213,5 -69,4 +203,5 @@@ static inline unsigned long virt_to_fix
        BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
        return __virt_to_fix(vaddr);
  }
 +#endif /* !__ASSEMBLY__ */
  #endif /* _ASM_X86_FIXMAP_H */
diff --combined arch/x86/kernel/efi.c
index b205272ad3947e8318659720f73917df8a7bcde5,eb1ef3b67dd50278c7ce88bd92f5895d7f06ede6..1736acc4d7aa6cfc13bc8ebd0db0e2727a8ebf5e
@@@ -366,12 -366,10 +366,12 @@@ void __init efi_init(void
                                        SMBIOS_TABLE_GUID)) {
                        efi.smbios = config_tables[i].table;
                        printk(" SMBIOS=0x%lx ", config_tables[i].table);
 +#ifdef CONFIG_X86_UV
                } else if (!efi_guidcmp(config_tables[i].guid,
                                        UV_SYSTEM_TABLE_GUID)) {
                        efi.uv_systab = config_tables[i].table;
                        printk(" UVsystab=0x%lx ", config_tables[i].table);
 +#endif
                } else if (!efi_guidcmp(config_tables[i].guid,
                                        HCDP_TABLE_GUID)) {
                        efi.hcdp = config_tables[i].table;
@@@ -469,7 -467,7 +469,7 @@@ void __init efi_enter_virtual_mode(void
        efi_memory_desc_t *md;
        efi_status_t status;
        unsigned long size;
-       u64 end, systab, addr, npages;
+       u64 end, systab, addr, npages, end_pfn;
        void *p, *va;
  
        efi.systab = NULL;
                size = md->num_pages << EFI_PAGE_SHIFT;
                end = md->phys_addr + size;
  
-               if (PFN_UP(end) <= max_low_pfn_mapped)
+               end_pfn = PFN_UP(end);
+               if (end_pfn <= max_low_pfn_mapped
+                   || (end_pfn > (1UL << (32 - PAGE_SHIFT))
+                       && end_pfn <= max_pfn_mapped))
                        va = __va(md->phys_addr);
                else
                        va = efi_ioremap(md->phys_addr, size);
diff --combined arch/x86/kernel/efi_64.c
index a4ee29127fdf24d916af929339a12faab1c7e618,cb783b92c50cce5b9d123c8bff127ba967a9b230..22c3b7828c50fa1f0c61e17d6680cbf19d0b6a17
@@@ -36,7 -36,6 +36,7 @@@
  #include <asm/proto.h>
  #include <asm/efi.h>
  #include <asm/cacheflush.h>
 +#include <asm/fixmap.h>
  
  static pgd_t save_pgd __initdata;
  static unsigned long efi_flags __initdata;
@@@ -100,24 -99,11 +100,11 @@@ void __init efi_call_phys_epilog(void
  
  void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size)
  {
-       static unsigned pages_mapped __initdata;
-       unsigned i, pages;
-       unsigned long offset;
+       unsigned long last_map_pfn;
  
-       pages = PFN_UP(phys_addr + size) - PFN_DOWN(phys_addr);
-       offset = phys_addr & ~PAGE_MASK;
-       phys_addr &= PAGE_MASK;
-       if (pages_mapped + pages > MAX_EFI_IO_PAGES)
+       last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size);
+       if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size)
                return NULL;
  
-       for (i = 0; i < pages; i++) {
-               __set_fixmap(FIX_EFI_IO_MAP_FIRST_PAGE - pages_mapped,
-                            phys_addr, PAGE_KERNEL);
-               phys_addr += PAGE_SIZE;
-               pages_mapped++;
-       }
-       return (void __iomem *)__fix_to_virt(FIX_EFI_IO_MAP_FIRST_PAGE - \
-                                            (pages_mapped - pages)) + offset;
+       return (void __iomem *)__va(phys_addr);
  }
diff --combined arch/x86/kernel/reboot.c
index 1cc18d439bbbd377bd6941eece6fa2397508d359,4526b3a75ed2aef73579212c7fde9ca6ed15e946..2aef36d8aca2783a2cf9cb04f74fe9a72c564734
@@@ -14,7 -14,6 +14,7 @@@
  #include <asm/reboot.h>
  #include <asm/pci_x86.h>
  #include <asm/virtext.h>
 +#include <asm/cpu.h>
  
  #ifdef CONFIG_X86_32
  # include <linux/dmi.h>
@@@ -24,6 -23,8 +24,6 @@@
  # include <asm/iommu.h>
  #endif
  
 -#include <mach_ipi.h>
 -
  /*
   * Power off function, if any
   */
@@@ -216,6 -217,14 +216,14 @@@ static struct dmi_system_id __initdata 
                        DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
                },
        },
+       {       /* Handle problems with rebooting on Dell XPS710 */
+               .callback = set_bios_reboot,
+               .ident = "Dell XPS710",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
+               },
+       },
        { }
  };
  
@@@ -649,7 -658,7 +657,7 @@@ static int crash_nmi_callback(struct no
  
  static void smp_send_nmi_allbutself(void)
  {
 -      send_IPI_allbutself(NMI_VECTOR);
 +      apic->send_IPI_allbutself(NMI_VECTOR);
  }
  
  static struct notifier_block crash_nmi_nb = {
diff --combined arch/x86/kernel/setup.c
index 4c54bc0d8ff3cc632f10a2639628dbf0592f7715,6a8811a693245e2b96f8815df4debdc5c9111749..b746deb9ebc649685c4c167f50e525541b8da292
  #include <asm/e820.h>
  #include <asm/mpspec.h>
  #include <asm/setup.h>
 -#include <asm/arch_hooks.h>
  #include <asm/efi.h>
 +#include <asm/timer.h>
 +#include <asm/i8259.h>
  #include <asm/sections.h>
  #include <asm/dmi.h>
  #include <asm/io_apic.h>
  #include <asm/ist.h>
  #include <asm/vmi.h>
 -#include <setup_arch.h>
 +#include <asm/setup_arch.h>
  #include <asm/bios_ebda.h>
  #include <asm/cacheflush.h>
  #include <asm/processor.h>
@@@ -90,7 -89,7 +90,7 @@@
  
  #include <asm/system.h>
  #include <asm/vsyscall.h>
 -#include <asm/smp.h>
 +#include <asm/cpu.h>
  #include <asm/desc.h>
  #include <asm/dma.h>
  #include <asm/iommu.h>
@@@ -98,6 -97,7 +98,6 @@@
  #include <asm/mmu_context.h>
  #include <asm/proto.h>
  
 -#include <mach_apic.h>
  #include <asm/paravirt.h>
  #include <asm/hypervisor.h>
  
  #define ARCH_SETUP
  #endif
  
 +unsigned int boot_cpu_id __read_mostly;
 +
 +#ifdef CONFIG_X86_64
 +int default_cpu_present_to_apicid(int mps_cpu)
 +{
 +      return __default_cpu_present_to_apicid(mps_cpu);
 +}
 +
 +int default_check_phys_apicid_present(int boot_cpu_physical_apicid)
 +{
 +      return __default_check_phys_apicid_present(boot_cpu_physical_apicid);
 +}
 +#endif
 +
  #ifndef CONFIG_DEBUG_BOOT_PARAMS
  struct boot_params __initdata boot_params;
  #else
@@@ -600,7 -586,20 +600,7 @@@ static int __init setup_elfcorehdr(cha
  early_param("elfcorehdr", setup_elfcorehdr);
  #endif
  
 -static int __init default_update_genapic(void)
 -{
 -#ifdef CONFIG_X86_SMP
 -# if defined(CONFIG_X86_GENERICARCH) || defined(CONFIG_X86_64)
 -      genapic->wakeup_cpu = wakeup_secondary_cpu_via_init;
 -# endif
 -#endif
 -
 -      return 0;
 -}
 -
 -static struct x86_quirks default_x86_quirks __initdata = {
 -      .update_genapic         = default_update_genapic,
 -};
 +static struct x86_quirks default_x86_quirks __initdata;
  
  struct x86_quirks *x86_quirks __initdata = &default_x86_quirks;
  
@@@ -657,6 -656,7 +657,6 @@@ void __init setup_arch(char **cmdline_p
  #ifdef CONFIG_X86_32
        memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
        visws_early_detect();
 -      pre_setup_arch_hook();
  #else
        printk(KERN_INFO "Command line: %s\n", boot_command_line);
  #endif
  
        finish_e820_parsing();
  
+       if (efi_enabled)
+               efi_init();
        dmi_scan_machine();
  
        dmi_check_system(bad_bios_dmi_table);
        insert_resource(&iomem_resource, &data_resource);
        insert_resource(&iomem_resource, &bss_resource);
  
-       if (efi_enabled)
-               efi_init();
  
  #ifdef CONFIG_X86_32
        if (ppro_with_ram_bug()) {
  #else
        num_physpages = max_pfn;
  
 -      if (cpu_has_x2apic)
 -              check_x2apic();
 +      check_x2apic();
  
        /* How many end-of-memory variables you have, grandma! */
        /* need this before calling reserve_initrd */
  
        reserve_initrd();
  
 -#ifdef CONFIG_X86_64
        vsmp_init();
 -#endif
  
        io_delay_init();
  
         */
        acpi_reserve_bootmem();
  #endif
 -#ifdef CONFIG_X86_FIND_SMP_CONFIG
        /*
         * Find and reserve possible boot-time SMP configuration:
         */
        find_smp_config();
 -#endif
 +
        reserve_crashkernel();
  
  #ifdef CONFIG_X86_64
        map_vsyscall();
  #endif
  
 -#ifdef CONFIG_X86_GENERICARCH
        generic_apic_probe();
 -#endif
  
        early_quirks();
  
  #endif
  }
  
 +#ifdef CONFIG_X86_32
  
 +/**
 + * x86_quirk_pre_intr_init - initialisation prior to setting up interrupt vectors
 + *
 + * Description:
 + *    Perform any necessary interrupt initialisation prior to setting up
 + *    the "ordinary" interrupt call gates.  For legacy reasons, the ISA
 + *    interrupts should be initialised here if the machine emulates a PC
 + *    in any way.
 + **/
 +void __init x86_quirk_pre_intr_init(void)
 +{
 +      if (x86_quirks->arch_pre_intr_init) {
 +              if (x86_quirks->arch_pre_intr_init())
 +                      return;
 +      }
 +      init_ISA_irqs();
 +}
 +
 +/**
 + * x86_quirk_intr_init - post gate setup interrupt initialisation
 + *
 + * Description:
 + *    Fill in any interrupts that may have been left out by the general
 + *    init_IRQ() routine.  interrupts having to do with the machine rather
 + *    than the devices on the I/O bus (like APIC interrupts in intel MP
 + *    systems) are started here.
 + **/
 +void __init x86_quirk_intr_init(void)
 +{
 +      if (x86_quirks->arch_intr_init) {
 +              if (x86_quirks->arch_intr_init())
 +                      return;
 +      }
 +}
 +
 +/**
 + * x86_quirk_trap_init - initialise system specific traps
 + *
 + * Description:
 + *    Called as the final act of trap_init().  Used in VISWS to initialise
 + *    the various board specific APIC traps.
 + **/
 +void __init x86_quirk_trap_init(void)
 +{
 +      if (x86_quirks->arch_trap_init) {
 +              if (x86_quirks->arch_trap_init())
 +                      return;
 +      }
 +}
 +
 +static struct irqaction irq0  = {
 +      .handler = timer_interrupt,
 +      .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER,
 +      .mask = CPU_MASK_NONE,
 +      .name = "timer"
 +};
 +
 +/**
 + * x86_quirk_pre_time_init - do any specific initialisations before.
 + *
 + **/
 +void __init x86_quirk_pre_time_init(void)
 +{
 +      if (x86_quirks->arch_pre_time_init)
 +              x86_quirks->arch_pre_time_init();
 +}
 +
 +/**
 + * x86_quirk_time_init - do any specific initialisations for the system timer.
 + *
 + * Description:
 + *    Must plug the system timer interrupt source at HZ into the IRQ listed
 + *    in irq_vectors.h:TIMER_IRQ
 + **/
 +void __init x86_quirk_time_init(void)
 +{
 +      if (x86_quirks->arch_time_init) {
 +              /*
 +               * A nonzero return code does not mean failure, it means
 +               * that the architecture quirk does not want any
 +               * generic (timer) setup to be performed after this:
 +               */
 +              if (x86_quirks->arch_time_init())
 +                      return;
 +      }
 +
 +      irq0.mask = cpumask_of_cpu(0);
 +      setup_irq(0, &irq0);
 +}
 +#endif /* CONFIG_X86_32 */
diff --combined include/linux/sched.h
index f0a50b20e8a03c2f98dec1cd859aa6e06853f7e2,8c216e057c94230ea01c110b0f5bc2c28e8f9ee3..a7c7698583bb15bae4de5b0da9b8aeda61019c5f
@@@ -1178,9 -1178,10 +1178,9 @@@ struct task_struct 
        pid_t pid;
        pid_t tgid;
  
 -#ifdef CONFIG_CC_STACKPROTECTOR
        /* Canary value for the -fstack-protector gcc feature */
        unsigned long stack_canary;
 -#endif
 +
        /* 
         * pointers to (original) parent process, youngest child, younger sibling,
         * older sibling, respectively.  (p->father can be replaced with 
@@@ -2086,19 -2087,6 +2086,19 @@@ static inline int object_is_on_stack(vo
  
  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
   */
@@@ -2303,9 -2291,13 +2303,13 @@@ extern long sched_group_rt_runtime(stru
  extern int sched_group_set_rt_period(struct task_group *tg,
                                      long rt_period_us);
  extern long sched_group_rt_period(struct task_group *tg);
+ extern int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk);
  #endif
  #endif
  
+ extern int task_can_switch_user(struct user_struct *up,
+                                       struct task_struct *tsk);
  #ifdef CONFIG_TASK_XACCT
  static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
  {
diff --combined init/main.c
index 6441083f827355108980280d7c7dd08f1ec16f5e,83697e160b3a786d3d91c14000f116a441f61bfc..6bf83afd654da44b5b52383a4697d4d98e0ff6fa
@@@ -14,7 -14,6 +14,7 @@@
  #include <linux/proc_fs.h>
  #include <linux/kernel.h>
  #include <linux/syscalls.h>
 +#include <linux/stackprotector.h>
  #include <linux/string.h>
  #include <linux/ctype.h>
  #include <linux/delay.h>
@@@ -98,7 -97,7 +98,7 @@@ static inline void mark_rodata_ro(void
  extern void tc_init(void);
  #endif
  
- enum system_states system_state;
+ enum system_states system_state __read_mostly;
  EXPORT_SYMBOL(system_state);
  
  /*
@@@ -136,14 -135,14 +136,14 @@@ unsigned int __initdata setup_max_cpus 
   * greater than 0, limits the maximum number of CPUs activated in
   * SMP mode to <NUM>.
   */
 -#ifndef CONFIG_X86_IO_APIC
 -static inline void disable_ioapic_setup(void) {};
 -#endif
 +
 +void __weak arch_disable_smp_support(void) { }
  
  static int __init nosmp(char *str)
  {
        setup_max_cpus = 0;
 -      disable_ioapic_setup();
 +      arch_disable_smp_support();
 +
        return 0;
  }
  
@@@ -153,14 -152,14 +153,14 @@@ static int __init maxcpus(char *str
  {
        get_option(&str, &setup_max_cpus);
        if (setup_max_cpus == 0)
 -              disable_ioapic_setup();
 +              arch_disable_smp_support();
  
        return 0;
  }
  
  early_param("maxcpus", maxcpus);
  #else
 -#define setup_max_cpus NR_CPUS
 +const unsigned int setup_max_cpus = NR_CPUS;
  #endif
  
  /*
@@@ -464,6 -463,7 +464,7 @@@ static noinline void __init_refok rest_
         * at least once to get things moving:
         */
        init_idle_bootup_task(current);
+       rcu_scheduler_starting();
        preempt_enable_no_resched();
        schedule();
        preempt_disable();
@@@ -540,12 -540,6 +541,12 @@@ asmlinkage void __init start_kernel(voi
         */
        lockdep_init();
        debug_objects_early_init();
 +
 +      /*
 +       * Set up the the initial canary ASAP:
 +       */
 +      boot_init_stack_canary();
 +
        cgroup_init_early();
  
        local_irq_disable();
diff --combined kernel/sched.c
index 0e5c38e1c8b5cdad3e2ab022fa8db8f79b88316c,8e2558c2ba67be440ef7bcb2d95ff8138c806404..0a76d0b6f2151e587a1ce04f8c1eba56da95d773
@@@ -223,7 -223,7 +223,7 @@@ static void start_rt_bandwidth(struct r
  {
        ktime_t now;
  
-       if (rt_bandwidth_enabled() && rt_b->rt_runtime == RUNTIME_INF)
+       if (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF)
                return;
  
        if (hrtimer_active(&rt_b->rt_period_timer))
@@@ -5944,7 -5944,12 +5944,7 @@@ void sched_show_task(struct task_struc
                printk(KERN_CONT " %016lx ", thread_saved_pc(p));
  #endif
  #ifdef CONFIG_DEBUG_STACK_USAGE
 -      {
 -              unsigned long *n = end_of_stack(p);
 -              while (!*n)
 -                      n++;
 -              free = (unsigned long)n - (unsigned long)end_of_stack(p);
 -      }
 +      free = stack_not_used(p);
  #endif
        printk(KERN_CONT "%5lu %5d %6d\n", free,
                task_pid_nr(p), task_pid_nr(p->real_parent));
@@@ -9219,6 -9224,16 +9219,16 @@@ static int sched_rt_global_constraints(
  
        return ret;
  }
+ int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk)
+ {
+       /* Don't accept realtime tasks when there is no way for them to run */
+       if (rt_task(tsk) && tg->rt_bandwidth.rt_runtime == 0)
+               return 0;
+       return 1;
+ }
  #else /* !CONFIG_RT_GROUP_SCHED */
  static int sched_rt_global_constraints(void)
  {
@@@ -9312,8 -9327,7 +9322,7 @@@ cpu_cgroup_can_attach(struct cgroup_sub
                      struct task_struct *tsk)
  {
  #ifdef CONFIG_RT_GROUP_SCHED
-       /* Don't accept realtime tasks when there is no way for them to run */
-       if (rt_task(tsk) && cgroup_tg(cgrp)->rt_bandwidth.rt_runtime == 0)
+       if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk))
                return -EINVAL;
  #else
        /* We don't support RT-tasks being in separate groups */
@@@ -9476,7 -9490,7 +9485,7 @@@ cpuacct_destroy(struct cgroup_subsys *s
  
  static u64 cpuacct_cpuusage_read(struct cpuacct *ca, int cpu)
  {
 -      u64 *cpuusage = percpu_ptr(ca->cpuusage, cpu);
 +      u64 *cpuusage = per_cpu_ptr(ca->cpuusage, cpu);
        u64 data;
  
  #ifndef CONFIG_64BIT
  
  static void cpuacct_cpuusage_write(struct cpuacct *ca, int cpu, u64 val)
  {
 -      u64 *cpuusage = percpu_ptr(ca->cpuusage, cpu);
 +      u64 *cpuusage = per_cpu_ptr(ca->cpuusage, cpu);
  
  #ifndef CONFIG_64BIT
        /*
@@@ -9591,7 -9605,7 +9600,7 @@@ static void cpuacct_charge(struct task_
        ca = task_ca(tsk);
  
        for (; ca; ca = ca->parent) {
 -              u64 *cpuusage = percpu_ptr(ca->cpuusage, cpu);
 +              u64 *cpuusage = per_cpu_ptr(ca->cpuusage, cpu);
                *cpuusage += cputime;
        }
  }