diff options
Diffstat (limited to 'arch/i386')
| -rw-r--r-- | arch/i386/kernel/acpi/boot.c | 10 | ||||
| -rw-r--r-- | arch/i386/kernel/acpi/earlyquirk.c | 8 | ||||
| -rw-r--r-- | arch/i386/kernel/apm.c | 2 | ||||
| -rw-r--r-- | arch/i386/kernel/io_apic.c | 96 | ||||
| -rw-r--r-- | arch/i386/kernel/kprobes.c | 22 | ||||
| -rw-r--r-- | arch/i386/kernel/microcode.c | 2 | ||||
| -rw-r--r-- | arch/i386/kernel/process.c | 4 | ||||
| -rw-r--r-- | arch/i386/kernel/setup.c | 2 | ||||
| -rw-r--r-- | arch/i386/kernel/traps.c | 10 | ||||
| -rw-r--r-- | arch/i386/kernel/vmlinux.lds.S | 9 | ||||
| -rw-r--r-- | arch/i386/mach-visws/visws_apic.c | 7 | ||||
| -rw-r--r-- | arch/i386/pci/common.c | 1 | ||||
| -rw-r--r-- | arch/i386/pci/fixup.c | 55 | ||||
| -rw-r--r-- | arch/i386/pci/i386.c | 9 | ||||
| -rw-r--r-- | arch/i386/pci/irq.c | 4 | ||||
| -rw-r--r-- | arch/i386/pci/mmconfig.c | 35 | ||||
| -rw-r--r-- | arch/i386/pci/pci.h | 1 |
17 files changed, 184 insertions, 93 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index ab974ff97073..d12fb97a5337 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
| @@ -70,7 +70,7 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return | |||
| 70 | 70 | ||
| 71 | #define PREFIX "ACPI: " | 71 | #define PREFIX "ACPI: " |
| 72 | 72 | ||
| 73 | int acpi_noirq __initdata; /* skip ACPI IRQ initialization */ | 73 | int acpi_noirq; /* skip ACPI IRQ initialization */ |
| 74 | int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */ | 74 | int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */ |
| 75 | int acpi_ht __initdata = 1; /* enable HT */ | 75 | int acpi_ht __initdata = 1; /* enable HT */ |
| 76 | 76 | ||
| @@ -82,6 +82,7 @@ EXPORT_SYMBOL(acpi_strict); | |||
| 82 | acpi_interrupt_flags acpi_sci_flags __initdata; | 82 | acpi_interrupt_flags acpi_sci_flags __initdata; |
| 83 | int acpi_sci_override_gsi __initdata; | 83 | int acpi_sci_override_gsi __initdata; |
| 84 | int acpi_skip_timer_override __initdata; | 84 | int acpi_skip_timer_override __initdata; |
| 85 | int acpi_use_timer_override __initdata; | ||
| 85 | 86 | ||
| 86 | #ifdef CONFIG_X86_LOCAL_APIC | 87 | #ifdef CONFIG_X86_LOCAL_APIC |
| 87 | static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; | 88 | static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; |
| @@ -1300,6 +1301,13 @@ static int __init parse_acpi_skip_timer_override(char *arg) | |||
| 1300 | return 0; | 1301 | return 0; |
| 1301 | } | 1302 | } |
| 1302 | early_param("acpi_skip_timer_override", parse_acpi_skip_timer_override); | 1303 | early_param("acpi_skip_timer_override", parse_acpi_skip_timer_override); |
| 1304 | |||
| 1305 | static int __init parse_acpi_use_timer_override(char *arg) | ||
| 1306 | { | ||
| 1307 | acpi_use_timer_override = 1; | ||
| 1308 | return 0; | ||
| 1309 | } | ||
| 1310 | early_param("acpi_use_timer_override", parse_acpi_use_timer_override); | ||
| 1303 | #endif /* CONFIG_X86_IO_APIC */ | 1311 | #endif /* CONFIG_X86_IO_APIC */ |
| 1304 | 1312 | ||
| 1305 | static int __init setup_acpi_sci(char *s) | 1313 | static int __init setup_acpi_sci(char *s) |
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c index fe799b11ac0a..c9841692bb7c 100644 --- a/arch/i386/kernel/acpi/earlyquirk.c +++ b/arch/i386/kernel/acpi/earlyquirk.c | |||
| @@ -27,11 +27,17 @@ static int __init check_bridge(int vendor, int device) | |||
| 27 | #ifdef CONFIG_ACPI | 27 | #ifdef CONFIG_ACPI |
| 28 | /* According to Nvidia all timer overrides are bogus unless HPET | 28 | /* According to Nvidia all timer overrides are bogus unless HPET |
| 29 | is enabled. */ | 29 | is enabled. */ |
| 30 | if (vendor == PCI_VENDOR_ID_NVIDIA) { | 30 | if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) { |
| 31 | nvidia_hpet_detected = 0; | 31 | nvidia_hpet_detected = 0; |
| 32 | acpi_table_parse(ACPI_HPET, nvidia_hpet_check); | 32 | acpi_table_parse(ACPI_HPET, nvidia_hpet_check); |
| 33 | if (nvidia_hpet_detected == 0) { | 33 | if (nvidia_hpet_detected == 0) { |
| 34 | acpi_skip_timer_override = 1; | 34 | acpi_skip_timer_override = 1; |
| 35 | printk(KERN_INFO "Nvidia board " | ||
| 36 | "detected. Ignoring ACPI " | ||
| 37 | "timer override.\n"); | ||
| 38 | printk(KERN_INFO "If you got timer trouble " | ||
| 39 | "try acpi_use_timer_override\n"); | ||
| 40 | |||
| 35 | } | 41 | } |
| 36 | } | 42 | } |
| 37 | #endif | 43 | #endif |
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index 2af65858d322..a60358fe9a49 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c | |||
| @@ -198,7 +198,7 @@ | |||
| 198 | * (APM) BIOS Interface Specification, Revision 1.2, February 1996. | 198 | * (APM) BIOS Interface Specification, Revision 1.2, February 1996. |
| 199 | * | 199 | * |
| 200 | * [This document is available from Microsoft at: | 200 | * [This document is available from Microsoft at: |
| 201 | * http://www.microsoft.com/hwdev/busbios/amp_12.htm] | 201 | * http://www.microsoft.com/whdc/archive/amp_12.mspx] |
| 202 | */ | 202 | */ |
| 203 | 203 | ||
| 204 | #include <linux/module.h> | 204 | #include <linux/module.h> |
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 350192d6ab98..3b7a63e0ed1a 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c | |||
| @@ -91,6 +91,46 @@ static struct irq_pin_list { | |||
| 91 | int apic, pin, next; | 91 | int apic, pin, next; |
| 92 | } irq_2_pin[PIN_MAP_SIZE]; | 92 | } irq_2_pin[PIN_MAP_SIZE]; |
| 93 | 93 | ||
| 94 | struct io_apic { | ||
| 95 | unsigned int index; | ||
| 96 | unsigned int unused[3]; | ||
| 97 | unsigned int data; | ||
| 98 | }; | ||
| 99 | |||
| 100 | static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx) | ||
| 101 | { | ||
| 102 | return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx) | ||
| 103 | + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK); | ||
| 104 | } | ||
| 105 | |||
| 106 | static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) | ||
| 107 | { | ||
| 108 | struct io_apic __iomem *io_apic = io_apic_base(apic); | ||
| 109 | writel(reg, &io_apic->index); | ||
| 110 | return readl(&io_apic->data); | ||
| 111 | } | ||
| 112 | |||
| 113 | static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value) | ||
| 114 | { | ||
| 115 | struct io_apic __iomem *io_apic = io_apic_base(apic); | ||
| 116 | writel(reg, &io_apic->index); | ||
| 117 | writel(value, &io_apic->data); | ||
| 118 | } | ||
| 119 | |||
| 120 | /* | ||
| 121 | * Re-write a value: to be used for read-modify-write | ||
| 122 | * cycles where the read already set up the index register. | ||
| 123 | * | ||
| 124 | * Older SiS APIC requires we rewrite the index register | ||
| 125 | */ | ||
| 126 | static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value) | ||
| 127 | { | ||
| 128 | volatile struct io_apic *io_apic = io_apic_base(apic); | ||
| 129 | if (sis_apic_bug) | ||
| 130 | writel(reg, &io_apic->index); | ||
| 131 | writel(value, &io_apic->data); | ||
| 132 | } | ||
| 133 | |||
| 94 | union entry_union { | 134 | union entry_union { |
| 95 | struct { u32 w1, w2; }; | 135 | struct { u32 w1, w2; }; |
| 96 | struct IO_APIC_route_entry entry; | 136 | struct IO_APIC_route_entry entry; |
| @@ -107,12 +147,34 @@ static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin) | |||
| 107 | return eu.entry; | 147 | return eu.entry; |
| 108 | } | 148 | } |
| 109 | 149 | ||
| 150 | /* | ||
| 151 | * When we write a new IO APIC routing entry, we need to write the high | ||
| 152 | * word first! If the mask bit in the low word is clear, we will enable | ||
| 153 | * the interrupt, and we need to make sure the entry is fully populated | ||
| 154 | * before that happens. | ||
| 155 | */ | ||
| 110 | static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) | 156 | static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) |
| 111 | { | 157 | { |
| 112 | unsigned long flags; | 158 | unsigned long flags; |
| 113 | union entry_union eu; | 159 | union entry_union eu; |
| 114 | eu.entry = e; | 160 | eu.entry = e; |
| 115 | spin_lock_irqsave(&ioapic_lock, flags); | 161 | spin_lock_irqsave(&ioapic_lock, flags); |
| 162 | io_apic_write(apic, 0x11 + 2*pin, eu.w2); | ||
| 163 | io_apic_write(apic, 0x10 + 2*pin, eu.w1); | ||
| 164 | spin_unlock_irqrestore(&ioapic_lock, flags); | ||
| 165 | } | ||
| 166 | |||
| 167 | /* | ||
| 168 | * When we mask an IO APIC routing entry, we need to write the low | ||
| 169 | * word first, in order to set the mask bit before we change the | ||
| 170 | * high bits! | ||
| 171 | */ | ||
| 172 | static void ioapic_mask_entry(int apic, int pin) | ||
| 173 | { | ||
| 174 | unsigned long flags; | ||
| 175 | union entry_union eu = { .entry.mask = 1 }; | ||
| 176 | |||
| 177 | spin_lock_irqsave(&ioapic_lock, flags); | ||
| 116 | io_apic_write(apic, 0x10 + 2*pin, eu.w1); | 178 | io_apic_write(apic, 0x10 + 2*pin, eu.w1); |
| 117 | io_apic_write(apic, 0x11 + 2*pin, eu.w2); | 179 | io_apic_write(apic, 0x11 + 2*pin, eu.w2); |
| 118 | spin_unlock_irqrestore(&ioapic_lock, flags); | 180 | spin_unlock_irqrestore(&ioapic_lock, flags); |
| @@ -234,9 +296,7 @@ static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin) | |||
| 234 | /* | 296 | /* |
| 235 | * Disable it in the IO-APIC irq-routing table: | 297 | * Disable it in the IO-APIC irq-routing table: |
| 236 | */ | 298 | */ |
| 237 | memset(&entry, 0, sizeof(entry)); | 299 | ioapic_mask_entry(apic, pin); |
| 238 | entry.mask = 1; | ||
| 239 | ioapic_write_entry(apic, pin, entry); | ||
| 240 | } | 300 | } |
| 241 | 301 | ||
| 242 | static void clear_IO_APIC (void) | 302 | static void clear_IO_APIC (void) |
| @@ -1227,9 +1287,11 @@ static void ioapic_register_intr(int irq, int vector, unsigned long trigger) | |||
| 1227 | trigger == IOAPIC_LEVEL) | 1287 | trigger == IOAPIC_LEVEL) |
| 1228 | set_irq_chip_and_handler_name(irq, &ioapic_chip, | 1288 | set_irq_chip_and_handler_name(irq, &ioapic_chip, |
| 1229 | handle_fasteoi_irq, "fasteoi"); | 1289 | handle_fasteoi_irq, "fasteoi"); |
| 1230 | else | 1290 | else { |
| 1291 | irq_desc[irq].status |= IRQ_DELAYED_DISABLE; | ||
| 1231 | set_irq_chip_and_handler_name(irq, &ioapic_chip, | 1292 | set_irq_chip_and_handler_name(irq, &ioapic_chip, |
| 1232 | handle_edge_irq, "edge"); | 1293 | handle_edge_irq, "edge"); |
| 1294 | } | ||
| 1233 | set_intr_gate(vector, interrupt[irq]); | 1295 | set_intr_gate(vector, interrupt[irq]); |
| 1234 | } | 1296 | } |
| 1235 | 1297 | ||
| @@ -2564,18 +2626,16 @@ void arch_teardown_msi_irq(unsigned int irq) | |||
| 2564 | 2626 | ||
| 2565 | static void target_ht_irq(unsigned int irq, unsigned int dest) | 2627 | static void target_ht_irq(unsigned int irq, unsigned int dest) |
| 2566 | { | 2628 | { |
| 2567 | u32 low, high; | 2629 | struct ht_irq_msg msg; |
| 2568 | low = read_ht_irq_low(irq); | 2630 | fetch_ht_irq_msg(irq, &msg); |
| 2569 | high = read_ht_irq_high(irq); | ||
| 2570 | 2631 | ||
| 2571 | low &= ~(HT_IRQ_LOW_DEST_ID_MASK); | 2632 | msg.address_lo &= ~(HT_IRQ_LOW_DEST_ID_MASK); |
| 2572 | high &= ~(HT_IRQ_HIGH_DEST_ID_MASK); | 2633 | msg.address_hi &= ~(HT_IRQ_HIGH_DEST_ID_MASK); |
| 2573 | 2634 | ||
| 2574 | low |= HT_IRQ_LOW_DEST_ID(dest); | 2635 | msg.address_lo |= HT_IRQ_LOW_DEST_ID(dest); |
| 2575 | high |= HT_IRQ_HIGH_DEST_ID(dest); | 2636 | msg.address_hi |= HT_IRQ_HIGH_DEST_ID(dest); |
| 2576 | 2637 | ||
| 2577 | write_ht_irq_low(irq, low); | 2638 | write_ht_irq_msg(irq, &msg); |
| 2578 | write_ht_irq_high(irq, high); | ||
| 2579 | } | 2639 | } |
| 2580 | 2640 | ||
| 2581 | static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask) | 2641 | static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask) |
| @@ -2613,7 +2673,7 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev) | |||
| 2613 | 2673 | ||
| 2614 | vector = assign_irq_vector(irq); | 2674 | vector = assign_irq_vector(irq); |
| 2615 | if (vector >= 0) { | 2675 | if (vector >= 0) { |
| 2616 | u32 low, high; | 2676 | struct ht_irq_msg msg; |
| 2617 | unsigned dest; | 2677 | unsigned dest; |
| 2618 | cpumask_t tmp; | 2678 | cpumask_t tmp; |
| 2619 | 2679 | ||
| @@ -2621,9 +2681,10 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev) | |||
| 2621 | cpu_set(vector >> 8, tmp); | 2681 | cpu_set(vector >> 8, tmp); |
| 2622 | dest = cpu_mask_to_apicid(tmp); | 2682 | dest = cpu_mask_to_apicid(tmp); |
| 2623 | 2683 | ||
| 2624 | high = HT_IRQ_HIGH_DEST_ID(dest); | 2684 | msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest); |
| 2625 | 2685 | ||
| 2626 | low = HT_IRQ_LOW_BASE | | 2686 | msg.address_lo = |
| 2687 | HT_IRQ_LOW_BASE | | ||
| 2627 | HT_IRQ_LOW_DEST_ID(dest) | | 2688 | HT_IRQ_LOW_DEST_ID(dest) | |
| 2628 | HT_IRQ_LOW_VECTOR(vector) | | 2689 | HT_IRQ_LOW_VECTOR(vector) | |
| 2629 | ((INT_DEST_MODE == 0) ? | 2690 | ((INT_DEST_MODE == 0) ? |
| @@ -2635,8 +2696,7 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev) | |||
| 2635 | HT_IRQ_LOW_MT_ARBITRATED) | | 2696 | HT_IRQ_LOW_MT_ARBITRATED) | |
| 2636 | HT_IRQ_LOW_IRQ_MASKED; | 2697 | HT_IRQ_LOW_IRQ_MASKED; |
| 2637 | 2698 | ||
| 2638 | write_ht_irq_low(irq, low); | 2699 | write_ht_irq_msg(irq, &msg); |
| 2639 | write_ht_irq_high(irq, high); | ||
| 2640 | 2700 | ||
| 2641 | set_irq_chip_and_handler_name(irq, &ht_irq_chip, | 2701 | set_irq_chip_and_handler_name(irq, &ht_irq_chip, |
| 2642 | handle_edge_irq, "edge"); | 2702 | handle_edge_irq, "edge"); |
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c index d98e44b16fe2..fc79e1e859c4 100644 --- a/arch/i386/kernel/kprobes.c +++ b/arch/i386/kernel/kprobes.c | |||
| @@ -361,8 +361,11 @@ no_kprobe: | |||
| 361 | asm volatile ( ".global kretprobe_trampoline\n" | 361 | asm volatile ( ".global kretprobe_trampoline\n" |
| 362 | "kretprobe_trampoline: \n" | 362 | "kretprobe_trampoline: \n" |
| 363 | " pushf\n" | 363 | " pushf\n" |
| 364 | /* skip cs, eip, orig_eax, es, ds */ | 364 | /* skip cs, eip, orig_eax */ |
| 365 | " subl $20, %esp\n" | 365 | " subl $12, %esp\n" |
| 366 | " pushl %gs\n" | ||
| 367 | " pushl %ds\n" | ||
| 368 | " pushl %es\n" | ||
| 366 | " pushl %eax\n" | 369 | " pushl %eax\n" |
| 367 | " pushl %ebp\n" | 370 | " pushl %ebp\n" |
| 368 | " pushl %edi\n" | 371 | " pushl %edi\n" |
| @@ -373,10 +376,10 @@ no_kprobe: | |||
| 373 | " movl %esp, %eax\n" | 376 | " movl %esp, %eax\n" |
| 374 | " call trampoline_handler\n" | 377 | " call trampoline_handler\n" |
| 375 | /* move eflags to cs */ | 378 | /* move eflags to cs */ |
| 376 | " movl 48(%esp), %edx\n" | 379 | " movl 52(%esp), %edx\n" |
| 377 | " movl %edx, 44(%esp)\n" | 380 | " movl %edx, 48(%esp)\n" |
| 378 | /* save true return address on eflags */ | 381 | /* save true return address on eflags */ |
| 379 | " movl %eax, 48(%esp)\n" | 382 | " movl %eax, 52(%esp)\n" |
| 380 | " popl %ebx\n" | 383 | " popl %ebx\n" |
| 381 | " popl %ecx\n" | 384 | " popl %ecx\n" |
| 382 | " popl %edx\n" | 385 | " popl %edx\n" |
| @@ -384,8 +387,8 @@ no_kprobe: | |||
| 384 | " popl %edi\n" | 387 | " popl %edi\n" |
| 385 | " popl %ebp\n" | 388 | " popl %ebp\n" |
| 386 | " popl %eax\n" | 389 | " popl %eax\n" |
| 387 | /* skip eip, orig_eax, es, ds */ | 390 | /* skip eip, orig_eax, es, ds, gs */ |
| 388 | " addl $16, %esp\n" | 391 | " addl $20, %esp\n" |
| 389 | " popf\n" | 392 | " popf\n" |
| 390 | " ret\n"); | 393 | " ret\n"); |
| 391 | } | 394 | } |
| @@ -404,6 +407,10 @@ fastcall void *__kprobes trampoline_handler(struct pt_regs *regs) | |||
| 404 | INIT_HLIST_HEAD(&empty_rp); | 407 | INIT_HLIST_HEAD(&empty_rp); |
| 405 | spin_lock_irqsave(&kretprobe_lock, flags); | 408 | spin_lock_irqsave(&kretprobe_lock, flags); |
| 406 | head = kretprobe_inst_table_head(current); | 409 | head = kretprobe_inst_table_head(current); |
| 410 | /* fixup registers */ | ||
| 411 | regs->xcs = __KERNEL_CS; | ||
| 412 | regs->eip = trampoline_address; | ||
| 413 | regs->orig_eax = 0xffffffff; | ||
| 407 | 414 | ||
| 408 | /* | 415 | /* |
| 409 | * It is possible to have multiple instances associated with a given | 416 | * It is possible to have multiple instances associated with a given |
| @@ -425,6 +432,7 @@ fastcall void *__kprobes trampoline_handler(struct pt_regs *regs) | |||
| 425 | 432 | ||
| 426 | if (ri->rp && ri->rp->handler){ | 433 | if (ri->rp && ri->rp->handler){ |
| 427 | __get_cpu_var(current_kprobe) = &ri->rp->kp; | 434 | __get_cpu_var(current_kprobe) = &ri->rp->kp; |
| 435 | get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE; | ||
| 428 | ri->rp->handler(ri, regs); | 436 | ri->rp->handler(ri, regs); |
| 429 | __get_cpu_var(current_kprobe) = NULL; | 437 | __get_cpu_var(current_kprobe) = NULL; |
| 430 | } | 438 | } |
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index c4d0291b519f..23f5984d0654 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c | |||
| @@ -577,7 +577,7 @@ static void microcode_init_cpu(int cpu) | |||
| 577 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | 577 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); |
| 578 | mutex_lock(µcode_mutex); | 578 | mutex_lock(µcode_mutex); |
| 579 | collect_cpu_info(cpu); | 579 | collect_cpu_info(cpu); |
| 580 | if (uci->valid) | 580 | if (uci->valid && system_state == SYSTEM_RUNNING) |
| 581 | cpu_request_microcode(cpu); | 581 | cpu_request_microcode(cpu); |
| 582 | mutex_unlock(µcode_mutex); | 582 | mutex_unlock(µcode_mutex); |
| 583 | set_cpus_allowed(current, old); | 583 | set_cpus_allowed(current, old); |
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index 1e1fa3e391a3..dd53c58f64f1 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c | |||
| @@ -205,7 +205,7 @@ void cpu_idle(void) | |||
| 205 | void cpu_idle_wait(void) | 205 | void cpu_idle_wait(void) |
| 206 | { | 206 | { |
| 207 | unsigned int cpu, this_cpu = get_cpu(); | 207 | unsigned int cpu, this_cpu = get_cpu(); |
| 208 | cpumask_t map; | 208 | cpumask_t map, tmp = current->cpus_allowed; |
| 209 | 209 | ||
| 210 | set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); | 210 | set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); |
| 211 | put_cpu(); | 211 | put_cpu(); |
| @@ -227,6 +227,8 @@ void cpu_idle_wait(void) | |||
| 227 | } | 227 | } |
| 228 | cpus_and(map, map, cpu_online_map); | 228 | cpus_and(map, map, cpu_online_map); |
| 229 | } while (!cpus_empty(map)); | 229 | } while (!cpus_empty(map)); |
| 230 | |||
| 231 | set_cpus_allowed(current, tmp); | ||
| 230 | } | 232 | } |
| 231 | EXPORT_SYMBOL_GPL(cpu_idle_wait); | 233 | EXPORT_SYMBOL_GPL(cpu_idle_wait); |
| 232 | 234 | ||
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 519e63c3c130..141041dde74d 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
| @@ -846,7 +846,7 @@ efi_find_max_pfn(unsigned long start, unsigned long end, void *arg) | |||
| 846 | static int __init | 846 | static int __init |
| 847 | efi_memory_present_wrapper(unsigned long start, unsigned long end, void *arg) | 847 | efi_memory_present_wrapper(unsigned long start, unsigned long end, void *arg) |
| 848 | { | 848 | { |
| 849 | memory_present(0, start, end); | 849 | memory_present(0, PFN_UP(start), PFN_DOWN(end)); |
| 850 | return 0; | 850 | return 0; |
| 851 | } | 851 | } |
| 852 | 852 | ||
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 00489b706d27..fe9c5e8e7e6f 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
| @@ -129,15 +129,19 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo, | |||
| 129 | 129 | ||
| 130 | #ifdef CONFIG_FRAME_POINTER | 130 | #ifdef CONFIG_FRAME_POINTER |
| 131 | while (valid_stack_ptr(tinfo, (void *)ebp)) { | 131 | while (valid_stack_ptr(tinfo, (void *)ebp)) { |
| 132 | unsigned long new_ebp; | ||
| 132 | addr = *(unsigned long *)(ebp + 4); | 133 | addr = *(unsigned long *)(ebp + 4); |
| 133 | ops->address(data, addr); | 134 | ops->address(data, addr); |
| 134 | /* | 135 | /* |
| 135 | * break out of recursive entries (such as | 136 | * break out of recursive entries (such as |
| 136 | * end_of_stack_stop_unwind_function): | 137 | * end_of_stack_stop_unwind_function). Also, |
| 138 | * we can never allow a frame pointer to | ||
| 139 | * move downwards! | ||
| 137 | */ | 140 | */ |
| 138 | if (ebp == *(unsigned long *)ebp) | 141 | new_ebp = *(unsigned long *)ebp; |
| 142 | if (new_ebp <= ebp) | ||
| 139 | break; | 143 | break; |
| 140 | ebp = *(unsigned long *)ebp; | 144 | ebp = new_ebp; |
| 141 | } | 145 | } |
| 142 | #else | 146 | #else |
| 143 | while (valid_stack_ptr(tinfo, stack)) { | 147 | while (valid_stack_ptr(tinfo, stack)) { |
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S index 1e7ac1c44ddc..c6f84a0322ba 100644 --- a/arch/i386/kernel/vmlinux.lds.S +++ b/arch/i386/kernel/vmlinux.lds.S | |||
| @@ -51,6 +51,7 @@ SECTIONS | |||
| 51 | __tracedata_end = .; | 51 | __tracedata_end = .; |
| 52 | 52 | ||
| 53 | /* writeable */ | 53 | /* writeable */ |
| 54 | . = ALIGN(4096); | ||
| 54 | .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */ | 55 | .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */ |
| 55 | *(.data) | 56 | *(.data) |
| 56 | CONSTRUCTORS | 57 | CONSTRUCTORS |
| @@ -126,13 +127,7 @@ SECTIONS | |||
| 126 | __setup_end = .; | 127 | __setup_end = .; |
| 127 | __initcall_start = .; | 128 | __initcall_start = .; |
| 128 | .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) { | 129 | .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) { |
| 129 | *(.initcall1.init) | 130 | INITCALLS |
| 130 | *(.initcall2.init) | ||
| 131 | *(.initcall3.init) | ||
| 132 | *(.initcall4.init) | ||
| 133 | *(.initcall5.init) | ||
| 134 | *(.initcall6.init) | ||
| 135 | *(.initcall7.init) | ||
| 136 | } | 131 | } |
| 137 | __initcall_end = .; | 132 | __initcall_end = .; |
| 138 | __con_initcall_start = .; | 133 | __con_initcall_start = .; |
diff --git a/arch/i386/mach-visws/visws_apic.c b/arch/i386/mach-visws/visws_apic.c index 07097ed48890..38c2b13124d9 100644 --- a/arch/i386/mach-visws/visws_apic.c +++ b/arch/i386/mach-visws/visws_apic.c | |||
| @@ -122,7 +122,7 @@ static void end_cobalt_irq(unsigned int irq) | |||
| 122 | spin_unlock_irqrestore(&cobalt_lock, flags); | 122 | spin_unlock_irqrestore(&cobalt_lock, flags); |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | static struct hw_interrupt_type cobalt_irq_type = { | 125 | static struct irq_chip cobalt_irq_type = { |
| 126 | .typename = "Cobalt-APIC", | 126 | .typename = "Cobalt-APIC", |
| 127 | .startup = startup_cobalt_irq, | 127 | .startup = startup_cobalt_irq, |
| 128 | .shutdown = disable_cobalt_irq, | 128 | .shutdown = disable_cobalt_irq, |
| @@ -159,7 +159,7 @@ static void end_piix4_master_irq(unsigned int irq) | |||
| 159 | spin_unlock_irqrestore(&cobalt_lock, flags); | 159 | spin_unlock_irqrestore(&cobalt_lock, flags); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | static struct hw_interrupt_type piix4_master_irq_type = { | 162 | static struct irq_chip piix4_master_irq_type = { |
| 163 | .typename = "PIIX4-master", | 163 | .typename = "PIIX4-master", |
| 164 | .startup = startup_piix4_master_irq, | 164 | .startup = startup_piix4_master_irq, |
| 165 | .ack = ack_cobalt_irq, | 165 | .ack = ack_cobalt_irq, |
| @@ -167,9 +167,8 @@ static struct hw_interrupt_type piix4_master_irq_type = { | |||
| 167 | }; | 167 | }; |
| 168 | 168 | ||
| 169 | 169 | ||
| 170 | static struct hw_interrupt_type piix4_virtual_irq_type = { | 170 | static struct irq_chip piix4_virtual_irq_type = { |
| 171 | .typename = "PIIX4-virtual", | 171 | .typename = "PIIX4-virtual", |
| 172 | .startup = startup_8259A_irq, | ||
| 173 | .shutdown = disable_8259A_irq, | 172 | .shutdown = disable_8259A_irq, |
| 174 | .enable = enable_8259A_irq, | 173 | .enable = enable_8259A_irq, |
| 175 | .disable = disable_8259A_irq, | 174 | .disable = disable_8259A_irq, |
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c index 6d5ace845e44..cdfcf971098b 100644 --- a/arch/i386/pci/common.c +++ b/arch/i386/pci/common.c | |||
| @@ -343,7 +343,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
| 343 | 343 | ||
| 344 | void pcibios_disable_device (struct pci_dev *dev) | 344 | void pcibios_disable_device (struct pci_dev *dev) |
| 345 | { | 345 | { |
| 346 | pcibios_disable_resources(dev); | ||
| 347 | if (pcibios_disable_irq) | 346 | if (pcibios_disable_irq) |
| 348 | pcibios_disable_irq(dev); | 347 | pcibios_disable_irq(dev); |
| 349 | } | 348 | } |
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c index 908b410f4c93..c1949ff38d61 100644 --- a/arch/i386/pci/fixup.c +++ b/arch/i386/pci/fixup.c | |||
| @@ -343,6 +343,61 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC, pcie_ro | |||
| 343 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_rootport_aspm_quirk ); | 343 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_rootport_aspm_quirk ); |
| 344 | 344 | ||
| 345 | /* | 345 | /* |
| 346 | * Fixup to mark boot BIOS video selected by BIOS before it changes | ||
| 347 | * | ||
| 348 | * From information provided by "Jon Smirl" <jonsmirl@gmail.com> | ||
| 349 | * | ||
| 350 | * The standard boot ROM sequence for an x86 machine uses the BIOS | ||
| 351 | * to select an initial video card for boot display. This boot video | ||
| 352 | * card will have it's BIOS copied to C0000 in system RAM. | ||
| 353 | * IORESOURCE_ROM_SHADOW is used to associate the boot video | ||
| 354 | * card with this copy. On laptops this copy has to be used since | ||
| 355 | * the main ROM may be compressed or combined with another image. | ||
| 356 | * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW | ||
| 357 | * is marked here since the boot video device will be the only enabled | ||
| 358 | * video device at this point. | ||
| 359 | */ | ||
| 360 | |||
| 361 | static void __devinit pci_fixup_video(struct pci_dev *pdev) | ||
| 362 | { | ||
| 363 | struct pci_dev *bridge; | ||
| 364 | struct pci_bus *bus; | ||
| 365 | u16 config; | ||
| 366 | |||
| 367 | if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA) | ||
| 368 | return; | ||
| 369 | |||
| 370 | /* Is VGA routed to us? */ | ||
| 371 | bus = pdev->bus; | ||
| 372 | while (bus) { | ||
| 373 | bridge = bus->self; | ||
| 374 | |||
| 375 | /* | ||
| 376 | * From information provided by | ||
| 377 | * "David Miller" <davem@davemloft.net> | ||
| 378 | * The bridge control register is valid for PCI header | ||
| 379 | * type BRIDGE, or CARDBUS. Host to PCI controllers use | ||
| 380 | * PCI header type NORMAL. | ||
| 381 | */ | ||
| 382 | if (bridge | ||
| 383 | &&((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE) | ||
| 384 | ||(bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) { | ||
| 385 | pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, | ||
| 386 | &config); | ||
| 387 | if (!(config & PCI_BRIDGE_CTL_VGA)) | ||
| 388 | return; | ||
| 389 | } | ||
| 390 | bus = bus->parent; | ||
| 391 | } | ||
| 392 | pci_read_config_word(pdev, PCI_COMMAND, &config); | ||
| 393 | if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { | ||
| 394 | pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; | ||
| 395 | printk(KERN_DEBUG "Boot video device is %s\n", pci_name(pdev)); | ||
| 396 | } | ||
| 397 | } | ||
| 398 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); | ||
| 399 | |||
| 400 | /* | ||
| 346 | * Some Toshiba laptops need extra code to enable their TI TSB43AB22/A. | 401 | * Some Toshiba laptops need extra code to enable their TI TSB43AB22/A. |
| 347 | * | 402 | * |
| 348 | * We pretend to bring them out of full D3 state, and restore the proper | 403 | * We pretend to bring them out of full D3 state, and restore the proper |
diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c index 10154a2cac68..98580292f0d4 100644 --- a/arch/i386/pci/i386.c +++ b/arch/i386/pci/i386.c | |||
| @@ -242,15 +242,6 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask) | |||
| 242 | return 0; | 242 | return 0; |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | void pcibios_disable_resources(struct pci_dev *dev) | ||
| 246 | { | ||
| 247 | u16 cmd; | ||
| 248 | |||
| 249 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | ||
| 250 | cmd &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY); | ||
| 251 | pci_write_config_word(dev, PCI_COMMAND, cmd); | ||
| 252 | } | ||
| 253 | |||
| 254 | /* | 245 | /* |
| 255 | * 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 |
| 256 | * 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/i386/pci/irq.c b/arch/i386/pci/irq.c index dbc4aae91959..69163998adeb 100644 --- a/arch/i386/pci/irq.c +++ b/arch/i386/pci/irq.c | |||
| @@ -255,13 +255,13 @@ static int pirq_via_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i | |||
| 255 | */ | 255 | */ |
| 256 | static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | 256 | static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq) |
| 257 | { | 257 | { |
| 258 | static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; | 258 | static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 }; |
| 259 | return read_config_nybble(router, 0x55, pirqmap[pirq-1]); | 259 | return read_config_nybble(router, 0x55, pirqmap[pirq-1]); |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 262 | static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
| 263 | { | 263 | { |
| 264 | static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; | 264 | static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 }; |
| 265 | write_config_nybble(router, 0x55, pirqmap[pirq-1], irq); | 265 | write_config_nybble(router, 0x55, pirqmap[pirq-1], irq); |
| 266 | return 1; | 266 | return 1; |
| 267 | } | 267 | } |
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c index d0c3da3aa2aa..c6b6d9bbc453 100644 --- a/arch/i386/pci/mmconfig.c +++ b/arch/i386/pci/mmconfig.c | |||
| @@ -154,38 +154,6 @@ static struct pci_raw_ops pci_mmcfg = { | |||
| 154 | .write = pci_mmcfg_write, | 154 | .write = pci_mmcfg_write, |
| 155 | }; | 155 | }; |
| 156 | 156 | ||
| 157 | |||
| 158 | static __init void pci_mmcfg_insert_resources(void) | ||
| 159 | { | ||
| 160 | #define PCI_MMCFG_RESOURCE_NAME_LEN 19 | ||
| 161 | int i; | ||
| 162 | struct resource *res; | ||
| 163 | char *names; | ||
| 164 | unsigned num_buses; | ||
| 165 | |||
| 166 | res = kcalloc(PCI_MMCFG_RESOURCE_NAME_LEN + sizeof(*res), | ||
| 167 | pci_mmcfg_config_num, GFP_KERNEL); | ||
| 168 | |||
| 169 | if (!res) { | ||
| 170 | printk(KERN_ERR "PCI: Unable to allocate MMCONFIG resources\n"); | ||
| 171 | return; | ||
| 172 | } | ||
| 173 | |||
| 174 | names = (void *)&res[pci_mmcfg_config_num]; | ||
| 175 | for (i = 0; i < pci_mmcfg_config_num; i++, res++) { | ||
| 176 | num_buses = pci_mmcfg_config[i].end_bus_number - | ||
| 177 | pci_mmcfg_config[i].start_bus_number + 1; | ||
| 178 | res->name = names; | ||
| 179 | snprintf(names, PCI_MMCFG_RESOURCE_NAME_LEN, "PCI MMCONFIG %u", | ||
| 180 | pci_mmcfg_config[i].pci_segment_group_number); | ||
| 181 | res->start = pci_mmcfg_config[i].base_address; | ||
| 182 | res->end = res->start + (num_buses << 20) - 1; | ||
| 183 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; | ||
| 184 | insert_resource(&iomem_resource, res); | ||
| 185 | names += PCI_MMCFG_RESOURCE_NAME_LEN; | ||
| 186 | } | ||
| 187 | } | ||
| 188 | |||
| 189 | /* K8 systems have some devices (typically in the builtin northbridge) | 157 | /* K8 systems have some devices (typically in the builtin northbridge) |
| 190 | that are only accessible using type1 | 158 | that are only accessible using type1 |
| 191 | Normally this can be expressed in the MCFG by not listing them | 159 | Normally this can be expressed in the MCFG by not listing them |
| @@ -222,8 +190,6 @@ static __init void unreachable_devices(void) | |||
| 222 | } | 190 | } |
| 223 | } | 191 | } |
| 224 | 192 | ||
| 225 | |||
| 226 | |||
| 227 | void __init pci_mmcfg_init(int type) | 193 | void __init pci_mmcfg_init(int type) |
| 228 | { | 194 | { |
| 229 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) | 195 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) |
| @@ -251,5 +217,4 @@ void __init pci_mmcfg_init(int type) | |||
| 251 | pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; | 217 | pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; |
| 252 | 218 | ||
| 253 | unreachable_devices(); | 219 | unreachable_devices(); |
| 254 | pci_mmcfg_insert_resources(); | ||
| 255 | } | 220 | } |
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h index ad065cebd7b9..a0a25180b61a 100644 --- a/arch/i386/pci/pci.h +++ b/arch/i386/pci/pci.h | |||
| @@ -43,7 +43,6 @@ extern unsigned int pcibios_max_latency; | |||
| 43 | 43 | ||
| 44 | void pcibios_resource_survey(void); | 44 | void pcibios_resource_survey(void); |
| 45 | int pcibios_enable_resources(struct pci_dev *, int); | 45 | int pcibios_enable_resources(struct pci_dev *, int); |
| 46 | void pcibios_disable_resources(struct pci_dev *); | ||
| 47 | 46 | ||
| 48 | /* pci-pc.c */ | 47 | /* pci-pc.c */ |
| 49 | 48 | ||
