diff options
author | Paul Mackerras <paulus@samba.org> | 2008-09-09 21:36:13 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-09-09 21:36:13 -0400 |
commit | 7e392f8c29ee045c6a29d50193d2fb10712eceb0 (patch) | |
tree | c84097fe644c50c82f087ab7fa2d75167b8c0e16 /arch/powerpc/mm | |
parent | 7713fef06517d216f96ee7c8ad750e72bc08d38f (diff) | |
parent | 93811d94f7e9bcfeed7d6ba75ea5d9c80a70ab95 (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 7efcb9c5217c..d666f71f1f30 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -191,12 +191,17 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
191 | unsigned long hash, hpteg; | 191 | unsigned long hash, hpteg; |
192 | unsigned long vsid = get_kernel_vsid(vaddr, ssize); | 192 | unsigned long vsid = get_kernel_vsid(vaddr, ssize); |
193 | unsigned long va = hpt_va(vaddr, vsid, ssize); | 193 | unsigned long va = hpt_va(vaddr, vsid, ssize); |
194 | unsigned long tprot = prot; | ||
195 | |||
196 | /* Make kernel text executable */ | ||
197 | if (in_kernel_text(vaddr)) | ||
198 | tprot &= ~HPTE_R_N; | ||
194 | 199 | ||
195 | hash = hpt_hash(va, shift, ssize); | 200 | hash = hpt_hash(va, shift, ssize); |
196 | hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); | 201 | hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); |
197 | 202 | ||
198 | BUG_ON(!ppc_md.hpte_insert); | 203 | BUG_ON(!ppc_md.hpte_insert); |
199 | ret = ppc_md.hpte_insert(hpteg, va, paddr, prot, | 204 | ret = ppc_md.hpte_insert(hpteg, va, paddr, tprot, |
200 | HPTE_V_BOLTED, psize, ssize); | 205 | HPTE_V_BOLTED, psize, ssize); |
201 | 206 | ||
202 | if (ret < 0) | 207 | if (ret < 0) |
@@ -586,7 +591,7 @@ void __init htab_initialize(void) | |||
586 | { | 591 | { |
587 | unsigned long table; | 592 | unsigned long table; |
588 | unsigned long pteg_count; | 593 | unsigned long pteg_count; |
589 | unsigned long prot, tprot; | 594 | unsigned long prot; |
590 | unsigned long base = 0, size = 0, limit; | 595 | unsigned long base = 0, size = 0, limit; |
591 | int i; | 596 | int i; |
592 | 597 | ||
@@ -662,10 +667,9 @@ void __init htab_initialize(void) | |||
662 | for (i=0; i < lmb.memory.cnt; i++) { | 667 | for (i=0; i < lmb.memory.cnt; i++) { |
663 | base = (unsigned long)__va(lmb.memory.region[i].base); | 668 | base = (unsigned long)__va(lmb.memory.region[i].base); |
664 | size = lmb.memory.region[i].size; | 669 | size = lmb.memory.region[i].size; |
665 | tprot = prot | (in_kernel_text(base) ? _PAGE_EXEC : 0); | ||
666 | 670 | ||
667 | DBG("creating mapping for region: %lx..%lx (prot: %x)\n", | 671 | DBG("creating mapping for region: %lx..%lx (prot: %x)\n", |
668 | base, size, tprot); | 672 | base, size, prot); |
669 | 673 | ||
670 | #ifdef CONFIG_U3_DART | 674 | #ifdef CONFIG_U3_DART |
671 | /* Do not map the DART space. Fortunately, it will be aligned | 675 | /* Do not map the DART space. Fortunately, it will be aligned |
@@ -682,21 +686,21 @@ void __init htab_initialize(void) | |||
682 | unsigned long dart_table_end = dart_tablebase + 16 * MB; | 686 | unsigned long dart_table_end = dart_tablebase + 16 * MB; |
683 | if (base != dart_tablebase) | 687 | if (base != dart_tablebase) |
684 | BUG_ON(htab_bolt_mapping(base, dart_tablebase, | 688 | BUG_ON(htab_bolt_mapping(base, dart_tablebase, |
685 | __pa(base), tprot, | 689 | __pa(base), prot, |
686 | mmu_linear_psize, | 690 | mmu_linear_psize, |
687 | mmu_kernel_ssize)); | 691 | mmu_kernel_ssize)); |
688 | if ((base + size) > dart_table_end) | 692 | if ((base + size) > dart_table_end) |
689 | BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, | 693 | BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, |
690 | base + size, | 694 | base + size, |
691 | __pa(dart_table_end), | 695 | __pa(dart_table_end), |
692 | tprot, | 696 | prot, |
693 | mmu_linear_psize, | 697 | mmu_linear_psize, |
694 | mmu_kernel_ssize)); | 698 | mmu_kernel_ssize)); |
695 | continue; | 699 | continue; |
696 | } | 700 | } |
697 | #endif /* CONFIG_U3_DART */ | 701 | #endif /* CONFIG_U3_DART */ |
698 | BUG_ON(htab_bolt_mapping(base, base + size, __pa(base), | 702 | BUG_ON(htab_bolt_mapping(base, base + size, __pa(base), |
699 | tprot, mmu_linear_psize, mmu_kernel_ssize)); | 703 | prot, mmu_linear_psize, mmu_kernel_ssize)); |
700 | } | 704 | } |
701 | 705 | ||
702 | /* | 706 | /* |