| #
1.5 |
|
05-Dec-2025 |
khorben |
sys/arch/amd64: support ramdisks when booting in GENPVH mode
This adds support for booting NetBSD/amd64 with QEMU’s -kernel/-initrd combination, in generic PVH mode (GENPVH). This includes the MICROVM kernel, which now defaults to supporting modules and root on memory disks.
This patch probes the first few bytes loaded in memory for differentiating between modules, splash screens (PNG or JPEG), or assumes filesystem images otherwise. It works with plain filesystem images, but not with modules yet. Supporting any combination of filesystem, modules or splash screen images should be possible in the future.
Tested on NetBSD/amd64 by iMil and myself; measured to gain another 1~3 ms of boot time with the MICROVM kernel on the reference hardware.
As posted on tech-kern@ on 26/11/2025, with no objections.
XXX pull-up to -11 and adapt for -10
|
| #
1.4 |
|
23-Aug-2025 |
imil |
Add `+invtsc` to the QEMU command line example, this enables the invariant TSC feature, allowing the kernel to use CPUID 0x40000010 to read TSC and LAPIC frequencies from the host, thus avoiding the need for frequency calculation and gaining over 200ms in boot speed.
|
| #
1.2 |
|
27-Mar-2025 |
riastradh |
virtio(4): Consolidate kernel configs.
No functional change intended.
Leave `# XXX ?' comments where I don't know why the driver in question is excluded. (Typical reason is that PAGE_SIZE is not 4096 but I didn't investigate -- if you do investigate, please either update the comment if you determine a reason, or enable the driver if you don't.)
PR kern/59211: vio9p(4): missing from various GENERICs and MAKEDEVs
|
| #
1.1 |
|
15-Jan-2025 |
imil |
Add support for command line MMIO devices, at least qemu and Firecracker pass MMIO virtual devices mapping through the kernel command line. This driver is based on Colin Percival's FreeBSD virtio_mmio_cmdline.c https://github.com/freebsd/freebsd-src/blob/main/sys/dev/virtio/mmio/virtio_mmio_cmdline.c
The following kernel options are needed
options MPBIOS options MPTABLE_LINUX_BUG_COMPAT
As are these drivers
pv* at pvbus? virtio* at pv?
Exemple qemu usage on a Linux host to boot a NetBSD guest:
qemu-system-x86_64 \ -M microvm,x-option-roms=off,rtc=on,acpi=off,pic=off,accel=kvm \ -m 256 -cpu host -kernel ${KERNEL} \ -append "root=ld0a console=com rw -v" \ -device virtio-blk-device,drive=hd0 \ -drive file=${IMG},format=raw,id=hd0 \ -device virtio-net-device,netdev=net0 \ -netdev user,id=net0,ipv6=off,hostfwd=::2200-:22 \ -global virtio-mmio.force-legacy=false -display none -serial stdio
A lightweight kernel configuration named MICROVM if available for this use case.
|