On Mon, Jan 08, 2024 at 10:03:07PM +0100, Emile 'iMil' Heitor wrote:
> 
> This morning I was given the idea of having the possibility to build a
> Xen-free kernel but still GENPVH capable.
> This doesn't impact GENERIC which is still able to boot both Xen and
> GENPVH with the following configuration:
> 
> options       XENPVHVM
> options       XEN
> hypervisor*   at mainbus?             # Xen hypervisor
> xenbus*               at hypervisor?          # Xen virtual bus
> xencons*      at hypervisor?          # Xen virtual console
> ...
> 
> Now for GENPVH only we would have a unique kernel configuration
> option:
> 
> options GENPVH
> 
> The only drawback I see is that it adds quite some ifn?def's GENPVH.
> 
> Here's the patch: https://imil.net/NetBSD/noxen.patch
> 
> Does this look reasonable to you?

in consinit.c you have:

+#if defined(XENPVHVM) || defined(GENPVH)
+#ifndef GENPVH
        if (vm_guest == VM_GUEST_XENPVH) {
                if (xen_pvh_consinit() != 0)
                        return;
                /* fallback to native console selection, usefull for dom0 PVH */
        }
+#endif

shouldn't the #ifndef GENPVH really be #ifdef XENPVHVM ?

In the same way, the #ifndef GENPVH in xen_machdep.c should either be
#ifdef XENPVHVM or #ifdef XEN

because we probably want to build kernels with both XENPVHVM and GENPVH

-- 
Manuel Bouyer <bou...@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

Reply via email to