diff options
author | Hari Bathini <hbathini@linux.vnet.ibm.com> | 2016-09-28 14:14:42 +0900 |
---|---|---|
committer | Atsushi Kumagai <ats-kumagai@wm.jp.nec.com> | 2016-10-14 19:57:07 +0900 |
commit | cf02f88ba82d7f61aeff783bad9ccefe8db12408 (patch) | |
tree | f8a68dd0ab80aac8b650a79063b738a356daf1d2 /arch | |
parent | c1c53f8ea410729d5e6ec4aa3d5e8d107f14864c (diff) |
[PATCH 1/8] ppc64: fix vtop page translation for 4K pages
* Required for kernel 3.7
PUD index size was changed to 9 from 7 since kernel v3.7, but it was
not updated here. Also, currently L4_MASK is set to 0xfff for kernel
v3.10 and above irrespective of page size but it should be based on
l4 index size which is different for 4k & 64K page sizes. This patch
fixes them.
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc64.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/ppc64.c b/arch/ppc64.c index 89a7f05..2cc3906 100644 --- a/arch/ppc64.c +++ b/arch/ppc64.c @@ -160,10 +160,12 @@ ppc64_vmalloc_init(void) info->l1_index_size = PTE_INDEX_SIZE_L4_64K_3_10; info->l2_index_size = PMD_INDEX_SIZE_L4_64K_3_10; info->l3_index_size = PUD_INDEX_SIZE_L4_64K; + info->l4_index_size = PGD_INDEX_SIZE_L4_64K_3_10; } else { info->l1_index_size = PTE_INDEX_SIZE_L4_64K; info->l2_index_size = PMD_INDEX_SIZE_L4_64K; info->l3_index_size = PUD_INDEX_SIZE_L4_64K; + info->l4_index_size = PGD_INDEX_SIZE_L4_64K; } info->pte_shift = SYMBOL(demote_segment_4k) ? @@ -175,7 +177,9 @@ ppc64_vmalloc_init(void) */ info->l1_index_size = PTE_INDEX_SIZE_L4_4K; info->l2_index_size = PMD_INDEX_SIZE_L4_4K; - info->l3_index_size = PUD_INDEX_SIZE_L4_4K; + info->l3_index_size = (info->kernel_version >= KERNEL_VERSION(3, 7, 0) ? + PUD_INDEX_SIZE_L4_4K_3_7 : PUD_INDEX_SIZE_L4_4K); + info->l4_index_size = PGD_INDEX_SIZE_L4_4K; info->pte_shift = PTE_SHIFT_L4_4K; info->l2_masked_bits = PMD_MASKED_BITS_4K; @@ -188,8 +192,8 @@ ppc64_vmalloc_init(void) info->ptrs_per_l1 = (1 << info->l1_index_size); info->ptrs_per_l2 = (1 << info->l2_index_size); info->ptrs_per_l3 = (1 << info->l3_index_size); - - info->ptrs_per_pgd = info->ptrs_per_l3; + info->ptrs_per_l4 = (1 << info->l4_index_size); + info->ptrs_per_pgd = info->ptrs_per_l4; /* * Compute shifts |