diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/amd_gart_64.c | 11 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_p4.c | 13 | ||||
-rw-r--r-- | arch/x86/kernel/irq.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/kdebugfs.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/kgdb.c | 60 | ||||
-rw-r--r-- | arch/x86/kernel/pci-calgary_64.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/pci-dma.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/pci-nommu.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/pci-swiotlb.c | 17 | ||||
-rw-r--r-- | arch/x86/kernel/process.c | 24 |
10 files changed, 109 insertions, 50 deletions
diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c index b1e7c7f7a0af..e66311200cbd 100644 --- a/arch/x86/kernel/amd_gart_64.c +++ b/arch/x86/kernel/amd_gart_64.c | |||
@@ -477,7 +477,7 @@ error: | |||
477 | /* allocate and map a coherent mapping */ | 477 | /* allocate and map a coherent mapping */ |
478 | static void * | 478 | static void * |
479 | gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, | 479 | gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, |
480 | gfp_t flag) | 480 | gfp_t flag, struct dma_attrs *attrs) |
481 | { | 481 | { |
482 | dma_addr_t paddr; | 482 | dma_addr_t paddr; |
483 | unsigned long align_mask; | 483 | unsigned long align_mask; |
@@ -500,7 +500,8 @@ gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, | |||
500 | } | 500 | } |
501 | __free_pages(page, get_order(size)); | 501 | __free_pages(page, get_order(size)); |
502 | } else | 502 | } else |
503 | return dma_generic_alloc_coherent(dev, size, dma_addr, flag); | 503 | return dma_generic_alloc_coherent(dev, size, dma_addr, flag, |
504 | attrs); | ||
504 | 505 | ||
505 | return NULL; | 506 | return NULL; |
506 | } | 507 | } |
@@ -508,7 +509,7 @@ gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, | |||
508 | /* free a coherent mapping */ | 509 | /* free a coherent mapping */ |
509 | static void | 510 | static void |
510 | gart_free_coherent(struct device *dev, size_t size, void *vaddr, | 511 | gart_free_coherent(struct device *dev, size_t size, void *vaddr, |
511 | dma_addr_t dma_addr) | 512 | dma_addr_t dma_addr, struct dma_attrs *attrs) |
512 | { | 513 | { |
513 | gart_unmap_page(dev, dma_addr, size, DMA_BIDIRECTIONAL, NULL); | 514 | gart_unmap_page(dev, dma_addr, size, DMA_BIDIRECTIONAL, NULL); |
514 | free_pages((unsigned long)vaddr, get_order(size)); | 515 | free_pages((unsigned long)vaddr, get_order(size)); |
@@ -700,8 +701,8 @@ static struct dma_map_ops gart_dma_ops = { | |||
700 | .unmap_sg = gart_unmap_sg, | 701 | .unmap_sg = gart_unmap_sg, |
701 | .map_page = gart_map_page, | 702 | .map_page = gart_map_page, |
702 | .unmap_page = gart_unmap_page, | 703 | .unmap_page = gart_unmap_page, |
703 | .alloc_coherent = gart_alloc_coherent, | 704 | .alloc = gart_alloc_coherent, |
704 | .free_coherent = gart_free_coherent, | 705 | .free = gart_free_coherent, |
705 | .mapping_error = gart_mapping_error, | 706 | .mapping_error = gart_mapping_error, |
706 | }; | 707 | }; |
707 | 708 | ||
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index ef484d9d0a25..a2dfacfd7103 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
@@ -1271,6 +1271,17 @@ done: | |||
1271 | return num ? -EINVAL : 0; | 1271 | return num ? -EINVAL : 0; |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | PMU_FORMAT_ATTR(cccr, "config:0-31" ); | ||
1275 | PMU_FORMAT_ATTR(escr, "config:32-62"); | ||
1276 | PMU_FORMAT_ATTR(ht, "config:63" ); | ||
1277 | |||
1278 | static struct attribute *intel_p4_formats_attr[] = { | ||
1279 | &format_attr_cccr.attr, | ||
1280 | &format_attr_escr.attr, | ||
1281 | &format_attr_ht.attr, | ||
1282 | NULL, | ||
1283 | }; | ||
1284 | |||
1274 | static __initconst const struct x86_pmu p4_pmu = { | 1285 | static __initconst const struct x86_pmu p4_pmu = { |
1275 | .name = "Netburst P4/Xeon", | 1286 | .name = "Netburst P4/Xeon", |
1276 | .handle_irq = p4_pmu_handle_irq, | 1287 | .handle_irq = p4_pmu_handle_irq, |
@@ -1305,6 +1316,8 @@ static __initconst const struct x86_pmu p4_pmu = { | |||
1305 | * the former idea is taken from OProfile code | 1316 | * the former idea is taken from OProfile code |
1306 | */ | 1317 | */ |
1307 | .perfctr_second_write = 1, | 1318 | .perfctr_second_write = 1, |
1319 | |||
1320 | .format_attrs = intel_p4_formats_attr, | ||
1308 | }; | 1321 | }; |
1309 | 1322 | ||
1310 | __init int p4_pmu_init(void) | 1323 | __init int p4_pmu_init(void) |
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 7943e0c21bde..3dafc6003b7c 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
@@ -282,8 +282,13 @@ void fixup_irqs(void) | |||
282 | else if (!(warned++)) | 282 | else if (!(warned++)) |
283 | set_affinity = 0; | 283 | set_affinity = 0; |
284 | 284 | ||
285 | /* | ||
286 | * We unmask if the irq was not marked masked by the | ||
287 | * core code. That respects the lazy irq disable | ||
288 | * behaviour. | ||
289 | */ | ||
285 | if (!irqd_can_move_in_process_context(data) && | 290 | if (!irqd_can_move_in_process_context(data) && |
286 | !irqd_irq_disabled(data) && chip->irq_unmask) | 291 | !irqd_irq_masked(data) && chip->irq_unmask) |
287 | chip->irq_unmask(data); | 292 | chip->irq_unmask(data); |
288 | 293 | ||
289 | raw_spin_unlock(&desc->lock); | 294 | raw_spin_unlock(&desc->lock); |
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c index 90fcf62854bb..1d5d31ea686b 100644 --- a/arch/x86/kernel/kdebugfs.c +++ b/arch/x86/kernel/kdebugfs.c | |||
@@ -68,16 +68,9 @@ static ssize_t setup_data_read(struct file *file, char __user *user_buf, | |||
68 | return count; | 68 | return count; |
69 | } | 69 | } |
70 | 70 | ||
71 | static int setup_data_open(struct inode *inode, struct file *file) | ||
72 | { | ||
73 | file->private_data = inode->i_private; | ||
74 | |||
75 | return 0; | ||
76 | } | ||
77 | |||
78 | static const struct file_operations fops_setup_data = { | 71 | static const struct file_operations fops_setup_data = { |
79 | .read = setup_data_read, | 72 | .read = setup_data_read, |
80 | .open = setup_data_open, | 73 | .open = simple_open, |
81 | .llseek = default_llseek, | 74 | .llseek = default_llseek, |
82 | }; | 75 | }; |
83 | 76 | ||
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c index db6720edfdd0..8bfb6146f753 100644 --- a/arch/x86/kernel/kgdb.c +++ b/arch/x86/kernel/kgdb.c | |||
@@ -43,6 +43,8 @@ | |||
43 | #include <linux/smp.h> | 43 | #include <linux/smp.h> |
44 | #include <linux/nmi.h> | 44 | #include <linux/nmi.h> |
45 | #include <linux/hw_breakpoint.h> | 45 | #include <linux/hw_breakpoint.h> |
46 | #include <linux/uaccess.h> | ||
47 | #include <linux/memory.h> | ||
46 | 48 | ||
47 | #include <asm/debugreg.h> | 49 | #include <asm/debugreg.h> |
48 | #include <asm/apicdef.h> | 50 | #include <asm/apicdef.h> |
@@ -741,6 +743,64 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) | |||
741 | regs->ip = ip; | 743 | regs->ip = ip; |
742 | } | 744 | } |
743 | 745 | ||
746 | int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt) | ||
747 | { | ||
748 | int err; | ||
749 | char opc[BREAK_INSTR_SIZE]; | ||
750 | |||
751 | bpt->type = BP_BREAKPOINT; | ||
752 | err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr, | ||
753 | BREAK_INSTR_SIZE); | ||
754 | if (err) | ||
755 | return err; | ||
756 | err = probe_kernel_write((char *)bpt->bpt_addr, | ||
757 | arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE); | ||
758 | #ifdef CONFIG_DEBUG_RODATA | ||
759 | if (!err) | ||
760 | return err; | ||
761 | /* | ||
762 | * It is safe to call text_poke() because normal kernel execution | ||
763 | * is stopped on all cores, so long as the text_mutex is not locked. | ||
764 | */ | ||
765 | if (mutex_is_locked(&text_mutex)) | ||
766 | return -EBUSY; | ||
767 | text_poke((void *)bpt->bpt_addr, arch_kgdb_ops.gdb_bpt_instr, | ||
768 | BREAK_INSTR_SIZE); | ||
769 | err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE); | ||
770 | if (err) | ||
771 | return err; | ||
772 | if (memcmp(opc, arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE)) | ||
773 | return -EINVAL; | ||
774 | bpt->type = BP_POKE_BREAKPOINT; | ||
775 | #endif /* CONFIG_DEBUG_RODATA */ | ||
776 | return err; | ||
777 | } | ||
778 | |||
779 | int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt) | ||
780 | { | ||
781 | #ifdef CONFIG_DEBUG_RODATA | ||
782 | int err; | ||
783 | char opc[BREAK_INSTR_SIZE]; | ||
784 | |||
785 | if (bpt->type != BP_POKE_BREAKPOINT) | ||
786 | goto knl_write; | ||
787 | /* | ||
788 | * It is safe to call text_poke() because normal kernel execution | ||
789 | * is stopped on all cores, so long as the text_mutex is not locked. | ||
790 | */ | ||
791 | if (mutex_is_locked(&text_mutex)) | ||
792 | goto knl_write; | ||
793 | text_poke((void *)bpt->bpt_addr, bpt->saved_instr, BREAK_INSTR_SIZE); | ||
794 | err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE); | ||
795 | if (err || memcmp(opc, bpt->saved_instr, BREAK_INSTR_SIZE)) | ||
796 | goto knl_write; | ||
797 | return err; | ||
798 | knl_write: | ||
799 | #endif /* CONFIG_DEBUG_RODATA */ | ||
800 | return probe_kernel_write((char *)bpt->bpt_addr, | ||
801 | (char *)bpt->saved_instr, BREAK_INSTR_SIZE); | ||
802 | } | ||
803 | |||
744 | struct kgdb_arch arch_kgdb_ops = { | 804 | struct kgdb_arch arch_kgdb_ops = { |
745 | /* Breakpoint instruction: */ | 805 | /* Breakpoint instruction: */ |
746 | .gdb_bpt_instr = { 0xcc }, | 806 | .gdb_bpt_instr = { 0xcc }, |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index 6ac5782f4d6b..d0b2fb9ccbb1 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -430,7 +430,7 @@ static void calgary_unmap_page(struct device *dev, dma_addr_t dma_addr, | |||
430 | } | 430 | } |
431 | 431 | ||
432 | static void* calgary_alloc_coherent(struct device *dev, size_t size, | 432 | static void* calgary_alloc_coherent(struct device *dev, size_t size, |
433 | dma_addr_t *dma_handle, gfp_t flag) | 433 | dma_addr_t *dma_handle, gfp_t flag, struct dma_attrs *attrs) |
434 | { | 434 | { |
435 | void *ret = NULL; | 435 | void *ret = NULL; |
436 | dma_addr_t mapping; | 436 | dma_addr_t mapping; |
@@ -463,7 +463,8 @@ error: | |||
463 | } | 463 | } |
464 | 464 | ||
465 | static void calgary_free_coherent(struct device *dev, size_t size, | 465 | static void calgary_free_coherent(struct device *dev, size_t size, |
466 | void *vaddr, dma_addr_t dma_handle) | 466 | void *vaddr, dma_addr_t dma_handle, |
467 | struct dma_attrs *attrs) | ||
467 | { | 468 | { |
468 | unsigned int npages; | 469 | unsigned int npages; |
469 | struct iommu_table *tbl = find_iommu_table(dev); | 470 | struct iommu_table *tbl = find_iommu_table(dev); |
@@ -476,8 +477,8 @@ static void calgary_free_coherent(struct device *dev, size_t size, | |||
476 | } | 477 | } |
477 | 478 | ||
478 | static struct dma_map_ops calgary_dma_ops = { | 479 | static struct dma_map_ops calgary_dma_ops = { |
479 | .alloc_coherent = calgary_alloc_coherent, | 480 | .alloc = calgary_alloc_coherent, |
480 | .free_coherent = calgary_free_coherent, | 481 | .free = calgary_free_coherent, |
481 | .map_sg = calgary_map_sg, | 482 | .map_sg = calgary_map_sg, |
482 | .unmap_sg = calgary_unmap_sg, | 483 | .unmap_sg = calgary_unmap_sg, |
483 | .map_page = calgary_map_page, | 484 | .map_page = calgary_map_page, |
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 28e5e06fcba4..3003250ac51d 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -96,7 +96,8 @@ void __init pci_iommu_alloc(void) | |||
96 | } | 96 | } |
97 | } | 97 | } |
98 | void *dma_generic_alloc_coherent(struct device *dev, size_t size, | 98 | void *dma_generic_alloc_coherent(struct device *dev, size_t size, |
99 | dma_addr_t *dma_addr, gfp_t flag) | 99 | dma_addr_t *dma_addr, gfp_t flag, |
100 | struct dma_attrs *attrs) | ||
100 | { | 101 | { |
101 | unsigned long dma_mask; | 102 | unsigned long dma_mask; |
102 | struct page *page; | 103 | struct page *page; |
diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c index 3af4af810c07..f96050685b46 100644 --- a/arch/x86/kernel/pci-nommu.c +++ b/arch/x86/kernel/pci-nommu.c | |||
@@ -75,7 +75,7 @@ static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg, | |||
75 | } | 75 | } |
76 | 76 | ||
77 | static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr, | 77 | static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr, |
78 | dma_addr_t dma_addr) | 78 | dma_addr_t dma_addr, struct dma_attrs *attrs) |
79 | { | 79 | { |
80 | free_pages((unsigned long)vaddr, get_order(size)); | 80 | free_pages((unsigned long)vaddr, get_order(size)); |
81 | } | 81 | } |
@@ -96,8 +96,8 @@ static void nommu_sync_sg_for_device(struct device *dev, | |||
96 | } | 96 | } |
97 | 97 | ||
98 | struct dma_map_ops nommu_dma_ops = { | 98 | struct dma_map_ops nommu_dma_ops = { |
99 | .alloc_coherent = dma_generic_alloc_coherent, | 99 | .alloc = dma_generic_alloc_coherent, |
100 | .free_coherent = nommu_free_coherent, | 100 | .free = nommu_free_coherent, |
101 | .map_sg = nommu_map_sg, | 101 | .map_sg = nommu_map_sg, |
102 | .map_page = nommu_map_page, | 102 | .map_page = nommu_map_page, |
103 | .sync_single_for_device = nommu_sync_single_for_device, | 103 | .sync_single_for_device = nommu_sync_single_for_device, |
diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c index 8f972cbddef0..6c483ba98b9c 100644 --- a/arch/x86/kernel/pci-swiotlb.c +++ b/arch/x86/kernel/pci-swiotlb.c | |||
@@ -15,21 +15,30 @@ | |||
15 | int swiotlb __read_mostly; | 15 | int swiotlb __read_mostly; |
16 | 16 | ||
17 | static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 17 | static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
18 | dma_addr_t *dma_handle, gfp_t flags) | 18 | dma_addr_t *dma_handle, gfp_t flags, |
19 | struct dma_attrs *attrs) | ||
19 | { | 20 | { |
20 | void *vaddr; | 21 | void *vaddr; |
21 | 22 | ||
22 | vaddr = dma_generic_alloc_coherent(hwdev, size, dma_handle, flags); | 23 | vaddr = dma_generic_alloc_coherent(hwdev, size, dma_handle, flags, |
24 | attrs); | ||
23 | if (vaddr) | 25 | if (vaddr) |
24 | return vaddr; | 26 | return vaddr; |
25 | 27 | ||
26 | return swiotlb_alloc_coherent(hwdev, size, dma_handle, flags); | 28 | return swiotlb_alloc_coherent(hwdev, size, dma_handle, flags); |
27 | } | 29 | } |
28 | 30 | ||
31 | static void x86_swiotlb_free_coherent(struct device *dev, size_t size, | ||
32 | void *vaddr, dma_addr_t dma_addr, | ||
33 | struct dma_attrs *attrs) | ||
34 | { | ||
35 | swiotlb_free_coherent(dev, size, vaddr, dma_addr); | ||
36 | } | ||
37 | |||
29 | static struct dma_map_ops swiotlb_dma_ops = { | 38 | static struct dma_map_ops swiotlb_dma_ops = { |
30 | .mapping_error = swiotlb_dma_mapping_error, | 39 | .mapping_error = swiotlb_dma_mapping_error, |
31 | .alloc_coherent = x86_swiotlb_alloc_coherent, | 40 | .alloc = x86_swiotlb_alloc_coherent, |
32 | .free_coherent = swiotlb_free_coherent, | 41 | .free = x86_swiotlb_free_coherent, |
33 | .sync_single_for_cpu = swiotlb_sync_single_for_cpu, | 42 | .sync_single_for_cpu = swiotlb_sync_single_for_cpu, |
34 | .sync_single_for_device = swiotlb_sync_single_for_device, | 43 | .sync_single_for_device = swiotlb_sync_single_for_device, |
35 | .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, | 44 | .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index a33afaa5ddb7..1d92a5ab6e8b 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -362,34 +362,10 @@ void (*pm_idle)(void); | |||
362 | EXPORT_SYMBOL(pm_idle); | 362 | EXPORT_SYMBOL(pm_idle); |
363 | #endif | 363 | #endif |
364 | 364 | ||
365 | #ifdef CONFIG_X86_32 | ||
366 | /* | ||
367 | * This halt magic was a workaround for ancient floppy DMA | ||
368 | * wreckage. It should be safe to remove. | ||
369 | */ | ||
370 | static int hlt_counter; | ||
371 | void disable_hlt(void) | ||
372 | { | ||
373 | hlt_counter++; | ||
374 | } | ||
375 | EXPORT_SYMBOL(disable_hlt); | ||
376 | |||
377 | void enable_hlt(void) | ||
378 | { | ||
379 | hlt_counter--; | ||
380 | } | ||
381 | EXPORT_SYMBOL(enable_hlt); | ||
382 | |||
383 | static inline int hlt_use_halt(void) | ||
384 | { | ||
385 | return (!hlt_counter && boot_cpu_data.hlt_works_ok); | ||
386 | } | ||
387 | #else | ||
388 | static inline int hlt_use_halt(void) | 365 | static inline int hlt_use_halt(void) |
389 | { | 366 | { |
390 | return 1; | 367 | return 1; |
391 | } | 368 | } |
392 | #endif | ||
393 | 369 | ||
394 | #ifndef CONFIG_SMP | 370 | #ifndef CONFIG_SMP |
395 | static inline void play_dead(void) | 371 | static inline void play_dead(void) |