NetBSD Problem Report #42645
From www@NetBSD.org Tue Jan 19 22:36:47 2010
Received: from mail.netbsd.org (mail.netbsd.org [126.96.36.199])
by www.NetBSD.org (Postfix) with ESMTP id EE71863C545
for <gnats-bugs@gnats.NetBSD.org>; Tue, 19 Jan 2010 22:36:46 +0000 (UTC)
Date: Tue, 19 Jan 2010 22:36:46 +0000 (UTC)
Subject: Instant reboot with big modules (e.g. miniroot.kmod) on amd64
>Synopsis: Instant reboot with big modules (e.g. miniroot.kmod) on amd64
>Arrival-Date: Tue Jan 19 22:40:00 +0000 2010
>Originator: Vladimir 'phcoder' Serbinenko
>Release: 5.0.1 and -current
sys/arch/amd64/amd64/locore.S seems to map only pages in the range 0x100000-0x1800000 When total amount of loaded modules is higher than that kernel instantly reboots (triple fault). It happes in following chunk of code:
* Finally, we're in long mode. However, we're still
* in the identity mapped area (could not jump out
* of that earlier because it would have been a > 32bit
* jump). We can do that now, so here we go.
* We have arrived.
* There's no need anymore for the identity mapping in low
* memory, remove it.
#if L2_SLOT_KERNBASE > 0
addq %r8, %rbx
1: movq $0,(%rbx)
More exactly on 1: movq $0,(%rbx)
It tries to remove some mappings but since page table is after modules if big modules were loaded the memory holding pagetable isn't mapped. Triple fault.
Make a miniroot.kmod with 32MiB image. Load it in bootloader, type boot and see how you get triple-fault reboot instead.
add necessary entries to initial pagetable. LAzy solution would be just to map low 4GiB. Since boot protocol has 32-bit pointers this value can't be exceeded and mapping with 2M pages should be quite easy
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.