diff options
author | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-11-28 02:00:27 +0000 |
---|---|---|
committer | Justin Hibbits <jhibbits@FreeBSD.org> | 2018-11-28 02:00:27 +0000 |
commit | ea32838af0826098ca7f6ed2996c32aa5482028a (patch) | |
tree | 195914cffd3ffb425ee6f6e642cc1e01efa7b529 /sys/powerpc/mpc85xx/platform_mpc85xx.c | |
parent | 89797c881d31f6a68e5f79fa21ed79885d751bef (diff) | |
download | src-ea32838af0826098ca7f6ed2996c32aa5482028a.tar.gz src-ea32838af0826098ca7f6ed2996c32aa5482028a.zip |
powerpc: Prepare Book-E kernels for KERNBASE != run base
Book-E kernels really run at VM_MIN_KERNEL_ADDRESS, which currently happens to
be the same as KERNBASE. KERNBASE is the linked address, which the loader also
takes to be the physical load address. Treat KERNBASE as a physical address,
not a virtual, and change virtual address references for KERNBASE to use
something more appropriate.
Notes
Notes:
svn path=/head/; revision=341102
Diffstat (limited to 'sys/powerpc/mpc85xx/platform_mpc85xx.c')
-rw-r--r-- | sys/powerpc/mpc85xx/platform_mpc85xx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/powerpc/mpc85xx/platform_mpc85xx.c b/sys/powerpc/mpc85xx/platform_mpc85xx.c index 5490755c018e..420e7b9b0b96 100644 --- a/sys/powerpc/mpc85xx/platform_mpc85xx.c +++ b/sys/powerpc/mpc85xx/platform_mpc85xx.c @@ -68,6 +68,7 @@ extern void *ap_pcpu; extern vm_paddr_t kernload; /* Kernel physical load address */ extern uint8_t __boot_page[]; /* Boot page body */ extern uint32_t bp_kernload; +extern vm_offset_t __startkernel; struct cpu_release { uint32_t entry_h; @@ -346,7 +347,7 @@ mpc85xx_smp_start_cpu_epapr(platform_t plat, struct pcpu *pc) rel_va = rel_page + (rel_pa & PAGE_MASK); pmap_kenter(rel_page, rel_pa & ~PAGE_MASK); rel = (struct cpu_release *)rel_va; - bptr = ((vm_paddr_t)(uintptr_t)__boot_page - KERNBASE) + kernload; + bptr = ((vm_paddr_t)(uintptr_t)__boot_page - __startkernel) + kernload; cpu_flush_dcache(__DEVOLATILE(struct cpu_release *,rel), sizeof(*rel)); rel->pir = pc->pc_cpuid; __asm __volatile("sync"); rel->entry_h = (bptr >> 32); @@ -415,7 +416,7 @@ mpc85xx_smp_start_cpu(platform_t plat, struct pcpu *pc) /* Flush caches to have our changes hit DRAM. */ cpu_flush_dcache(__boot_page, 4096); - bptr = ((vm_paddr_t)(uintptr_t)__boot_page - KERNBASE) + kernload; + bptr = ((vm_paddr_t)(uintptr_t)__boot_page - __startkernel) + kernload; KASSERT((bptr & 0xfff) == 0, ("%s: boot page is not aligned (%#jx)", __func__, (uintmax_t)bptr)); if (mpc85xx_is_qoriq()) { |