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

Re: [Xen-devel] EFLAGS based v->arch.hvm_vcpu.single_step



At 23:10 -0400 on 30 Apr (1367363415), Cutter 409 wrote:
> Hi all,
> 
> Does anyone have thoughts on extending v->arch.hvm_vcpu.single_step to
> support pre-MTF systems, in a way that would mimic the MTF?

It sounds hard. :P

> So far I'm emulating PUSHF/POPF to hide the hypervisor's trap flag

How are you doing that?  Are you also catching SMSW/LMSW, and other ways
that RFLAGS can be accessed (interrupt delivery, system call, IRET, 
task switching &c)?

> Right now, I'm enabling X86_EFLAGS_TF in vmx_intr_assist, just like where
> MTF is enabled if desired. It's cleared at the start of vmx_exit_handler
> (if required). I'm catching single step from TRAP_debug, but when I disable
> stepping the guest usually seems to hang. It's not completely frozen,
> because if I turn single stepping back on I see more events, and the
> instruction pointer is moving.

Well it sounds like you've probably set TF when you want it set, so I
assume that the OS has
 - seen that TS is set and got confused;
 - accidentally turned TS on (e.g. in an IRET) and hung taking #DB; or
 - tried to turn on TF itself and you've turned it off in a vmexit. :)

TBH, given the number of ways RFLAGS can be read and written in the
guest, trying to shadow it like this seems like a _lot_ of work.

Tim.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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