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

Re: [Xen-devel] [PATCH] [RFC] More fp instructions for realmode emulation (Enables booting OS/2 as a HVM guest on Intel/VT hardware)


  • To: Trolle Selander <trolle.selander@xxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • Date: Tue, 04 Mar 2008 10:13:01 +0000
  • Delivery-date: Tue, 04 Mar 2008 02:14:24 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Ach94FOsklTvh+nTEdyzcwAX8io7RQ==
  • Thread-topic: [Xen-devel] [PATCH] [RFC] More fp instructions for realmode emulation (Enables booting OS/2 as a HVM guest on Intel/VT hardware)

Annoying fact #2 about the FPU instructions is that the GNU assembler reverses the operand order of many two-operand FPU instructions. So, for example, FDIVP becomes DIVRP, and vice versa. Super annoying. So I’m going to change our emulated opcodes for most FPU instructions to be “.byte xx,yy”. Personally I think this is as clear as using the mnemonic opcode, or perhaps clearer since it is now obvious that we are executing the exact instruction that we have just decoded.

 -- Keir

On 29/2/08 22:14, "Trolle Selander" <trolle.selander@xxxxxxxxx> wrote:

This patch adds a number of fp instructions needed for OS/2 to boot as a HVM guest on Intel/VT hardware. It appears to work fine, and OS/2 is now finally working on Intel/VT as well as AMD/SVM.

I'm a little concerned about the "correctness" of the FSTSW emulation and the use of inline assembly directly using the corresponding ops for emulation. Wrt FSTSW, it is really two ops FNSTSW immediately preceeded by an FWAIT. I've left FWAIT defined, but a no-op because after looking at realmode.c it seems in the emulation, exceptions are always processed if a call to x86_emulate returns an exception, so there should be no way for there to be "pending" exceptions for FWAIT to wait for. I may have missed something, though, hence the RFC.

Secondly, about the inline assembly - i saw that this was how many of the other FP instructions were done, so I did it that way as well. However, none of the previous instructions done that way referenced the fp registers. Does this make a difference, or is it ok the way i've done it here?

Signed-off-by: Trolle Selander <trolle.selander@xxxxxxxxx>


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

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