tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PVH boot with qemu




I first asked guidance in port-xen@ but the topic doesn't seem to have much
success, I'll try my chances here.

I am trying to make NetBSD/amd64 boot in PVH mode with qemu, using qemu's
-kernel flag. The kernel does start executing thanks to the first step
explained here https://www.daemonology.net/blog/2022-10-18-FreeBSD-Firecracker.html
i.e. adding PVH entry point to the kernel ELF notes.

   #define ELFNOTE(name, type, desctype, descdata...) \
  -.pushsection .note.name            ;   \
  +.pushsection .note.name, "a", @note    ;   \
     .align 4             ;   \
     .long 2f - 1f        /* namesz */    ;   \
     .long 4f - 3f        /* descsz */    ;   \
  @@ -588,6 +603,8 @@ next:   pop %edi
      movl    %eax,(%ebp)

The start_xen32 entrypoint is then found, and the kernel start, but falls in
an infinite loop in locore.S when mapping symbols and preloaded modules,
more precisely, in the fillkpt_nox macro. I assume %ecx is wrong or the region
corrupted for some reason. https://github.com/NetBSD/src/blob/trunk/sys/arch/amd64/amd64/locore.S#L738

This is far from my comfort zone but I'm willing to go down the rabbit hole, yet
some advice on where to look and possible reasons of this loop would be greatly
appreciated.

Note that this feature would also allow NetBSD to run on AWS's Firecracker, a
microvm hypervisor used in their Lambda product.

Thanks,

------------------------------------------------------------------------
Emile `iMil' Heitor <imil@{home.imil.net,NetBSD.org}> | https://imil.net



Home | Main Index | Thread Index | Old Index