Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 13 Feb 2008 16:22:41 +0000 (08:22 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 13 Feb 2008 16:22:41 +0000 (08:22 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
  sched: rt-group: refure unrunnable tasks
  sched: rt-group: clean up the ifdeffery
  sched: rt-group: make rt groups scheduling configurable
  sched: rt-group: interface
  sched: rt-group: deal with PI
  sched: fix incorrect irq lock usage in normalize_rt_tasks()
  sched: fair-group: separate tg->shares from task_group_lock
  hrtimer: more hrtimer_init_sleeper() fallout.

12 files changed:
arch/x86/kernel/efi.c
arch/x86/kernel/efi_64.c
arch/x86/kernel/i8253.c
arch/x86/kernel/reboot.c
arch/x86/mm/ioremap.c
arch/x86/mm/pageattr.c
arch/x86/xen/enlighten.c
drivers/acpi/wmi.c
drivers/md/dm-raid1.c
drivers/memstick/host/tifm_ms.c
include/asm-x86/sigcontext.h
kernel/timeconst.pl

index 32dd62b36ff7e200807d1e8ea20651651bd41a9b..cbdf9bacc5758e76132ca77dcc5a36d27ccf01fb 100644 (file)
@@ -384,9 +384,6 @@ static void __init runtime_code_page_mkexec(void)
        efi_memory_desc_t *md;
        void *p;
 
-       if (!(__supported_pte_mask & _PAGE_NX))
-               return;
-
        /* Make EFI runtime service code area executable */
        for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
                md = p;
@@ -428,9 +425,6 @@ void __init efi_enter_virtual_mode(void)
                else
                        va = efi_ioremap(md->phys_addr, size);
 
-               if (md->attribute & EFI_MEMORY_WB)
-                       set_memory_uc(md->virt_addr, size);
-
                md->virt_addr = (u64) (unsigned long) va;
 
                if (!va) {
@@ -439,6 +433,9 @@ void __init efi_enter_virtual_mode(void)
                        continue;
                }
 
+               if (!(md->attribute & EFI_MEMORY_WB))
+                       set_memory_uc(md->virt_addr, size);
+
                systab = (u64) (unsigned long) efi_phys.systab;
                if (md->phys_addr <= systab && systab < end) {
                        systab += md->virt_addr - md->phys_addr;
@@ -476,7 +473,8 @@ void __init efi_enter_virtual_mode(void)
        efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count;
        efi.reset_system = virt_efi_reset_system;
        efi.set_virtual_address_map = virt_efi_set_virtual_address_map;
-       runtime_code_page_mkexec();
+       if (__supported_pte_mask & _PAGE_NX)
+               runtime_code_page_mkexec();
        early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
        memmap.map = NULL;
 }
index 09d5c23309342779ca955e641a408657a7395ec8..d143a1e76b301737c6fc34f2a0d6da656b787038 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/tlbflush.h>
 #include <asm/proto.h>
 #include <asm/efi.h>
+#include <asm/cacheflush.h>
 
 static pgd_t save_pgd __initdata;
 static unsigned long efi_flags __initdata;
@@ -43,22 +44,15 @@ static void __init early_mapping_set_exec(unsigned long start,
                                          unsigned long end,
                                          int executable)
 {
-       pte_t *kpte;
-       unsigned int level;
-
-       while (start < end) {
-               kpte = lookup_address((unsigned long)__va(start), &level);
-               BUG_ON(!kpte);
-               if (executable)
-                       set_pte(kpte, pte_mkexec(*kpte));
-               else
-                       set_pte(kpte, __pte((pte_val(*kpte) | _PAGE_NX) & \
-                                           __supported_pte_mask));
-               if (level == PG_LEVEL_4K)
-                       start = (start + PAGE_SIZE) & PAGE_MASK;
-               else
-                       start = (start + PMD_SIZE) & PMD_MASK;
-       }
+       unsigned long num_pages;
+
+       start &= PMD_MASK;
+       end = (end + PMD_SIZE - 1) & PMD_MASK;
+       num_pages = (end - start) >> PAGE_SHIFT;
+       if (executable)
+               set_memory_x((unsigned long)__va(start), num_pages);
+       else
+               set_memory_nx((unsigned long)__va(start), num_pages);
 }
 
 static void __init early_runtime_code_mapping_set_exec(int executable)
@@ -74,7 +68,7 @@ static void __init early_runtime_code_mapping_set_exec(int executable)
                md = p;
                if (md->type == EFI_RUNTIME_SERVICES_CODE) {
                        unsigned long end;
-                       end = md->phys_addr + (md->num_pages << PAGE_SHIFT);
+                       end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT);
                        early_mapping_set_exec(md->phys_addr, end, executable);
                }
        }
@@ -84,8 +78,8 @@ void __init efi_call_phys_prelog(void)
 {
        unsigned long vaddress;
 
-       local_irq_save(efi_flags);
        early_runtime_code_mapping_set_exec(1);
+       local_irq_save(efi_flags);
        vaddress = (unsigned long)__va(0x0UL);
        save_pgd = *pgd_offset_k(0x0UL);
        set_pgd(pgd_offset_k(0x0UL), *pgd_offset_k(vaddress));
@@ -98,9 +92,9 @@ void __init efi_call_phys_epilog(void)
         * After the lock is released, the original page table is restored.
         */
        set_pgd(pgd_offset_k(0x0UL), save_pgd);
-       early_runtime_code_mapping_set_exec(0);
        __flush_tlb_all();
        local_irq_restore(efi_flags);
+       early_runtime_code_mapping_set_exec(0);
 }
 
 void __init efi_reserve_bootmem(void)
index ef62b07b2b488531255adf0a36824d4172028249..8540abe86ade2d0b1f3fd26ad0dff18b5733a6e1 100644 (file)
@@ -95,7 +95,7 @@ static int pit_next_event(unsigned long delta, struct clock_event_device *evt)
  * registered. This mechanism replaces the previous #ifdef LOCAL_APIC -
  * !using_apic_timer decisions in do_timer_interrupt_hook()
  */
-struct clock_event_device pit_clockevent = {
+static struct clock_event_device pit_clockevent = {
        .name           = "pit",
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .set_mode       = init_pit_timer,
index 5818dc28167d71bee82c305a85410192ef59e2b1..7fd6ac43e4a114a6de9826fe71c7a0cede037c69 100644 (file)
@@ -326,7 +326,7 @@ static inline void kb_wait(void)
        }
 }
 
-void machine_emergency_restart(void)
+static void native_machine_emergency_restart(void)
 {
        int i;
 
@@ -376,7 +376,7 @@ void machine_emergency_restart(void)
        }
 }
 
-void machine_shutdown(void)
+static void native_machine_shutdown(void)
 {
        /* Stop the cpus and apics */
 #ifdef CONFIG_SMP
@@ -420,7 +420,7 @@ void machine_shutdown(void)
 #endif
 }
 
-void machine_restart(char *__unused)
+static void native_machine_restart(char *__unused)
 {
        printk("machine restart\n");
 
@@ -429,11 +429,11 @@ void machine_restart(char *__unused)
        machine_emergency_restart();
 }
 
-void machine_halt(void)
+static void native_machine_halt(void)
 {
 }
 
-void machine_power_off(void)
+static void native_machine_power_off(void)
 {
        if (pm_power_off) {
                if (!reboot_force)
@@ -443,9 +443,35 @@ void machine_power_off(void)
 }
 
 struct machine_ops machine_ops = {
-       .power_off = machine_power_off,
-       .shutdown = machine_shutdown,
-       .emergency_restart = machine_emergency_restart,
-       .restart = machine_restart,
-       .halt = machine_halt
+       .power_off = native_machine_power_off,
+       .shutdown = native_machine_shutdown,
+       .emergency_restart = native_machine_emergency_restart,
+       .restart = native_machine_restart,
+       .halt = native_machine_halt
 };
+
+void machine_power_off(void)
+{
+       machine_ops.power_off();
+}
+
+void machine_shutdown(void)
+{
+       machine_ops.shutdown();
+}
+
+void machine_emergency_restart(void)
+{
+       machine_ops.emergency_restart();
+}
+
+void machine_restart(char *cmd)
+{
+       machine_ops.restart(cmd);
+}
+
+void machine_halt(void)
+{
+       machine_ops.halt();
+}
+
index a4897a85268a5274d76145783a240426e6d456b7..9f42d7e9c15829431ed31c90fd993750adf9791f 100644 (file)
@@ -265,7 +265,9 @@ static __initdata pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)]
 
 static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
 {
-       pgd_t *pgd = &swapper_pg_dir[pgd_index(addr)];
+       /* Don't assume we're using swapper_pg_dir at this point */
+       pgd_t *base = __va(read_cr3());
+       pgd_t *pgd = &base[pgd_index(addr)];
        pud_t *pud = pud_offset(pgd, addr);
        pmd_t *pmd = pmd_offset(pud, addr);
 
index 440210a2277d3d6a710dcb713792e377f8306d89..bd61ed13f9cf5a1c13b2e7a052e5bc009001866d 100644 (file)
@@ -275,8 +275,8 @@ try_preserve_large_page(pte_t *kpte, unsigned long address,
                break;
 #ifdef CONFIG_X86_64
        case PG_LEVEL_1G:
-               psize = PMD_PAGE_SIZE;
-               pmask = PMD_PAGE_MASK;
+               psize = PUD_PAGE_SIZE;
+               pmask = PUD_PAGE_MASK;
                break;
 #endif
        default:
index de647bc6e74db4e8bf42169d5ae9c5f37a3ad4a5..49e5358f481a2fdcb5e7eec2c2d4087ec256786a 100644 (file)
@@ -798,6 +798,10 @@ static __init void xen_pagetable_setup_start(pgd_t *base)
         * added to the table can be prepared properly for Xen.
         */
        xen_write_cr3(__pa(base));
+
+       /* Unpin initial Xen pagetable */
+       pin_pagetable_pfn(MMUEXT_UNPIN_TABLE,
+                         PFN_DOWN(__pa(xen_start_info->pt_base)));
 }
 
 static __init void xen_pagetable_setup_done(pgd_t *base)
index 457ed3d3f51cd3bcd7841eadc694e60c17404b30..efacc9f8bfe31a0b9c84b5aec4ea11c8285dc527 100644 (file)
@@ -247,7 +247,7 @@ u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
        block = &wblock->gblock;
        handle = wblock->handle;
 
-       if (!block->flags & ACPI_WMI_METHOD)
+       if (!(block->flags & ACPI_WMI_METHOD))
                return AE_BAD_DATA;
 
        if (block->instance_count < instance)
index edc057f5cdccf2b07dc09dcfe83fda5f37a811cb..2928ef228101e941ff3876b454601d59b938a1ac 100644 (file)
@@ -124,7 +124,7 @@ enum dm_raid1_error {
 struct mirror {
        struct mirror_set *ms;
        atomic_t error_count;
-       uint32_t error_type;
+       unsigned long error_type;
        struct dm_dev *dev;
        sector_t offset;
 };
index f55b71a4337db81acd78606dc5c3fd24c26cba1d..4fb24215bd952aba5a8ab20dc59cd22bee24f87c 100644 (file)
@@ -282,7 +282,7 @@ static int tifm_ms_issue_cmd(struct tifm_ms *host)
 
                        writel(TIFM_MS_SYS_LATCH
                               | readl(sock->addr + SOCK_MS_SYSTEM),
-                              sock + SOCK_MS_SYSTEM);
+                              sock->addr + SOCK_MS_SYSTEM);
                        writel(0, sock->addr + SOCK_MS_DATA);
                        dev_dbg(&sock->dev, "writing %x\n", 0);
 
index 681deade5f0005d5ac0938104b377712997257a8..d743947f4c77af5c5dcd7ce10eee31d9176a41c6 100644 (file)
@@ -58,6 +58,7 @@ struct _fpstate {
 
 #define X86_FXSR_MAGIC         0x0000
 
+#ifdef __KERNEL__
 struct sigcontext {
        unsigned short gs, __gsh;
        unsigned short fs, __fsh;
@@ -82,6 +83,35 @@ struct sigcontext {
        unsigned long oldmask;
        unsigned long cr2;
 };
+#else /* __KERNEL__ */
+/*
+ * User-space might still rely on the old definition:
+ */
+struct sigcontext {
+       unsigned short gs, __gsh;
+       unsigned short fs, __fsh;
+       unsigned short es, __esh;
+       unsigned short ds, __dsh;
+       unsigned long edi;
+       unsigned long esi;
+       unsigned long ebp;
+       unsigned long esp;
+       unsigned long ebx;
+       unsigned long edx;
+       unsigned long ecx;
+       unsigned long eax;
+       unsigned long trapno;
+       unsigned long err;
+       unsigned long eip;
+       unsigned short cs, __csh;
+       unsigned long eflags;
+       unsigned long esp_at_signal;
+       unsigned short ss, __ssh;
+       struct _fpstate __user * fpstate;
+       unsigned long oldmask;
+       unsigned long cr2;
+};
+#endif /* !__KERNEL__ */
 
 #else /* __i386__ */
 
@@ -102,6 +132,7 @@ struct _fpstate {
        __u32   reserved2[24];
 };
 
+#ifdef __KERNEL__
 struct sigcontext {
        unsigned long r8;
        unsigned long r9;
@@ -132,6 +163,41 @@ struct sigcontext {
        struct _fpstate __user *fpstate;        /* zero when no FPU context */
        unsigned long reserved1[8];
 };
+#else /* __KERNEL__ */
+/*
+ * User-space might still rely on the old definition:
+ */
+struct sigcontext {
+       unsigned long r8;
+       unsigned long r9;
+       unsigned long r10;
+       unsigned long r11;
+       unsigned long r12;
+       unsigned long r13;
+       unsigned long r14;
+       unsigned long r15;
+       unsigned long rdi;
+       unsigned long rsi;
+       unsigned long rbp;
+       unsigned long rbx;
+       unsigned long rdx;
+       unsigned long rax;
+       unsigned long rcx;
+       unsigned long rsp;
+       unsigned long rip;
+       unsigned long eflags;           /* RFLAGS */
+       unsigned short cs;
+       unsigned short gs;
+       unsigned short fs;
+       unsigned short __pad0;
+       unsigned long err;
+       unsigned long trapno;
+       unsigned long oldmask;
+       unsigned long cr2;
+       struct _fpstate __user *fpstate;        /* zero when no FPU context */
+       unsigned long reserved1[8];
+};
+#endif /* !__KERNEL__ */
 
 #endif /* !__i386__ */
 
index 62b1287932ed4c8506ad2b8151c2dd778262b36e..41468035473ccbb943495466159173058862d6f0 100644 (file)
@@ -339,7 +339,7 @@ sub output($@)
        print "\n";
 
        foreach $pfx ('HZ_TO_MSEC','MSEC_TO_HZ',
-                     'USEC_TO_HZ','HZ_TO_USEC') {
+                     'HZ_TO_USEC','USEC_TO_HZ') {
                foreach $bit (32, 64) {
                        foreach $suf ('MUL', 'ADJ', 'SHR') {
                                printf "#define %-23s %s\n",