Update to 3.4-final.
[linux-flexiantxendom0-3.2.10.git] / arch / x86 / kernel / acpi / boot.c
index 7c439fe..79c14db 100644 (file)
@@ -70,6 +70,7 @@ int acpi_strict;
 
 u8 acpi_sci_flags __initdata;
 int acpi_sci_override_gsi __initdata;
+#ifndef CONFIG_XEN
 int acpi_skip_timer_override __initdata;
 int acpi_use_timer_override __initdata;
 int acpi_fix_pin2_polarity __initdata;
@@ -77,6 +78,10 @@ int acpi_fix_pin2_polarity __initdata;
 #ifdef CONFIG_X86_LOCAL_APIC
 static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
 #endif
+#else
+#define acpi_skip_timer_override 0
+#define acpi_fix_pin2_polarity 0
+#endif
 
 #ifndef __HAVE_ARCH_CMPXCHG
 #warning ACPI uses CMPXCHG, i486 and later hardware
@@ -182,6 +187,7 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
                return -ENODEV;
        }
 
+#ifndef CONFIG_XEN
        if (madt->address) {
                acpi_lapic_addr = (u64) madt->address;
 
@@ -191,12 +197,14 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
 
        default_acpi_madt_oem_check(madt->header.oem_id,
                                    madt->header.oem_table_id);
+#endif
 
        return 0;
 }
 
 static void __cpuinit acpi_register_lapic(int id, u8 enabled)
 {
+#ifndef CONFIG_XEN
        unsigned int ver = 0;
 
        if (id >= (MAX_LOCAL_APIC-1)) {
@@ -213,6 +221,7 @@ static void __cpuinit acpi_register_lapic(int id, u8 enabled)
                ver = apic_version[boot_cpu_physical_apicid];
 
        generic_processor_info(id, ver);
+#endif
 }
 
 static int __init
@@ -243,7 +252,7 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
                printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
        else
                acpi_register_lapic(apic_id, enabled);
-#else
+#elif !defined(CONFIG_XEN)
        printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
 #endif
 
@@ -297,6 +306,7 @@ static int __init
 acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header,
                          const unsigned long end)
 {
+#ifndef CONFIG_XEN
        struct acpi_madt_local_apic_override *lapic_addr_ovr = NULL;
 
        lapic_addr_ovr = (struct acpi_madt_local_apic_override *)header;
@@ -305,6 +315,7 @@ acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header,
                return -EINVAL;
 
        acpi_lapic_addr = lapic_addr_ovr->address;
+#endif
 
        return 0;
 }
@@ -593,6 +604,7 @@ void __init acpi_set_irq_model_ioapic(void)
 #ifdef CONFIG_ACPI_HOTPLUG_CPU
 #include <acpi/processor.h>
 
+#ifndef CONFIG_XEN
 static void __cpuinit acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
 {
 #ifdef CONFIG_ACPI_NUMA
@@ -679,6 +691,9 @@ free_tmp_map:
 out:
        return retval;
 }
+#else
+#define _acpi_map_lsapic(h, p) (-EINVAL)
+#endif
 
 /* wrapper to silence section mismatch warning */
 int __ref acpi_map_lsapic(acpi_handle handle, int *pcpu)
@@ -689,9 +704,11 @@ EXPORT_SYMBOL(acpi_map_lsapic);
 
 int acpi_unmap_lsapic(int cpu)
 {
+#ifndef CONFIG_XEN
        per_cpu(x86_cpu_to_apicid, cpu) = -1;
        set_cpu_present(cpu, false);
        num_processors--;
+#endif
 
        return (0);
 }
@@ -1333,6 +1350,7 @@ static int __init dmi_disable_acpi(const struct dmi_system_id *d)
        return 0;
 }
 
+#ifndef CONFIG_XEN
 /*
  * Force ignoring BIOS IRQ0 pin2 override
  */
@@ -1350,6 +1368,22 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
        }
        return 0;
 }
+#endif
+
+static int __init force_acpi_rsdt(const struct dmi_system_id *d)
+{
+       if (!acpi_force) {
+               printk(KERN_NOTICE "%s detected: force use of acpi=rsdt\n",
+                      d->ident);
+               acpi_rsdt_forced = 1;
+       } else {
+               printk(KERN_NOTICE
+                      "Warning: acpi=force overrules DMI blacklist: "
+                      "acpi=rsdt\n");
+       }
+       return 0;
+
+}
 
 /*
  * If your system is blacklisted here, but you find that acpi=force
@@ -1426,9 +1460,36 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
                     DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
                     },
         },
+
+       /*
+        * Boxes that need RSDT as ACPI root table
+        */
+       {
+           .callback = force_acpi_rsdt,
+           .ident = "ThinkPad ", /* R40e, broken C-states */
+           .matches = {
+               DMI_MATCH(DMI_BIOS_VENDOR, "IBM"),
+               DMI_MATCH(DMI_BIOS_VERSION, "1SET")},
+       },
+       {
+           .callback = force_acpi_rsdt,
+           .ident = "ThinkPad ", /* R50e, slow booting */
+           .matches = {
+               DMI_MATCH(DMI_BIOS_VENDOR, "IBM"),
+               DMI_MATCH(DMI_BIOS_VERSION, "1WET")},
+       },
+       {
+           .callback = force_acpi_rsdt,
+           .ident = "ThinkPad ", /* T40, T40p, T41, T41p, T42, T42p
+                                    R50, R50p */
+           .matches = {
+               DMI_MATCH(DMI_BIOS_VENDOR, "IBM"),
+               DMI_MATCH(DMI_BIOS_VERSION, "1RET")},
+       },
        {}
 };
 
+#ifndef CONFIG_XEN
 /* second table for DMI checks that should run after early-quirks */
 static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
        /*
@@ -1475,6 +1536,7 @@ static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
         },
        {}
 };
+#endif
 
 /*
  * acpi_boot_table_init() and acpi_boot_init()
@@ -1547,8 +1609,10 @@ int __init early_acpi_boot_init(void)
 
 int __init acpi_boot_init(void)
 {
+#ifndef CONFIG_XEN
        /* those are executed after early-quirks are executed */
        dmi_check_system(acpi_dmi_table_late);
+#endif
 
        /*
         * If acpi_disabled, bail out
@@ -1613,6 +1677,18 @@ static int __init parse_acpi(char *arg)
 }
 early_param("acpi", parse_acpi);
 
+/* Alias for acpi=rsdt for compatibility with openSUSE 11.1 and SLE11 */
+static int __init parse_acpi_root_table(char *opt)
+{
+       if (!strcmp(opt, "rsdt")) {
+               acpi_rsdt_forced = 1;
+               printk(KERN_WARNING "acpi_root_table=rsdt is deprecated. "
+                      "Please use acpi=rsdt instead.\n");
+       }
+       return 0;
+}
+early_param("acpi_root_table", parse_acpi_root_table);
+
 /* FIXME: Using pci= for an ACPI parameter is a travesty. */
 static int __init parse_pci(char *arg)
 {
@@ -1636,7 +1712,7 @@ int __init acpi_mps_check(void)
        return 0;
 }
 
-#ifdef CONFIG_X86_IO_APIC
+#if defined(CONFIG_X86_IO_APIC) && !defined(CONFIG_XEN)
 static int __init parse_acpi_skip_timer_override(char *arg)
 {
        acpi_skip_timer_override = 1;