powerpc/mm/hash64: Add a variable to track the end of IO mapping
Subsystems (2)
RFC PATCH 1/2 powerpc/mm/hash64: Add a variable to track the end of IO mapping
--- arch/powerpc/include/asm/book3s/64/hash.h | 1 + arch/powerpc/include/asm/book3s/64/pgtable.h | 8 +++++--- arch/powerpc/include/asm/book3s/64/radix.h | 1 + arch/powerpc/mm/hash_utils_64.c | 1 + arch/powerpc/mm/pgtable-radix.c | 1 + arch/powerpc/mm/pgtable_64.c | 2 ++ 6 files changed, 11 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/book3s/64/hash.h +1 -0
@@ -56,6 +56,7 @@#define H_VMALLOC_END (H_VMALLOC_START + H_VMALLOC_SIZE)#define H_KERN_IO_START H_VMALLOC_END +#define H_KERN_IO_END (H_KERN_VIRT_START + H_KER_VIRT_SIZE)/* * Region IDs
arch/powerpc/include/asm/book3s/64/pgtable.h +5 -3
@@ -277,9 +277,12 @@ extern unsigned long __vmalloc_end;extern unsigned long __kernel_virt_start;extern unsigned long __kernel_virt_size;extern unsigned long __kernel_io_start; +extern unsigned long __kernel_io_end;#define KERN_VIRT_START __kernel_virt_start#define KERN_VIRT_SIZE __kernel_virt_size#define KERN_IO_START __kernel_io_start +#define KERN_IO_END __kernel_io_end +extern struct page *vmemmap;extern unsigned long ioremap_bot;extern unsigned long pci_io_base;
@@ -296,8 +299,7 @@ extern unsigned long pci_io_base;#include <asm/barrier.h> /* -* The second half of the kernel virtual space is used for IO mappings, -* it's itself carved into the PIO region (ISA and PHB IO space) and +* IO space itself carved into the PIO region (ISA and PHB IO space) and * the ioremap space * * ISA_IO_BASE = KERN_IO_START, 64K reserved area
@@ -310,7 +312,7 @@ extern unsigned long pci_io_base;#define PHB_IO_BASE (ISA_IO_END)#define PHB_IO_END (KERN_IO_START + FULL_IO_SIZE)#define IOREMAP_BASE (PHB_IO_END) -#define IOREMAP_END (KERN_VIRT_START + KERN_VIRT_SIZE) +#define IOREMAP_END (KERN_IO_END)/* Advertise special mapping type for AGP */ #define HAVE_PAGE_AGP
arch/powerpc/include/asm/book3s/64/radix.h +1 -0
@@ -111,6 +111,7 @@#define RADIX_VMEMMAP_BASE (RADIX_VMALLOC_END)#define RADIX_KERN_IO_START (RADIX_KERN_VIRT_START + (RADIX_KERN_VIRT_SIZE >> 1)) +#define RADIX_KERN_IO_END (RADIX_KERN_VIRT_START + RADIX_KERN_VIRT_SIZE)#ifndef __ASSEMBLY__#define RADIX_PTE_TABLE_SIZE (sizeof(pte_t) << RADIX_PTE_INDEX_SIZE)
arch/powerpc/mm/hash_utils_64.c +1 -0
@@ -1010,6 +1010,7 @@ void __init hash__early_init_mmu(void) __vmalloc_start =H_VMALLOC_START ; __vmalloc_end =H_VMALLOC_END ; __kernel_io_start =H_KERN_IO_START ; + __kernel_io_end =H_KERN_IO_END ; vmemmap = (struct page *)H_VMEMMAP_BASE ; ioremap_bot =IOREMAP_BASE ;
arch/powerpc/mm/pgtable-radix.c +1 -0
@@ -582,6 +582,7 @@ void __init radix__early_init_mmu(void) __vmalloc_start =RADIX_VMALLOC_START ; __vmalloc_end =RADIX_VMALLOC_END ; __kernel_io_start =RADIX_KERN_IO_START ; + __kernel_io_end =RADIX_KERN_IO_END ; vmemmap = (struct page *)RADIX_VMEMMAP_BASE ; ioremap_bot =IOREMAP_BASE ;
arch/powerpc/mm/pgtable_64.c +2 -0
@@ -98,6 +98,8 @@ unsigned long __vmalloc_end;EXPORT_SYMBOL (__vmalloc_end);unsigned long __kernel_io_start;EXPORT_SYMBOL (__kernel_io_start); +unsigned long __kernel_io_end; +EXPORT_SYMBOL (__kernel_io_end);struct page *vmemmap;EXPORT_SYMBOL (vmemmap);unsigned long __pte_frag_nr;
Signature · 1 line
2.20.1
RFC PATCH 2/2 powerpc/mm/hash64: Map all the kernel mapping in the same 0xc range
This patch maps vmap, IO and vmemap regions in the 0xc address range instead of the current 0xd and 0xf range. This brings the mapping closer to radix translation mode.
With hash 64K page size each of this region is 512TB whereas with 4K config we are limitted by the max page table range of 64TB and hence there regions are of 16TB size.
--- arch/powerpc/include/asm/book3s/64/hash-4k.h | 17 ++++ arch/powerpc/include/asm/book3s/64/hash-64k.h | 11 +++ arch/powerpc/include/asm/book3s/64/hash.h | 89 ++++++++++++++----- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 31 ++++--- arch/powerpc/include/asm/book3s/64/radix.h | 24 ++--- arch/powerpc/include/asm/page.h | 3 +- arch/powerpc/kvm/book3s_hv_rm_xics.c | 2 +- arch/powerpc/mm/copro_fault.c | 14 +-- arch/powerpc/mm/dump_hashpagetable.c | 2 +- arch/powerpc/mm/dump_linuxpagetables.c | 2 +- arch/powerpc/mm/hash_utils_64.c | 29 +++--- arch/powerpc/mm/pgtable-radix.c | 2 +- arch/powerpc/mm/slb.c | 22 +++-- 13 files changed, 166 insertions(+), 82 deletions(-)
arch/powerpc/include/asm/book3s/64/hash-4k.h +17 -0
@@ -13,6 +13,23 @@*/ #define MAX_EA_BITS_PER_CONTEXT 46 +/* +* Our page table limit us to 64TB. Hence for the kernel mapping, +* each MAP area is limited to 16 TB. +* The four map areas are: +* linear mapping +* vmap +* IO +* vmemmap +*/ +#define EA_KERNEL_MAP_SIZE (ASM_CONST(1) << (46 - 2)) + +/* +* Define the address range of the kernel non-linear virtual area +* 16TB +*/ +#define H_KERN_VIRT_START ASM_CONST(0xc000100000000000) +#ifndef __ASSEMBLY__#define H_PTE_TABLE_SIZE (sizeof(pte_t) << H_PTE_INDEX_SIZE)#define H_PMD_TABLE_SIZE (sizeof(pmd_t) << H_PMD_INDEX_SIZE)
arch/powerpc/include/asm/book3s/64/hash-64k.h +11 -0
@@ -13,6 +13,17 @@*/ #define MAX_EA_BITS_PER_CONTEXT 49 +/* +* We use one context for each MAP area. +*/ +#define EA_KERNEL_MAP_SIZE (1UL << MAX_EA_BITS_PER_CONTEXT) + +/* +* Define the address range of the kernel non-linear virtual area +* 2PB +*/ +#define H_KERN_VIRT_START ASM_CONST(0xc008000000000000) +/* * 64k aligned address free up few of the lower bits of RPN for us * We steal that here. For more deatils look at pte_pfn/pfn_pte()
arch/powerpc/include/asm/book3s/64/hash.h +68 -21
121 lines not on this page · raw message
arch/powerpc/include/asm/book3s/64/mmu-hash.h +15 -16
@@ -588,7 +588,8 @@ extern void slb_set_size(u16 size);#endif #define MAX_VMALLOC_CTX_CNT 1 -#define MAX_MEMMAP_CTX_CNT 1 +#define MAX_IO_CTX_CNT 1 +#define MAX_VMEMMAP_CTX_CNT 1/* * 256MB segment
@@ -601,13 +602,10 @@ extern void slb_set_size(u16 size);* would give a protovsid of 0x1fffffffff. That will result in a VSID 0 * because of the modulo operation in vsid scramble. * -* We add one extra context to MIN_USER_CONTEXT so that we can map kernel -* context easily. The +1 is to map the unused 0xe region mapping. */ #define MAX_USER_CONTEXT ((ASM_CONST(1) << CONTEXT_BITS) - 2)#define MIN_USER_CONTEXT (MAX_KERNEL_CTX_CNT + MAX_VMALLOC_CTX_CNT + \ - MAX_MEMMAP_CTX_CNT + 2) - + MAX_IO_CTX_CNT + MAX_VMEMMAP_CTX_CNT)/* * For platforms that support on 65bit VA we limit the context bits */
@@ -747,7 +745,7 @@ static inline unsigned long get_vsid(unsigned long context, unsigned long ea,/* * Bad address. We return VSID 0 for that */ -if ((ea & ~REGION_MASK ) >=H_PGTABLE_RANGE ) +if ((ea &EA_MASK ) >=H_PGTABLE_RANGE )return 0 ;if (!mmu_has_feature (MMU_FTR_68_BIT_VA ))
@@ -774,28 +772,29 @@ static inline unsigned long get_vsid(unsigned long context, unsigned long ea,* 0x00002 - [ 0xc002000000000000 - 0xc003ffffffffffff] * 0x00003 - [ 0xc004000000000000 - 0xc005ffffffffffff] * 0x00004 - [ 0xc006000000000000 - 0xc007ffffffffffff] - -* 0x00005 - [ 0xd000000000000000 - 0xd001ffffffffffff ] -* 0x00006 - Not used - Can map 0xe000000000000000 range. -* 0x00007 - [ 0xf000000000000000 - 0xf001ffffffffffff ] * -* So we can compute the context from the region (top nibble) by -* subtracting 11, or 0xc - 1. +* vmap, IO, vmemap +* +* 0x00005 - [ 0xc008000000000000 - 0xc009ffffffffffff] +* 0x00006 - [ 0xc00a000000000000 - 0xc00bffffffffffff] +* 0x00007 - [ 0xc00c000000000000 - 0xc00dffffffffffff] +* */ static inline unsigned long get_kernel_context (unsigned long ea) { -unsigned long region_id =REGION_ID (ea); +unsigned long region_id =get_region_id (ea);unsigned long ctx;/* -* For linear mapping we do support multiple context +* Depending on Kernel config, kernel region can have one context +* or more. */ if (region_id ==KERNEL_REGION_ID ) {/* * We already verified ea to be not beyond the addr limit. */ - ctx =1 + ((ea & ~REGION_MASK ) >>MAX_EA_BITS_PER_CONTEXT ); + ctx =1 + ((ea &EA_MASK ) >>MAX_EA_BITS_PER_CONTEXT ); }else - ctx = (region_id -0xc ) +MAX_KERNEL_CTX_CNT ; + ctx = region_id +MAX_KERNEL_CTX_CNT -2 ;return ctx; }
arch/powerpc/include/asm/book3s/64/radix.h +9 -15
@@ -72,17 +72,17 @@* | | * | | * | | -* +------------------------------+ Kernel IO map end (0xc010000000000000) +* +------------------------------+ Kernel vmemmap end (0xc010000000000000) * | | * | | * | 1/2 of virtual map | * | | * | | -* +------------------------------+ Kernel IO map start +* +------------------------------+ Kernel IO map end/vmemap start * | | * | 1/4 of virtual map | * | | -* +------------------------------+ Kernel vmemap start +* +------------------------------+ Kernel vmap end/ IO map start * | | * | 1/4 of virtual map | * | |
@@ -96,22 +96,16 @@#define RADIX_KERN_VIRT_START ASM_CONST(0xc008000000000000)#define RADIX_KERN_VIRT_SIZE ASM_CONST(0x0008000000000000) -/* -* The vmalloc space starts at the beginning of that region, and -* occupies a quarter of it on radix config. -* (we keep a quarter for the virtual memmap) -*/ #define RADIX_VMALLOC_START RADIX_KERN_VIRT_START#define RADIX_VMALLOC_SIZE (RADIX_KERN_VIRT_SIZE >> 2)#define RADIX_VMALLOC_END (RADIX_VMALLOC_START + RADIX_VMALLOC_SIZE) -/* -* Defines the address of the vmemap area, in its own region on -* hash table CPUs. -*/ -#define RADIX_VMEMMAP_BASE (RADIX_VMALLOC_END) -#define RADIX_KERN_IO_START (RADIX_KERN_VIRT_START + (RADIX_KERN_VIRT_SIZE >> 1)) -#define RADIX_KERN_IO_END (RADIX_KERN_VIRT_START + RADIX_KERN_VIRT_SIZE) +#define RADIX_KERN_IO_START RADIX_VMALLOC_END +#define RADIX_KERN_IO_SIZE (RADIX_KERN_VIRT_SIZE >> 2) +#define RADIX_KERN_IO_END (RADIX_KERN_IO_START + RADIX_KERN_IO_SIZE) + +#define RADIX_VMEMMAP_START (RADIX_VMALLOC_END) +#define RADIX_VMEMMAP_END (RADIX_KERN_VIRT_START + RADIX_KERN_VIRT_SIZE)#ifndef __ASSEMBLY__#define RADIX_PTE_TABLE_SIZE (sizeof(pte_t) << RADIX_PTE_INDEX_SIZE)
arch/powerpc/include/asm/page.h +2 -1
@@ -148,7 +148,8 @@ static inline bool pfn_valid(unsigned long pfn)* return true for some vmalloc addresses, which is incorrect. So explicitly * check that the address is in the kernel region. */ -#define virt_addr_valid (kaddr) (REGION_ID(kaddr) == KERNEL_REGION_ID && \ +/* may be can drop get_region_id */ +#define virt_addr_valid (kaddr) (get_region_id((unsigned long)kaddr) == KERNEL_REGION_ID && \ pfn_valid(virt_to_pfn(kaddr)))#else #define virt_addr_valid (kaddr) pfn_valid(virt_to_pfn(kaddr))
arch/powerpc/kvm/book3s_hv_rm_xics.c +1 -1
@@ -815,7 +815,7 @@ static inline void this_cpu_inc_rm(unsigned int __percpu *addr) raddr =per_cpu_ptr (addr, cpu); l = (unsigned long )raddr; -if (REGION_ID (l) ==VMALLOC_REGION_ID ) { +if (get_region_id (l) ==VMALLOC_REGION_ID ) { l =vmalloc_to_phys (raddr); raddr = (unsigned int *)l; }
arch/powerpc/mm/copro_fault.c +9 -5
@@ -105,7 +105,7 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)u64 vsid, vsidkey;int psize, ssize; -switch (REGION_ID (ea)) { +switch (get_region_id (ea)) {case USER_REGION_ID :pr_devel ("%s: 0x%llx -- USER_REGION_ID\n" , __func__, ea);if (mm ==NULL )
@@ -117,14 +117,18 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)break ;case VMALLOC_REGION_ID :pr_devel ("%s: 0x%llx -- VMALLOC_REGION_ID\n" , __func__, ea); -if (ea <VMALLOC_END ) - psize = mmu_vmalloc_psize; -else - psize = mmu_io_psize; + psize = mmu_vmalloc_psize; ssize = mmu_kernel_ssize; vsid =get_kernel_vsid (ea, mmu_kernel_ssize); vsidkey =SLB_VSID_KERNEL ;break ; + +case IO_REGION_ID : +pr_devel ("%s: 0x%llx -- IO_REGION_ID\n" , __func__, ea); + psize = mmu_io_psize; + ssize = mmu_kernel_ssize; + vsid =get_kernel_vsid (ea, mmu_kernel_ssize); + vsidkey =SLB_VSID_KERNEL ;case KERNEL_REGION_ID :pr_devel ("%s: 0x%llx -- KERNEL_REGION_ID\n" , __func__, ea); psize = mmu_linear_psize;
arch/powerpc/mm/dump_hashpagetable.c +1 -1
@@ -500,7 +500,7 @@ static void populate_markers(void) address_markers[7 ].start_address =IOREMAP_BASE ; address_markers[8 ].start_address =IOREMAP_END ;#ifdef CONFIG_PPC_BOOK3S_64 - address_markers[9 ].start_address =H_VMEMMAP_BASE ; + address_markers[9 ].start_address =H_KERN_VMEMMAP_START ;#else address_markers[9 ].start_address =VMEMMAP_BASE ;#endif
arch/powerpc/mm/dump_linuxpagetables.c +1 -1
@@ -298,7 +298,7 @@ static void populate_markers(void) address_markers[i++].start_address =IOREMAP_BASE ; address_markers[i++].start_address =IOREMAP_END ;#ifdef CONFIG_PPC_BOOK3S_64 - address_markers[i++].start_address =H_VMEMMAP_BASE ; + address_markers[i++].start_address =H_KERN_VMEMMAP_START ;#else address_markers[i++].start_address =VMEMMAP_BASE ;#endif
arch/powerpc/mm/hash_utils_64.c +17 -12
@@ -1007,11 +1007,11 @@ void __init hash__early_init_mmu(void) __kernel_virt_start =H_KERN_VIRT_START ; __kernel_virt_size =H_KERN_VIRT_SIZE ; - __vmalloc_start =H_VMALLOC_START ; - __vmalloc_end =H_VMALLOC_END ; + __vmalloc_start =H_KERN_VMALLOC_START ; + __vmalloc_end =H_KERN_VMALLOC_END ; __kernel_io_start =H_KERN_IO_START ; __kernel_io_end =H_KERN_IO_END ; - vmemmap = (struct page *)H_VMEMMAP_BASE ; + vmemmap = (struct page *)H_KERN_VMEMMAP_START ; ioremap_bot =IOREMAP_BASE ;#ifdef CONFIG_PCI
@@ -1232,7 +1232,7 @@ int hash_page_mm(struct mm_struct *mm, unsigned long ea,trace_hash_fault (ea, access, trap);/* Get region & vsid */ -switch (REGION_ID (ea)) { +switch (get_region_id (ea)) {case USER_REGION_ID : user_region =1 ;if (! mm) {
@@ -1246,10 +1246,13 @@ int hash_page_mm(struct mm_struct *mm, unsigned long ea,break ;case VMALLOC_REGION_ID : vsid =get_kernel_vsid (ea, mmu_kernel_ssize); -if (ea <VMALLOC_END ) - psize = mmu_vmalloc_psize; -else - psize = mmu_io_psize; + psize = mmu_vmalloc_psize; + ssize = mmu_kernel_ssize; +break ; + +case IO_REGION_ID : + vsid =get_kernel_vsid (ea, mmu_kernel_ssize); + psize = mmu_io_psize; ssize = mmu_kernel_ssize;break ;default :
@@ -1415,7 +1418,8 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap,unsigned long flags =0 ;struct mm_struct *mm = current->mm; -if (REGION_ID (ea) ==VMALLOC_REGION_ID ) +if ((get_region_id (ea) ==VMALLOC_REGION_ID ) || + (get_region_id (ea) ==IO_REGION_ID )) mm = &init_mm;if (dsisr &DSISR_NOHPTE )
@@ -1431,8 +1435,9 @@ int __hash_page(unsigned long ea, unsigned long msr, unsigned long trap,unsigned long access = _PAGE_PRESENT | _PAGE_READ;unsigned long flags =0 ;struct mm_struct *mm = current->mm; +unsigned int region_id =get_region_id (ea); -if (REGION_ID (ea) ==VMALLOC_REGION_ID ) +if ((region_id ==VMALLOC_REGION_ID ) || (region_id ==IO_REGION_ID )) mm = &init_mm;if (dsisr &DSISR_NOHPTE )
@@ -1449,7 +1454,7 @@ int __hash_page(unsigned long ea, unsigned long msr, unsigned long trap,* 2) user space access kernel space. */ access |= _PAGE_PRIVILEGED; -if ((msr &MSR_PR ) || (REGION_ID (ea) ==USER_REGION_ID )) +if ((msr &MSR_PR ) || (region_id ==USER_REGION_ID )) access &= ~_PAGE_PRIVILEGED;if (trap ==0x400 )
@@ -1493,7 +1498,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,int rc, ssize, update_flags =0 ;unsigned long access = _PAGE_PRESENT | _PAGE_READ | (is_exec ? _PAGE_EXEC :0 ); -BUG_ON (REGION_ID (ea) !=USER_REGION_ID ); +BUG_ON (get_region_id (ea) !=USER_REGION_ID );if (!should_hash_preload (mm, ea))return ;
arch/powerpc/mm/pgtable-radix.c +1 -1
@@ -583,7 +583,7 @@ void __init radix__early_init_mmu(void) __vmalloc_end =RADIX_VMALLOC_END ; __kernel_io_start =RADIX_KERN_IO_START ; __kernel_io_end =RADIX_KERN_IO_END ; - vmemmap = (struct page *)RADIX_VMEMMAP_BASE ; + vmemmap = (struct page *)RADIX_VMEMMAP_START ; ioremap_bot =IOREMAP_BASE ;#ifdef CONFIG_PCI
arch/powerpc/mm/slb.c +14 -8
@@ -689,7 +689,7 @@ static long slb_allocate_kernel(unsigned long ea, unsigned long id)if (id ==KERNEL_REGION_ID ) {/* We only support upto MAX_PHYSMEM_BITS */ -if ((ea & ~REGION_MASK ) > (1UL <<MAX_PHYSMEM_BITS )) +if ((ea &EA_MASK ) > (1UL <<MAX_PHYSMEM_BITS ))return -EFAULT ; flags =SLB_VSID_KERNEL | mmu_psize_defs[mmu_linear_psize].sllp;
@@ -697,20 +697,25 @@ static long slb_allocate_kernel(unsigned long ea, unsigned long id) #ifdef CONFIG_SPARSEMEM_VMEMMAP }else if (id ==VMEMMAP_REGION_ID ) { -if ((ea & ~REGION_MASK ) >= (1ULL <<MAX_EA_BITS_PER_CONTEXT )) +if (ea >=H_KERN_VMEMMAP_END )return -EFAULT ; flags =SLB_VSID_KERNEL | mmu_psize_defs[mmu_vmemmap_psize].sllp;#endif }else if (id ==VMALLOC_REGION_ID ) { -if ((ea & ~REGION_MASK ) >= (1ULL <<MAX_EA_BITS_PER_CONTEXT )) +if (ea >=H_KERN_VMALLOC_END )return -EFAULT ; -if (ea <H_VMALLOC_END ) - flags = local_paca->vmalloc_sllp; -else - flags =SLB_VSID_KERNEL | mmu_psize_defs[mmu_io_psize].sllp; + flags = local_paca->vmalloc_sllp; + + }else if (id ==IO_REGION_ID ) { + +if (ea >=H_KERN_IO_END ) +return -EFAULT ; + + flags =SLB_VSID_KERNEL | mmu_psize_defs[mmu_io_psize].sllp; + }else {return -EFAULT ; }
@@ -720,6 +725,7 @@ static long slb_allocate_kernel(unsigned long ea, unsigned long id) ssize =MMU_SEGSIZE_256M ; context =get_kernel_context (ea); +return slb_insert_entry (ea, context, flags, ssize, true); }
@@ -756,7 +762,7 @@ static long slb_allocate_user(struct mm_struct *mm, unsigned long ea)long do_slb_fault (struct pt_regs *regs,unsigned long ea) { -unsigned long id =REGION_ID (ea); +unsigned long id =get_region_id (ea);/* IRQs are not reconciled here, so can't check irqs_disabled */ VM_WARN_ON (mfmsr () &MSR_EE );
Signature · 1 line
2.20.1
Nicholas Piggin
reviewerRe: [RFC PATCH 2/2] powerpc/mm/hash64: Map all the kernel mapping in the same 0xc range
Aneesh Kumar K.V's on February 17, 2019 3:16 pm:
Quoted 3 lines
This patch maps vmap, IO and vmemap regions in the
0xcaddress range instead of the current0xdand0xfrange. This brings the mapping closer to radix translation mode.
What was the reason for that address layout in the first place?
Thanks,
Nick
Re: [RFC PATCH 2/2] powerpc/mm/hash64: Map all the kernel mapping in the same 0xc range
Quoted 7 lines · Nicholas Piggin
Aneesh Kumar K.V's on February 17, 2019 3:16 pm:
Quoted 3 lines
This patch maps vmap, IO and vmemap regions in the
0xcaddress range instead of the current0xdand0xfrange. This brings the mapping closer to radix translation mode.What was the reason for that address layout in the first place?
To bring in closer to radix translation mode and it should also help with KASAN implementation.
-aneesh
Nicholas Piggin
reviewerRe: [RFC PATCH 2/2] powerpc/mm/hash64: Map all the kernel mapping in the same 0xc range
Aneesh Kumar K.V's on February 19, 2019 4:00 pm:
Quoted 11 lines · Nicholas Piggin
Quoted 7 lines
Aneesh Kumar K.V's on February 17, 2019 3:16 pm:
Quoted 3 lines
This patch maps vmap, IO and vmemap regions in the
0xcaddress range instead of the current0xdand0xfrange. This brings the mapping closer to radix translation mode.What was the reason for that address layout in the first place?
To bring in closer to radix translation mode and it should also help with KASAN implementation.
No I mean the old implementation. Your change seems fine, it would just be good to know what the downside (if any) is from changing. Maybe it was just to make debugging slightly simpler?
Thanks,
Nick
Michael Ellerman
reviewerRe: [RFC PATCH 2/2] powerpc/mm/hash64: Map all the kernel mapping in the same 0xc range
Quoted 10 lines · Nicholas Piggin
Aneesh Kumar K.V's on February 19, 2019 4:00 pm:
Quoted 9 lines · Nicholas Piggin
Quoted 7 lines
Aneesh Kumar K.V's on February 17, 2019 3:16 pm:
Quoted 3 lines
This patch maps vmap, IO and vmemap regions in the
0xcaddress range instead of the current0xdand0xfrange. This brings the mapping closer to radix translation mode.What was the reason for that address layout in the first place?
Quoted 6 lines
Quoted 2 lines
To bring in closer to radix translation mode and it should also help with KASAN implementation.
No I mean the old implementation. Your change seems fine, it would just be good to know what the downside (if any) is from changing. Maybe it was just to make debugging slightly simpler?
I don't know what the reason was for using 0xd to begin with. The original ppc64 port already had it.
Takes a few seconds to load:
https://github.com/mpe/linux-fullhistory/commit/c3aa9878533e724f639852c3d951e6a169e04081#diff-0adfdefb64f0f0ef306be06ce7f953ebR173
#define PAGE_OFFSET 0xC000000000000000 #define KERNELBASE PAGE_OFFSET #define VMALLOCBASE 0xD000000000000000 #define IOREGIONBASE 0xE000000000000000
cheers