aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-11-09 01:07:12 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-11-09 01:07:12 -0500
commita892acacd3a8546ac161526522f13b5174f2c471 (patch)
treeee6d36f27f1388989ebfcabf90253fb7194112ac /arch/powerpc/mm
parent193515d51ccb363165d6b09e9ba5c21089e34bad (diff)
parent330d57fb98a916fa8e1363846540dd420e99499a (diff)
Merge branch 'master'
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/fault.c17
-rw-r--r--arch/powerpc/mm/hash_utils_64.c16
-rw-r--r--arch/powerpc/mm/hugetlbpage.c6
-rw-r--r--arch/powerpc/mm/init_64.c1
-rw-r--r--arch/powerpc/mm/mem.c2
-rw-r--r--arch/powerpc/mm/numa.c1
-rw-r--r--arch/powerpc/mm/pgtable_64.c1
-rw-r--r--arch/powerpc/mm/ppc_mmu_32.c4
-rw-r--r--arch/powerpc/mm/slb_low.S13
9 files changed, 43 insertions, 18 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 841d8b6323a8..93d4fbfdb724 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -389,5 +389,22 @@ void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
389 } 389 }
390 390
391 /* kernel has accessed a bad area */ 391 /* kernel has accessed a bad area */
392
393 printk(KERN_ALERT "Unable to handle kernel paging request for ");
394 switch (regs->trap) {
395 case 0x300:
396 case 0x380:
397 printk("data at address 0x%08lx\n", regs->dar);
398 break;
399 case 0x400:
400 case 0x480:
401 printk("instruction fetch\n");
402 break;
403 default:
404 printk("unknown fault\n");
405 }
406 printk(KERN_ALERT "Faulting instruction address: 0x%08lx\n",
407 regs->nip);
408
392 die("Kernel access of bad area", regs, sig); 409 die("Kernel access of bad area", regs, sig);
393} 410}
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index b2f3dbca6952..22e474876133 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -33,7 +33,6 @@
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/signal.h> 34#include <linux/signal.h>
35 35
36#include <asm/ppcdebug.h>
37#include <asm/processor.h> 36#include <asm/processor.h>
38#include <asm/pgtable.h> 37#include <asm/pgtable.h>
39#include <asm/mmu.h> 38#include <asm/mmu.h>
@@ -329,12 +328,14 @@ static void __init htab_init_page_sizes(void)
329 */ 328 */
330 if (mmu_psize_defs[MMU_PAGE_16M].shift) 329 if (mmu_psize_defs[MMU_PAGE_16M].shift)
331 mmu_huge_psize = MMU_PAGE_16M; 330 mmu_huge_psize = MMU_PAGE_16M;
331 /* With 4k/4level pagetables, we can't (for now) cope with a
332 * huge page size < PMD_SIZE */
332 else if (mmu_psize_defs[MMU_PAGE_1M].shift) 333 else if (mmu_psize_defs[MMU_PAGE_1M].shift)
333 mmu_huge_psize = MMU_PAGE_1M; 334 mmu_huge_psize = MMU_PAGE_1M;
334 335
335 /* Calculate HPAGE_SHIFT and sanity check it */ 336 /* Calculate HPAGE_SHIFT and sanity check it */
336 if (mmu_psize_defs[mmu_huge_psize].shift > 16 && 337 if (mmu_psize_defs[mmu_huge_psize].shift > MIN_HUGEPTE_SHIFT &&
337 mmu_psize_defs[mmu_huge_psize].shift < 28) 338 mmu_psize_defs[mmu_huge_psize].shift < SID_SHIFT)
338 HPAGE_SHIFT = mmu_psize_defs[mmu_huge_psize].shift; 339 HPAGE_SHIFT = mmu_psize_defs[mmu_huge_psize].shift;
339 else 340 else
340 HPAGE_SHIFT = 0; /* No huge pages dude ! */ 341 HPAGE_SHIFT = 0; /* No huge pages dude ! */
@@ -407,12 +408,6 @@ void __init htab_initialize(void)
407 htab_size_bytes = htab_get_table_size(); 408 htab_size_bytes = htab_get_table_size();
408 pteg_count = htab_size_bytes >> 7; 409 pteg_count = htab_size_bytes >> 7;
409 410
410 /* For debug, make the HTAB 1/8 as big as it normally would be. */
411 ifppcdebug(PPCDBG_HTABSIZE) {
412 pteg_count >>= 3;
413 htab_size_bytes = pteg_count << 7;
414 }
415
416 htab_hash_mask = pteg_count - 1; 411 htab_hash_mask = pteg_count - 1;
417 412
418 if (systemcfg->platform & PLATFORM_LPAR) { 413 if (systemcfg->platform & PLATFORM_LPAR) {
@@ -512,6 +507,9 @@ unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap)
512{ 507{
513 struct page *page; 508 struct page *page;
514 509
510 if (!pfn_valid(pte_pfn(pte)))
511 return pp;
512
515 page = pte_page(pte); 513 page = pte_page(pte);
516 514
517 /* page is dirty */ 515 /* page is dirty */
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 0073a04047e4..426c269e552e 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -212,6 +212,12 @@ static int prepare_high_area_for_htlb(struct mm_struct *mm, unsigned long area)
212 212
213 BUG_ON(area >= NUM_HIGH_AREAS); 213 BUG_ON(area >= NUM_HIGH_AREAS);
214 214
215 /* Hack, so that each addresses is controlled by exactly one
216 * of the high or low area bitmaps, the first high area starts
217 * at 4GB, not 0 */
218 if (start == 0)
219 start = 0x100000000UL;
220
215 /* Check no VMAs are in the region */ 221 /* Check no VMAs are in the region */
216 vma = find_vma(mm, start); 222 vma = find_vma(mm, start);
217 if (vma && (vma->vm_start < end)) 223 if (vma && (vma->vm_start < end))
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index dfe7fa37b41a..ce974c83d88a 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -57,7 +57,6 @@
57#include <asm/processor.h> 57#include <asm/processor.h>
58#include <asm/mmzone.h> 58#include <asm/mmzone.h>
59#include <asm/cputable.h> 59#include <asm/cputable.h>
60#include <asm/ppcdebug.h>
61#include <asm/sections.h> 60#include <asm/sections.h>
62#include <asm/system.h> 61#include <asm/system.h>
63#include <asm/iommu.h> 62#include <asm/iommu.h>
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 7faa46b71f21..6f55efd9be95 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -358,7 +358,7 @@ void __init mem_init(void)
358 } 358 }
359 359
360 codesize = (unsigned long)&_sdata - (unsigned long)&_stext; 360 codesize = (unsigned long)&_sdata - (unsigned long)&_stext;
361 datasize = (unsigned long)&__init_begin - (unsigned long)&_sdata; 361 datasize = (unsigned long)&_edata - (unsigned long)&_sdata;
362 initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin; 362 initsize = (unsigned long)&__init_end - (unsigned long)&__init_begin;
363 bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start; 363 bsssize = (unsigned long)&__bss_stop - (unsigned long)&__bss_start;
364 364
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 4035cad8d7f1..da09ba03c424 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -21,6 +21,7 @@
21#include <asm/machdep.h> 21#include <asm/machdep.h>
22#include <asm/abs_addr.h> 22#include <asm/abs_addr.h>
23#include <asm/system.h> 23#include <asm/system.h>
24#include <asm/smp.h>
24 25
25static int numa_enabled = 1; 26static int numa_enabled = 1;
26 27
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 51b786940971..900842451bd3 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -59,7 +59,6 @@
59#include <asm/processor.h> 59#include <asm/processor.h>
60#include <asm/mmzone.h> 60#include <asm/mmzone.h>
61#include <asm/cputable.h> 61#include <asm/cputable.h>
62#include <asm/ppcdebug.h>
63#include <asm/sections.h> 62#include <asm/sections.h>
64#include <asm/system.h> 63#include <asm/system.h>
65#include <asm/iommu.h> 64#include <asm/iommu.h>
diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
index d137abd241ff..ed7fcfe5fd37 100644
--- a/arch/powerpc/mm/ppc_mmu_32.c
+++ b/arch/powerpc/mm/ppc_mmu_32.c
@@ -188,9 +188,9 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
188 188
189 if (Hash == 0) 189 if (Hash == 0)
190 return; 190 return;
191 pmd = pmd_offset(pgd_offset(vma->vm_mm, address), address); 191 pmd = pmd_offset(pgd_offset(mm, ea), ea);
192 if (!pmd_none(*pmd)) 192 if (!pmd_none(*pmd))
193 add_hash_page(vma->vm_mm->context, address, pmd_val(*pmd)); 193 add_hash_page(mm->context, ea, pmd_val(*pmd));
194} 194}
195 195
196/* 196/*
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index 3e18241b6f35..950ffc5848c7 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -80,12 +80,17 @@ _GLOBAL(slb_miss_kernel_load_virtual)
80BEGIN_FTR_SECTION 80BEGIN_FTR_SECTION
81 b 1f 81 b 1f
82END_FTR_SECTION_IFCLR(CPU_FTR_16M_PAGE) 82END_FTR_SECTION_IFCLR(CPU_FTR_16M_PAGE)
83 cmpldi r10,16
84
85 lhz r9,PACALOWHTLBAREAS(r13)
86 mr r11,r10
87 blt 5f
88
83 lhz r9,PACAHIGHHTLBAREAS(r13) 89 lhz r9,PACAHIGHHTLBAREAS(r13)
84 srdi r11,r10,(HTLB_AREA_SHIFT-SID_SHIFT) 90 srdi r11,r10,(HTLB_AREA_SHIFT-SID_SHIFT)
85 srd r9,r9,r11 91
86 lhz r11,PACALOWHTLBAREAS(r13) 925: srd r9,r9,r11
87 srd r11,r11,r10 93 andi. r9,r9,1
88 or. r9,r9,r11
89 beq 1f 94 beq 1f
90_GLOBAL(slb_miss_user_load_huge) 95_GLOBAL(slb_miss_user_load_huge)
91 li r11,0 96 li r11,0