On Mon, Dec 11, 2023 at 10:22:18AM +0100, Emile `iMil' Heitor wrote: > > Hi Manuel, > > On Mon, 11 Dec 2023, Manuel Bouyer wrote: > > > #ifndef GENPVH > > /* get a page for HYPERVISOR_shared_info */ > > addl $PAGE_SIZE, %ebx > > addl $PGOFSET,%ebx > > andl $~PGOFSET,%ebx > > movl $RELOC(HYPERVISOR_shared_info_pa),%ebp > > movl %ebx,(%ebp) > > movl $0,4(%ebp) > > #endif > > > > How can this work on Xen when GENPVH is defined ? > > Shouldn't this be made conditional on vm_guest == VM_GUEST_XENPVH ? > > Well the point is that you don't define GENPVH when using Xen, PVH using > qemu and friends don't need HYPERVISOR_shared_info neither any of the > hypercall portion of the code. A big chunk of Xen related code is > ifndef'ed to GENPVH in hypervisor.c; And I was planning on isolating GENPVH > so there's as little ifdef's as possible. > > Or would you prefer the same kernel to be able to boot in both XENPVH and > GENPVH modes? I am focusing on making the resulting kernel smaller but this > could be done also.
Yes, right now GENERIC can be used on bare-metal, PVHVM and XENPVH. It would be good to have GENERIC working on GENPVH too. -- Manuel Bouyer <bou...@antioche.eu.org> NetBSD: 26 ans d'experience feront toujours la difference --