diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-09-08 20:55:21 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-09-08 20:55:21 -0400 |
commit | bbb20089a3275a19e475dbc21320c3742e3ca423 (patch) | |
tree | 216fdc1cbef450ca688135c5b8969169482d9a48 /arch/sparc/mm | |
parent | 3e48e656903e9fd8bc805c6a2c4264d7808d315b (diff) | |
parent | 657a77fa7284d8ae28dfa48f1dc5d919bf5b2843 (diff) |
Merge branch 'dmaengine' into async-tx-next
Conflicts:
crypto/async_tx/async_xor.c
drivers/dma/ioat/dma_v2.h
drivers/dma/ioat/pci.c
drivers/md/raid5.c
Diffstat (limited to 'arch/sparc/mm')
-rw-r--r-- | arch/sparc/mm/extable.c | 29 | ||||
-rw-r--r-- | arch/sparc/mm/fault_32.c | 4 | ||||
-rw-r--r-- | arch/sparc/mm/fault_64.c | 2 | ||||
-rw-r--r-- | arch/sparc/mm/init_32.c | 1 | ||||
-rw-r--r-- | arch/sparc/mm/init_64.c | 22 | ||||
-rw-r--r-- | arch/sparc/mm/srmmu.c | 3 |
6 files changed, 45 insertions, 16 deletions
diff --git a/arch/sparc/mm/extable.c b/arch/sparc/mm/extable.c index 16cc28935e39..a61c349448e1 100644 --- a/arch/sparc/mm/extable.c +++ b/arch/sparc/mm/extable.c | |||
@@ -28,6 +28,10 @@ search_extable(const struct exception_table_entry *start, | |||
28 | * word 3: last insn address + 4 bytes | 28 | * word 3: last insn address + 4 bytes |
29 | * word 4: fixup code address | 29 | * word 4: fixup code address |
30 | * | 30 | * |
31 | * Deleted entries are encoded as: | ||
32 | * word 1: unused | ||
33 | * word 2: -1 | ||
34 | * | ||
31 | * See asm/uaccess.h for more details. | 35 | * See asm/uaccess.h for more details. |
32 | */ | 36 | */ |
33 | 37 | ||
@@ -39,6 +43,10 @@ search_extable(const struct exception_table_entry *start, | |||
39 | continue; | 43 | continue; |
40 | } | 44 | } |
41 | 45 | ||
46 | /* A deleted entry; see trim_init_extable */ | ||
47 | if (walk->fixup == -1) | ||
48 | continue; | ||
49 | |||
42 | if (walk->insn == value) | 50 | if (walk->insn == value) |
43 | return walk; | 51 | return walk; |
44 | } | 52 | } |
@@ -57,6 +65,27 @@ search_extable(const struct exception_table_entry *start, | |||
57 | return NULL; | 65 | return NULL; |
58 | } | 66 | } |
59 | 67 | ||
68 | #ifdef CONFIG_MODULES | ||
69 | /* We could memmove them around; easier to mark the trimmed ones. */ | ||
70 | void trim_init_extable(struct module *m) | ||
71 | { | ||
72 | unsigned int i; | ||
73 | bool range; | ||
74 | |||
75 | for (i = 0; i < m->num_exentries; i += range ? 2 : 1) { | ||
76 | range = m->extable[i].fixup == 0; | ||
77 | |||
78 | if (within_module_init(m->extable[i].insn, m)) { | ||
79 | m->extable[i].fixup = -1; | ||
80 | if (range) | ||
81 | m->extable[i+1].fixup = -1; | ||
82 | } | ||
83 | if (range) | ||
84 | i++; | ||
85 | } | ||
86 | } | ||
87 | #endif /* CONFIG_MODULES */ | ||
88 | |||
60 | /* Special extable search, which handles ranges. Returns fixup */ | 89 | /* Special extable search, which handles ranges. Returns fixup */ |
61 | unsigned long search_extables_range(unsigned long addr, unsigned long *g2) | 90 | unsigned long search_extables_range(unsigned long addr, unsigned long *g2) |
62 | { | 91 | { |
diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c index 12e447fc8542..a5e30c642ee3 100644 --- a/arch/sparc/mm/fault_32.c +++ b/arch/sparc/mm/fault_32.c | |||
@@ -241,7 +241,7 @@ good_area: | |||
241 | * make sure we exit gracefully rather than endlessly redo | 241 | * make sure we exit gracefully rather than endlessly redo |
242 | * the fault. | 242 | * the fault. |
243 | */ | 243 | */ |
244 | fault = handle_mm_fault(mm, vma, address, write); | 244 | fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0); |
245 | if (unlikely(fault & VM_FAULT_ERROR)) { | 245 | if (unlikely(fault & VM_FAULT_ERROR)) { |
246 | if (fault & VM_FAULT_OOM) | 246 | if (fault & VM_FAULT_OOM) |
247 | goto out_of_memory; | 247 | goto out_of_memory; |
@@ -484,7 +484,7 @@ good_area: | |||
484 | if(!(vma->vm_flags & (VM_READ | VM_EXEC))) | 484 | if(!(vma->vm_flags & (VM_READ | VM_EXEC))) |
485 | goto bad_area; | 485 | goto bad_area; |
486 | } | 486 | } |
487 | switch (handle_mm_fault(mm, vma, address, write)) { | 487 | switch (handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0)) { |
488 | case VM_FAULT_SIGBUS: | 488 | case VM_FAULT_SIGBUS: |
489 | case VM_FAULT_OOM: | 489 | case VM_FAULT_OOM: |
490 | goto do_sigbus; | 490 | goto do_sigbus; |
diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c index 4ab8993b0863..e5620b27c8bf 100644 --- a/arch/sparc/mm/fault_64.c +++ b/arch/sparc/mm/fault_64.c | |||
@@ -398,7 +398,7 @@ good_area: | |||
398 | goto bad_area; | 398 | goto bad_area; |
399 | } | 399 | } |
400 | 400 | ||
401 | fault = handle_mm_fault(mm, vma, address, (fault_code & FAULT_CODE_WRITE)); | 401 | fault = handle_mm_fault(mm, vma, address, (fault_code & FAULT_CODE_WRITE) ? FAULT_FLAG_WRITE : 0); |
402 | if (unlikely(fault & VM_FAULT_ERROR)) { | 402 | if (unlikely(fault & VM_FAULT_ERROR)) { |
403 | if (fault & VM_FAULT_OOM) | 403 | if (fault & VM_FAULT_OOM) |
404 | goto out_of_memory; | 404 | goto out_of_memory; |
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c index cbb282dab5a7..26bb3919ff1f 100644 --- a/arch/sparc/mm/init_32.c +++ b/arch/sparc/mm/init_32.c | |||
@@ -358,6 +358,7 @@ void __init paging_init(void) | |||
358 | protection_map[15] = PAGE_SHARED; | 358 | protection_map[15] = PAGE_SHARED; |
359 | btfixup(); | 359 | btfixup(); |
360 | prom_build_devicetree(); | 360 | prom_build_devicetree(); |
361 | of_fill_in_cpu_data(); | ||
361 | device_scan(); | 362 | device_scan(); |
362 | } | 363 | } |
363 | 364 | ||
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index f26a352c08a0..ed6be6ba2f4e 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -1679,11 +1679,6 @@ pgd_t swapper_pg_dir[2048]; | |||
1679 | static void sun4u_pgprot_init(void); | 1679 | static void sun4u_pgprot_init(void); |
1680 | static void sun4v_pgprot_init(void); | 1680 | static void sun4v_pgprot_init(void); |
1681 | 1681 | ||
1682 | /* Dummy function */ | ||
1683 | void __init setup_per_cpu_areas(void) | ||
1684 | { | ||
1685 | } | ||
1686 | |||
1687 | void __init paging_init(void) | 1682 | void __init paging_init(void) |
1688 | { | 1683 | { |
1689 | unsigned long end_pfn, shift, phys_base; | 1684 | unsigned long end_pfn, shift, phys_base; |
@@ -1799,16 +1794,19 @@ void __init paging_init(void) | |||
1799 | if (tlb_type == hypervisor) | 1794 | if (tlb_type == hypervisor) |
1800 | sun4v_ktsb_register(); | 1795 | sun4v_ktsb_register(); |
1801 | 1796 | ||
1802 | /* We must setup the per-cpu areas before we pull in the | ||
1803 | * PROM and the MDESC. The code there fills in cpu and | ||
1804 | * other information into per-cpu data structures. | ||
1805 | */ | ||
1806 | real_setup_per_cpu_areas(); | ||
1807 | |||
1808 | prom_build_devicetree(); | 1797 | prom_build_devicetree(); |
1798 | of_populate_present_mask(); | ||
1799 | #ifndef CONFIG_SMP | ||
1800 | of_fill_in_cpu_data(); | ||
1801 | #endif | ||
1809 | 1802 | ||
1810 | if (tlb_type == hypervisor) | 1803 | if (tlb_type == hypervisor) { |
1811 | sun4v_mdesc_init(); | 1804 | sun4v_mdesc_init(); |
1805 | mdesc_populate_present_mask(cpu_all_mask); | ||
1806 | #ifndef CONFIG_SMP | ||
1807 | mdesc_fill_in_cpu_data(cpu_all_mask); | ||
1808 | #endif | ||
1809 | } | ||
1812 | 1810 | ||
1813 | /* Once the OF device tree and MDESC have been setup, we know | 1811 | /* Once the OF device tree and MDESC have been setup, we know |
1814 | * the list of possible cpus. Therefore we can allocate the | 1812 | * the list of possible cpus. Therefore we can allocate the |
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index 06c9a7d98206..ade4eb373bdd 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
20 | #include <linux/seq_file.h> | 20 | #include <linux/seq_file.h> |
21 | #include <linux/kdebug.h> | 21 | #include <linux/kdebug.h> |
22 | #include <linux/log2.h> | ||
22 | 23 | ||
23 | #include <asm/bitext.h> | 24 | #include <asm/bitext.h> |
24 | #include <asm/page.h> | 25 | #include <asm/page.h> |
@@ -349,7 +350,7 @@ static void srmmu_free_nocache(unsigned long vaddr, int size) | |||
349 | vaddr, srmmu_nocache_end); | 350 | vaddr, srmmu_nocache_end); |
350 | BUG(); | 351 | BUG(); |
351 | } | 352 | } |
352 | if (size & (size-1)) { | 353 | if (!is_power_of_2(size)) { |
353 | printk("Size 0x%x is not a power of 2\n", size); | 354 | printk("Size 0x%x is not a power of 2\n", size); |
354 | BUG(); | 355 | BUG(); |
355 | } | 356 | } |