]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'iommu-fixes-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorIngo Molnar <mingo@elte.hu>
Tue, 18 Nov 2008 15:48:49 +0000 (16:48 +0100)
committerIngo Molnar <mingo@elte.hu>
Tue, 18 Nov 2008 15:48:49 +0000 (16:48 +0100)
arch/x86/Kconfig
arch/x86/include/asm/iomap.h [moved from include/asm-x86/iomap.h with 100% similarity]
arch/x86/kernel/ds.c
arch/x86/kernel/es7000_32.c
arch/x86/kernel/setup.c
arch/x86/kernel/tsc_sync.c
arch/x86/mach-voyager/voyager_smp.c
drivers/xen/balloon.c

index 93224b56918798ac9b6bae7c6210602ef42604de..fd2de7019537dabe1c47f537237464c46f2438d2 100644 (file)
@@ -167,9 +167,12 @@ config GENERIC_PENDING_IRQ
 config X86_SMP
        bool
        depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64)
-       select USE_GENERIC_SMP_HELPERS
        default y
 
+config USE_GENERIC_SMP_HELPERS
+       def_bool y
+       depends on SMP
+
 config X86_32_SMP
        def_bool y
        depends on X86_32 && SMP
index 2b69994fd3a800458f4d81abbebad357405eac69..d1a121443bde5b571c2e853734b006cbb100fbcb 100644 (file)
@@ -236,17 +236,33 @@ static inline struct ds_context *ds_alloc_context(struct task_struct *task)
        struct ds_context *context = *p_context;
 
        if (!context) {
+               spin_unlock(&ds_lock);
+
                context = kzalloc(sizeof(*context), GFP_KERNEL);
 
-               if (!context)
+               if (!context) {
+                       spin_lock(&ds_lock);
                        return NULL;
+               }
 
                context->ds = kzalloc(ds_cfg.sizeof_ds, GFP_KERNEL);
                if (!context->ds) {
                        kfree(context);
+                       spin_lock(&ds_lock);
                        return NULL;
                }
 
+               spin_lock(&ds_lock);
+               /*
+                * Check for race - another CPU could have allocated
+                * it meanwhile:
+                */
+               if (*p_context) {
+                       kfree(context->ds);
+                       kfree(context);
+                       return *p_context;
+               }
+
                *p_context = context;
 
                context->this = p_context;
@@ -384,14 +400,15 @@ static int ds_request(struct task_struct *task, void *base, size_t size,
 
        spin_lock(&ds_lock);
 
-       if (!check_tracer(task))
-               return -EPERM;
-
        error = -ENOMEM;
        context = ds_alloc_context(task);
        if (!context)
                goto out_unlock;
 
+       error = -EPERM;
+       if (!check_tracer(task))
+               goto out_unlock;
+
        error = -EALREADY;
        if (context->owner[qual] == current)
                goto out_unlock;
index f454c78fcef6c7172db2fc0088548974f2f083e1..0aa2c443d600c64dcf5b4ac440c18bb4f3d0e9d9 100644 (file)
@@ -250,31 +250,24 @@ int __init find_unisys_acpi_oem_table(unsigned long *oem_addr)
 {
        struct acpi_table_header *header = NULL;
        int i = 0;
-       acpi_size tbl_size;
 
-       while (ACPI_SUCCESS(acpi_get_table_with_size("OEM1", i++, &header, &tbl_size))) {
+       while (ACPI_SUCCESS(acpi_get_table("OEM1", i++, &header))) {
                if (!memcmp((char *) &header->oem_id, "UNISYS", 6)) {
                        struct oem_table *t = (struct oem_table *)header;
 
                        oem_addrX = t->OEMTableAddr;
                        oem_size = t->OEMTableSize;
-                       early_acpi_os_unmap_memory(header, tbl_size);
 
                        *oem_addr = (unsigned long)__acpi_map_table(oem_addrX,
                                                                    oem_size);
                        return 0;
                }
-               early_acpi_os_unmap_memory(header, tbl_size);
        }
        return -1;
 }
 
 void __init unmap_unisys_acpi_oem_table(unsigned long oem_addr)
 {
-       if (!oem_addr)
-               return;
-
-       __acpi_unmap_table((char *)oem_addr, oem_size);
 }
 #endif
 
index 0fa6790c1dd37d76e257de661ba3ed9312de89e0..9d5674f7b6ccbfbdef7f5ad16901f9dc9dc08ad0 100644 (file)
@@ -764,7 +764,7 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
                .callback = dmi_low_memory_corruption,
                .ident = "Phoenix BIOS",
                .matches = {
-                       DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
+                       DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"),
                },
        },
 #endif
index 9ffb01c31c40a8c9083e9949d065a442a62f46b7..1c0dfbca87c18a05beb42cebaa8e9ffed6d508a1 100644 (file)
@@ -46,7 +46,9 @@ static __cpuinit void check_tsc_warp(void)
        cycles_t start, now, prev, end;
        int i;
 
+       rdtsc_barrier();
        start = get_cycles();
+       rdtsc_barrier();
        /*
         * The measurement runs for 20 msecs:
         */
@@ -61,7 +63,9 @@ static __cpuinit void check_tsc_warp(void)
                 */
                __raw_spin_lock(&sync_lock);
                prev = last_tsc;
+               rdtsc_barrier();
                now = get_cycles();
+               rdtsc_barrier();
                last_tsc = now;
                __raw_spin_unlock(&sync_lock);
 
index 0e331652681e4a247122f2381861b0403f88b93c..52145007bd7efb8e99a9516ddeb09af6ea1e445b 100644 (file)
@@ -7,6 +7,7 @@
  * This file provides all the same external entries as smp.c but uses
  * the voyager hal to provide the functionality
  */
+#include <linux/cpu.h>
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/kernel_stat.h>
@@ -1790,6 +1791,17 @@ void __init smp_setup_processor_id(void)
        x86_write_percpu(cpu_number, hard_smp_processor_id());
 }
 
+static void voyager_send_call_func(cpumask_t callmask)
+{
+       __u32 mask = cpus_addr(callmask)[0] & ~(1 << smp_processor_id());
+       send_CPI(mask, VIC_CALL_FUNCTION_CPI);
+}
+
+static void voyager_send_call_func_single(int cpu)
+{
+       send_CPI(1 << cpu, VIC_CALL_FUNCTION_SINGLE_CPI);
+}
+
 struct smp_ops smp_ops = {
        .smp_prepare_boot_cpu = voyager_smp_prepare_boot_cpu,
        .smp_prepare_cpus = voyager_smp_prepare_cpus,
@@ -1799,6 +1811,6 @@ struct smp_ops smp_ops = {
        .smp_send_stop = voyager_smp_send_stop,
        .smp_send_reschedule = voyager_smp_send_reschedule,
 
-       .send_call_func_ipi = native_send_call_func_ipi,
-       .send_call_func_single_ipi = native_send_call_func_single_ipi,
+       .send_call_func_ipi = voyager_send_call_func,
+       .send_call_func_single_ipi = voyager_send_call_func_single,
 };
index a0fb5eac407c78b07f54f281db70664b78f761a6..526c191e84ea9cfd32d0a6252e27046a90cfc6f4 100644 (file)
@@ -122,14 +122,7 @@ static struct timer_list balloon_timer;
 static void scrub_page(struct page *page)
 {
 #ifdef CONFIG_XEN_SCRUB_PAGES
-       if (PageHighMem(page)) {
-               void *v = kmap(page);
-               clear_page(v);
-               kunmap(v);
-       } else {
-               void *v = page_address(page);
-               clear_page(v);
-       }
+       clear_highpage(page);
 #endif
 }