From: Crystal Kolipe Subject: Re: vmd(8): Use 32-bit direct kernel launch for both amd64 and i386 To: Dave Voutila Cc: Mike Larkin , tech@openbsd.org Date: Wed, 20 Aug 2025 21:28:21 +0100 On Wed, Aug 20, 2025 at 03:36:51PM -0400, Dave Voutila wrote: > Crystal Kolipe writes: > > As noted previously, this is 7.7-release with local patches unrelated to vmd, > > and loadfile_elf.c updated to HEAD, with hshoexer@'s patch applied. > > > > Note: with just the previous patch by bluhm@ applied, (I.E. loadfile_elf.c at > > HEAD), vmd works as expected, (no regressions). > > Can't quite grok this note. Does this mean with this diff plus a > separate diff it's working on this machine? > > I can't tell if things are now working or still broken with the diff. Here is a summary: * We have various OpenBSD vms running on various vmd hosts, almost all of them boot the OpenBSD kernel directly and do not make use of a bios image. * Both the hosts and the vms run -release with various local modifications to the kernel and userland, (mostly things that are not expected to conflict with any work on vmd, E.G. wscons and softraid stuff) * Since we are in the minority by: * not using a bios image for booting * running modified kernels * running some vms with large memory allocations, ( > 16 Gb) ... it seemed useful to test this patch and look for any breakage. From a quick read of the code, I naively assumed that it would 'just work', as the changes were minimal. * Updated loadfile_elf.c to HEAD, (I.E. to v1.51), and recompiled vmd. ... everything works as before * Applied hshoexer@'s patch on top of v1.51 ... all vms, (both amd64 and i386), fail to start, with vm_resetcpu: failed * Looked at vm_resetcpu(), and saw no obvious cause, so posted my observation to the list, with the assumption that I was missing some other update from -current that I would need to backport. * Read the code again with more care, and realised that the new code was not a no-op for i386 compared with -release as I had originally thought, but sets ET | PE, (which I overlooked) * Deleted just that line from loadfile_elf.c, effectivly making the changes a no-op for i386 vms. ... result: i386 vms boot, amd64 vms do not, (as expected). [1] Honestly, this looks like my bad for trying to apply the diff to a modified -release, which I was aware of right from the start, but decided to test anyway for the reasons mentioned above. [1] Although at this point, amd64 vms just hang with no output rather than report vm_resetcpu: failed.