Commit 63ee9b2f authored by Michael Ellerman's avatar Michael Ellerman

powerpc/mm/book3s64: Make KERN_IO_START a variable

Currently KERN_IO_START is defined as:

 #define KERN_IO_START  (KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))

Although it looks like a constant, both the components are actually
variables, to allow us to have a different value between Radix and
Hash with a single kernel.

However that still requires both Radix and Hash to place the kernel IO
region at the same location relative to the start and end of the
kernel virtual region (namely 1/2 way through it), and we'd like to
change that.

So split KERN_IO_START out into its own variable, and initialise it
for Radix and Hash. In the medium term we should be able to
reconsolidate this, by doing a more involved rearrangement of the
location of the regions.
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Reviewed-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: default avatarBalbir Singh <bsingharora@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent e66ca3db
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
#define H_VMALLOC_SIZE (H_KERN_VIRT_SIZE >> 1) #define H_VMALLOC_SIZE (H_KERN_VIRT_SIZE >> 1)
#define H_VMALLOC_END (H_VMALLOC_START + H_VMALLOC_SIZE) #define H_VMALLOC_END (H_VMALLOC_START + H_VMALLOC_SIZE)
#define H_KERN_IO_START H_VMALLOC_END
/* /*
* Region IDs * Region IDs
*/ */
......
...@@ -272,8 +272,10 @@ extern unsigned long __vmalloc_end; ...@@ -272,8 +272,10 @@ extern unsigned long __vmalloc_end;
extern unsigned long __kernel_virt_start; extern unsigned long __kernel_virt_start;
extern unsigned long __kernel_virt_size; extern unsigned long __kernel_virt_size;
extern unsigned long __kernel_io_start;
#define KERN_VIRT_START __kernel_virt_start #define KERN_VIRT_START __kernel_virt_start
#define KERN_VIRT_SIZE __kernel_virt_size #define KERN_VIRT_SIZE __kernel_virt_size
#define KERN_IO_START __kernel_io_start
extern struct page *vmemmap; extern struct page *vmemmap;
extern unsigned long ioremap_bot; extern unsigned long ioremap_bot;
extern unsigned long pci_io_base; extern unsigned long pci_io_base;
...@@ -298,7 +300,6 @@ extern unsigned long pci_io_base; ...@@ -298,7 +300,6 @@ extern unsigned long pci_io_base;
* PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces * PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces
* IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE * IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE
*/ */
#define KERN_IO_START (KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))
#define FULL_IO_SIZE 0x80000000ul #define FULL_IO_SIZE 0x80000000ul
#define ISA_IO_BASE (KERN_IO_START) #define ISA_IO_BASE (KERN_IO_START)
#define ISA_IO_END (KERN_IO_START + 0x10000ul) #define ISA_IO_END (KERN_IO_START + 0x10000ul)
......
...@@ -110,6 +110,8 @@ ...@@ -110,6 +110,8 @@
*/ */
#define RADIX_VMEMMAP_BASE (RADIX_VMALLOC_END) #define RADIX_VMEMMAP_BASE (RADIX_VMALLOC_END)
#define RADIX_KERN_IO_START (RADIX_KERN_VIRT_START + (RADIX_KERN_VIRT_SIZE >> 1))
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#define RADIX_PTE_TABLE_SIZE (sizeof(pte_t) << RADIX_PTE_INDEX_SIZE) #define RADIX_PTE_TABLE_SIZE (sizeof(pte_t) << RADIX_PTE_INDEX_SIZE)
#define RADIX_PMD_TABLE_SIZE (sizeof(pmd_t) << RADIX_PMD_INDEX_SIZE) #define RADIX_PMD_TABLE_SIZE (sizeof(pmd_t) << RADIX_PMD_INDEX_SIZE)
......
...@@ -1019,6 +1019,7 @@ void __init hash__early_init_mmu(void) ...@@ -1019,6 +1019,7 @@ void __init hash__early_init_mmu(void)
__kernel_virt_size = H_KERN_VIRT_SIZE; __kernel_virt_size = H_KERN_VIRT_SIZE;
__vmalloc_start = H_VMALLOC_START; __vmalloc_start = H_VMALLOC_START;
__vmalloc_end = H_VMALLOC_END; __vmalloc_end = H_VMALLOC_END;
__kernel_io_start = H_KERN_IO_START;
vmemmap = (struct page *)H_VMEMMAP_BASE; vmemmap = (struct page *)H_VMEMMAP_BASE;
ioremap_bot = IOREMAP_BASE; ioremap_bot = IOREMAP_BASE;
......
...@@ -494,6 +494,7 @@ void __init radix__early_init_mmu(void) ...@@ -494,6 +494,7 @@ void __init radix__early_init_mmu(void)
__kernel_virt_size = RADIX_KERN_VIRT_SIZE; __kernel_virt_size = RADIX_KERN_VIRT_SIZE;
__vmalloc_start = RADIX_VMALLOC_START; __vmalloc_start = RADIX_VMALLOC_START;
__vmalloc_end = RADIX_VMALLOC_END; __vmalloc_end = RADIX_VMALLOC_END;
__kernel_io_start = RADIX_KERN_IO_START;
vmemmap = (struct page *)RADIX_VMEMMAP_BASE; vmemmap = (struct page *)RADIX_VMEMMAP_BASE;
ioremap_bot = IOREMAP_BASE; ioremap_bot = IOREMAP_BASE;
......
...@@ -104,6 +104,8 @@ unsigned long __vmalloc_start; ...@@ -104,6 +104,8 @@ unsigned long __vmalloc_start;
EXPORT_SYMBOL(__vmalloc_start); EXPORT_SYMBOL(__vmalloc_start);
unsigned long __vmalloc_end; unsigned long __vmalloc_end;
EXPORT_SYMBOL(__vmalloc_end); EXPORT_SYMBOL(__vmalloc_end);
unsigned long __kernel_io_start;
EXPORT_SYMBOL(__kernel_io_start);
struct page *vmemmap; struct page *vmemmap;
EXPORT_SYMBOL(vmemmap); EXPORT_SYMBOL(vmemmap);
unsigned long __pte_frag_nr; unsigned long __pte_frag_nr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment