diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-12 06:17:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-12 06:17:36 -0400 |
commit | 6cda3eb62ef42aa5acd649bf99c8db544e0f4051 (patch) | |
tree | 93f74ca002f5756c8e157611174f9540b5cf41c0 /arch/x86 | |
parent | b9c61b70075c87a8612624736faf4a2de5b1ed30 (diff) | |
parent | cec6be6d1069d697beb490bbb40a290d5ff554a2 (diff) |
Merge branch 'x86/apic' into irq/numa
Merge reason: both topics modify the APIC code but were able to do it in
parallel so far. An upcoming patch generates a conflict so
merge them to avoid the conflict.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
26 files changed, 163 insertions, 82 deletions
diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h index bc9514fb3b13..7ddb36ab933b 100644 --- a/arch/x86/include/asm/apicdef.h +++ b/arch/x86/include/asm/apicdef.h | |||
@@ -22,6 +22,7 @@ | |||
22 | # define APIC_INTEGRATED(x) (1) | 22 | # define APIC_INTEGRATED(x) (1) |
23 | #endif | 23 | #endif |
24 | #define APIC_XAPIC(x) ((x) >= 0x14) | 24 | #define APIC_XAPIC(x) ((x) >= 0x14) |
25 | #define APIC_EXT_SPACE(x) ((x) & 0x80000000) | ||
25 | #define APIC_TASKPRI 0x80 | 26 | #define APIC_TASKPRI 0x80 |
26 | #define APIC_TPRI_MASK 0xFFu | 27 | #define APIC_TPRI_MASK 0xFFu |
27 | #define APIC_ARBPRI 0x90 | 28 | #define APIC_ARBPRI 0x90 |
@@ -116,7 +117,9 @@ | |||
116 | #define APIC_TDR_DIV_32 0x8 | 117 | #define APIC_TDR_DIV_32 0x8 |
117 | #define APIC_TDR_DIV_64 0x9 | 118 | #define APIC_TDR_DIV_64 0x9 |
118 | #define APIC_TDR_DIV_128 0xA | 119 | #define APIC_TDR_DIV_128 0xA |
119 | #define APIC_EILVT0 0x500 | 120 | #define APIC_EFEAT 0x400 |
121 | #define APIC_ECTRL 0x410 | ||
122 | #define APIC_EILVTn(n) (0x500 + 0x10 * n) | ||
120 | #define APIC_EILVT_NR_AMD_K8 1 /* # of extended interrupts */ | 123 | #define APIC_EILVT_NR_AMD_K8 1 /* # of extended interrupts */ |
121 | #define APIC_EILVT_NR_AMD_10H 4 | 124 | #define APIC_EILVT_NR_AMD_10H 4 |
122 | #define APIC_EILVT_LVTOFF(x) (((x) >> 4) & 0xF) | 125 | #define APIC_EILVT_LVTOFF(x) (((x) >> 4) & 0xF) |
@@ -125,9 +128,6 @@ | |||
125 | #define APIC_EILVT_MSG_NMI 0x4 | 128 | #define APIC_EILVT_MSG_NMI 0x4 |
126 | #define APIC_EILVT_MSG_EXT 0x7 | 129 | #define APIC_EILVT_MSG_EXT 0x7 |
127 | #define APIC_EILVT_MASKED (1 << 16) | 130 | #define APIC_EILVT_MASKED (1 << 16) |
128 | #define APIC_EILVT1 0x510 | ||
129 | #define APIC_EILVT2 0x520 | ||
130 | #define APIC_EILVT3 0x530 | ||
131 | 131 | ||
132 | #define APIC_BASE (fix_to_virt(FIX_APIC_BASE)) | 132 | #define APIC_BASE (fix_to_virt(FIX_APIC_BASE)) |
133 | #define APIC_BASE_MSR 0x800 | 133 | #define APIC_BASE_MSR 0x800 |
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 563933e06a35..4f8c199584e7 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h | |||
@@ -137,6 +137,7 @@ DECLARE_PER_CPU(mce_banks_t, mce_poll_banks); | |||
137 | enum mcp_flags { | 137 | enum mcp_flags { |
138 | MCP_TIMESTAMP = (1 << 0), /* log time stamp */ | 138 | MCP_TIMESTAMP = (1 << 0), /* log time stamp */ |
139 | MCP_UC = (1 << 1), /* log uncorrected errors */ | 139 | MCP_UC = (1 << 1), /* log uncorrected errors */ |
140 | MCP_DONTLOG = (1 << 2), /* only clear, don't log */ | ||
140 | }; | 141 | }; |
141 | extern void machine_check_poll(enum mcp_flags flags, mce_banks_t *b); | 142 | extern void machine_check_poll(enum mcp_flags flags, mce_banks_t *b); |
142 | 143 | ||
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index 892b119dba6f..f44b49abca49 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h | |||
@@ -200,7 +200,7 @@ static inline void arch_fix_phys_package_id(int num, u32 slot) | |||
200 | } | 200 | } |
201 | 201 | ||
202 | struct pci_bus; | 202 | struct pci_bus; |
203 | void set_pci_bus_resources_arch_default(struct pci_bus *b); | 203 | void x86_pci_root_bus_res_quirks(struct pci_bus *b); |
204 | 204 | ||
205 | #ifdef CONFIG_SMP | 205 | #ifdef CONFIG_SMP |
206 | #define mc_capable() (cpumask_weight(cpu_core_mask(0)) != nr_cpu_ids) | 206 | #define mc_capable() (cpumask_weight(cpu_core_mask(0)) != nr_cpu_ids) |
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 42c33cebf00f..8c0be0902dac 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -49,10 +49,10 @@ | |||
49 | #define IVHD_DEV_EXT_SELECT 0x46 | 49 | #define IVHD_DEV_EXT_SELECT 0x46 |
50 | #define IVHD_DEV_EXT_SELECT_RANGE 0x47 | 50 | #define IVHD_DEV_EXT_SELECT_RANGE 0x47 |
51 | 51 | ||
52 | #define IVHD_FLAG_HT_TUN_EN 0x00 | 52 | #define IVHD_FLAG_HT_TUN_EN_MASK 0x01 |
53 | #define IVHD_FLAG_PASSPW_EN 0x01 | 53 | #define IVHD_FLAG_PASSPW_EN_MASK 0x02 |
54 | #define IVHD_FLAG_RESPASSPW_EN 0x02 | 54 | #define IVHD_FLAG_RESPASSPW_EN_MASK 0x04 |
55 | #define IVHD_FLAG_ISOC_EN 0x03 | 55 | #define IVHD_FLAG_ISOC_EN_MASK 0x08 |
56 | 56 | ||
57 | #define IVMD_FLAG_EXCL_RANGE 0x08 | 57 | #define IVMD_FLAG_EXCL_RANGE 0x08 |
58 | #define IVMD_FLAG_UNITY_MAP 0x01 | 58 | #define IVMD_FLAG_UNITY_MAP 0x01 |
@@ -569,19 +569,19 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu, | |||
569 | * First set the recommended feature enable bits from ACPI | 569 | * First set the recommended feature enable bits from ACPI |
570 | * into the IOMMU control registers | 570 | * into the IOMMU control registers |
571 | */ | 571 | */ |
572 | h->flags & IVHD_FLAG_HT_TUN_EN ? | 572 | h->flags & IVHD_FLAG_HT_TUN_EN_MASK ? |
573 | iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) : | 573 | iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) : |
574 | iommu_feature_disable(iommu, CONTROL_HT_TUN_EN); | 574 | iommu_feature_disable(iommu, CONTROL_HT_TUN_EN); |
575 | 575 | ||
576 | h->flags & IVHD_FLAG_PASSPW_EN ? | 576 | h->flags & IVHD_FLAG_PASSPW_EN_MASK ? |
577 | iommu_feature_enable(iommu, CONTROL_PASSPW_EN) : | 577 | iommu_feature_enable(iommu, CONTROL_PASSPW_EN) : |
578 | iommu_feature_disable(iommu, CONTROL_PASSPW_EN); | 578 | iommu_feature_disable(iommu, CONTROL_PASSPW_EN); |
579 | 579 | ||
580 | h->flags & IVHD_FLAG_RESPASSPW_EN ? | 580 | h->flags & IVHD_FLAG_RESPASSPW_EN_MASK ? |
581 | iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) : | 581 | iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) : |
582 | iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN); | 582 | iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN); |
583 | 583 | ||
584 | h->flags & IVHD_FLAG_ISOC_EN ? | 584 | h->flags & IVHD_FLAG_ISOC_EN_MASK ? |
585 | iommu_feature_enable(iommu, CONTROL_ISOC_EN) : | 585 | iommu_feature_enable(iommu, CONTROL_ISOC_EN) : |
586 | iommu_feature_disable(iommu, CONTROL_ISOC_EN); | 586 | iommu_feature_disable(iommu, CONTROL_ISOC_EN); |
587 | 587 | ||
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 28f747d61d78..07cffc1214cb 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -395,7 +395,7 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen) | |||
395 | 395 | ||
396 | static void setup_APIC_eilvt(u8 lvt_off, u8 vector, u8 msg_type, u8 mask) | 396 | static void setup_APIC_eilvt(u8 lvt_off, u8 vector, u8 msg_type, u8 mask) |
397 | { | 397 | { |
398 | unsigned long reg = (lvt_off << 4) + APIC_EILVT0; | 398 | unsigned long reg = (lvt_off << 4) + APIC_EILVTn(0); |
399 | unsigned int v = (mask << 16) | (msg_type << 8) | vector; | 399 | unsigned int v = (mask << 16) | (msg_type << 8) | vector; |
400 | 400 | ||
401 | apic_write(reg, v); | 401 | apic_write(reg, v); |
@@ -1456,7 +1456,6 @@ static int __init detect_init_APIC(void) | |||
1456 | } | 1456 | } |
1457 | 1457 | ||
1458 | mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; | 1458 | mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; |
1459 | boot_cpu_physical_apicid = 0; | ||
1460 | return 0; | 1459 | return 0; |
1461 | } | 1460 | } |
1462 | #else | 1461 | #else |
@@ -1570,6 +1569,8 @@ void __init early_init_lapic_mapping(void) | |||
1570 | */ | 1569 | */ |
1571 | void __init init_apic_mappings(void) | 1570 | void __init init_apic_mappings(void) |
1572 | { | 1571 | { |
1572 | unsigned int new_apicid; | ||
1573 | |||
1573 | if (x2apic_mode) { | 1574 | if (x2apic_mode) { |
1574 | boot_cpu_physical_apicid = read_apic_id(); | 1575 | boot_cpu_physical_apicid = read_apic_id(); |
1575 | return; | 1576 | return; |
@@ -1586,21 +1587,32 @@ void __init init_apic_mappings(void) | |||
1586 | } else | 1587 | } else |
1587 | apic_phys = mp_lapic_addr; | 1588 | apic_phys = mp_lapic_addr; |
1588 | 1589 | ||
1589 | set_fixmap_nocache(FIX_APIC_BASE, apic_phys); | ||
1590 | apic_printk(APIC_VERBOSE, "mapped APIC to %08lx (%08lx)\n", | ||
1591 | APIC_BASE, apic_phys); | ||
1592 | |||
1593 | /* | 1590 | /* |
1594 | * Fetch the APIC ID of the BSP in case we have a | 1591 | * acpi lapic path already maps that address in |
1595 | * default configuration (or the MP table is broken). | 1592 | * acpi_register_lapic_address() |
1596 | */ | 1593 | */ |
1597 | if (boot_cpu_physical_apicid == -1U) | 1594 | if (!acpi_lapic) |
1598 | boot_cpu_physical_apicid = read_apic_id(); | 1595 | set_fixmap_nocache(FIX_APIC_BASE, apic_phys); |
1596 | |||
1597 | apic_printk(APIC_VERBOSE, "mapped APIC to %08lx (%08lx)\n", | ||
1598 | APIC_BASE, apic_phys); | ||
1599 | 1599 | ||
1600 | /* lets check if we may to NOP'ify apic operations */ | 1600 | /* lets check if we may NOP'ify apic operations */ |
1601 | if (!cpu_has_apic) { | 1601 | if (!cpu_has_apic) { |
1602 | pr_info("APIC: disable apic facility\n"); | 1602 | pr_info("APIC: disable apic facility\n"); |
1603 | apic_disable(); | 1603 | apic_disable(); |
1604 | return; | ||
1605 | } | ||
1606 | |||
1607 | /* | ||
1608 | * Fetch the APIC ID of the BSP in case we have a | ||
1609 | * default configuration (or the MP table is broken). | ||
1610 | */ | ||
1611 | new_apicid = read_apic_id(); | ||
1612 | if (boot_cpu_physical_apicid != new_apicid) { | ||
1613 | boot_cpu_physical_apicid = new_apicid; | ||
1614 | apic_version[new_apicid] = | ||
1615 | GET_APIC_VERSION(apic_read(APIC_LVR)); | ||
1604 | } | 1616 | } |
1605 | } | 1617 | } |
1606 | 1618 | ||
@@ -2191,7 +2203,7 @@ static int __cpuinit set_multi(const struct dmi_system_id *d) | |||
2191 | { | 2203 | { |
2192 | if (multi) | 2204 | if (multi) |
2193 | return 0; | 2205 | return 0; |
2194 | printk(KERN_INFO "APIC: %s detected, Multi Chassis\n", d->ident); | 2206 | pr_info("APIC: %s detected, Multi Chassis\n", d->ident); |
2195 | multi = 1; | 2207 | multi = 1; |
2196 | return 0; | 2208 | return 0; |
2197 | } | 2209 | } |
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index 306e5e88fb6f..744e6d8af27b 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c | |||
@@ -235,7 +235,7 @@ static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
235 | * regardless of how many processors are present (x86_64 ES7000 | 235 | * regardless of how many processors are present (x86_64 ES7000 |
236 | * is an example). | 236 | * is an example). |
237 | */ | 237 | */ |
238 | if (acpi_gbl_FADT.header.revision > FADT2_REVISION_ID && | 238 | if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID && |
239 | (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) { | 239 | (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) { |
240 | printk(KERN_DEBUG "system APIC only can use physical flat"); | 240 | printk(KERN_DEBUG "system APIC only can use physical flat"); |
241 | return 1; | 241 | return 1; |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 5d5f4120c743..1f3d3669dae8 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -1730,7 +1730,7 @@ __apicdebuginit(void) print_APIC_bitfield(int base) | |||
1730 | 1730 | ||
1731 | __apicdebuginit(void) print_local_APIC(void *dummy) | 1731 | __apicdebuginit(void) print_local_APIC(void *dummy) |
1732 | { | 1732 | { |
1733 | unsigned int v, ver, maxlvt; | 1733 | unsigned int i, v, ver, maxlvt; |
1734 | u64 icr; | 1734 | u64 icr; |
1735 | 1735 | ||
1736 | if (apic_verbosity == APIC_QUIET) | 1736 | if (apic_verbosity == APIC_QUIET) |
@@ -1818,6 +1818,18 @@ __apicdebuginit(void) print_local_APIC(void *dummy) | |||
1818 | printk(KERN_DEBUG "... APIC TMCCT: %08x\n", v); | 1818 | printk(KERN_DEBUG "... APIC TMCCT: %08x\n", v); |
1819 | v = apic_read(APIC_TDCR); | 1819 | v = apic_read(APIC_TDCR); |
1820 | printk(KERN_DEBUG "... APIC TDCR: %08x\n", v); | 1820 | printk(KERN_DEBUG "... APIC TDCR: %08x\n", v); |
1821 | |||
1822 | if (boot_cpu_has(X86_FEATURE_EXTAPIC)) { | ||
1823 | v = apic_read(APIC_EFEAT); | ||
1824 | maxlvt = (v >> 16) & 0xff; | ||
1825 | printk(KERN_DEBUG "... APIC EFEAT: %08x\n", v); | ||
1826 | v = apic_read(APIC_ECTRL); | ||
1827 | printk(KERN_DEBUG "... APIC ECTRL: %08x\n", v); | ||
1828 | for (i = 0; i < maxlvt; i++) { | ||
1829 | v = apic_read(APIC_EILVTn(i)); | ||
1830 | printk(KERN_DEBUG "... APIC EILVT%d: %08x\n", i, v); | ||
1831 | } | ||
1832 | } | ||
1821 | printk("\n"); | 1833 | printk("\n"); |
1822 | } | 1834 | } |
1823 | 1835 | ||
@@ -3742,6 +3754,8 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade, | |||
3742 | unsigned long flags; | 3754 | unsigned long flags; |
3743 | int err; | 3755 | int err; |
3744 | 3756 | ||
3757 | BUILD_BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long)); | ||
3758 | |||
3745 | cfg = irq_cfg(irq); | 3759 | cfg = irq_cfg(irq); |
3746 | 3760 | ||
3747 | err = assign_irq_vector(irq, cfg, eligible_cpu); | 3761 | err = assign_irq_vector(irq, cfg, eligible_cpu); |
@@ -3755,15 +3769,13 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade, | |||
3755 | 3769 | ||
3756 | mmr_value = 0; | 3770 | mmr_value = 0; |
3757 | entry = (struct uv_IO_APIC_route_entry *)&mmr_value; | 3771 | entry = (struct uv_IO_APIC_route_entry *)&mmr_value; |
3758 | BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long)); | 3772 | entry->vector = cfg->vector; |
3759 | 3773 | entry->delivery_mode = apic->irq_delivery_mode; | |
3760 | entry->vector = cfg->vector; | 3774 | entry->dest_mode = apic->irq_dest_mode; |
3761 | entry->delivery_mode = apic->irq_delivery_mode; | 3775 | entry->polarity = 0; |
3762 | entry->dest_mode = apic->irq_dest_mode; | 3776 | entry->trigger = 0; |
3763 | entry->polarity = 0; | 3777 | entry->mask = 0; |
3764 | entry->trigger = 0; | 3778 | entry->dest = apic->cpu_mask_to_apicid(eligible_cpu); |
3765 | entry->mask = 0; | ||
3766 | entry->dest = apic->cpu_mask_to_apicid(eligible_cpu); | ||
3767 | 3779 | ||
3768 | mmr_pnode = uv_blade_to_pnode(mmr_blade); | 3780 | mmr_pnode = uv_blade_to_pnode(mmr_blade); |
3769 | uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value); | 3781 | uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value); |
@@ -3781,10 +3793,10 @@ void arch_disable_uv_irq(int mmr_blade, unsigned long mmr_offset) | |||
3781 | struct uv_IO_APIC_route_entry *entry; | 3793 | struct uv_IO_APIC_route_entry *entry; |
3782 | int mmr_pnode; | 3794 | int mmr_pnode; |
3783 | 3795 | ||
3796 | BUILD_BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long)); | ||
3797 | |||
3784 | mmr_value = 0; | 3798 | mmr_value = 0; |
3785 | entry = (struct uv_IO_APIC_route_entry *)&mmr_value; | 3799 | entry = (struct uv_IO_APIC_route_entry *)&mmr_value; |
3786 | BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long)); | ||
3787 | |||
3788 | entry->mask = 1; | 3800 | entry->mask = 1; |
3789 | 3801 | ||
3790 | mmr_pnode = uv_blade_to_pnode(mmr_blade); | 3802 | mmr_pnode = uv_blade_to_pnode(mmr_blade); |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 93d604dee9b7..780a733a5e7a 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -583,15 +583,18 @@ void __init uv_system_init(void) | |||
583 | 583 | ||
584 | bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades(); | 584 | bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades(); |
585 | uv_blade_info = kmalloc(bytes, GFP_KERNEL); | 585 | uv_blade_info = kmalloc(bytes, GFP_KERNEL); |
586 | BUG_ON(!uv_blade_info); | ||
586 | 587 | ||
587 | get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); | 588 | get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); |
588 | 589 | ||
589 | bytes = sizeof(uv_node_to_blade[0]) * num_possible_nodes(); | 590 | bytes = sizeof(uv_node_to_blade[0]) * num_possible_nodes(); |
590 | uv_node_to_blade = kmalloc(bytes, GFP_KERNEL); | 591 | uv_node_to_blade = kmalloc(bytes, GFP_KERNEL); |
592 | BUG_ON(!uv_node_to_blade); | ||
591 | memset(uv_node_to_blade, 255, bytes); | 593 | memset(uv_node_to_blade, 255, bytes); |
592 | 594 | ||
593 | bytes = sizeof(uv_cpu_to_blade[0]) * num_possible_cpus(); | 595 | bytes = sizeof(uv_cpu_to_blade[0]) * num_possible_cpus(); |
594 | uv_cpu_to_blade = kmalloc(bytes, GFP_KERNEL); | 596 | uv_cpu_to_blade = kmalloc(bytes, GFP_KERNEL); |
597 | BUG_ON(!uv_cpu_to_blade); | ||
595 | memset(uv_cpu_to_blade, 255, bytes); | 598 | memset(uv_cpu_to_blade, 255, bytes); |
596 | 599 | ||
597 | blade = 0; | 600 | blade = 0; |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index c4f667896c28..c1caefc82e62 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -1203,6 +1203,8 @@ void __cpuinit cpu_init(void) | |||
1203 | load_TR_desc(); | 1203 | load_TR_desc(); |
1204 | load_LDT(&init_mm.context); | 1204 | load_LDT(&init_mm.context); |
1205 | 1205 | ||
1206 | t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap); | ||
1207 | |||
1206 | #ifdef CONFIG_DOUBLEFAULT | 1208 | #ifdef CONFIG_DOUBLEFAULT |
1207 | /* Set up doublefault TSS pointer in the GDT */ | 1209 | /* Set up doublefault TSS pointer in the GDT */ |
1208 | __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); | 1210 | __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); |
diff --git a/arch/x86/kernel/cpu/cpu_debug.c b/arch/x86/kernel/cpu/cpu_debug.c index 46e29ab96c6a..2fc4f6bb9ca5 100644 --- a/arch/x86/kernel/cpu/cpu_debug.c +++ b/arch/x86/kernel/cpu/cpu_debug.c | |||
@@ -588,8 +588,20 @@ static void print_apic(void *arg) | |||
588 | seq_printf(seq, " TMICT\t\t: %08x\n", apic_read(APIC_TMICT)); | 588 | seq_printf(seq, " TMICT\t\t: %08x\n", apic_read(APIC_TMICT)); |
589 | seq_printf(seq, " TMCCT\t\t: %08x\n", apic_read(APIC_TMCCT)); | 589 | seq_printf(seq, " TMCCT\t\t: %08x\n", apic_read(APIC_TMCCT)); |
590 | seq_printf(seq, " TDCR\t\t: %08x\n", apic_read(APIC_TDCR)); | 590 | seq_printf(seq, " TDCR\t\t: %08x\n", apic_read(APIC_TDCR)); |
591 | #endif /* CONFIG_X86_LOCAL_APIC */ | 591 | if (boot_cpu_has(X86_FEATURE_EXTAPIC)) { |
592 | unsigned int i, v, maxeilvt; | ||
593 | |||
594 | v = apic_read(APIC_EFEAT); | ||
595 | maxeilvt = (v >> 16) & 0xff; | ||
596 | seq_printf(seq, " EFEAT\t\t: %08x\n", v); | ||
597 | seq_printf(seq, " ECTRL\t\t: %08x\n", apic_read(APIC_ECTRL)); | ||
592 | 598 | ||
599 | for (i = 0; i < maxeilvt; i++) { | ||
600 | v = apic_read(APIC_EILVTn(i)); | ||
601 | seq_printf(seq, " EILVT%d\t\t: %08x\n", i, v); | ||
602 | } | ||
603 | } | ||
604 | #endif /* CONFIG_X86_LOCAL_APIC */ | ||
593 | seq_printf(seq, "\n MSR\t:\n"); | 605 | seq_printf(seq, "\n MSR\t:\n"); |
594 | } | 606 | } |
595 | 607 | ||
diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c index 863f89568b1a..6fb0b359d2a5 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_64.c | |||
@@ -239,9 +239,10 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b) | |||
239 | * Don't get the IP here because it's unlikely to | 239 | * Don't get the IP here because it's unlikely to |
240 | * have anything to do with the actual error location. | 240 | * have anything to do with the actual error location. |
241 | */ | 241 | */ |
242 | 242 | if (!(flags & MCP_DONTLOG)) { | |
243 | mce_log(&m); | 243 | mce_log(&m); |
244 | add_taint(TAINT_MACHINE_CHECK); | 244 | add_taint(TAINT_MACHINE_CHECK); |
245 | } | ||
245 | 246 | ||
246 | /* | 247 | /* |
247 | * Clear state for this bank. | 248 | * Clear state for this bank. |
@@ -452,13 +453,14 @@ void mce_log_therm_throt_event(__u64 status) | |||
452 | */ | 453 | */ |
453 | 454 | ||
454 | static int check_interval = 5 * 60; /* 5 minutes */ | 455 | static int check_interval = 5 * 60; /* 5 minutes */ |
455 | static int next_interval; /* in jiffies */ | 456 | static DEFINE_PER_CPU(int, next_interval); /* in jiffies */ |
456 | static void mcheck_timer(unsigned long); | 457 | static void mcheck_timer(unsigned long); |
457 | static DEFINE_PER_CPU(struct timer_list, mce_timer); | 458 | static DEFINE_PER_CPU(struct timer_list, mce_timer); |
458 | 459 | ||
459 | static void mcheck_timer(unsigned long data) | 460 | static void mcheck_timer(unsigned long data) |
460 | { | 461 | { |
461 | struct timer_list *t = &per_cpu(mce_timer, data); | 462 | struct timer_list *t = &per_cpu(mce_timer, data); |
463 | int *n; | ||
462 | 464 | ||
463 | WARN_ON(smp_processor_id() != data); | 465 | WARN_ON(smp_processor_id() != data); |
464 | 466 | ||
@@ -470,14 +472,14 @@ static void mcheck_timer(unsigned long data) | |||
470 | * Alert userspace if needed. If we logged an MCE, reduce the | 472 | * Alert userspace if needed. If we logged an MCE, reduce the |
471 | * polling interval, otherwise increase the polling interval. | 473 | * polling interval, otherwise increase the polling interval. |
472 | */ | 474 | */ |
475 | n = &__get_cpu_var(next_interval); | ||
473 | if (mce_notify_user()) { | 476 | if (mce_notify_user()) { |
474 | next_interval = max(next_interval/2, HZ/100); | 477 | *n = max(*n/2, HZ/100); |
475 | } else { | 478 | } else { |
476 | next_interval = min(next_interval * 2, | 479 | *n = min(*n*2, (int)round_jiffies_relative(check_interval*HZ)); |
477 | (int)round_jiffies_relative(check_interval*HZ)); | ||
478 | } | 480 | } |
479 | 481 | ||
480 | t->expires = jiffies + next_interval; | 482 | t->expires = jiffies + *n; |
481 | add_timer(t); | 483 | add_timer(t); |
482 | } | 484 | } |
483 | 485 | ||
@@ -584,7 +586,7 @@ static void mce_init(void *dummy) | |||
584 | * Log the machine checks left over from the previous reset. | 586 | * Log the machine checks left over from the previous reset. |
585 | */ | 587 | */ |
586 | bitmap_fill(all_banks, MAX_NR_BANKS); | 588 | bitmap_fill(all_banks, MAX_NR_BANKS); |
587 | machine_check_poll(MCP_UC, &all_banks); | 589 | machine_check_poll(MCP_UC|(!mce_bootlog ? MCP_DONTLOG : 0), &all_banks); |
588 | 590 | ||
589 | set_in_cr4(X86_CR4_MCE); | 591 | set_in_cr4(X86_CR4_MCE); |
590 | 592 | ||
@@ -632,14 +634,13 @@ static void mce_cpu_features(struct cpuinfo_x86 *c) | |||
632 | static void mce_init_timer(void) | 634 | static void mce_init_timer(void) |
633 | { | 635 | { |
634 | struct timer_list *t = &__get_cpu_var(mce_timer); | 636 | struct timer_list *t = &__get_cpu_var(mce_timer); |
637 | int *n = &__get_cpu_var(next_interval); | ||
635 | 638 | ||
636 | /* data race harmless because everyone sets to the same value */ | 639 | *n = check_interval * HZ; |
637 | if (!next_interval) | 640 | if (!*n) |
638 | next_interval = check_interval * HZ; | ||
639 | if (!next_interval) | ||
640 | return; | 641 | return; |
641 | setup_timer(t, mcheck_timer, smp_processor_id()); | 642 | setup_timer(t, mcheck_timer, smp_processor_id()); |
642 | t->expires = round_jiffies(jiffies + next_interval); | 643 | t->expires = round_jiffies(jiffies + *n); |
643 | add_timer(t); | 644 | add_timer(t); |
644 | } | 645 | } |
645 | 646 | ||
@@ -907,7 +908,6 @@ static void mce_cpu_restart(void *data) | |||
907 | /* Reinit MCEs after user configuration changes */ | 908 | /* Reinit MCEs after user configuration changes */ |
908 | static void mce_restart(void) | 909 | static void mce_restart(void) |
909 | { | 910 | { |
910 | next_interval = check_interval * HZ; | ||
911 | on_each_cpu(mce_cpu_restart, NULL, 1); | 911 | on_each_cpu(mce_cpu_restart, NULL, 1); |
912 | } | 912 | } |
913 | 913 | ||
@@ -1110,7 +1110,8 @@ static int __cpuinit mce_cpu_callback(struct notifier_block *nfb, | |||
1110 | break; | 1110 | break; |
1111 | case CPU_DOWN_FAILED: | 1111 | case CPU_DOWN_FAILED: |
1112 | case CPU_DOWN_FAILED_FROZEN: | 1112 | case CPU_DOWN_FAILED_FROZEN: |
1113 | t->expires = round_jiffies(jiffies + next_interval); | 1113 | t->expires = round_jiffies(jiffies + |
1114 | __get_cpu_var(next_interval)); | ||
1114 | add_timer_on(t, cpu); | 1115 | add_timer_on(t, cpu); |
1115 | smp_call_function_single(cpu, mce_reenable_cpu, &action, 1); | 1116 | smp_call_function_single(cpu, mce_reenable_cpu, &action, 1); |
1116 | break; | 1117 | break; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c index d6b72df89d69..cef3ee30744b 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c | |||
@@ -151,10 +151,11 @@ static void print_update(char *type, int *hdr, int num) | |||
151 | static void cmci_discover(int banks, int boot) | 151 | static void cmci_discover(int banks, int boot) |
152 | { | 152 | { |
153 | unsigned long *owned = (void *)&__get_cpu_var(mce_banks_owned); | 153 | unsigned long *owned = (void *)&__get_cpu_var(mce_banks_owned); |
154 | unsigned long flags; | ||
154 | int hdr = 0; | 155 | int hdr = 0; |
155 | int i; | 156 | int i; |
156 | 157 | ||
157 | spin_lock(&cmci_discover_lock); | 158 | spin_lock_irqsave(&cmci_discover_lock, flags); |
158 | for (i = 0; i < banks; i++) { | 159 | for (i = 0; i < banks; i++) { |
159 | u64 val; | 160 | u64 val; |
160 | 161 | ||
@@ -184,7 +185,7 @@ static void cmci_discover(int banks, int boot) | |||
184 | WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks))); | 185 | WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks))); |
185 | } | 186 | } |
186 | } | 187 | } |
187 | spin_unlock(&cmci_discover_lock); | 188 | spin_unlock_irqrestore(&cmci_discover_lock, flags); |
188 | if (hdr) | 189 | if (hdr) |
189 | printk(KERN_CONT "\n"); | 190 | printk(KERN_CONT "\n"); |
190 | } | 191 | } |
@@ -211,13 +212,14 @@ void cmci_recheck(void) | |||
211 | */ | 212 | */ |
212 | void cmci_clear(void) | 213 | void cmci_clear(void) |
213 | { | 214 | { |
215 | unsigned long flags; | ||
214 | int i; | 216 | int i; |
215 | int banks; | 217 | int banks; |
216 | u64 val; | 218 | u64 val; |
217 | 219 | ||
218 | if (!cmci_supported(&banks)) | 220 | if (!cmci_supported(&banks)) |
219 | return; | 221 | return; |
220 | spin_lock(&cmci_discover_lock); | 222 | spin_lock_irqsave(&cmci_discover_lock, flags); |
221 | for (i = 0; i < banks; i++) { | 223 | for (i = 0; i < banks; i++) { |
222 | if (!test_bit(i, __get_cpu_var(mce_banks_owned))) | 224 | if (!test_bit(i, __get_cpu_var(mce_banks_owned))) |
223 | continue; | 225 | continue; |
@@ -227,7 +229,7 @@ void cmci_clear(void) | |||
227 | wrmsrl(MSR_IA32_MC0_CTL2 + i, val); | 229 | wrmsrl(MSR_IA32_MC0_CTL2 + i, val); |
228 | __clear_bit(i, __get_cpu_var(mce_banks_owned)); | 230 | __clear_bit(i, __get_cpu_var(mce_banks_owned)); |
229 | } | 231 | } |
230 | spin_unlock(&cmci_discover_lock); | 232 | spin_unlock_irqrestore(&cmci_discover_lock, flags); |
231 | } | 233 | } |
232 | 234 | ||
233 | /* | 235 | /* |
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index f93047fed791..d5e30397246b 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c | |||
@@ -14,7 +14,7 @@ static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c, | |||
14 | if (c->x86_max_cores * smp_num_siblings > 1) { | 14 | if (c->x86_max_cores * smp_num_siblings > 1) { |
15 | seq_printf(m, "physical id\t: %d\n", c->phys_proc_id); | 15 | seq_printf(m, "physical id\t: %d\n", c->phys_proc_id); |
16 | seq_printf(m, "siblings\t: %d\n", | 16 | seq_printf(m, "siblings\t: %d\n", |
17 | cpumask_weight(cpu_sibling_mask(cpu))); | 17 | cpumask_weight(cpu_core_mask(cpu))); |
18 | seq_printf(m, "core id\t\t: %d\n", c->cpu_core_id); | 18 | seq_printf(m, "core id\t\t: %d\n", c->cpu_core_id); |
19 | seq_printf(m, "cpu cores\t: %d\n", c->booted_cores); | 19 | seq_printf(m, "cpu cores\t: %d\n", c->booted_cores); |
20 | seq_printf(m, "apicid\t\t: %d\n", c->apicid); | 20 | seq_printf(m, "apicid\t\t: %d\n", c->apicid); |
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index ef2c3563357d..006281302925 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -1074,12 +1074,13 @@ u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align) | |||
1074 | u64 addr; | 1074 | u64 addr; |
1075 | u64 start; | 1075 | u64 start; |
1076 | 1076 | ||
1077 | start = startt; | 1077 | for (start = startt; ; start += size) { |
1078 | while (size < sizet && (start + 1)) | ||
1079 | start = find_e820_area_size(start, &size, align); | 1078 | start = find_e820_area_size(start, &size, align); |
1080 | 1079 | if (!(start + 1)) | |
1081 | if (size < sizet) | 1080 | return 0; |
1082 | return 0; | 1081 | if (size >= sizet) |
1082 | break; | ||
1083 | } | ||
1083 | 1084 | ||
1084 | #ifdef CONFIG_X86_32 | 1085 | #ifdef CONFIG_X86_32 |
1085 | if (start >= MAXMEM) | 1086 | if (start >= MAXMEM) |
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c index e7368c1da01d..c1c429d00130 100644 --- a/arch/x86/kernel/machine_kexec_32.c +++ b/arch/x86/kernel/machine_kexec_32.c | |||
@@ -194,7 +194,7 @@ void machine_kexec(struct kimage *image) | |||
194 | unsigned int preserve_context); | 194 | unsigned int preserve_context); |
195 | 195 | ||
196 | #ifdef CONFIG_KEXEC_JUMP | 196 | #ifdef CONFIG_KEXEC_JUMP |
197 | if (kexec_image->preserve_context) | 197 | if (image->preserve_context) |
198 | save_processor_state(); | 198 | save_processor_state(); |
199 | #endif | 199 | #endif |
200 | 200 | ||
@@ -253,7 +253,7 @@ void machine_kexec(struct kimage *image) | |||
253 | image->preserve_context); | 253 | image->preserve_context); |
254 | 254 | ||
255 | #ifdef CONFIG_KEXEC_JUMP | 255 | #ifdef CONFIG_KEXEC_JUMP |
256 | if (kexec_image->preserve_context) | 256 | if (image->preserve_context) |
257 | restore_processor_state(); | 257 | restore_processor_state(); |
258 | #endif | 258 | #endif |
259 | 259 | ||
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 89cea4d44679..84c3bf209e98 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c | |||
@@ -274,7 +274,7 @@ void machine_kexec(struct kimage *image) | |||
274 | int save_ftrace_enabled; | 274 | int save_ftrace_enabled; |
275 | 275 | ||
276 | #ifdef CONFIG_KEXEC_JUMP | 276 | #ifdef CONFIG_KEXEC_JUMP |
277 | if (kexec_image->preserve_context) | 277 | if (image->preserve_context) |
278 | save_processor_state(); | 278 | save_processor_state(); |
279 | #endif | 279 | #endif |
280 | 280 | ||
@@ -333,7 +333,7 @@ void machine_kexec(struct kimage *image) | |||
333 | image->preserve_context); | 333 | image->preserve_context); |
334 | 334 | ||
335 | #ifdef CONFIG_KEXEC_JUMP | 335 | #ifdef CONFIG_KEXEC_JUMP |
336 | if (kexec_image->preserve_context) | 336 | if (image->preserve_context) |
337 | restore_processor_state(); | 337 | restore_processor_state(); |
338 | #endif | 338 | #endif |
339 | 339 | ||
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index fd3da1dda1c9..ae4f7b5d7104 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <asm/page.h> | 7 | #include <asm/page.h> |
8 | #include <asm/page_types.h> | 8 | #include <asm/page_types.h> |
9 | #include <asm/sections.h> | 9 | #include <asm/sections.h> |
10 | #include <asm/setup.h> | ||
10 | #include <asm/system.h> | 11 | #include <asm/system.h> |
11 | #include <asm/tlbflush.h> | 12 | #include <asm/tlbflush.h> |
12 | 13 | ||
@@ -304,8 +305,23 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
304 | #endif | 305 | #endif |
305 | 306 | ||
306 | #ifdef CONFIG_X86_64 | 307 | #ifdef CONFIG_X86_64 |
307 | if (!after_bootmem) | 308 | if (!after_bootmem && !start) { |
309 | pud_t *pud; | ||
310 | pmd_t *pmd; | ||
311 | |||
308 | mmu_cr4_features = read_cr4(); | 312 | mmu_cr4_features = read_cr4(); |
313 | |||
314 | /* | ||
315 | * _brk_end cannot change anymore, but it and _end may be | ||
316 | * located on different 2M pages. cleanup_highmap(), however, | ||
317 | * can only consider _end when it runs, so destroy any | ||
318 | * mappings beyond _brk_end here. | ||
319 | */ | ||
320 | pud = pud_offset(pgd_offset_k(_brk_end), _brk_end); | ||
321 | pmd = pmd_offset(pud, _brk_end - 1); | ||
322 | while (++pmd <= pmd_offset(pud, (unsigned long)_end - 1)) | ||
323 | pmd_clear(pmd); | ||
324 | } | ||
309 | #endif | 325 | #endif |
310 | __flush_tlb_all(); | 326 | __flush_tlb_all(); |
311 | 327 | ||
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index 4f115e00486b..50dc802a1c46 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c | |||
@@ -87,7 +87,7 @@ static struct kmmio_probe *get_kmmio_probe(unsigned long addr) | |||
87 | { | 87 | { |
88 | struct kmmio_probe *p; | 88 | struct kmmio_probe *p; |
89 | list_for_each_entry_rcu(p, &kmmio_probes, list) { | 89 | list_for_each_entry_rcu(p, &kmmio_probes, list) { |
90 | if (addr >= p->addr && addr <= (p->addr + p->len)) | 90 | if (addr >= p->addr && addr < (p->addr + p->len)) |
91 | return p; | 91 | return p; |
92 | } | 92 | } |
93 | return NULL; | 93 | return NULL; |
diff --git a/arch/x86/mm/srat_32.c b/arch/x86/mm/srat_32.c index 16ae70fc57e7..29a0e37114f8 100644 --- a/arch/x86/mm/srat_32.c +++ b/arch/x86/mm/srat_32.c | |||
@@ -216,7 +216,7 @@ int __init get_memcfg_from_srat(void) | |||
216 | 216 | ||
217 | if (num_memory_chunks == 0) { | 217 | if (num_memory_chunks == 0) { |
218 | printk(KERN_WARNING | 218 | printk(KERN_WARNING |
219 | "could not finy any ACPI SRAT memory areas.\n"); | 219 | "could not find any ACPI SRAT memory areas.\n"); |
220 | goto out_fail; | 220 | goto out_fail; |
221 | } | 221 | } |
222 | 222 | ||
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index 33c5fa57e43d..01765955baaf 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c | |||
@@ -361,6 +361,7 @@ static void __init unparse_node(int node) | |||
361 | { | 361 | { |
362 | int i; | 362 | int i; |
363 | node_clear(node, nodes_parsed); | 363 | node_clear(node, nodes_parsed); |
364 | node_clear(node, cpu_nodes_parsed); | ||
364 | for (i = 0; i < MAX_LOCAL_APIC; i++) { | 365 | for (i = 0; i < MAX_LOCAL_APIC; i++) { |
365 | if (apicid_to_node[i] == node) | 366 | if (apicid_to_node[i] == node) |
366 | apicid_to_node[i] = NUMA_NO_NODE; | 367 | apicid_to_node[i] = NUMA_NO_NODE; |
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c index 9bb09823b362..f893d6a6e803 100644 --- a/arch/x86/pci/amd_bus.c +++ b/arch/x86/pci/amd_bus.c | |||
@@ -94,12 +94,16 @@ struct pci_root_info { | |||
94 | static int pci_root_num; | 94 | static int pci_root_num; |
95 | static struct pci_root_info pci_root_info[PCI_ROOT_NR]; | 95 | static struct pci_root_info pci_root_info[PCI_ROOT_NR]; |
96 | 96 | ||
97 | void set_pci_bus_resources_arch_default(struct pci_bus *b) | 97 | void x86_pci_root_bus_res_quirks(struct pci_bus *b) |
98 | { | 98 | { |
99 | int i; | 99 | int i; |
100 | int j; | 100 | int j; |
101 | struct pci_root_info *info; | 101 | struct pci_root_info *info; |
102 | 102 | ||
103 | /* don't go for it if _CRS is used */ | ||
104 | if (pci_probe & PCI_USE__CRS) | ||
105 | return; | ||
106 | |||
103 | /* if only one root bus, don't need to anything */ | 107 | /* if only one root bus, don't need to anything */ |
104 | if (pci_root_num < 2) | 108 | if (pci_root_num < 2) |
105 | return; | 109 | return; |
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 8c362b96b644..2202b6257b82 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c | |||
@@ -147,10 +147,13 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) | |||
147 | * are examined. | 147 | * are examined. |
148 | */ | 148 | */ |
149 | 149 | ||
150 | void __devinit pcibios_fixup_bus(struct pci_bus *b) | 150 | void __devinit pcibios_fixup_bus(struct pci_bus *b) |
151 | { | 151 | { |
152 | struct pci_dev *dev; | 152 | struct pci_dev *dev; |
153 | 153 | ||
154 | /* root bus? */ | ||
155 | if (!b->parent) | ||
156 | x86_pci_root_bus_res_quirks(b); | ||
154 | pci_read_bridge_bases(b); | 157 | pci_read_bridge_bases(b); |
155 | list_for_each_entry(dev, &b->devices, bus_list) | 158 | list_for_each_entry(dev, &b->devices, bus_list) |
156 | pcibios_fixup_device_resources(dev); | 159 | pcibios_fixup_device_resources(dev); |
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index f1817f71e009..a85bef20a3b9 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -238,6 +238,10 @@ void __init pcibios_resource_survey(void) | |||
238 | */ | 238 | */ |
239 | fs_initcall(pcibios_assign_resources); | 239 | fs_initcall(pcibios_assign_resources); |
240 | 240 | ||
241 | void __weak x86_pci_root_bus_res_quirks(struct pci_bus *b) | ||
242 | { | ||
243 | } | ||
244 | |||
241 | /* | 245 | /* |
242 | * If we set up a device for bus mastering, we need to check the latency | 246 | * If we set up a device for bus mastering, we need to check the latency |
243 | * timer as certain crappy BIOSes forget to set it properly. | 247 | * timer as certain crappy BIOSes forget to set it properly. |
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 905bb526b133..5fa10bb9604f 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c | |||
@@ -375,7 +375,7 @@ static acpi_status __init check_mcfg_resource(struct acpi_resource *res, | |||
375 | if (!fixmem32) | 375 | if (!fixmem32) |
376 | return AE_OK; | 376 | return AE_OK; |
377 | if ((mcfg_res->start >= fixmem32->address) && | 377 | if ((mcfg_res->start >= fixmem32->address) && |
378 | (mcfg_res->end < (fixmem32->address + | 378 | (mcfg_res->end <= (fixmem32->address + |
379 | fixmem32->address_length))) { | 379 | fixmem32->address_length))) { |
380 | mcfg_res->flags = 1; | 380 | mcfg_res->flags = 1; |
381 | return AE_CTRL_TERMINATE; | 381 | return AE_CTRL_TERMINATE; |
@@ -392,7 +392,7 @@ static acpi_status __init check_mcfg_resource(struct acpi_resource *res, | |||
392 | return AE_OK; | 392 | return AE_OK; |
393 | 393 | ||
394 | if ((mcfg_res->start >= address.minimum) && | 394 | if ((mcfg_res->start >= address.minimum) && |
395 | (mcfg_res->end < (address.minimum + address.address_length))) { | 395 | (mcfg_res->end <= (address.minimum + address.address_length))) { |
396 | mcfg_res->flags = 1; | 396 | mcfg_res->flags = 1; |
397 | return AE_CTRL_TERMINATE; | 397 | return AE_CTRL_TERMINATE; |
398 | } | 398 | } |
@@ -439,7 +439,7 @@ static int __init is_mmconf_reserved(check_reserved_t is_reserved, | |||
439 | u64 old_size = size; | 439 | u64 old_size = size; |
440 | int valid = 0; | 440 | int valid = 0; |
441 | 441 | ||
442 | while (!is_reserved(addr, addr + size - 1, E820_RESERVED)) { | 442 | while (!is_reserved(addr, addr + size, E820_RESERVED)) { |
443 | size >>= 1; | 443 | size >>= 1; |
444 | if (size < (16UL<<20)) | 444 | if (size < (16UL<<20)) |
445 | break; | 445 | break; |
diff --git a/arch/x86/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_gettime.c index d9d35824c56f..6a40b78b46aa 100644 --- a/arch/x86/vdso/vclock_gettime.c +++ b/arch/x86/vdso/vclock_gettime.c | |||
@@ -104,11 +104,13 @@ notrace int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz) | |||
104 | { | 104 | { |
105 | long ret; | 105 | long ret; |
106 | if (likely(gtod->sysctl_enabled && gtod->clock.vread)) { | 106 | if (likely(gtod->sysctl_enabled && gtod->clock.vread)) { |
107 | BUILD_BUG_ON(offsetof(struct timeval, tv_usec) != | 107 | if (likely(tv != NULL)) { |
108 | offsetof(struct timespec, tv_nsec) || | 108 | BUILD_BUG_ON(offsetof(struct timeval, tv_usec) != |
109 | sizeof(*tv) != sizeof(struct timespec)); | 109 | offsetof(struct timespec, tv_nsec) || |
110 | do_realtime((struct timespec *)tv); | 110 | sizeof(*tv) != sizeof(struct timespec)); |
111 | tv->tv_usec /= 1000; | 111 | do_realtime((struct timespec *)tv); |
112 | tv->tv_usec /= 1000; | ||
113 | } | ||
112 | if (unlikely(tz != NULL)) { | 114 | if (unlikely(tz != NULL)) { |
113 | /* Avoid memcpy. Some old compilers fail to inline it */ | 115 | /* Avoid memcpy. Some old compilers fail to inline it */ |
114 | tz->tz_minuteswest = gtod->sys_tz.tz_minuteswest; | 116 | tz->tz_minuteswest = gtod->sys_tz.tz_minuteswest; |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 9842b1212407..e25a78e1113a 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1794,6 +1794,11 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, | |||
1794 | 1794 | ||
1795 | pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(swapper_pg_dir))); | 1795 | pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(swapper_pg_dir))); |
1796 | 1796 | ||
1797 | reserve_early(__pa(xen_start_info->pt_base), | ||
1798 | __pa(xen_start_info->pt_base + | ||
1799 | xen_start_info->nr_pt_frames * PAGE_SIZE), | ||
1800 | "XEN PAGETABLES"); | ||
1801 | |||
1797 | return swapper_pg_dir; | 1802 | return swapper_pg_dir; |
1798 | } | 1803 | } |
1799 | #endif /* CONFIG_X86_64 */ | 1804 | #endif /* CONFIG_X86_64 */ |