From: Tom Rotenberg Subject: Re: Doamin crash when trying to install disk encryption (PointSec) on Windows HVM Date: Thu, 23 Apr 2009 14:44:04 +0300 Message-ID: <8686c3cd0904230444tf05a311p813f8a426fa9ac1e@mail.gmail.com> References: <8686c3cd0904230256x792782bu744776fdd3d9903e@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0217230462==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Tim Deegan , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============0217230462== Content-Type: multipart/alternative; boundary=0016e6470ab0a49cb00468376512 --0016e6470ab0a49cb00468376512 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit OK. BTW - i am starting to digg this up, and i saw, that the LLDT instruction was done with value of 0, meaning (according to Intel spec), to mark the LDTR as invalid. After that the LTR instruction was done with value (AX) of 0x50. 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?). And more important, the TR selector is 0x58, although from the LTR, it was supposed to be 0x50, no? (of-course it's possible that there were other instructions who changed it back, however, i am wondering if there is a problem here). Tom 2009/4/23 Keir Fraser > I don't think we have anything obvious for dealing with single stepping of > real mode and 16-bit protected mode. Not to mention that sometimes these > bugs occur after execution of many thousands of instructions, which makes a > single step approach impractical. > > -- Keir > > On 23/04/2009 10:56, "Tom Rotenberg" wrote: > > > Keir, > > > > Is there any tool, which allows debugging step by step of the boot > sequence > > (starting from the point which the hvmloader transfers control to the > MBR)? > > If there is such tool, i will be able to debug it step by step, and > compare it > > to a real machine, and thus, hopefully find the bug. > > > > Tom > > > > 2009/4/22 Keir Fraser > >> On 22/04/2009 15:40, "Tom Rotenberg" wrote: > >> > >>> So, do u have any suggestion for me, on how to advance with this issue? > >>> should > >>> i debug the real mode emulation myself in order to track it down? will > u be > >>> able top assist me in any way with this issue? > >> > >> If specific questions arise then certainly yes. > >> > >>> BTW - what is exactly the problem which causes this exception from the > CPU? > >>> Tim mentioned something about segment state - can u please elaborate on > this > >>> issue? > >> > >> Bit 17 in EFLAGS is set, meaning the guest is in vm86 mode. In this > mode, on > >> vmentry, the processor applies specific checks to guest segment register > >> state. These are listed in SDM Vol 3B, but they include checking that > >> segment selector equals segment base address shifted right four bit > >> positions, for example. Clearly the segment state in the dump you > emailed is > >> not valid for vm86 mode. Quite possibly PointSec doesn't expect to be in > >> vm86 mode at all, and something may have gone wrong to set that bit in > >> EFLAGS. But it's hard to say at arm's length. > >> > >> -- Keir > >> > >>> Tom > >>> > >>> 2009/4/22 Keir Fraser > >>>> Then it probably is a mis-emulation somewhere down the line. > Unfortunately > >>>> that could be hard to track down, even if we had PointSec software to > hand, > >>>> which we do not. > >>>> > >>>> -- Keir > >>>> > >>>> On 22/04/2009 15:20, "Tom Rotenberg" wrote: > >>>> > >>>>> Well, just tried this patch, and it doesn't seem to work. > >>>>> I get the following error: > >>>>> > >>>>> (XEN) HVM1: Booting from 0000:7c00 > >>>>> (XEN) Failed vm entry (exit reason 0x80000021) caused by invalid > guest > >>>>> state > >>>>> (0). > >>>>> (XEN) ************* VMCS Area ************** > >>>>> (XEN) *** Guest State *** > >>>>> (XEN) CR0: actual=0x0000000080010039, shadow=0x0000000080000019, > >>>>> gh_mask=ffffffffffffffff > >>>>> (XEN) CR4: actual=0x0000000000002060, shadow=0x0000000000000000, > >>>>> gh_mask=ffffffffffffffff > >>>>> (XEN) CR3: actual=0x000000000a22fa20, target_count=0 > >>>>> (XEN) target0=0000000000000000, target1=0000000000000000 > >>>>> (XEN) target2=0000000000000000, target3=0000000000000000 > >>>>> (XEN) RSP = 0x0000000000000080 (0x0000000000000080) RIP = > >>>>> 0x000000000000002a > >>>>> (0x000000000000002a) > >>>>> (XEN) RFLAGS=0x0000000000023202 (0x0000000000023202) DR7 = > >>>>> 0x0000000000000400 > >>>>> (XEN) Sysenter RSP=0000000000000000 CS:RIP=0000:0000000000000000 > >>>>> (XEN) CS: sel=0x0060, attr=0x0c09b, limit=0xffffffff, > >>>>> base=0x0000000000200000 > >>>>> (XEN) DS: sel=0x0068, attr=0x0c093, limit=0xffffffff, > >>>>> base=0x0000000000200000 > >>>>> (XEN) SS: sel=0x0070, attr=0x0c093, limit=0xfc000fff, > >>>>> base=0x000000000020ba62 > >>>>> (XEN) ES: sel=0x0068, attr=0x0c093, limit=0xffffffff, > >>>>> base=0x0000000000200000 > >>>>> (XEN) FS: sel=0x0068, attr=0x0c093, limit=0xffffffff, > >>>>> base=0x0000000000200000 > >>>>> (XEN) GS: sel=0x0068, attr=0x0c093, limit=0xffffffff, > >>>>> base=0x0000000000200000 > >>>>> (XEN) GDTR: limit=0x00001dd8, > >>>>> base=0x0000000000200000 > >>>>> (XEN) LDTR: sel=0x0000, attr=0x1c000, limit=0xffffffff, > >>>>> base=0x0000000000000000 > >>>>> (XEN) IDTR: limit=0x00000188, > >>>>> base=0x0000000000201df0 > >>>>> (XEN) TR: sel=0x0058, attr=0x0008b, limit=0x0000ffff, > >>>>> base=0x0000000000201ff2 > >>>>> (XEN) Guest PAT = 0x0000000000000000 > >>>>> (XEN) TSC Offset = ffffffe2242f086e > >>>>> (XEN) DebugCtl=0000000000000000 DebugExceptions=0000000000000000 > >>>>> (XEN) Interruptibility=0001 ActivityState=0000 > >>>>> (XEN) *** Host State *** > >>>>> (XEN) RSP = 0xffff83007e4f7fa0 RIP = 0xffff828c8019aa20 > >>>>> (XEN) CS=e008 DS=0000 ES=0000 FS=0000 GS=0000 SS=0000 TR=e040 > >>>>> (XEN) FSBase=0000000000000000 GSBase=0000000000000000 > >>>>> TRBase=ffff828c802a8b00 > >>>>> (XEN) GDTBase=ffff83007e9a3000 IDTBase=ffff83007e62e010 > >>>>> (XEN) CR0=0000000080050033 CR3=000000007cfd8000 CR4=00000000000026f0 > >>>>> (XEN) Sysenter RSP=ffff83007e4f7fd0 CS:RIP=e008:ffff828c801c7290 > >>>>> (XEN) Host PAT = 0x0000000000000000 > >>>>> (XEN) *** Control State *** > >>>>> (XEN) PinBased=0000003f CPUBased=b6a1e7fe SecondaryExec=00000041 > >>>>> (XEN) EntryControls=000011ff ExitControls=0003efff > >>>>> (XEN) ExceptionBitmap=00044080 > >>>>> (XEN) VMEntry: intr_info=80000b0b errcode=00001eac ilen=00000000 > >>>>> (XEN) VMExit: intr_info=00000000 errcode=00008000 ilen=00000000 > >>>>> (XEN) reason=80000021 qualification=00000000 > >>>>> (XEN) IDTVectoring: info=00000000 errcode=00000000 > >>>>> (XEN) TPR Threshold = 0x00 > >>>>> (XEN) EPT pointer = 0x0000000000000000 > >>>>> (XEN) Virtual processor ID = 0x0000 > >>>>> (XEN) ************************************** > >>>>> (XEN) domain_crash called from vmx.c:2218 > >>>>> (XEN) Domain 1 (vcpu#0) crashed on cpu#1: > >>>>> (XEN) ----[ Xen-3.4.0-rc3-pre x86_64 debug=n Not tainted ]---- > >>>>> (XEN) CPU: 1 > >>>>> (XEN) RIP: 0060:[<000000000000002a>] > >>>>> (XEN) RFLAGS: 0000000000023202 CONTEXT: hvm guest > >>>>> (XEN) rax: 0000000000000007 rbx: 0000000000001490 rcx: > >>>>> 0000000000000000 > >>>>> (XEN) rdx: 0000000000001da8 rsi: 0000000000000000 rdi: > >>>>> 0000000000000000 > >>>>> (XEN) rbp: 0000000000008ebf rsp: 0000000000000080 r8: > >>>>> 0000000000000000 > >>>>> (XEN) r9: 0000000000000000 r10: 0000000000000000 r11: > >>>>> 0000000000000000 > >>>>> (XEN) r12: 0000000000000000 r13: 0000000000000000 r14: > >>>>> 0000000000000000 > >>>>> (XEN) r15: 0000000000000000 cr0: 0000000080000019 cr4: > >>>>> 0000000000000000 > >>>>> (XEN) cr3: 0000000001443000 cr2: 0000000000000000 > >>>>> (XEN) ds: 0068 es: 0068 fs: 0068 gs: 0068 ss: 0070 cs: 0060 > >>>>> > >>>>> > >>>>> Any ideas? > >>>>> > >>>>> Tom > >>>>> > >>>>> > >>>>> 2009/4/22 Keir Fraser > >>>>>> That should do it. > >>>>>> > >>>>>> K. > >>>>>> > >>>>>> > >>>>>> On 22/04/2009 15:04, "Tom Rotenberg" > wrote: > >>>>>> > >>>>>>> Keir, > >>>>>>> Just to make sure, i am using the following patch, in order to > disable > >>>>>>> the > >>>>>>> vm86 acceleration: > >>>>>>> > >>>>>>> diff -r cdc044f665dc xen/arch/x86/hvm/vmx/vmx.c > >>>>>>> --- a/xen/arch/x86/hvm/vmx/vmx.c Wed Apr 22 11:26:37 2009 +0100 > >>>>>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c Wed Apr 22 17:03:20 2009 +0300 > >>>>>>> @@ -829,7 +829,7 @@ > >>>>>>> > >>>>>>> if ( seg == x86_seg_tr ) > >>>>>>> { > >>>>>>> - if ( > v->domain->arch.hvm_domain.params[HVM_PARAM_VM86_TSS] > >>>>>>> ) > >>>>>>> + if (0) > >>>>>>> { > >>>>>>> sel = 0; > >>>>>>> attr = vm86_tr_attr; > >>>>>>> > >>>>>>> Is this OK? > >>>>>>> > >>>>>>> Tom > >>>>>>> > >>>>>>> 2009/4/22 Keir Fraser > >>>>>>>> Yes, the safest way to be sure is probably to replace the if() > >>>>>>>> statement > >>>>>>>> in > >>>>>>>> vmx_set_segment_register() that tests HVM_PARAM_VM86_TSS with > if(0). > >>>>>>>> That > >>>>>>>> is > >>>>>>>> the only place in Xen that checks HVM_PARAM_VM86_TSS. Then you can > >>>>>>>> re-build/install Xen and be sure that vm86 accel must be disabled. > >>>>>>>> > >>>>>>>> -- Keir > >>>>>>>> > >>>>>>>> On 22/04/2009 14:52, "Tom Rotenberg" > wrote: > >>>>>>>> > >>>>>>>>> So, do u suggest, that i will set HVM_PARAM_VM86_TSS to 0, and > >>>>>>>>> re-check > >>>>>>>>> it? > >>>>>>>>> > >>>>>>>>> 2009/4/22 Tim Deegan > >>>>>>>>>> At 14:34 +0100 on 22 Apr (1240410866), Keir Fraser wrote: > >>>>>>>>>>> It could be an issue with the vm86 acceleration, possibly. I'm > >>>>>>>>>>> pretty > >>>>>>>>>>> sure > >>>>>>>>>>> the guest would have to IRET from protected mode to enter vm86 > mode > >>>>>>>>>>> itself, > >>>>>>>>>>> and we don't emulate that. Tim: what would we need to do to > disable > >>>>>>>>>>> the > >>>>>>>>>>> vm86 > >>>>>>>>>>> acceleration for testing purposes? You suggested not setting > >>>>>>>>>>> VM86_TSS > >>>>>>>>>>> param > >>>>>>>>>>> from hvmloader, but I couldn't convince myself what effect that > >>>>>>>>>>> would > >>>>>>>>>>> actually have as the logic in Xen is non-trivial. > >>>>>>>>>> > >>>>>>>>>> Yes; if HVM_PARAM_VM86_TSS is zero, vmx_set_segment_register() > will > >>>>>>>>>> always set the tss bit in the bitmap of segments that aren't > safe to > >>>>>>>>>> enter VM86 with. > >>>>>>>>>> > >>>>>>>>>> Tim. > >>>>>>>>>> > >>>>>>>>>>> > >>>>>>>>>>> -- Keir > >>>>>>>>>>> > >>>>>>>>>>> On 22/04/2009 14:23, "Tom Rotenberg" > >>>>>>>>>>> wrote: > >>>>>>>>>>> > >>>>>>>>>>>> Tim, > >>>>>>>>>>>> > >>>>>>>>>>>> so what does it mean? could it be that we have a bug in the > real > >>>>>>>>>>>> mode > >>>>>>>>>>>> emulation, which causes the segment state to be invalid (maybe > it's > >>>>>>>>>>>> because > >>>>>>>>>>>> of > >>>>>>>>>>>> a bug in the patch that Keir made for me, which emulated the > LLDT, > >>>>>>>>>>>> and > >>>>>>>>>>>> the > >>>>>>>>>>>> LTR > >>>>>>>>>>>> instructions)? > >>>>>>>>>>>> > >>>>>>>>>>>> Keir suggested to trace back where the problem (segment state) > >>>>>>>>>>>> occured, > >>>>>>>>>>>> and > >>>>>>>>>>>> from there to try and find the bug which caused it. Do u have > any > >>>>>>>>>>>> better > >>>>>>>>>>>> suggestion for solving this? > >>>>>>>>>>>> > >>>>>>>>>>>> Tom > >>>>>>>>>>>> > >>>>>>>>>>>> 2009/4/22 Tim Deegan > >>>>>>>>>>>>> At 13:39 +0100 on 22 Apr (1240407546), Tom Rotenberg wrote: > >>>>>>>>>>>>> Keir, > >>>>>>>>>>>>> > >>>>>>>>>>>>> I have tried your latest patch, and it looks like now it > passes > >>>>>>>>>>>>> the > >>>>>>>>>>>>> emulation problem. However, now the domain crashes with the > >>>>>>>>>>>>> following > >>>>>>>>>>>>> error: > >>>>>>>>>>>>> > >>>>>>>>>>>>> (XEN) HVM1: Booting from 0000:7c00 > >>>>>>>>>>>>> (XEN) Failed vm entry (exit reason 0x80000021) caused by > invalid > >>>>>>>>>>>>> guest > >>>>>>>>>>>>> state > >>>>>>>>>>>>> (0). > >>>>>>>>>>>>> (XEN) ************* VMCS Area ************** > >>>>>>>>>>>>> (XEN) *** Guest State *** > >>>>>>>>>>>>> (XEN) CR0: actual=0x0000000080010039, > shadow=0x0000000080000019, > >>>>>>>>>>>>> gh_mask=ffffffffffffffff > >>>>>>>>>>>>> (XEN) CR4: actual=0x0000000000002060, > shadow=0x0000000000000000, > >>>>>>>>>>>>> gh_mask=ffffffffffffffff > >>>>>>>>>>>>> (XEN) CR3: actual=0x000000000a213a20, target_count=0 > >>>>>>>>>>>>> (XEN) target0=0000000000000000, target1=0000000000000000 > >>>>>>>>>>>>> (XEN) target2=0000000000000000, target3=0000000000000000 > >>>>>>>>>>>>> (XEN) RSP = 0x0000000000000080 (0x0000000000000080) RIP = > >>>>>>>>>>>>> 0x000000000000002a (0x000000000000002a) > >>>>>>>>>>>>> (XEN) RFLAGS=0x0000000000023202 (0x0000000000023202) DR7 = > >>>>>>>>>>>>> 0x0000000000000400 > >>>>>>>>>>>>> > >>>>>>>>>>>>> Looks like we're trying to VMENTER in virtual 8086 mode but > >>>>>>>>>>>>> without > >>>>>>>>>>>>> tidying up the segment state. That could either be the guest > >>>>>>>>>>>>> entering > >>>>>>>>>>>>> virtual 8086 mode itself or Xen entering vitrual 8086 mode to > >>>>>>>>>>>>> emulate > >>>>>>>>>>>>> real mode, but Xen is always careful to make the segment > state > >>>>>>>>>>>>> agree > >>>>>>>>>>>>> with Intel's rather strict requrements when it does that. > >>>>>>>>>>>>> > >>>>>>>>>>>>> Tim. > >>>>>>>>>>>>> > >>>>>>>>>>>>> > >>>>>>>>>>>>> (XEN) Sysenter RSP=0000000000000000 > CS:RIP=0000:0000000000000000 > >>>>>>>>>>>>> (XEN) CS: sel=0x0060, attr=0x0c09b, limit=0xffffffff, > >>>>>>>>>>>>> base=0x0000000000200000 > >>>>>>>>>>>>> (XEN) DS: sel=0x0068, attr=0x0c093, limit=0xffffffff, > >>>>>>>>>>>>> base=0x0000000000200000 > >>>>>>>>>>>>> (XEN) SS: sel=0x0070, attr=0x0c093, limit=0xfc000fff, > >>>>>>>>>>>>> base=0x000000000020ba62 > >>>>>>>>>>>>> (XEN) ES: sel=0x0068, attr=0x0c093, limit=0xffffffff, > >>>>>>>>>>>>> base=0x0000000000200000 > >>>>>>>>>>>>> (XEN) FS: sel=0x0068, attr=0x0c093, limit=0xffffffff, > >>>>>>>>>>>>> base=0x0000000000200000 > >>>>>>>>>>>>> (XEN) GS: sel=0x0068, attr=0x0c093, limit=0xffffffff, > >>>>>>>>>>>>> base=0x0000000000200000 > >>>>>>>>>>>>> (XEN) GDTR: limit=0x00001dd8, > >>>>>>>>>>>>> base=0x0000000000200000 > >>>>>>>>>>>>> (XEN) LDTR: sel=0x0000, attr=0x1c000, limit=0xffffffff, > >>>>>>>>>>>>> base=0x0000000000000000 > >>>>>>>>>>>>> (XEN) IDTR: limit=0x00000188, > >>>>>>>>>>>>> base=0x0000000000201df0 > >>>>>>>>>>>>> (XEN) TR: sel=0x0058, attr=0x0008b, limit=0x0000ffff, > >>>>>>>>>>>>> base=0x0000000000201ff2 > >>>>>>>>>>>>> (XEN) Guest PAT = 0x0000000000000000 > >>>>>>>>>>>>> (XEN) TSC Offset = ffffffe4920110b7 > >>>>>>>>>>>>> (XEN) DebugCtl=0000000000000000 > DebugExceptions=0000000000000000 > >>>>>>>>>>>>> (XEN) Interruptibility=0001 ActivityState=0000 > >>>>>>>>>>>>> (XEN) *** Host State *** > >>>>>>>>>>>>> (XEN) RSP = 0xffff83007e4f7fa0 RIP = 0xffff828c8019aa20 > >>>>>>>>>>>>> (XEN) CS=e008 DS=0000 ES=0000 FS=0000 GS=0000 SS=0000 TR=e040 > >>>>>>>>>>>>> (XEN) FSBase=0000000000000000 GSBase=0000000000000000 > >>>>>>>>>>>>> TRBase=ffff828c802a8b00 > >>>>>>>>>>>>> (XEN) GDTBase=ffff83007e9a3000 IDTBase=ffff83007e62e010 > >>>>>>>>>>>>> (XEN) CR0=0000000080050033 CR3=000000007cfdc000 > >>>>>>>>>>>>> CR4=00000000000026f0 > >>>>>>>>>>>>> (XEN) Sysenter RSP=ffff83007e4f7fd0 > CS:RIP=e008:ffff828c801c7290 > >>>>>>>>>>>>> (XEN) Host PAT = 0x0000000000000000 > >>>>>>>>>>>>> (XEN) *** Control State *** > >>>>>>>>>>>>> (XEN) PinBased=0000003f CPUBased=b6a1e7fe > SecondaryExec=00000041 > >>>>>>>>>>>>> (XEN) EntryControls=000011ff ExitControls=0003efff > >>>>>>>>>>>>> (XEN) ExceptionBitmap=00044080 > >>>>>>>>>>>>> (XEN) VMEntry: intr_info=80000b0b errcode=00001eac > ilen=00000000 > >>>>>>>>>>>>> (XEN) VMExit: intr_info=00000000 errcode=00008000 > ilen=00000000 > >>>>>>>>>>>>> (XEN) reason=80000021 qualification=00000000 > >>>>>>>>>>>>> (XEN) IDTVectoring: info=00000000 errcode=00000000 > >>>>>>>>>>>>> (XEN) TPR Threshold = 0x00 > >>>>>>>>>>>>> (XEN) EPT pointer = 0x0000000000000000 > >>>>>>>>>>>>> (XEN) Virtual processor ID = 0x0000 > >>>>>>>>>>>>> (XEN) ************************************** > >>>>>>>>>>>>> (XEN) domain_crash called from vmx.c:2218 > >>>>>>>>>>>>> (XEN) Domain 1 (vcpu#0) crashed on cpu#1: > >>>>>>>>>>>>> (XEN) ----[ Xen-3.4.0-rc3-pre x86_64 debug=n Not tainted > ]---- > >>>>>>>>>>>>> (XEN) CPU: 1 > >>>>>>>>>>>>> (XEN) RIP: 0060:[<000000000000002a>] > >>>>>>>>>>>>> (XEN) RFLAGS: 0000000000023202 CONTEXT: hvm guest > >>>>>>>>>>>>> (XEN) rax: 0000000000000007 rbx: 0000000000001490 rcx: > >>>>>>>>>>>>> 0000000000000000 > >>>>>>>>>>>>> (XEN) rdx: 0000000000001da8 rsi: 0000000000000000 rdi: > >>>>>>>>>>>>> 0000000000000000 > >>>>>>>>>>>>> (XEN) rbp: 0000000000008ebf rsp: 0000000000000080 r8: > >>>>>>>>>>>>> 0000000000000000 > >>>>>>>>>>>>> (XEN) r9: 0000000000000000 r10: 0000000000000000 r11: > >>>>>>>>>>>>> 0000000000000000 > >>>>>>>>>>>>> (XEN) r12: 0000000000000000 r13: 0000000000000000 r14: > >>>>>>>>>>>>> 0000000000000000 > >>>>>>>>>>>>> (XEN) r15: 0000000000000000 cr0: 0000000080000019 cr4: > >>>>>>>>>>>>> 0000000000000000 > >>>>>>>>>>>>> (XEN) cr3: 0000000001443000 cr2: 0000000000000000 > >>>>>>>>>>>>> (XEN) ds: 0068 es: 0068 fs: 0068 gs: 0068 ss: 0070 > cs: > >>>>>>>>>>>>> 0060 > >>>>>>>>>>>>> > >>>>>>>>>>>>> Could it be, that the real mode emulation code has a bug? > What > >>>>>>>>>>>>> does > >>>>>>>>>>>>> this > >>>>>>>>>>>>> error means? > >>>>>>>>>>>>> > >>>>>>>>>>>>> Tom > >>>>>>>>>>>>> > >>>>>>>>>>>>> 2009/4/22 Keir Fraser > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> On 22/04/2009 12:18, "Tom Rotenberg" > >>>>>>>>>>>>> > > wrote: > >>>>>>>>>>>>> > >>>>>>>>>>>>> Keir, > >>>>>>>>>>>>> > >>>>>>>>>>>>> I have applied your patch, and it seemed to work. However, > the > >>>>>>>>>>>>> domain > >>>>>>>>>>>>> still > >>>>>>>>>>>>> crashes, and now it looks like it's because of the 'LTR' > >>>>>>>>>>>>> instruction. > >>>>>>>>>>>>> > >>>>>>>>>>>>> Try the attached patch. It replaces the one I sent last time, > and > >>>>>>>>>>>>> emulates > >>>>>>>>>>>>> both LLDT and LTR. > >>>>>>>>>>>>> > >>>>>>>>>>>>> -- Keir > >>>>>>>>>>>>> > >>>>>>>>>>>>> > >>>>>>>>>>>>> Content-Description: ATT00001.txt > >>>>>>>>>>>>> _______________________________________________ > >>>>>>>>>>>>> Xen-devel mailing list > >>>>>>>>>>>>> Xen-devel@lists.xensource.com > >>>>>>>>>>>>> http://lists.xensource.com/xen-devel > >>>>>>>>>>>>> > >>>>>>>>>>>>> > >>>>>>>>>>>>> -- > >>>>>>>>>>>>> Tim Deegan > >>>>>>>>>>>>> Principal Software Engineer, Citrix Systems (R&D) Ltd. > >>>>>>>>>>>>> [Company #02300071, SL9 0DZ, UK.] > >>>>>>>>>>>> > >>>>>>>>>>> > >>>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> -- > >>>>>>>>>> Tim Deegan > >>>>>>>>>> Principal Software Engineer, Citrix Systems (R&D) Ltd. > >>>>>>>>>> [Company #02300071, SL9 0DZ, UK.] > >>>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> > >>>>>> > >>>>>> > >>>>> > >>>> > >>>> > >>> > >> > >> > > > > > --0016e6470ab0a49cb00468376512 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
OK.

BTW - i am starting to digg this up, and i saw,= that the LLDT instruction was done with value of 0, meaning (according to = Intel spec), to mark the LDTR as invalid.
After that the LTR instruction= was done with value (AX) of 0x50.

However, from the VMCS dump, i saw data, which doesn't seem compati= ble with this, as the LDTR sellector is indeed 0, but has attributes and li= mit different from zero (although it should have been totaly disabled, by t= he LLDT, no?).

And more important, the TR selector is 0x58, although from the LTR, it = was supposed to be 0x50, no?
(of-course it's possible that there we= re other instructions who changed it back, however, i am wondering if there= is a problem here).

Tom

2009/4/23 Keir Fraser <keir.fraser@eu.ci= trix.com>
I don't think we have anything obvious for dealing with single stepping= of
real mode and 16-bit protected mode. Not to mention that sometimes these bugs occur after execution of many thousands of instructions, which makes a=
single step approach impractical.

=A0-- Keir

On 23/04/2009 10:56, "Tom Rotenberg" <tom.rotenberg@gmail.com> wrote:

> Keir,
>
> Is there any tool, which allows debugging step by step of the boot seq= uence
> (starting from the point which the hvmloader transfers control to the = MBR)?
> If there is such tool, i will be able to debug it step by step, and co= mpare it
> to a real machine, and thus, hopefully find the bug.
>
> Tom
>
> 2009/4/22 Keir Fraser <keir.fraser@eu.citrix.com>
>> On 22/04/2009 15:40, "Tom Rotenberg" <tom.rotenberg@gmail.com> wrote:
>>
>>> So, do u have any suggestion for me, on how to advance with th= is issue?
>>> should
>>> i debug the real mode emulation myself in order to track it do= wn? will u be
>>> able top assist me in any way with this issue?
>>
>> If specific questions arise then certainly yes.
>>
>>> BTW - what is exactly the problem which causes this exception = from the CPU?
>>> Tim mentioned something about segment state - can u please ela= borate on this
>>> issue?
>>
>> Bit 17 in EFLAGS is set, meaning the guest is in vm86 mode. In thi= s mode, on
>> vmentry, the processor applies specific checks to guest segment re= gister
>> state. These are listed in SDM Vol 3B, but they include checking t= hat
>> segment selector equals segment base address shifted right four bi= t
>> positions, for example. Clearly the segment state in the dump you = emailed is
>> not valid for vm86 mode. Quite possibly PointSec doesn't expec= t to be in
>> vm86 mode at all, and something may have gone wrong to set that bi= t in
>> EFLAGS. But it's hard to say at arm's length.
>>
>> =A0-- Keir
>>
>>> Tom
>>>
>>> 2009/4/22 Keir Fraser <keir.fraser@eu.citrix.com>
>>>> Then it probably is a mis-emulation somewhere down the lin= e. Unfortunately
>>>> that could be hard to track down, even if we had PointSec = software to hand,
>>>> which we do not.
>>>>
>>>> =A0-- Keir
>>>>
>>>> On 22/04/2009 15:20, "Tom Rotenberg" <tom.rotenberg@gmail.com> wrote:<= br> >>>>
>>>>> Well, just tried this patch, and it doesn't seem t= o work.
>>>>> I get the following error:
>>>>>
>>>>> (XEN) HVM1: Booting from 0000:7c00
>>>>> (XEN) Failed vm entry (exit reason 0x80000021) caused = by invalid guest
>>>>> state
>>>>> (0).
>>>>> (XEN) ************* VMCS Area **************
>>>>> (XEN) *** Guest State ***
>>>>> (XEN) CR0: actual=3D0x0000000080010039, shadow=3D0x000= 0000080000019,
>>>>> gh_mask=3Dffffffffffffffff
>>>>> (XEN) CR4: actual=3D0x0000000000002060, shadow=3D0x000= 0000000000000,
>>>>> gh_mask=3Dffffffffffffffff
>>>>> (XEN) CR3: actual=3D0x000000000a22fa20, target_count= =3D0
>>>>> (XEN)=A0=A0=A0=A0=A0 target0=3D0000000000000000, targe= t1=3D0000000000000000
>>>>> (XEN)=A0=A0=A0=A0=A0 target2=3D0000000000000000, targe= t3=3D0000000000000000
>>>>> (XEN) RSP =3D 0x0000000000000080 (0x0000000000000080)= =A0 RIP =3D
>>>>> 0x000000000000002a
>>>>> (0x000000000000002a)
>>>>> (XEN) RFLAGS=3D0x0000000000023202 (0x0000000000023202)= =A0 DR7 =3D
>>>>> 0x0000000000000400
>>>>> (XEN) Sysenter RSP=3D0000000000000000 CS:RIP=3D0000:00= 00000000000000
>>>>> (XEN) CS: sel=3D0x0060, attr=3D0x0c09b, limit=3D0xffff= ffff,
>>>>> base=3D0x0000000000200000
>>>>> (XEN) DS: sel=3D0x0068, attr=3D0x0c093, limit=3D0xffff= ffff,
>>>>> base=3D0x0000000000200000
>>>>> (XEN) SS: sel=3D0x0070, attr=3D0x0c093, limit=3D0xfc00= 0fff,
>>>>> base=3D0x000000000020ba62
>>>>> (XEN) ES: sel=3D0x0068, attr=3D0x0c093, limit=3D0xffff= ffff,
>>>>> base=3D0x0000000000200000
>>>>> (XEN) FS: sel=3D0x0068, attr=3D0x0c093, limit=3D0xffff= ffff,
>>>>> base=3D0x0000000000200000
>>>>> (XEN) GS: sel=3D0x0068, attr=3D0x0c093, limit=3D0xffff= ffff,
>>>>> base=3D0x0000000000200000
>>>>> (XEN) GDTR:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 limit=3D0x00001dd8,
>>>>> base=3D0x0000000000200000
>>>>> (XEN) LDTR: sel=3D0x0000, attr=3D0x1c000, limit=3D0xff= ffffff,
>>>>> base=3D0x0000000000000000
>>>>> (XEN) IDTR:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 limit=3D0x00000188,
>>>>> base=3D0x0000000000201df0
>>>>> (XEN) TR: sel=3D0x0058, attr=3D0x0008b, limit=3D0x0000= ffff,
>>>>> base=3D0x0000000000201ff2
>>>>> (XEN) Guest PAT =3D 0x0000000000000000
>>>>> (XEN) TSC Offset =3D ffffffe2242f086e
>>>>> (XEN) DebugCtl=3D0000000000000000 DebugExceptions=3D00= 00000000000000
>>>>> (XEN) Interruptibility=3D0001 ActivityState=3D0000
>>>>> (XEN) *** Host State ***
>>>>> (XEN) RSP =3D 0xffff83007e4f7fa0=A0 RIP =3D 0xffff828c= 8019aa20
>>>>> (XEN) CS=3De008 DS=3D0000 ES=3D0000 FS=3D0000 GS=3D000= 0 SS=3D0000 TR=3De040
>>>>> (XEN) FSBase=3D0000000000000000 GSBase=3D0000000000000= 000
>>>>> TRBase=3Dffff828c802a8b00
>>>>> (XEN) GDTBase=3Dffff83007e9a3000 IDTBase=3Dffff83007e6= 2e010
>>>>> (XEN) CR0=3D0000000080050033 CR3=3D000000007cfd8000 CR= 4=3D00000000000026f0
>>>>> (XEN) Sysenter RSP=3Dffff83007e4f7fd0 CS:RIP=3De008:ff= ff828c801c7290
>>>>> (XEN) Host PAT =3D 0x0000000000000000
>>>>> (XEN) *** Control State ***
>>>>> (XEN) PinBased=3D0000003f CPUBased=3Db6a1e7fe Secondar= yExec=3D00000041
>>>>> (XEN) EntryControls=3D000011ff ExitControls=3D0003efff=
>>>>> (XEN) ExceptionBitmap=3D00044080
>>>>> (XEN) VMEntry: intr_info=3D80000b0b errcode=3D00001eac= ilen=3D00000000
>>>>> (XEN) VMExit: intr_info=3D00000000 errcode=3D00008000 = ilen=3D00000000
>>>>> (XEN)=A0=A0=A0=A0=A0=A0=A0=A0 reason=3D80000021 qualif= ication=3D00000000
>>>>> (XEN) IDTVectoring: info=3D00000000 errcode=3D00000000=
>>>>> (XEN) TPR Threshold =3D 0x00
>>>>> (XEN) EPT pointer =3D 0x0000000000000000
>>>>> (XEN) Virtual processor ID =3D 0x0000
>>>>> (XEN) **************************************
>>>>> (XEN) domain_crash called from vmx.c:2218
>>>>> (XEN) Domain 1 (vcpu#0) crashed on cpu#1:
>>>>> (XEN) ----[ Xen-3.4.0-rc3-pre=A0 x86_64=A0 debug=3Dn= =A0 Not tainted ]----
>>>>> (XEN) CPU:=A0=A0=A0 1
>>>>> (XEN) RIP:=A0=A0=A0 0060:[<000000000000002a>] >>>>> (XEN) RFLAGS: 0000000000023202=A0=A0 CONTEXT: hvm gues= t
>>>>> (XEN) rax: 0000000000000007=A0=A0 rbx: 000000000000149= 0=A0=A0 rcx:
>>>>> 0000000000000000
>>>>> (XEN) rdx: 0000000000001da8=A0=A0 rsi: 000000000000000= 0=A0=A0 rdi:
>>>>> 0000000000000000
>>>>> (XEN) rbp: 0000000000008ebf=A0=A0 rsp: 000000000000008= 0=A0=A0 r8:=A0
>>>>> 0000000000000000
>>>>> (XEN) r9:=A0 0000000000000000=A0=A0 r10: 0000000000000= 000=A0=A0 r11:
>>>>> 0000000000000000
>>>>> (XEN) r12: 0000000000000000=A0=A0 r13: 000000000000000= 0=A0=A0 r14:
>>>>> 0000000000000000
>>>>> (XEN) r15: 0000000000000000=A0=A0 cr0: 000000008000001= 9=A0=A0 cr4:
>>>>> 0000000000000000
>>>>> (XEN) cr3: 0000000001443000=A0=A0 cr2: 000000000000000= 0
>>>>> (XEN) ds: 0068=A0=A0 es: 0068=A0=A0 fs: 0068=A0=A0 gs:= 0068=A0=A0 ss: 0070=A0=A0 cs: 0060
>>>>>
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> Tom
>>>>>
>>>>>
>>>>> 2009/4/22 Keir Fraser <keir.fraser@eu.citrix.com>
>>>>>> That should do it.
>>>>>>
>>>>>> =A0K.
>>>>>>
>>>>>>
>>>>>> On 22/04/2009 15:04, "Tom Rotenberg" <= ;tom.rotenberg@gmail.com>= wrote:
>>>>>>
>>>>>>> Keir,
>>>>>>> Just to make sure, i am using the following pa= tch, in order to disable
>>>>>>> the
>>>>>>> vm86 acceleration:
>>>>>>>
>>>>>>> diff -r cdc044f665dc xen/arch/x86/hvm/vmx/vmx.= c
>>>>>>> --- a/xen/arch/x86/hvm/vmx/vmx.c=A0=A0=A0 Wed = Apr 22 11:26:37 2009 +0100
>>>>>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c=A0=A0=A0 Wed = Apr 22 17:03:20 2009 +0300
>>>>>>> @@ -829,7 +829,7 @@
>>>>>>> =A0=A0=A0=A0=A0=A0=A0=A0
>>>>>>> =A0=A0=A0=A0=A0=A0=A0=A0 if ( seg =3D=3D x86_s= eg_tr )
>>>>>>> =A0=A0=A0=A0=A0=A0=A0=A0 {
>>>>>>> -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if ( v->= domain->arch.hvm_domain.params[HVM_PARAM_VM86_TSS]
>>>>>>> )
>>>>>>> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (0)
>>>>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 {
>>>>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 sel =3D 0;
>>>>>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 attr =3D vm86_tr_attr;
>>>>>>>
>>>>>>> Is this OK?
>>>>>>>
>>>>>>> Tom
>>>>>>>
>>>>>>> 2009/4/22 Keir Fraser <keir.fraser@eu.citrix.com>
>>>>>>>> Yes, the safest way to be sure is probably= to replace the if()
>>>>>>>> statement
>>>>>>>> in
>>>>>>>> vmx_set_segment_register() that tests HVM_= PARAM_VM86_TSS with if(0).
>>>>>>>> That
>>>>>>>> is
>>>>>>>> the only place in Xen that checks HVM_PARA= M_VM86_TSS. Then you can
>>>>>>>> re-build/install Xen and be sure that vm86= accel must be disabled.
>>>>>>>>
>>>>>>>> =A0-- Keir
>>>>>>>>
>>>>>>>> On 22/04/2009 14:52, "Tom Rotenberg&q= uot; <tom.rotenberg@gmail.com= > wrote:
>>>>>>>>
>>>>>>>>> So, do u suggest, that i will set HVM_= PARAM_VM86_TSS to 0, and
>>>>>>>>> re-check
>>>>>>>>> it?
>>>>>>>>>
>>>>>>>>> 2009/4/22 Tim Deegan <Tim.Deegan@citrix.com>
>>>>>>>>>> At 14:34 +0100 on 22 Apr (12404108= 66), Keir Fraser wrote:
>>>>>>>>>>> It could be an issue with the = vm86 acceleration, possibly. I'm
>>>>>>>>>>> pretty
>>>>>>>>>>> sure
>>>>>>>>>>> the guest would have to IRET f= rom protected mode to enter vm86 mode
>>>>>>>>>>> itself,
>>>>>>>>>>> and we don't emulate that.= Tim: what would we need to do to disable
>>>>>>>>>>> the
>>>>>>>>>>> vm86
>>>>>>>>>>> acceleration for testing purpo= ses? You suggested not setting
>>>>>>>>>>> VM86_TSS
>>>>>>>>>>> param
>>>>>>>>>>> from hvmloader, but I couldn&#= 39;t convince myself what effect that
>>>>>>>>>>> would
>>>>>>>>>>> actually have as the logic in = Xen is non-trivial.
>>>>>>>>>>
>>>>>>>>>> Yes; if HVM_PARAM_VM86_TSS is zero= , vmx_set_segment_register() will
>>>>>>>>>> always set the tss bit in the bitm= ap of segments that aren't safe to
>>>>>>>>>> enter VM86 with.
>>>>>>>>>>
>>>>>>>>>> Tim.
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> =A0-- Keir
>>>>>>>>>>>
>>>>>>>>>>> On 22/04/2009 14:23, "Tom= Rotenberg" <tom.rotenbe= rg@gmail.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Tim,
>>>>>>>>>>>>
>>>>>>>>>>>> so what does it mean? coul= d it be that we have a bug in the real
>>>>>>>>>>>> mode
>>>>>>>>>>>> emulation, which causes th= e segment state to be invalid (maybe it's
>>>>>>>>>>>> because
>>>>>>>>>>>> of
>>>>>>>>>>>> a bug in the patch that Ke= ir made for me, which emulated the LLDT,
>>>>>>>>>>>> and
>>>>>>>>>>>> the
>>>>>>>>>>>> LTR
>>>>>>>>>>>> instructions)?
>>>>>>>>>>>>
>>>>>>>>>>>> Keir suggested to trace ba= ck where the problem (segment state)
>>>>>>>>>>>> occured,
>>>>>>>>>>>> and
>>>>>>>>>>>> from there to try and find= the bug which caused it. Do u have any
>>>>>>>>>>>> better
>>>>>>>>>>>> suggestion for solving thi= s?
>>>>>>>>>>>>
>>>>>>>>>>>> Tom
>>>>>>>>>>>>
>>>>>>>>>>>> 2009/4/22 Tim Deegan <<= a href=3D"mailto:Tim.Deegan@citrix.com">Tim.Deegan@citrix.com>
>>>>>>>>>>>>> At 13:39 +0100 on 22 A= pr (1240407546), Tom Rotenberg wrote:
>>>>>>>>>>>>> Keir,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I have tried your late= st patch, and it looks like now it passes
>>>>>>>>>>>>> the
>>>>>>>>>>>>> emulation problem. How= ever, =A0now the domain crashes with the
>>>>>>>>>>>>> following
>>>>>>>>>>>>> error:
>>>>>>>>>>>>>
>>>>>>>>>>>>> (XEN) HVM1: Booting fr= om 0000:7c00
>>>>>>>>>>>>> (XEN) Failed vm entry = (exit reason 0x80000021) caused by invalid
>>>>>>>>>>>>> guest
>>>>>>>>>>>>> state
>>>>>>>>>>>>> (0).
>>>>>>>>>>>>> (XEN) ************* VM= CS Area **************
>>>>>>>>>>>>> (XEN) *** Guest State = ***
>>>>>>>>>>>>> (XEN) CR0: actual=3D0x= 0000000080010039, shadow=3D0x0000000080000019,
>>>>>>>>>>>>> gh_mask=3Dffffffffffff= ffff
>>>>>>>>>>>>> (XEN) CR4: actual=3D0x= 0000000000002060, shadow=3D0x0000000000000000,
>>>>>>>>>>>>> gh_mask=3Dffffffffffff= ffff
>>>>>>>>>>>>> (XEN) CR3: actual=3D0x= 000000000a213a20, target_count=3D0
>>>>>>>>>>>>> (XEN) =A0 =A0 =A0targe= t0=3D0000000000000000, target1=3D0000000000000000
>>>>>>>>>>>>> (XEN) =A0 =A0 =A0targe= t2=3D0000000000000000, target3=3D0000000000000000
>>>>>>>>>>>>> (XEN) RSP =3D 0x000000= 0000000080 (0x0000000000000080) =A0RIP =3D
>>>>>>>>>>>>> 0x000000000000002a (0x= 000000000000002a)
>>>>>>>>>>>>> (XEN) RFLAGS=3D0x00000= 00000023202 (0x0000000000023202) =A0DR7 =3D
>>>>>>>>>>>>> 0x0000000000000400
>>>>>>>>>>>>>
>>>>>>>>>>>>> Looks like we're t= rying to VMENTER in virtual 8086 mode but
>>>>>>>>>>>>> without
>>>>>>>>>>>>> tidying up the segment= state. =A0That could either be the guest
>>>>>>>>>>>>> entering
>>>>>>>>>>>>> virtual 8086 mode itse= lf or Xen entering vitrual 8086 mode to
>>>>>>>>>>>>> emulate
>>>>>>>>>>>>> real mode, but Xen is = always careful to make the segment state
>>>>>>>>>>>>> agree
>>>>>>>>>>>>> with Intel's rathe= r strict requrements when it does that.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Tim.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> (XEN) Sysenter RSP=3D0= 000000000000000 CS:RIP=3D0000:0000000000000000
>>>>>>>>>>>>> (XEN) CS: sel=3D0x0060= , attr=3D0x0c09b, limit=3D0xffffffff,
>>>>>>>>>>>>> base=3D0x0000000000200= 000
>>>>>>>>>>>>> (XEN) DS: sel=3D0x0068= , attr=3D0x0c093, limit=3D0xffffffff,
>>>>>>>>>>>>> base=3D0x0000000000200= 000
>>>>>>>>>>>>> (XEN) SS: sel=3D0x0070= , attr=3D0x0c093, limit=3D0xfc000fff,
>>>>>>>>>>>>> base=3D0x000000000020b= a62
>>>>>>>>>>>>> (XEN) ES: sel=3D0x0068= , attr=3D0x0c093, limit=3D0xffffffff,
>>>>>>>>>>>>> base=3D0x0000000000200= 000
>>>>>>>>>>>>> (XEN) FS: sel=3D0x0068= , attr=3D0x0c093, limit=3D0xffffffff,
>>>>>>>>>>>>> base=3D0x0000000000200= 000
>>>>>>>>>>>>> (XEN) GS: sel=3D0x0068= , attr=3D0x0c093, limit=3D0xffffffff,
>>>>>>>>>>>>> base=3D0x0000000000200= 000
>>>>>>>>>>>>> (XEN) GDTR: =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 limit=3D0x00001dd8,
>>>>>>>>>>>>> base=3D0x0000000000200= 000
>>>>>>>>>>>>> (XEN) LDTR: sel=3D0x00= 00, attr=3D0x1c000, limit=3D0xffffffff,
>>>>>>>>>>>>> base=3D0x0000000000000= 000
>>>>>>>>>>>>> (XEN) IDTR: =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 limit=3D0x00000188,
>>>>>>>>>>>>> base=3D0x0000000000201= df0
>>>>>>>>>>>>> (XEN) TR: sel=3D0x0058= , attr=3D0x0008b, limit=3D0x0000ffff,
>>>>>>>>>>>>> base=3D0x0000000000201= ff2
>>>>>>>>>>>>> (XEN) Guest PAT =3D 0x= 0000000000000000
>>>>>>>>>>>>> (XEN) TSC Offset =3D f= fffffe4920110b7
>>>>>>>>>>>>> (XEN) DebugCtl=3D00000= 00000000000 DebugExceptions=3D0000000000000000
>>>>>>>>>>>>> (XEN) Interruptibility= =3D0001 ActivityState=3D0000
>>>>>>>>>>>>> (XEN) *** Host State *= **
>>>>>>>>>>>>> (XEN) RSP =3D 0xffff83= 007e4f7fa0 =A0RIP =3D 0xffff828c8019aa20
>>>>>>>>>>>>> (XEN) CS=3De008 DS=3D0= 000 ES=3D0000 FS=3D0000 GS=3D0000 SS=3D0000 TR=3De040
>>>>>>>>>>>>> (XEN) FSBase=3D0000000= 000000000 GSBase=3D0000000000000000
>>>>>>>>>>>>> TRBase=3Dffff828c802a8= b00
>>>>>>>>>>>>> (XEN) GDTBase=3Dffff83= 007e9a3000 IDTBase=3Dffff83007e62e010
>>>>>>>>>>>>> (XEN) CR0=3D0000000080= 050033 CR3=3D000000007cfdc000
>>>>>>>>>>>>> CR4=3D00000000000026f0=
>>>>>>>>>>>>> (XEN) Sysenter RSP=3Df= fff83007e4f7fd0 CS:RIP=3De008:ffff828c801c7290
>>>>>>>>>>>>> (XEN) Host PAT =3D 0x0= 000000000000000
>>>>>>>>>>>>> (XEN) *** Control Stat= e ***
>>>>>>>>>>>>> (XEN) PinBased=3D00000= 03f CPUBased=3Db6a1e7fe SecondaryExec=3D00000041
>>>>>>>>>>>>> (XEN) EntryControls=3D= 000011ff ExitControls=3D0003efff
>>>>>>>>>>>>> (XEN) ExceptionBitmap= =3D00044080
>>>>>>>>>>>>> (XEN) VMEntry: intr_in= fo=3D80000b0b errcode=3D00001eac ilen=3D00000000
>>>>>>>>>>>>> (XEN) VMExit: intr_inf= o=3D00000000 errcode=3D00008000 ilen=3D00000000
>>>>>>>>>>>>> (XEN) =A0 =A0 =A0 =A0 = reason=3D80000021 qualification=3D00000000
>>>>>>>>>>>>> (XEN) IDTVectoring: in= fo=3D00000000 errcode=3D00000000
>>>>>>>>>>>>> (XEN) TPR Threshold = =3D 0x00
>>>>>>>>>>>>> (XEN) EPT pointer =3D = 0x0000000000000000
>>>>>>>>>>>>> (XEN) Virtual processo= r ID =3D 0x0000
>>>>>>>>>>>>> (XEN) ****************= **********************
>>>>>>>>>>>>> (XEN) domain_crash cal= led from vmx.c:2218
>>>>>>>>>>>>> (XEN) Domain 1 (vcpu#0= ) crashed on cpu#1:
>>>>>>>>>>>>> (XEN) ----[ Xen-3.4.0-= rc3-pre =A0x86_64 =A0debug=3Dn =A0Not tainted ]----
>>>>>>>>>>>>> (XEN) CPU: =A0 =A01 >>>>>>>>>>>>> (XEN) RIP: =A0 =A00060= :[<000000000000002a>]
>>>>>>>>>>>>> (XEN) RFLAGS: 00000000= 00023202 =A0 CONTEXT: hvm guest
>>>>>>>>>>>>> (XEN) rax: 00000000000= 00007 =A0 rbx: 0000000000001490 =A0 rcx:
>>>>>>>>>>>>> 0000000000000000
>>>>>>>>>>>>> (XEN) rdx: 00000000000= 01da8 =A0 rsi: 0000000000000000 =A0 rdi:
>>>>>>>>>>>>> 0000000000000000
>>>>>>>>>>>>> (XEN) rbp: 00000000000= 08ebf =A0 rsp: 0000000000000080 =A0 r8:
>>>>>>>>>>>>> =A00000000000000000 >>>>>>>>>>>>> (XEN) r9: =A0000000000= 0000000 =A0 r10: 0000000000000000 =A0 r11:
>>>>>>>>>>>>> 0000000000000000
>>>>>>>>>>>>> (XEN) r12: 00000000000= 00000 =A0 r13: 0000000000000000 =A0 r14:
>>>>>>>>>>>>> 0000000000000000
>>>>>>>>>>>>> (XEN) r15: 00000000000= 00000 =A0 cr0: 0000000080000019 =A0 cr4:
>>>>>>>>>>>>> 0000000000000000
>>>>>>>>>>>>> (XEN) cr3: 00000000014= 43000 =A0 cr2: 0000000000000000
>>>>>>>>>>>>> (XEN) ds: 0068 =A0 es:= 0068 =A0 fs: 0068 =A0 gs: 0068 =A0 ss: 0070 =A0 cs:
>>>>>>>>>>>>> 0060
>>>>>>>>>>>>>
>>>>>>>>>>>>> Could it be, that the = real mode emulation code has a bug? What
>>>>>>>>>>>>> does
>>>>>>>>>>>>> this
>>>>>>>>>>>>> error means?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Tom
>>>>>>>>>>>>>
>>>>>>>>>>>>> 2009/4/22 Keir Fraser<= br> >>>>>>>>>>>>> <keir.fraser@eu.citrix.com<mailto:keir.fraser@eu.citrix.com>>=
>>>>>>>>>>>>> On 22/04/2009 12:18, &= quot;Tom Rotenberg"
>>>>>>>>>>>>> <tom.rotenberg@gmail.com<mailto:tom.rotenberg@gmail.com>> wrote: >>>>>>>>>>>>>
>>>>>>>>>>>>> Keir,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I have applied your pa= tch, and it seemed to work. However, the
>>>>>>>>>>>>> domain
>>>>>>>>>>>>> still
>>>>>>>>>>>>> crashes, and now it lo= oks like it's because of the 'LTR'
>>>>>>>>>>>>> instruction.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Try the attached patch= . It replaces the one I sent last time, and
>>>>>>>>>>>>> emulates
>>>>>>>>>>>>> both LLDT and LTR.
>>>>>>>>>>>>>
>>>>>>>>>>>>> =A0-- Keir
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Content-Description: A= TT00001.txt
>>>>>>>>>>>>> ______________________= _________________________
>>>>>>>>>>>>> Xen-devel mailing list=
>>>>>>>>>>>>> Xen-devel@lists.xensource.com
>>>>>>>>>>>>> http://lists.xensource.com/xen= -devel
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> Tim Deegan <Tim.Deegan@citrix.com>
>>>>>>>>>>>>> Principal Software Eng= ineer, Citrix Systems (R&D) Ltd.
>>>>>>>>>>>>> [Company #02300071, SL= 9 0DZ, UK.]
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Tim Deegan <Tim.Deegan@citrix.com>
>>>>>>>>>> Principal Software Engineer, Citri= x Systems (R&D) Ltd.
>>>>>>>>>> [Company #02300071, SL9 0DZ, UK.]<= br> >>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>


--0016e6470ab0a49cb00468376512-- --===============0217230462== 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 --===============0217230462==--