From: Keir Fraser Subject: Re: [PATCH] [RFC] More fp instructions for realmode emulation (Enables booting OS/2 as a HVM guest on Intel/VT hardware) Date: Mon, 03 Mar 2008 12:21:50 +0000 Message-ID: References: <515922b50803030418g4df884basfb2f6278dea47a3b@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0706592721==" Return-path: In-Reply-To: <515922b50803030418g4df884basfb2f6278dea47a3b@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Trolle Selander Cc: xen-devel List-Id: xen-devel@lists.xenproject.org > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --===============0706592721== Content-type: multipart/alternative; boundary="B_3287391717_22301730" > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3287391717_22301730 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable I=B9ll have some time to do it this afternoon. -- Keir On 3/3/08 12:18, "Trolle Selander" wrote: > That's what I was worried about. I honestly had zilch experience working = with > assembler-level x87 stuff before Friday afternoon when I whipped up this > patch, mainly to see if the fp instructions were all that was missing to = get > OS/2 on VT to work. I'll see if I can find time to make an exception-safe > version of this sometime this week. I'm not worrying about life being too > short, but rather that March 2008 is too dense... ;) >=20 > On Sat, Mar 1, 2008 at 10:18 AM, Keir Fraser > wrote: >> Intel SDM Volume 1 Section 8.6 ("X87 FPU Exception Synchronization") is = very >> helpful in this regard. It confirms my suspicions, that we will need to = wrap >> the FPU inline asms in some fixup glue. The only exceptions to this rule= are >> the FN* (no-wait) instructions. Properly speaking we should also check f= or >> unmasked exceptions becoming pending after any FPU instruction and set t= he >> faulting CS:IP in the FPU context block appropriately. But life is perha= ps >> too short. :-) >>=20 >> -- Keir >>=20 >>=20 >> On 1/3/08 08:46, "Keir Fraser" wrote: >>=20 >>> Regarding point 1: Don't FPU instructions that raise an exception only = log >>> that in the status word, to be picked up by the next FPU instruction wh= ich >>> checks for exceptions? It strikes me that we can have previously loaded= up a >>> status word that requires an exception to occur on FWAIT, in which case >>> semantics are broken. More worryingly, if any of the instructions you h= ave >>> added can cause an exception, we will crash Xen because you have not ad= ded >>> fixup handling. Unfortunately I'm not really up on exactly how FPU exce= ption >>> handling works: are you? >>=20 >=20 >=20 --B_3287391717_22301730 Content-type: text/html; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable Re: [Xen-devel] [PATCH] [RFC] More fp instructions for realmode emul= ation (Enables booting OS/2 as a HVM guest on Intel/VT hardware) IR= 17;ll have some time to do it this afternoon.

 -- Keir

On 3/3/08 12:18, "Trolle Selander" <trolle.selander@gmail.com&= gt; wrote:

That's what I was worried about. I honestly had zilch e= xperience working with assembler-level x87 stuff before Friday afternoon whe= n I whipped up this patch, mainly to see if the fp instructions were all tha= t was missing to get OS/2 on VT to work. I'll see if I can find time to make= an exception-safe version of this sometime this week. I'm not worrying abou= t life being too short, but rather that March 2008 is too dense... ;)

On Sat, Mar 1, 2008 at 10:18 AM, Keir Fraser <keir.fraser@eu.citrix.com&= gt; wrote:
Intel SDM Volume 1 Section 8.6 ("X87 FPU Exception= Synchronization") is very helpful in this regard. It confirms my suspi= cions, that we will need to wrap the FPU inline asms in some fixup glue. The= only exceptions to this rule are the FN* (no-wait) instructions. Properly s= peaking we should also check for unmasked exceptions becoming pending after = any FPU instruction and set the faulting CS:IP in the FPU context block appr= opriately. But life is perhaps too short. :-)

 -- Keir


On 1/3/08 08:46, "Keir Fraser" <keir.fraser@eu.citrix.com> = wrote:

Regarding point 1: Don't FPU instructions that raise an= exception only log that in the status word, to be picked up by the next FPU= instruction which checks for exceptions? It strikes me that we can have pre= viously loaded up a status word that requires an exception to occur on FWAIT= , in which case semantics are broken. More worryingly, if any of the = instructions you have added can cause an exception, we will crash Xen becaus= e you have not added fixup handling. Unfortunately I'm not really up on exac= tly how FPU exception handling works: are you?




--B_3287391717_22301730-- --===============0706592721== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0706592721==--