Re: PVH boot with qemu

Manuel Bouyer <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
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 <[email protected]>
     NetBSD: 26 ans d'experience feront toujours la difference
--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.