The hvm domain which is being debugged sometimes crashes with the following message: (XEN) Failed vm entry (exit reason 0x80000021) caused by invalid guest state (0). (XEN) ************* VMCS Area ************** (XEN) *** Guest State *** (XEN) CR0: actual=0x000000008005003b, shadow=0x000000008005003b, gh_mask=ffffffffffffffff ...[snip]... (XEN) DebugCtl=0000000000000000 DebugExceptions=0000000000000000 (XEN) Interruptibility=0001 ActivityState=0000 (XEN) *** Host State *** (XEN) RSP = 0xffff828c8024ffa0 RIP = 0xffff828c801885b0 (XEN) CS=e008 DS=0000 ES=0000 FS=0000 GS=0000 SS=0000 TR=e040 (XEN) FSBase=0000000000000000 GSBase=0000000000000000 TRBase=ffff828c8028a200 (XEN) GDTBase=ffff828c800f3000 IDTBase=ffff828c8028db20 (XEN) CR0=000000008005003b CR3=00000001315b9000 CR4=00000000000026b0 (XEN) Sysenter RSP=ffff828c8024ffd0 CS:RIP=e008:ffff828c801af290 (XEN) *** Control State *** (XEN) PinBased=0000003f CPUBased=b6a1e7fe SecondaryExec=00000041 (XEN) EntryControls=000013ff ExitControls=0003efff (XEN) ExceptionBitmap=0004400a (XEN) VMEntry: intr_info=00000031 errcode=00000004 ilen=00000000 (XEN) VMExit: intr_info=80000301 errcode=00000400 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:2207 (XEN) Domain 14 (vcpu#0) crashed on cpu#0: Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Dec-19 15:10 UTC
Re: [Xen-devel] [PATCH] vmx: Fix single step on debugger
On 19/12/2008 09:48, "Kouya Shimura" <kouya@jp.fujitsu.com> wrote:> The hvm domain which is being debugged sometimes crashes with the > following message:The fix looks like a dubious hack to me. Wouldn''t it at least be a bit cleaner to mess with DR6.BS (the flag that''s actually being checked by the CPU) rather than messing with the DEBUGCTL.BTF control flag? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kouya Shimura
2008-Dec-22 02:34 UTC
Re: [Xen-devel] [PATCH] vmx: Fix single step on debugger
Indeed, this fix is hacky but it works well for me. At first, I tried setting GUEST_PENDING_DBG_EXCEPTIONS.BS according to the SDM. As a result, the guest doesn''t be killed but never go progress after the STI instruction (i.e. VM exit immediately after VM entry) as long as RFLAGS.TF=1. That is inconvenient for debugging. Is there any other way? Thanks, Kouya Keir Fraser writes:> On 19/12/2008 09:48, "Kouya Shimura" <kouya@jp.fujitsu.com> wrote: > > > The hvm domain which is being debugged sometimes crashes with the > > following message: > > The fix looks like a dubious hack to me. Wouldn''t it at least be a bit > cleaner to mess with DR6.BS (the flag that''s actually being checked by the > CPU) rather than messing with the DEBUGCTL.BTF control flag? > > -- Keir >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Dec-22 08:02 UTC
Re: [Xen-devel] [PATCH] vmx: Fix single step on debugger
On 22/12/2008 02:34, "Kouya Shimura" <kouya@jp.fujitsu.com> wrote:> Indeed, this fix is hacky but it works well for me. > > At first, I tried setting GUEST_PENDING_DBG_EXCEPTIONS.BS > according to the SDM. As a result, the guest doesn''t be killed > but never go progress after the STI instruction > (i.e. VM exit immediately after VM entry) as long as RFLAGS.TF=1. > That is inconvenient for debugging. > > Is there any other way?If you make it conditional on debugger_attached then I guess you can do what you like. I strongly dislike it though. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kouya Shimura
2008-Dec-25 02:53 UTC
Re: [Xen-devel] [PATCH] vmx: Fix single step on debugger
Keir Fraser writes:> On 22/12/2008 02:34, "Kouya Shimura" <kouya@jp.fujitsu.com> wrote: > > > Indeed, this fix is hacky but it works well for me. > > > > At first, I tried setting GUEST_PENDING_DBG_EXCEPTIONS.BS > > according to the SDM. As a result, the guest doesn''t be killed > > but never go progress after the STI instruction > > (i.e. VM exit immediately after VM entry) as long as RFLAGS.TF=1. > > That is inconvenient for debugging. > > > > Is there any other way? > > If you make it conditional on debugger_attached then I guess you can do what > you like. I strongly dislike it though. > > -- Keir >I read the SDM carefully, however, I can''t find any solution for this. Although the monitor trap flag might help, my machine doesn''t have such a feature. At least, crashing the guest should be avoided. Attached is the updated patch. I think it might become a little better. Thanks, Kouya Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Seemingly Similar Threads
- [PATCH] x86/hap: fix race condition between ENABLE_LOGDIRTY and track_dirty_vram hypercall
- [Xen-ia64-devel] [PATCH 0/3][IA64] Accelerate IDE PIO on HVM/IA64
- [PATCH] x86/hvm: fix corrupt ACPI PM-Timer during live migration
- [PATCH] vmx: fix debugctl handling
- [PATCH]xend: fix a typo in pci.py