[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] [HVM] Patches to make HVM capable of running OS/2.

  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: "Trolle Selander" <trolle.selander@xxxxxxxxx>
  • Date: Fri, 16 Mar 2007 13:07:04 +0100
  • Cc: Mats.Petersson@xxxxxxx, thomas.woller@xxxxxxx
  • Delivery-date: Fri, 16 Mar 2007 05:06:12 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:mime-version:content-type; b=F3bYCCYLVPQYWGB7JQ3BmJ6hSb37BYKnwDHG5ZxKNWqbFTlo8RWkwolSSxYkxT7fbxAYMh5jGT2O8bodFOjVx2untTWsQjE5TsqX8VicymOxSu+TSv3A5cKSoajE5Ojp3VJaGoyze08LerYTZRTfVV8qVdzSx1eUTVLIusBdSFw=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

This is a set of patches that makes it possible to run OS/2 in a fully virtualized guest. Because of the limited real-mode support on Intel VT, this will currently only work on AMD-V  CPUs.
One of the patches (the smsw instruction emulation) is very "stop-gap" and ugly as sin, but arguably even that is better than the current case which blissfully does the wrong thing and then resumes execution from the wrong EIP. :) The "right thing" is probably to add the lmsw/smsw instructions to x86_emulate, and use that instead, unless something about how the control register intercepts & emulation makes x86_emulate the wrong tool for the job. Suggestions welcome, because I do want to make a proper general-case fix for this, rather than the ugly special-case kludge provided here.

Patch descriptions:

Patch 1:

This is plain bugfix - IRQ priority calculation is currently broken in the virtual vpic. The priority shift should be a right-rotation, not a left-rotation.

Patch 2:

Just two additional mmio ops that OS/2 needs emulated.

Patch 3:

Adds support for IOREQ_TYPE_XCHG in qemu-dm.

Patch 4:

This is a "minimally intrusive" way to fix an issue that I think should really be fixed in a different way.
Currently, the shared info, ioreq and buffered_io pages are mapped into the guest's memory space as the three highest page frames. They are "protected" from use by being marked as reserved in the e820 ram map. However, legacy software won't know about the e820 call, and since the older e801 call reports all ram, including the shared pages, the guest OS will end up using them as regular ram with disastrous results.
This patch makes the older e801 bios call report one 64kb block less memory, thus "protecting" the shared pages from older OS's in a similar manner to the e820 call, at the expense of 52kb of wasted ram (the e801 call reports memory in 64kb blocks, so no way around this).

However, while I think shared_info might be needed by PV-on-HVM drivers, I don't see why the ioreq and buffered_iopage pages should be guest-accessible at all. Rather they should be shared only between HV and Dom0, since their use is strictly for the qemu-dm device model, which should happen entirely "out of sight" of a fully virtualized guest.

Patch 5:


This is the abovementioned ugly patch.
The current SVM emulation of the smsw instruction makes the assumption that the destination for the msw is always a register. While i think this is true for the newer MOV from CRx, the legacy smsw can also copy to mem. Since I've only encountered one specific usage of msw->mem this, which is msw->segment base + offset, I've put in handling only of this special case. Consider this one very temporary.

Attachment: pic-prio-fix.patch
Description: Text Data

Attachment: mmio_ops.patch
Description: Text Data

Attachment: qemu-dm_xchg.patch
Description: Text Data

Attachment: rombios_e801_fix.patch
Description: Text Data

Attachment: svm_smsw_modrm.patch
Description: Text Data

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.