diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-06-02 11:39:11 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-06-02 11:39:11 -0400 |
commit | 1c3f45ab2f7f879ea482501c83899505c31f7539 (patch) | |
tree | 672465b3b9b3e2e26a8caf74ed64aa6885c52c13 /arch/x86_64 | |
parent | 4bcff1b37e7c3aed914d1ce5b45994adc7dbf455 (diff) | |
parent | e0d6d71440a3a35c6fc2dde09f8e8d4d7bd44dda (diff) |
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/Kconfig | 3 | ||||
-rw-r--r-- | arch/x86_64/kernel/io_apic.c | 12 | ||||
-rw-r--r-- | arch/x86_64/kernel/mpparse.c | 1 | ||||
-rw-r--r-- | arch/x86_64/kernel/ptrace.c | 4 | ||||
-rw-r--r-- | arch/x86_64/kernel/setup.c | 25 | ||||
-rw-r--r-- | arch/x86_64/kernel/signal.c | 5 | ||||
-rw-r--r-- | arch/x86_64/kernel/smpboot.c | 1 | ||||
-rw-r--r-- | arch/x86_64/kernel/time.c | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/traps.c | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/x8664_ksyms.c | 3 | ||||
-rw-r--r-- | arch/x86_64/mm/ioremap.c | 29 |
11 files changed, 47 insertions, 40 deletions
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index 82cb2a3f127a..289f448ac89c 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig | |||
@@ -305,6 +305,7 @@ config HPET_TIMER | |||
305 | 305 | ||
306 | config X86_PM_TIMER | 306 | config X86_PM_TIMER |
307 | bool "PM timer" | 307 | bool "PM timer" |
308 | depends on ACPI | ||
308 | default y | 309 | default y |
309 | help | 310 | help |
310 | Support the ACPI PM timer for time keeping. This is slow, | 311 | Support the ACPI PM timer for time keeping. This is slow, |
@@ -421,7 +422,7 @@ config PCI_DIRECT | |||
421 | 422 | ||
422 | config PCI_MMCONFIG | 423 | config PCI_MMCONFIG |
423 | bool "Support mmconfig PCI config space access" | 424 | bool "Support mmconfig PCI config space access" |
424 | depends on PCI | 425 | depends on PCI && ACPI |
425 | select ACPI_BOOT | 426 | select ACPI_BOOT |
426 | 427 | ||
427 | config UNORDERED_IO | 428 | config UNORDERED_IO |
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index ac7684324954..afd87e64d0a8 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c | |||
@@ -37,11 +37,14 @@ | |||
37 | #include <asm/desc.h> | 37 | #include <asm/desc.h> |
38 | #include <asm/proto.h> | 38 | #include <asm/proto.h> |
39 | #include <asm/mach_apic.h> | 39 | #include <asm/mach_apic.h> |
40 | #include <asm/acpi.h> | ||
40 | 41 | ||
41 | #define __apicdebuginit __init | 42 | #define __apicdebuginit __init |
42 | 43 | ||
43 | int sis_apic_bug; /* not actually supported, dummy for compile */ | 44 | int sis_apic_bug; /* not actually supported, dummy for compile */ |
44 | 45 | ||
46 | static int no_timer_check; | ||
47 | |||
45 | static DEFINE_SPINLOCK(ioapic_lock); | 48 | static DEFINE_SPINLOCK(ioapic_lock); |
46 | 49 | ||
47 | /* | 50 | /* |
@@ -1601,7 +1604,7 @@ static inline void check_timer(void) | |||
1601 | * Ok, does IRQ0 through the IOAPIC work? | 1604 | * Ok, does IRQ0 through the IOAPIC work? |
1602 | */ | 1605 | */ |
1603 | unmask_IO_APIC_irq(0); | 1606 | unmask_IO_APIC_irq(0); |
1604 | if (timer_irq_works()) { | 1607 | if (!no_timer_check && timer_irq_works()) { |
1605 | nmi_watchdog_default(); | 1608 | nmi_watchdog_default(); |
1606 | if (nmi_watchdog == NMI_IO_APIC) { | 1609 | if (nmi_watchdog == NMI_IO_APIC) { |
1607 | disable_8259A_irq(0); | 1610 | disable_8259A_irq(0); |
@@ -1671,6 +1674,13 @@ static inline void check_timer(void) | |||
1671 | panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n"); | 1674 | panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n"); |
1672 | } | 1675 | } |
1673 | 1676 | ||
1677 | static int __init notimercheck(char *s) | ||
1678 | { | ||
1679 | no_timer_check = 1; | ||
1680 | return 1; | ||
1681 | } | ||
1682 | __setup("no_timer_check", notimercheck); | ||
1683 | |||
1674 | /* | 1684 | /* |
1675 | * | 1685 | * |
1676 | * IRQ's that are handled by the PIC in the MPS IOAPIC case. | 1686 | * IRQ's that are handled by the PIC in the MPS IOAPIC case. |
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c index f86d9db94bfc..61a63be6b294 100644 --- a/arch/x86_64/kernel/mpparse.c +++ b/arch/x86_64/kernel/mpparse.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/pgalloc.h> | 30 | #include <asm/pgalloc.h> |
31 | #include <asm/io_apic.h> | 31 | #include <asm/io_apic.h> |
32 | #include <asm/proto.h> | 32 | #include <asm/proto.h> |
33 | #include <asm/acpi.h> | ||
33 | 34 | ||
34 | /* Have we found an MP table */ | 35 | /* Have we found an MP table */ |
35 | int smp_found_config; | 36 | int smp_found_config; |
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86_64/kernel/ptrace.c index 60dc9b98951d..525f6a128a27 100644 --- a/arch/x86_64/kernel/ptrace.c +++ b/arch/x86_64/kernel/ptrace.c | |||
@@ -380,7 +380,7 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data | |||
380 | break; | 380 | break; |
381 | 381 | ||
382 | switch (addr) { | 382 | switch (addr) { |
383 | case 0 ... sizeof(struct user_regs_struct): | 383 | case 0 ... sizeof(struct user_regs_struct) - sizeof(long): |
384 | tmp = getreg(child, addr); | 384 | tmp = getreg(child, addr); |
385 | break; | 385 | break; |
386 | case offsetof(struct user, u_debugreg[0]): | 386 | case offsetof(struct user, u_debugreg[0]): |
@@ -425,7 +425,7 @@ asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, long data | |||
425 | break; | 425 | break; |
426 | 426 | ||
427 | switch (addr) { | 427 | switch (addr) { |
428 | case 0 ... sizeof(struct user_regs_struct): | 428 | case 0 ... sizeof(struct user_regs_struct) - sizeof(long): |
429 | ret = putreg(child, addr, data); | 429 | ret = putreg(child, addr, data); |
430 | break; | 430 | break; |
431 | /* Disallows to set a breakpoint into the vsyscall */ | 431 | /* Disallows to set a breakpoint into the vsyscall */ |
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index b9fd0252c279..99f038ede23c 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -719,7 +719,6 @@ static void __init display_cacheinfo(struct cpuinfo_x86 *c) | |||
719 | } | 719 | } |
720 | } | 720 | } |
721 | 721 | ||
722 | #ifdef CONFIG_SMP | ||
723 | /* | 722 | /* |
724 | * On a AMD dual core setup the lower bits of the APIC id distingush the cores. | 723 | * On a AMD dual core setup the lower bits of the APIC id distingush the cores. |
725 | * Assumes number of cores is a power of two. | 724 | * Assumes number of cores is a power of two. |
@@ -729,16 +728,24 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c) | |||
729 | #ifdef CONFIG_SMP | 728 | #ifdef CONFIG_SMP |
730 | int cpu = smp_processor_id(); | 729 | int cpu = smp_processor_id(); |
731 | int node = 0; | 730 | int node = 0; |
731 | unsigned bits; | ||
732 | if (c->x86_num_cores == 1) | 732 | if (c->x86_num_cores == 1) |
733 | return; | 733 | return; |
734 | /* Fix up the APIC ID following the AMD specification. */ | 734 | |
735 | cpu_core_id[cpu] >>= hweight32(c->x86_num_cores - 1); | 735 | bits = 0; |
736 | while ((1 << bits) < c->x86_num_cores) | ||
737 | bits++; | ||
738 | |||
739 | /* Low order bits define the core id (index of core in socket) */ | ||
740 | cpu_core_id[cpu] = phys_proc_id[cpu] & ((1 << bits)-1); | ||
741 | /* Convert the APIC ID into the socket ID */ | ||
742 | phys_proc_id[cpu] >>= bits; | ||
736 | 743 | ||
737 | #ifdef CONFIG_NUMA | 744 | #ifdef CONFIG_NUMA |
738 | /* When an ACPI SRAT table is available use the mappings from SRAT | 745 | /* When an ACPI SRAT table is available use the mappings from SRAT |
739 | instead. */ | 746 | instead. */ |
740 | if (acpi_numa <= 0) { | 747 | if (acpi_numa <= 0) { |
741 | node = cpu_core_id[cpu]; | 748 | node = phys_proc_id[cpu]; |
742 | if (!node_online(node)) | 749 | if (!node_online(node)) |
743 | node = first_node(node_online_map); | 750 | node = first_node(node_online_map); |
744 | cpu_to_node[cpu] = node; | 751 | cpu_to_node[cpu] = node; |
@@ -746,18 +753,11 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c) | |||
746 | node = cpu_to_node[cpu]; | 753 | node = cpu_to_node[cpu]; |
747 | } | 754 | } |
748 | #endif | 755 | #endif |
749 | /* For now: - better than BAD_APIC_ID at least*/ | ||
750 | phys_proc_id[cpu] = cpu_core_id[cpu]; | ||
751 | 756 | ||
752 | printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n", | 757 | printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n", |
753 | cpu, c->x86_num_cores, node, cpu_core_id[cpu]); | 758 | cpu, c->x86_num_cores, node, cpu_core_id[cpu]); |
754 | #endif | 759 | #endif |
755 | } | 760 | } |
756 | #else | ||
757 | static void __init amd_detect_cmp(struct cpuinfo_x86 *c) | ||
758 | { | ||
759 | } | ||
760 | #endif | ||
761 | 761 | ||
762 | static int __init init_amd(struct cpuinfo_x86 *c) | 762 | static int __init init_amd(struct cpuinfo_x86 *c) |
763 | { | 763 | { |
@@ -963,8 +963,7 @@ void __init early_identify_cpu(struct cpuinfo_x86 *c) | |||
963 | } | 963 | } |
964 | 964 | ||
965 | #ifdef CONFIG_SMP | 965 | #ifdef CONFIG_SMP |
966 | phys_proc_id[smp_processor_id()] = | 966 | phys_proc_id[smp_processor_id()] = (cpuid_ebx(1) >> 24) & 0xff; |
967 | cpu_core_id[smp_processor_id()] = (cpuid_ebx(1) >> 24) & 0xff; | ||
968 | #endif | 967 | #endif |
969 | } | 968 | } |
970 | 969 | ||
diff --git a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c index d439ced150c6..429c0269dc4e 100644 --- a/arch/x86_64/kernel/signal.c +++ b/arch/x86_64/kernel/signal.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
29 | #include <asm/i387.h> | 29 | #include <asm/i387.h> |
30 | #include <asm/proto.h> | 30 | #include <asm/proto.h> |
31 | #include <asm/ia32_unistd.h> | ||
31 | 32 | ||
32 | /* #define DEBUG_SIG 1 */ | 33 | /* #define DEBUG_SIG 1 */ |
33 | 34 | ||
@@ -452,7 +453,9 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) | |||
452 | regs->rip -= 2; | 453 | regs->rip -= 2; |
453 | } | 454 | } |
454 | if (regs->rax == (unsigned long)-ERESTART_RESTARTBLOCK) { | 455 | if (regs->rax == (unsigned long)-ERESTART_RESTARTBLOCK) { |
455 | regs->rax = __NR_restart_syscall; | 456 | regs->rax = test_thread_flag(TIF_IA32) ? |
457 | __NR_ia32_restart_syscall : | ||
458 | __NR_restart_syscall; | ||
456 | regs->rip -= 2; | 459 | regs->rip -= 2; |
457 | } | 460 | } |
458 | } | 461 | } |
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index 5abdee1e16a5..f1ec0f345941 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c | |||
@@ -94,6 +94,7 @@ int smp_threads_ready; | |||
94 | 94 | ||
95 | cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned; | 95 | cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned; |
96 | cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; | 96 | cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; |
97 | EXPORT_SYMBOL(cpu_core_map); | ||
97 | 98 | ||
98 | /* | 99 | /* |
99 | * Trampoline 80x86 program as an array. | 100 | * Trampoline 80x86 program as an array. |
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index 735b6767c8ed..fb8c809b4cd9 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c | |||
@@ -27,7 +27,9 @@ | |||
27 | #include <linux/bcd.h> | 27 | #include <linux/bcd.h> |
28 | #include <linux/kallsyms.h> | 28 | #include <linux/kallsyms.h> |
29 | #include <linux/acpi.h> | 29 | #include <linux/acpi.h> |
30 | #ifdef CONFIG_ACPI | ||
30 | #include <acpi/achware.h> /* for PM timer frequency */ | 31 | #include <acpi/achware.h> /* for PM timer frequency */ |
32 | #endif | ||
31 | #include <asm/8253pit.h> | 33 | #include <asm/8253pit.h> |
32 | #include <asm/pgtable.h> | 34 | #include <asm/pgtable.h> |
33 | #include <asm/vsyscall.h> | 35 | #include <asm/vsyscall.h> |
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index 65a37f52c56e..3dfec8fdabcd 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c | |||
@@ -332,10 +332,12 @@ void handle_BUG(struct pt_regs *regs) | |||
332 | printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", f.filename, f.line); | 332 | printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", f.filename, f.line); |
333 | } | 333 | } |
334 | 334 | ||
335 | #ifdef CONFIG_BUG | ||
335 | void out_of_line_bug(void) | 336 | void out_of_line_bug(void) |
336 | { | 337 | { |
337 | BUG(); | 338 | BUG(); |
338 | } | 339 | } |
340 | #endif | ||
339 | 341 | ||
340 | static DEFINE_SPINLOCK(die_lock); | 342 | static DEFINE_SPINLOCK(die_lock); |
341 | static int die_owner = -1; | 343 | static int die_owner = -1; |
diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c index a43dedb58fa2..68ec03070e5a 100644 --- a/arch/x86_64/kernel/x8664_ksyms.c +++ b/arch/x86_64/kernel/x8664_ksyms.c | |||
@@ -193,8 +193,9 @@ EXPORT_SYMBOL(smp_num_siblings); | |||
193 | extern void do_softirq_thunk(void); | 193 | extern void do_softirq_thunk(void); |
194 | EXPORT_SYMBOL(do_softirq_thunk); | 194 | EXPORT_SYMBOL(do_softirq_thunk); |
195 | 195 | ||
196 | void out_of_line_bug(void); | 196 | #ifdef CONFIG_BUG |
197 | EXPORT_SYMBOL(out_of_line_bug); | 197 | EXPORT_SYMBOL(out_of_line_bug); |
198 | #endif | ||
198 | 199 | ||
199 | EXPORT_SYMBOL(init_level4_pgt); | 200 | EXPORT_SYMBOL(init_level4_pgt); |
200 | 201 | ||
diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c index c6fb0cb69992..58aac23760ef 100644 --- a/arch/x86_64/mm/ioremap.c +++ b/arch/x86_64/mm/ioremap.c | |||
@@ -133,7 +133,7 @@ ioremap_change_attr(unsigned long phys_addr, unsigned long size, | |||
133 | unsigned long flags) | 133 | unsigned long flags) |
134 | { | 134 | { |
135 | int err = 0; | 135 | int err = 0; |
136 | if (flags && phys_addr + size - 1 < (end_pfn_map << PAGE_SHIFT)) { | 136 | if (phys_addr + size - 1 < (end_pfn_map << PAGE_SHIFT)) { |
137 | unsigned long npages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; | 137 | unsigned long npages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; |
138 | unsigned long vaddr = (unsigned long) __va(phys_addr); | 138 | unsigned long vaddr = (unsigned long) __va(phys_addr); |
139 | 139 | ||
@@ -214,7 +214,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l | |||
214 | remove_vm_area((void *)(PAGE_MASK & (unsigned long) addr)); | 214 | remove_vm_area((void *)(PAGE_MASK & (unsigned long) addr)); |
215 | return NULL; | 215 | return NULL; |
216 | } | 216 | } |
217 | if (ioremap_change_attr(phys_addr, size, flags) < 0) { | 217 | if (flags && ioremap_change_attr(phys_addr, size, flags) < 0) { |
218 | area->flags &= 0xffffff; | 218 | area->flags &= 0xffffff; |
219 | vunmap(addr); | 219 | vunmap(addr); |
220 | return NULL; | 220 | return NULL; |
@@ -251,7 +251,7 @@ void __iomem *ioremap_nocache (unsigned long phys_addr, unsigned long size) | |||
251 | 251 | ||
252 | void iounmap(volatile void __iomem *addr) | 252 | void iounmap(volatile void __iomem *addr) |
253 | { | 253 | { |
254 | struct vm_struct *p, **pprev; | 254 | struct vm_struct *p; |
255 | 255 | ||
256 | if (addr <= high_memory) | 256 | if (addr <= high_memory) |
257 | return; | 257 | return; |
@@ -260,24 +260,11 @@ void iounmap(volatile void __iomem *addr) | |||
260 | return; | 260 | return; |
261 | 261 | ||
262 | write_lock(&vmlist_lock); | 262 | write_lock(&vmlist_lock); |
263 | for (p = vmlist, pprev = &vmlist; p != NULL; pprev = &p->next, p = *pprev) | 263 | p = __remove_vm_area((void *)((unsigned long)addr & PAGE_MASK)); |
264 | if (p->addr == (void *)(PAGE_MASK & (unsigned long)addr)) | 264 | if (!p) |
265 | break; | 265 | printk("iounmap: bad address %p\n", addr); |
266 | if (!p) { | 266 | else if (p->flags >> 20) |
267 | printk("__iounmap: bad address %p\n", addr); | 267 | ioremap_change_attr(p->phys_addr, p->size, 0); |
268 | goto out_unlock; | ||
269 | } | ||
270 | *pprev = p->next; | ||
271 | unmap_vm_area(p); | ||
272 | if ((p->flags >> 20) && | ||
273 | p->phys_addr + p->size - 1 < virt_to_phys(high_memory)) { | ||
274 | /* p->size includes the guard page, but cpa doesn't like that */ | ||
275 | change_page_attr_addr((unsigned long)__va(p->phys_addr), | ||
276 | p->size >> PAGE_SHIFT, | ||
277 | PAGE_KERNEL); | ||
278 | global_flush_tlb(); | ||
279 | } | ||
280 | out_unlock: | ||
281 | write_unlock(&vmlist_lock); | 268 | write_unlock(&vmlist_lock); |
282 | kfree(p); | 269 | kfree(p); |
283 | } | 270 | } |