From 26bedc8f4e1f542195b31858342a07d4e374f63c Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Wed, 30 Dec 2020 21:31:05 +0100 Subject: [PATCH] sparc: move kernel to a lower address The openboot mmu code does not like addresses above 4GB, so load the kernel to a lower address. It doesn't really matter anyway, because on sparc the kernel normally lives in a separate address space and uses special instructions to access userland memory. See #19597 for details, further changes will be needed here. Change-Id: Iac6901f275667efef5e64d059daf4c96032a7baf Reviewed-on: https://review.haiku-os.org/c/haiku/+/3573 Reviewed-by: Adrien Destugues Tested-by: Commit checker robot --- headers/private/kernel/arch/sparc/arch_kernel.h | 6 +++++- src/system/ldscripts/sparc/kernel.ld | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/headers/private/kernel/arch/sparc/arch_kernel.h b/headers/private/kernel/arch/sparc/arch_kernel.h index 5666fff6b5..10029e071e 100644 --- a/headers/private/kernel/arch/sparc/arch_kernel.h +++ b/headers/private/kernel/arch/sparc/arch_kernel.h @@ -9,7 +9,11 @@ #include // memory layout -#define KERNEL_LOAD_BASE_64_BIT 0xffffffff80000000ll +// FIXME: On sparc, the kernel should live in an independent address space, +// and does not share addresses with userspace. So, a lot of this doesn't +// really make sense. See #19597 for discussion. +// The consequence is that IS_USER_MEMORY cannot work in the way we need. +#define KERNEL_LOAD_BASE_64_BIT 0x80000000ll // Base of the kernel address space. // KERNEL_BASE is the base of the kernel address space. This differs from the diff --git a/src/system/ldscripts/sparc/kernel.ld b/src/system/ldscripts/sparc/kernel.ld index f465690d66..fb50cdb64e 100644 --- a/src/system/ldscripts/sparc/kernel.ld +++ b/src/system/ldscripts/sparc/kernel.ld @@ -13,7 +13,7 @@ PHDRS SECTIONS { - . = 0xFFFFFFFF80000000 + SIZEOF_HEADERS; + . = 0x80000000 + SIZEOF_HEADERS; .interp : { *(.interp) } : text .hash : { *(.hash) }