how to port

Samuel Rydh mol-devel@lists.maconlinux.org
Wed, 29 Oct 2003 14:02:11 +0100


On Wed, Oct 29, 2003 at 12:24:00PM +0100, Laurent Vivier wrote:
> > > do you think MOL can be used as a base of a virtual machine on Itanium-2
> > > IA 64 linux ?
> > > Can we use technical solutions found for powerPC and Openfirmware with
> > > Itanium-2 and EFI ?
> >
> > Do you mean a virtual PowerPC machine on IA 64 or a virtual IA 64 on
> > Itanium-2?
> 
> I mean virtual IA-64 machine on IA-64 linux.

OK, that's what I thought.

I believe MOL could be a good starting point for such a VM. The key
design points are:

- Complete virtualization of the MMU. The physical MMU is used
to achieve this.

- The VM engine consists of two parts; a kernel module part and
a userspace part (which is an ordinary linux process).

- Almost the entire virtualization engine is implemented in the MOL kernel
module. Userspace handles I/O, emulation of certain key
hardware and other similar things. Userspace is also responsible
for configuring the virtualization (mapping RAM and other things).

- The VM itself runs in its own context completely
controller by MOL. In particular, the VM is completely isolated
from the VM engine. However, from the point of view of the
rest of the kernel, it is just the MOL userspace process that
is running.

- The VM communicates with the VM engine through a syscall
like mechanism.

- MOL makes very few assumptions about the linux kernel. Less than
10 lines of MOL related stuff is in the 2.6 kernel (mostly exportation
of some symbols). The bulk of the interaction with the kernel proper
is due to the useage of unlocked RAM for the VM.

- The userspace part of the VM engine has only untranslated RAM
access. That is, the VM engine itself can not utilize the
MMU virtualization (mainly due to performance considerations).

The low-level MOL core has to be completely reimplemented for IA 64 but
I believe it is possible to implement something which is more or
less functionally equivalent. I haven't actually read the IA 64
specs though so I could be wrong. 

One really nice aspect of the PowerPC CPU is that it turns off
MMU translation whenever an exception occurs. The low-level MOL
core (written in assembly) intercepts the exception and usually
handles it completely without turning the MMU on. I'm not sure how
IA 64 handles this, but if it does stuff more like the the x86
then there might be some trouble here (but it can probably be
resolved). Besides, with 64-bit it is not such a big limitation
if the VM engine itself uses up a small part of the
effective address space.

/Samuel