Subject: NetBSD and Xen 2.0
To: Pavel Cahyna <pavel.cahyna@st.cuni.cz>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: port-xen
Date: 12/09/2004 10:08:21
On Thu, Dec 09, 2004 at 03:55:19PM +0100, Pavel Cahyna wrote:
> On Wed, 08 Dec 2004 07:06:05 +0000, Christian Limpach wrote:
> 
> >> Due to the way Xen works, you need NetBSD/xen in all Domains.
> > 
> > This is not true, you can mix NetBSD and Linux domains on the same machine.
> > You can run NetBSD as domain0 on Xen 1.2, which is the Xen version the
> > NetBSD/xen port in the NetBSD cvs repository (-current as well as -2.0)
> > works with.  On Xen 2.0, for which there's a NetBSD/xen port in the Xen
> > bitkeeper repository, you can only run NetBSD in unprivileged domains.
> 
> So Xen is not backward-compatible? OS for Xen 1.2 can't be run on 2.0 in
> unprivileged domains?

The interface between the guest OS and the "hypervisor" (the Xen kernel
that controls certain privileged operations) changed in 2.0, even for
unprivileged domains.  It looks like there is some effort for backwards
compatibility but not a complete one, so the answer is "you need a
different NetBSD kernel that supports the 2.0 hypervisor interface". 

In theory, we could maintain two sets of architecture-dependent code
to allow a NetBSD kernel to run with xen1 or xen2, but that would be
pretty ugly and painful.  A single NetBSD "port" that could do either
hypervisor interface would be...less ugly, but more painful, I think.

The xen2 hypervisor interface offers significant advantages and we should,
I think, transition the code that is in the NetBSD CVS repository to work
with it ASAP.

The only problem is that we will lose domain0 ability.  With that, we
will lose the ability to switch back and forth between NetBSD/i386 and
NetBSD/xen from the same root filesystem.  That will be a real pain.

Someone needs to step up and do the work to make NetBSD a block and
network provider so it can run as domain0 with the xen2 hypervisor.
That someone will probably not be Christian, since AFAIK he is very
very busy; and it will certainly not be me, among other reasons because
I would like to pass my current courses and I have an even heavier
courseload coming up next semester.

However, I am sure that if anyone *does* step up to do the work, everyone
who can will help out will help as much as they are able.  The work looks
rather mechanical and time-consuming but not very hard.

-- 
 Thor Lancelot Simon	                                      tls@rek.tjls.com

"The inconsistency is startling, though admittedly, if consistency is to be
 abandoned or transcended, there is no problem."		- Noam Chomsky