From: Tom Rotenberg Subject: Re: Doamin crash when trying to install disk encryption (PointSec) on Windows HVM Date: Thu, 23 Apr 2009 19:10:21 +0300 Message-ID: <8686c3cd0904230910r1b9aca6ay512f6c6fc03a6a84@mail.gmail.com> References: <8686c3cd0904230708w7e0f41c3he3ed303573d52e38@mail.gmail.com> <8686c3cd0904230857o6fe60098vb4bc0d2280ff9595@mail.gmail.com> <20090423160152.GJ10010@york.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1914169560==" Return-path: In-Reply-To: <20090423160152.GJ10010@york.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tim Deegan Cc: "xen-devel@lists.xensource.com" , Keir Fraser List-Id: xen-devel@lists.xenproject.org --===============1914169560== Content-Type: multipart/alternative; boundary=0016e64eacb4f0675204683b1d56 --0016e64eacb4f0675204683b1d56 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit So, do u have any suggestion, on how can i fix this issue? 2009/4/23 Tim Deegan > At 16:57 +0100 on 23 Apr (1240505849), Tom Rotenberg wrote: > > Keir, > > > > After further testing, it seems like the flow of events were like this: > there was a VMEXIT with the reason of task switch, which changed to vm86mode > (!), and upon trying to resume from this vmexit, the cpu raised an > exception. > > > > And the question is why and how did the task switch caused the vm86 > > mode to be turned on? is it even legal? > > Yes, task-switching into vm86 mode is legal; ISTR it and IRET are the > only ways mentioned in the SDMs of getting into vm86. > > Looks like Xen doesn't support it, though. It would need special > handling of the segment state to get round the extra restrictions that > Intel imposed on VMENTER (which are stricter than the limits on using > vm86 mode unvirtualized). > > Cheers, > > Tim. > > > Tom > > > > 2009/4/23 Keir Fraser keir.fraser@eu.citrix.com>> > > All task switches are emulated, so you can add tracing to > hvm_task_switch() to check if a switch has occurred. An alternative is that > the guest did another LTR while not being emulated? > > > > If you want to remember the last VMEXIT, you?ll have to add code to store > state away somewhere to pick up on the next VMENTRY. > > > > -- Keir > > > > > > On 23/04/2009 15:08, "Tom Rotenberg" http://tom.rotenberg@gmail.com>> wrote: > > > > About the TR, i have re-checked it, and it seems like the TR value is > still 0x58, althoug the LTR operation put 0x50 into it. Since, i looked at > the LTR code you sent me, and it seems ok, i tend to suspect, that there was > some kind of (hardware) task switch, which changed the TR value without me > knowing, is it possible? because otherwise, i can't really explain why the > TR value is different than what was loaded from the LTR operation... > > > > BTW - how can i track what was the previous VMEXIT before this last > VMENTRY which caused the exception? i think, that probably the last VMEXIT > caused the "change" to vm86 mode, and this is waht causes the problem... > > > > Tom > > > > 2009/4/23 Keir Fraser eu.citrix.com>> > > On 23/04/2009 12:44, "Tom Rotenberg" http://tom.rotenberg@gmail.com>> wrote: > > > > > However, from the VMCS dump, i saw data, which doesn't seem compatible > with > > > this, as the LDTR sellector is indeed 0, but has attributes and limit > > > different from zero (although it should have been totaly disabled, by > the > > > LLDT, no?). > > > > The 'unused' flag in the attributes word is set (bit 16) so LDTR is okay. > > > > > And more important, the TR selector is 0x58, although from the LTR, it > was > > > supposed to be 0x50, no? > > > > If 0x50 was loaded then the selector should certainly be 0x50. > > > > -- Keir > > > > > (of-course it's possible that there were other instructions who changed > it > > > back, however, i am wondering if there is a problem here). > > > > > > > > -- > Tim Deegan > Principal Software Engineer, Citrix Systems (R&D) Ltd. > [Company #02300071, SL9 0DZ, UK.] > --0016e64eacb4f0675204683b1d56 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
So, do u have any suggestion, on how can i fix this issue?=

2009/4/23 Tim Deegan &= lt;Tim.Deegan@citrix.com>
At 16:57 +0100 on 23 Apr (1240505849), Tom Rotenberg wrote:
> Keir,
>
> After further testing, it seems like the flow of events were like this= : there was a VMEXIT with the reason of task switch, which changed to vm86m= ode (!), and upon trying to resume from this vmexit, the cpu raised an exce= ption.
>
> And the question is why and how did the task switch caused the vm86 > mode to be turned on? is it even legal?

Yes, task-switching into vm86 mode is legal; ISTR it and IRET are the=
only ways mentioned in the SDMs of getting into vm86.

Looks like Xen doesn't support it, though. =A0It would need special
handling of the segment state to get round the extra restrictions that
Intel imposed on VMENTER (which are stricter than the limits on using
vm86 mode unvirtualized).

Cheers,

Tim.

> Tom
>
> 2009/4/23 Keir Fraser <keir.fraser@eu.citrix.com<mailto:keir.fraser@eu.citrix.com>>
> All task switches are emulated, so you can add traci= ng to hvm_task_switch() to check if a switch has occurred. An alternative i= s that the guest did another LTR while not being emulated?
>
> If you want to remember the last VMEXIT, you?ll have to add code to st= ore state away somewhere to pick up on the next VMENTRY.
>
> =A0-- Keir
>
>
> On 23/04/2009 15:08, "Tom Rotenberg"= <tom.rotenberg@gmail.com= <http://tom.rotenberg= @gmail.com>> w= rote:
>
> About the TR, i have re-checked it, and it seems like the TR value is = still 0x58, althoug the LTR operation put 0x50 into it. Since, i looked at = the LTR code you sent me, and it seems ok, i tend to suspect, that there wa= s some kind of (hardware) task switch, which changed the TR value without m= e knowing, is it possible? because otherwise, i can't really explain wh= y the TR value is different than what was loaded from the LTR operation...<= br> >
> BTW - how can i track what was the previous VMEXIT before this last VM= ENTRY which caused the exception? i think, that probably the last VMEXIT ca= used the "change" to vm86 mode, and this is waht causes the probl= em...
>
> Tom
>
> 2009/4/23 Keir Fraser <keir.fraser@eu.citrix.com<http://keir.fraser@eu.citrix.com>>
> On 23/04/2009 12:44, "Tom Rotenberg" <<= a href=3D"mailto:tom.rotenberg@gmail.com">tom.rotenberg@gmail.com<http://tom.rotenberg@<= a href=3D"http://gmail.com" target=3D"_blank">gmail.com>> wrote:<= br> >
> > However, from the VMCS dump, i saw data, which doesn't seem c= ompatible with
> > this, as the LDTR sellector is indeed 0, but has attributes and l= imit
> > different from zero (although it should have been totaly disabled= , by the
> > LLDT, no?).
>
> The 'unused' flag in the attributes word is set (bit 16) so LD= TR is okay.
>
> > And more important, the TR selector is 0x58, although from the LT= R, it was
> > supposed to be 0x50, no?
>
> If 0x50 was loaded then the selector should certainly be 0x50.
>
> =A0-- Keir
>
> > (of-course it's possible that there were other instructions w= ho changed it
> > back, however, i am wondering if there is a problem here).
>
>
>

--
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]
--0016e64eacb4f0675204683b1d56-- --===============1914169560== 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 --===============1914169560==--