Due to a (bug?) in OpenBSD's pmap_bootstrap(), the kernel attempts to locate its text segment and size by searching the translations property for continuous regions in use starting from the kernel load address.
Unfortunately if we have already mapped memory above the kernel load address of 0x1000000 then the kernel extends the text region way beyond the text segement causing an exception when eventually trying to set non-existent mappings in the TLB.
Fix this by only mapping 8MB of RAM so that we guarantee that the region above 0x1000000 will always be free, and hence the text/data regions will be discrete so that the sizing algorithms return the correct answer.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- openbios-devel/arch/sparc64/ofmem_sparc64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/openbios-devel/arch/sparc64/ofmem_sparc64.c b/openbios-devel/arch/sparc64/ofmem_sparc64.c index 5758a5d..16f9247 100644 --- a/openbios-devel/arch/sparc64/ofmem_sparc64.c +++ b/openbios-devel/arch/sparc64/ofmem_sparc64.c @@ -366,7 +366,7 @@ void ofmem_init( void ) ofmem_walk_boot_map(remap_page_range);
/* Map the memory */ - ofmem_map_page_range(PAGE_SIZE, PAGE_SIZE, qemu_mem_size, 0x36); + ofmem_map_page_range(PAGE_SIZE, PAGE_SIZE, 0x800000, 0x36);
if (!(retained->magic == RETAIN_MAGIC)) { OFMEM_TRACE("ofmem_init: no retained magic found, creating\n");