Re: [RFC] Porting KVM to QEMU CVS

Avi Kivity
2006-12-18T08:16:39Z

Anthony Liguori wrote:
> I spent some time this weekend trying to port the KVM changes to the
> latest QEMU CVS. I got snagged on a certain changeset though.
> Specifically, the changeset on Sep 24th that added SMM support (and
> moved ACPI init to the BIOS) is where my patch stops working.
>
> KVM dies with a bus error after real early in boot. The BIOS appears
> to be accessing a memory address at 0xa8000. With the latest CVS,
> this bus error doesn't occur but the guest never makes any progress
> (not even in the BIOS).
>
> So far, my best guess is that the VGA area is no longer in
> 0xa0000-0xc0000 so the special handling of this is no longer valid.
> Although, I don't really know all that much about the legacy RAM space
> but I thought that the VGA area was pretty much fixed?
>
> Any thoughts?

SMM continues the tradition of making each x86 generation hackier than
before.

What happens (probably) is that the virtual hardware unmaps the vga
memory when SMM is entered, and uses the physical memory at these
addresses (which is not normally accessible) to store the SMI handler code.

The way to fix this (again, probably) is to:

1. Revert the 0-640K/1MB-end-of-memory slot thing and create just one
memory slot for all physical RAM.
2. Add hacks in the memory slot code to not return a memory slot if the
physical address is in the forbidden range.
3. Add another hack to disable the first hack when SMM is entered and
re-enabled it when SMM is exited (e.g. some ioctl).

> Is anyone else working on this?

I intended to merge qemu once a release is made. However, if you get
this working and it is stable, it may make sense to merge sooner as I
very much like qemu cvs.

--
error compiling committee.c: too many arguments to function