diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /arch/x86/kernel/acpi | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/x86/kernel/acpi')
-rw-r--r-- | arch/x86/kernel/acpi/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 173 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/cstate.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/processor.c | 101 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/sleep.c | 26 |
5 files changed, 64 insertions, 240 deletions
diff --git a/arch/x86/kernel/acpi/Makefile b/arch/x86/kernel/acpi/Makefile index fd5ca97a2ad5..6f35260bb3ef 100644 --- a/arch/x86/kernel/acpi/Makefile +++ b/arch/x86/kernel/acpi/Makefile | |||
@@ -4,7 +4,7 @@ obj-$(CONFIG_ACPI) += boot.o | |||
4 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup_rm.o wakeup_$(BITS).o | 4 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup_rm.o wakeup_$(BITS).o |
5 | 5 | ||
6 | ifneq ($(CONFIG_ACPI_PROCESSOR),) | 6 | ifneq ($(CONFIG_ACPI_PROCESSOR),) |
7 | obj-y += cstate.o processor.o | 7 | obj-y += cstate.o |
8 | endif | 8 | endif |
9 | 9 | ||
10 | $(obj)/wakeup_rm.o: $(obj)/realmode/wakeup.bin | 10 | $(obj)/wakeup_rm.o: $(obj)/realmode/wakeup.bin |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 67e929b89875..cd40aba6aa95 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -31,10 +31,12 @@ | |||
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <linux/dmi.h> | 32 | #include <linux/dmi.h> |
33 | #include <linux/irq.h> | 33 | #include <linux/irq.h> |
34 | #include <linux/slab.h> | ||
34 | #include <linux/bootmem.h> | 35 | #include <linux/bootmem.h> |
35 | #include <linux/ioport.h> | 36 | #include <linux/ioport.h> |
36 | #include <linux/pci.h> | 37 | #include <linux/pci.h> |
37 | 38 | ||
39 | #include <asm/pci_x86.h> | ||
38 | #include <asm/pgtable.h> | 40 | #include <asm/pgtable.h> |
39 | #include <asm/io_apic.h> | 41 | #include <asm/io_apic.h> |
40 | #include <asm/apic.h> | 42 | #include <asm/apic.h> |
@@ -49,6 +51,7 @@ EXPORT_SYMBOL(acpi_disabled); | |||
49 | 51 | ||
50 | #ifdef CONFIG_X86_64 | 52 | #ifdef CONFIG_X86_64 |
51 | # include <asm/proto.h> | 53 | # include <asm/proto.h> |
54 | # include <asm/numa_64.h> | ||
52 | #endif /* X86 */ | 55 | #endif /* X86 */ |
53 | 56 | ||
54 | #define BAD_MADT_ENTRY(entry, end) ( \ | 57 | #define BAD_MADT_ENTRY(entry, end) ( \ |
@@ -446,6 +449,12 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger) | |||
446 | int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) | 449 | int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) |
447 | { | 450 | { |
448 | *irq = gsi; | 451 | *irq = gsi; |
452 | |||
453 | #ifdef CONFIG_X86_IO_APIC | ||
454 | if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) | ||
455 | setup_IO_APIC_irq_extra(gsi); | ||
456 | #endif | ||
457 | |||
449 | return 0; | 458 | return 0; |
450 | } | 459 | } |
451 | 460 | ||
@@ -473,7 +482,8 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity) | |||
473 | plat_gsi = mp_register_gsi(dev, gsi, trigger, polarity); | 482 | plat_gsi = mp_register_gsi(dev, gsi, trigger, polarity); |
474 | } | 483 | } |
475 | #endif | 484 | #endif |
476 | acpi_gsi_to_irq(plat_gsi, &irq); | 485 | irq = plat_gsi; |
486 | |||
477 | return irq; | 487 | return irq; |
478 | } | 488 | } |
479 | 489 | ||
@@ -481,6 +491,26 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity) | |||
481 | * ACPI based hotplug support for CPU | 491 | * ACPI based hotplug support for CPU |
482 | */ | 492 | */ |
483 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 493 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
494 | #include <acpi/processor.h> | ||
495 | |||
496 | static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) | ||
497 | { | ||
498 | #ifdef CONFIG_ACPI_NUMA | ||
499 | int nid; | ||
500 | |||
501 | nid = acpi_get_node(handle); | ||
502 | if (nid == -1 || !node_online(nid)) | ||
503 | return; | ||
504 | #ifdef CONFIG_X86_64 | ||
505 | apicid_to_node[physid] = nid; | ||
506 | numa_set_node(cpu, nid); | ||
507 | #else /* CONFIG_X86_32 */ | ||
508 | apicid_2_node[physid] = nid; | ||
509 | cpu_to_node_map[cpu] = nid; | ||
510 | #endif | ||
511 | |||
512 | #endif | ||
513 | } | ||
484 | 514 | ||
485 | static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu) | 515 | static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu) |
486 | { | 516 | { |
@@ -539,7 +569,10 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu) | |||
539 | goto free_new_map; | 569 | goto free_new_map; |
540 | } | 570 | } |
541 | 571 | ||
572 | acpi_processor_set_pdc(handle); | ||
573 | |||
542 | cpu = cpumask_first(new_map); | 574 | cpu = cpumask_first(new_map); |
575 | acpi_map_cpu2node(handle, cpu, physid); | ||
543 | 576 | ||
544 | *pcpu = cpu; | 577 | *pcpu = cpu; |
545 | retval = 0; | 578 | retval = 0; |
@@ -624,6 +657,7 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table) | |||
624 | } | 657 | } |
625 | 658 | ||
626 | hpet_address = hpet_tbl->address.address; | 659 | hpet_address = hpet_tbl->address.address; |
660 | hpet_blockid = hpet_tbl->sequence; | ||
627 | 661 | ||
628 | /* | 662 | /* |
629 | * Some broken BIOSes advertise HPET at 0x0. We really do not | 663 | * Some broken BIOSes advertise HPET at 0x0. We really do not |
@@ -1122,7 +1156,7 @@ static int __init acpi_parse_madt_ioapic_entries(void) | |||
1122 | if (!acpi_sci_override_gsi) | 1156 | if (!acpi_sci_override_gsi) |
1123 | acpi_sci_ioapic_setup(acpi_gbl_FADT.sci_interrupt, 0, 0); | 1157 | acpi_sci_ioapic_setup(acpi_gbl_FADT.sci_interrupt, 0, 0); |
1124 | 1158 | ||
1125 | /* Fill in identity legacy mapings where no override */ | 1159 | /* Fill in identity legacy mappings where no override */ |
1126 | mp_config_acpi_legacy_irqs(); | 1160 | mp_config_acpi_legacy_irqs(); |
1127 | 1161 | ||
1128 | count = | 1162 | count = |
@@ -1184,9 +1218,6 @@ static void __init acpi_process_madt(void) | |||
1184 | if (!error) { | 1218 | if (!error) { |
1185 | acpi_lapic = 1; | 1219 | acpi_lapic = 1; |
1186 | 1220 | ||
1187 | #ifdef CONFIG_X86_BIGSMP | ||
1188 | generic_bigsmp_probe(); | ||
1189 | #endif | ||
1190 | /* | 1221 | /* |
1191 | * Parse MADT IO-APIC entries | 1222 | * Parse MADT IO-APIC entries |
1192 | */ | 1223 | */ |
@@ -1196,8 +1227,6 @@ static void __init acpi_process_madt(void) | |||
1196 | acpi_ioapic = 1; | 1227 | acpi_ioapic = 1; |
1197 | 1228 | ||
1198 | smp_found_config = 1; | 1229 | smp_found_config = 1; |
1199 | if (apic->setup_apic_routing) | ||
1200 | apic->setup_apic_routing(); | ||
1201 | } | 1230 | } |
1202 | } | 1231 | } |
1203 | if (error == -EINVAL) { | 1232 | if (error == -EINVAL) { |
@@ -1268,23 +1297,6 @@ static int __init dmi_disable_acpi(const struct dmi_system_id *d) | |||
1268 | } | 1297 | } |
1269 | 1298 | ||
1270 | /* | 1299 | /* |
1271 | * Limit ACPI to CPU enumeration for HT | ||
1272 | */ | ||
1273 | static int __init force_acpi_ht(const struct dmi_system_id *d) | ||
1274 | { | ||
1275 | if (!acpi_force) { | ||
1276 | printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", | ||
1277 | d->ident); | ||
1278 | disable_acpi(); | ||
1279 | acpi_ht = 1; | ||
1280 | } else { | ||
1281 | printk(KERN_NOTICE | ||
1282 | "Warning: acpi=force overrules DMI blacklist: acpi=ht\n"); | ||
1283 | } | ||
1284 | return 0; | ||
1285 | } | ||
1286 | |||
1287 | /* | ||
1288 | * Force ignoring BIOS IRQ0 pin2 override | 1300 | * Force ignoring BIOS IRQ0 pin2 override |
1289 | */ | 1301 | */ |
1290 | static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d) | 1302 | static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d) |
@@ -1320,90 +1332,6 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { | |||
1320 | }, | 1332 | }, |
1321 | 1333 | ||
1322 | /* | 1334 | /* |
1323 | * Boxes that need acpi=ht | ||
1324 | */ | ||
1325 | { | ||
1326 | .callback = force_acpi_ht, | ||
1327 | .ident = "FSC Primergy T850", | ||
1328 | .matches = { | ||
1329 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), | ||
1330 | DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"), | ||
1331 | }, | ||
1332 | }, | ||
1333 | { | ||
1334 | .callback = force_acpi_ht, | ||
1335 | .ident = "HP VISUALIZE NT Workstation", | ||
1336 | .matches = { | ||
1337 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), | ||
1338 | DMI_MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"), | ||
1339 | }, | ||
1340 | }, | ||
1341 | { | ||
1342 | .callback = force_acpi_ht, | ||
1343 | .ident = "Compaq Workstation W8000", | ||
1344 | .matches = { | ||
1345 | DMI_MATCH(DMI_SYS_VENDOR, "Compaq"), | ||
1346 | DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"), | ||
1347 | }, | ||
1348 | }, | ||
1349 | { | ||
1350 | .callback = force_acpi_ht, | ||
1351 | .ident = "ASUS P2B-DS", | ||
1352 | .matches = { | ||
1353 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | ||
1354 | DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"), | ||
1355 | }, | ||
1356 | }, | ||
1357 | { | ||
1358 | .callback = force_acpi_ht, | ||
1359 | .ident = "ASUS CUR-DLS", | ||
1360 | .matches = { | ||
1361 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | ||
1362 | DMI_MATCH(DMI_BOARD_NAME, "CUR-DLS"), | ||
1363 | }, | ||
1364 | }, | ||
1365 | { | ||
1366 | .callback = force_acpi_ht, | ||
1367 | .ident = "ABIT i440BX-W83977", | ||
1368 | .matches = { | ||
1369 | DMI_MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"), | ||
1370 | DMI_MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"), | ||
1371 | }, | ||
1372 | }, | ||
1373 | { | ||
1374 | .callback = force_acpi_ht, | ||
1375 | .ident = "IBM Bladecenter", | ||
1376 | .matches = { | ||
1377 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), | ||
1378 | DMI_MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"), | ||
1379 | }, | ||
1380 | }, | ||
1381 | { | ||
1382 | .callback = force_acpi_ht, | ||
1383 | .ident = "IBM eServer xSeries 360", | ||
1384 | .matches = { | ||
1385 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), | ||
1386 | DMI_MATCH(DMI_BOARD_NAME, "eServer xSeries 360"), | ||
1387 | }, | ||
1388 | }, | ||
1389 | { | ||
1390 | .callback = force_acpi_ht, | ||
1391 | .ident = "IBM eserver xSeries 330", | ||
1392 | .matches = { | ||
1393 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), | ||
1394 | DMI_MATCH(DMI_BOARD_NAME, "eserver xSeries 330"), | ||
1395 | }, | ||
1396 | }, | ||
1397 | { | ||
1398 | .callback = force_acpi_ht, | ||
1399 | .ident = "IBM eserver xSeries 440", | ||
1400 | .matches = { | ||
1401 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), | ||
1402 | DMI_MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"), | ||
1403 | }, | ||
1404 | }, | ||
1405 | |||
1406 | /* | ||
1407 | * Boxes that need ACPI PCI IRQ routing disabled | 1335 | * Boxes that need ACPI PCI IRQ routing disabled |
1408 | */ | 1336 | */ |
1409 | { | 1337 | { |
@@ -1528,16 +1456,10 @@ static struct dmi_system_id __initdata acpi_dmi_table_late[] = { | |||
1528 | * if acpi_blacklisted() acpi_disabled = 1; | 1456 | * if acpi_blacklisted() acpi_disabled = 1; |
1529 | * acpi_irq_model=... | 1457 | * acpi_irq_model=... |
1530 | * ... | 1458 | * ... |
1531 | * | ||
1532 | * return value: (currently ignored) | ||
1533 | * 0: success | ||
1534 | * !0: failure | ||
1535 | */ | 1459 | */ |
1536 | 1460 | ||
1537 | int __init acpi_boot_table_init(void) | 1461 | void __init acpi_boot_table_init(void) |
1538 | { | 1462 | { |
1539 | int error; | ||
1540 | |||
1541 | dmi_check_system(acpi_dmi_table); | 1463 | dmi_check_system(acpi_dmi_table); |
1542 | 1464 | ||
1543 | /* | 1465 | /* |
@@ -1545,15 +1467,14 @@ int __init acpi_boot_table_init(void) | |||
1545 | * One exception: acpi=ht continues far enough to enumerate LAPICs | 1467 | * One exception: acpi=ht continues far enough to enumerate LAPICs |
1546 | */ | 1468 | */ |
1547 | if (acpi_disabled && !acpi_ht) | 1469 | if (acpi_disabled && !acpi_ht) |
1548 | return 1; | 1470 | return; |
1549 | 1471 | ||
1550 | /* | 1472 | /* |
1551 | * Initialize the ACPI boot-time table parser. | 1473 | * Initialize the ACPI boot-time table parser. |
1552 | */ | 1474 | */ |
1553 | error = acpi_table_init(); | 1475 | if (acpi_table_init()) { |
1554 | if (error) { | ||
1555 | disable_acpi(); | 1476 | disable_acpi(); |
1556 | return error; | 1477 | return; |
1557 | } | 1478 | } |
1558 | 1479 | ||
1559 | acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); | 1480 | acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); |
@@ -1561,18 +1482,15 @@ int __init acpi_boot_table_init(void) | |||
1561 | /* | 1482 | /* |
1562 | * blacklist may disable ACPI entirely | 1483 | * blacklist may disable ACPI entirely |
1563 | */ | 1484 | */ |
1564 | error = acpi_blacklisted(); | 1485 | if (acpi_blacklisted()) { |
1565 | if (error) { | ||
1566 | if (acpi_force) { | 1486 | if (acpi_force) { |
1567 | printk(KERN_WARNING PREFIX "acpi=force override\n"); | 1487 | printk(KERN_WARNING PREFIX "acpi=force override\n"); |
1568 | } else { | 1488 | } else { |
1569 | printk(KERN_WARNING PREFIX "Disabling ACPI support\n"); | 1489 | printk(KERN_WARNING PREFIX "Disabling ACPI support\n"); |
1570 | disable_acpi(); | 1490 | disable_acpi(); |
1571 | return error; | 1491 | return; |
1572 | } | 1492 | } |
1573 | } | 1493 | } |
1574 | |||
1575 | return 0; | ||
1576 | } | 1494 | } |
1577 | 1495 | ||
1578 | int __init early_acpi_boot_init(void) | 1496 | int __init early_acpi_boot_init(void) |
@@ -1618,6 +1536,9 @@ int __init acpi_boot_init(void) | |||
1618 | 1536 | ||
1619 | acpi_table_parse(ACPI_SIG_HPET, acpi_parse_hpet); | 1537 | acpi_table_parse(ACPI_SIG_HPET, acpi_parse_hpet); |
1620 | 1538 | ||
1539 | if (!acpi_noirq) | ||
1540 | x86_init.pci.init = pci_acpi_init; | ||
1541 | |||
1621 | return 0; | 1542 | return 0; |
1622 | } | 1543 | } |
1623 | 1544 | ||
@@ -1642,8 +1563,10 @@ static int __init parse_acpi(char *arg) | |||
1642 | } | 1563 | } |
1643 | /* Limit ACPI just to boot-time to enable HT */ | 1564 | /* Limit ACPI just to boot-time to enable HT */ |
1644 | else if (strcmp(arg, "ht") == 0) { | 1565 | else if (strcmp(arg, "ht") == 0) { |
1645 | if (!acpi_force) | 1566 | if (!acpi_force) { |
1567 | printk(KERN_WARNING "acpi=ht will be removed in Linux-2.6.35\n"); | ||
1646 | disable_acpi(); | 1568 | disable_acpi(); |
1569 | } | ||
1647 | acpi_ht = 1; | 1570 | acpi_ht = 1; |
1648 | } | 1571 | } |
1649 | /* acpi=rsdt use RSDT instead of XSDT */ | 1572 | /* acpi=rsdt use RSDT instead of XSDT */ |
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 59cdfa4686b2..2e837f5080fe 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c | |||
@@ -48,7 +48,7 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, | |||
48 | * P4, Core and beyond CPUs | 48 | * P4, Core and beyond CPUs |
49 | */ | 49 | */ |
50 | if (c->x86_vendor == X86_VENDOR_INTEL && | 50 | if (c->x86_vendor == X86_VENDOR_INTEL && |
51 | (c->x86 > 0xf || (c->x86 == 6 && c->x86_model >= 14))) | 51 | (c->x86 > 0xf || (c->x86 == 6 && c->x86_model >= 0x0f))) |
52 | flags->bm_control = 0; | 52 | flags->bm_control = 0; |
53 | } | 53 | } |
54 | EXPORT_SYMBOL(acpi_processor_power_init_bm_check); | 54 | EXPORT_SYMBOL(acpi_processor_power_init_bm_check); |
diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c deleted file mode 100644 index d85d1b2432ba..000000000000 --- a/arch/x86/kernel/acpi/processor.c +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Intel Corporation | ||
3 | * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> | ||
4 | * - Added _PDC for platforms with Intel CPUs | ||
5 | */ | ||
6 | |||
7 | #include <linux/kernel.h> | ||
8 | #include <linux/module.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/acpi.h> | ||
11 | |||
12 | #include <acpi/processor.h> | ||
13 | #include <asm/acpi.h> | ||
14 | |||
15 | static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c) | ||
16 | { | ||
17 | struct acpi_object_list *obj_list; | ||
18 | union acpi_object *obj; | ||
19 | u32 *buf; | ||
20 | |||
21 | /* allocate and initialize pdc. It will be used later. */ | ||
22 | obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL); | ||
23 | if (!obj_list) { | ||
24 | printk(KERN_ERR "Memory allocation error\n"); | ||
25 | return; | ||
26 | } | ||
27 | |||
28 | obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL); | ||
29 | if (!obj) { | ||
30 | printk(KERN_ERR "Memory allocation error\n"); | ||
31 | kfree(obj_list); | ||
32 | return; | ||
33 | } | ||
34 | |||
35 | buf = kmalloc(12, GFP_KERNEL); | ||
36 | if (!buf) { | ||
37 | printk(KERN_ERR "Memory allocation error\n"); | ||
38 | kfree(obj); | ||
39 | kfree(obj_list); | ||
40 | return; | ||
41 | } | ||
42 | |||
43 | buf[0] = ACPI_PDC_REVISION_ID; | ||
44 | buf[1] = 1; | ||
45 | buf[2] = ACPI_PDC_C_CAPABILITY_SMP; | ||
46 | |||
47 | /* | ||
48 | * The default of PDC_SMP_T_SWCOORD bit is set for intel x86 cpu so | ||
49 | * that OSPM is capable of native ACPI throttling software | ||
50 | * coordination using BIOS supplied _TSD info. | ||
51 | */ | ||
52 | buf[2] |= ACPI_PDC_SMP_T_SWCOORD; | ||
53 | if (cpu_has(c, X86_FEATURE_EST)) | ||
54 | buf[2] |= ACPI_PDC_EST_CAPABILITY_SWSMP; | ||
55 | |||
56 | if (cpu_has(c, X86_FEATURE_ACPI)) | ||
57 | buf[2] |= ACPI_PDC_T_FFH; | ||
58 | |||
59 | /* | ||
60 | * If mwait/monitor is unsupported, C2/C3_FFH will be disabled | ||
61 | */ | ||
62 | if (!cpu_has(c, X86_FEATURE_MWAIT)) | ||
63 | buf[2] &= ~(ACPI_PDC_C_C2C3_FFH); | ||
64 | |||
65 | obj->type = ACPI_TYPE_BUFFER; | ||
66 | obj->buffer.length = 12; | ||
67 | obj->buffer.pointer = (u8 *) buf; | ||
68 | obj_list->count = 1; | ||
69 | obj_list->pointer = obj; | ||
70 | pr->pdc = obj_list; | ||
71 | |||
72 | return; | ||
73 | } | ||
74 | |||
75 | |||
76 | /* Initialize _PDC data based on the CPU vendor */ | ||
77 | void arch_acpi_processor_init_pdc(struct acpi_processor *pr) | ||
78 | { | ||
79 | struct cpuinfo_x86 *c = &cpu_data(pr->id); | ||
80 | |||
81 | pr->pdc = NULL; | ||
82 | if (c->x86_vendor == X86_VENDOR_INTEL || | ||
83 | c->x86_vendor == X86_VENDOR_CENTAUR) | ||
84 | init_intel_pdc(pr, c); | ||
85 | |||
86 | return; | ||
87 | } | ||
88 | |||
89 | EXPORT_SYMBOL(arch_acpi_processor_init_pdc); | ||
90 | |||
91 | void arch_acpi_processor_cleanup_pdc(struct acpi_processor *pr) | ||
92 | { | ||
93 | if (pr->pdc) { | ||
94 | kfree(pr->pdc->pointer->buffer.pointer); | ||
95 | kfree(pr->pdc->pointer); | ||
96 | kfree(pr->pdc); | ||
97 | pr->pdc = NULL; | ||
98 | } | ||
99 | } | ||
100 | |||
101 | EXPORT_SYMBOL(arch_acpi_processor_cleanup_pdc); | ||
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index ca93638ba430..f9961034e557 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -78,12 +78,9 @@ int acpi_save_state_mem(void) | |||
78 | #ifndef CONFIG_64BIT | 78 | #ifndef CONFIG_64BIT |
79 | store_gdt((struct desc_ptr *)&header->pmode_gdt); | 79 | store_gdt((struct desc_ptr *)&header->pmode_gdt); |
80 | 80 | ||
81 | header->pmode_efer_low = nx_enabled; | 81 | if (rdmsr_safe(MSR_EFER, &header->pmode_efer_low, |
82 | if (header->pmode_efer_low & 1) { | 82 | &header->pmode_efer_high)) |
83 | /* This is strange, why not save efer, always? */ | 83 | header->pmode_efer_low = header->pmode_efer_high = 0; |
84 | rdmsr(MSR_EFER, header->pmode_efer_low, | ||
85 | header->pmode_efer_high); | ||
86 | } | ||
87 | #endif /* !CONFIG_64BIT */ | 84 | #endif /* !CONFIG_64BIT */ |
88 | 85 | ||
89 | header->pmode_cr0 = read_cr0(); | 86 | header->pmode_cr0 = read_cr0(); |
@@ -119,29 +116,32 @@ void acpi_restore_state_mem(void) | |||
119 | 116 | ||
120 | 117 | ||
121 | /** | 118 | /** |
122 | * acpi_reserve_bootmem - do _very_ early ACPI initialisation | 119 | * acpi_reserve_wakeup_memory - do _very_ early ACPI initialisation |
123 | * | 120 | * |
124 | * We allocate a page from the first 1MB of memory for the wakeup | 121 | * We allocate a page from the first 1MB of memory for the wakeup |
125 | * routine for when we come back from a sleep state. The | 122 | * routine for when we come back from a sleep state. The |
126 | * runtime allocator allows specification of <16MB pages, but not | 123 | * runtime allocator allows specification of <16MB pages, but not |
127 | * <1MB pages. | 124 | * <1MB pages. |
128 | */ | 125 | */ |
129 | void __init acpi_reserve_bootmem(void) | 126 | void __init acpi_reserve_wakeup_memory(void) |
130 | { | 127 | { |
128 | unsigned long mem; | ||
129 | |||
131 | if ((&wakeup_code_end - &wakeup_code_start) > WAKEUP_SIZE) { | 130 | if ((&wakeup_code_end - &wakeup_code_start) > WAKEUP_SIZE) { |
132 | printk(KERN_ERR | 131 | printk(KERN_ERR |
133 | "ACPI: Wakeup code way too big, S3 disabled.\n"); | 132 | "ACPI: Wakeup code way too big, S3 disabled.\n"); |
134 | return; | 133 | return; |
135 | } | 134 | } |
136 | 135 | ||
137 | acpi_realmode = (unsigned long)alloc_bootmem_low(WAKEUP_SIZE); | 136 | mem = find_e820_area(0, 1<<20, WAKEUP_SIZE, PAGE_SIZE); |
138 | 137 | ||
139 | if (!acpi_realmode) { | 138 | if (mem == -1L) { |
140 | printk(KERN_ERR "ACPI: Cannot allocate lowmem, S3 disabled.\n"); | 139 | printk(KERN_ERR "ACPI: Cannot allocate lowmem, S3 disabled.\n"); |
141 | return; | 140 | return; |
142 | } | 141 | } |
143 | 142 | acpi_realmode = (unsigned long) phys_to_virt(mem); | |
144 | acpi_wakeup_address = virt_to_phys((void *)acpi_realmode); | 143 | acpi_wakeup_address = mem; |
144 | reserve_early(mem, mem + WAKEUP_SIZE, "ACPI WAKEUP"); | ||
145 | } | 145 | } |
146 | 146 | ||
147 | 147 | ||
@@ -162,6 +162,8 @@ static int __init acpi_sleep_setup(char *str) | |||
162 | #endif | 162 | #endif |
163 | if (strncmp(str, "old_ordering", 12) == 0) | 163 | if (strncmp(str, "old_ordering", 12) == 0) |
164 | acpi_old_suspend_ordering(); | 164 | acpi_old_suspend_ordering(); |
165 | if (strncmp(str, "sci_force_enable", 16) == 0) | ||
166 | acpi_set_sci_en_on_resume(); | ||
165 | str = strchr(str, ','); | 167 | str = strchr(str, ','); |
166 | if (str != NULL) | 168 | if (str != NULL) |
167 | str += strspn(str, ", \t"); | 169 | str += strspn(str, ", \t"); |