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

Re: [Xen-devel] [V0 PATCH] SVM: set/unset TF flag for single_step



On Wed, 02 Jul 2014 09:38:40 +0100
"Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> >>> On 02.07.14 at 05:36, <boris.ostrovsky@xxxxxxxxxx> wrote:
> >> --- a/xen/arch/x86/hvm/svm/svm.c
> >> +++ b/xen/arch/x86/hvm/svm/svm.c
> >> @@ -2350,6 +2350,8 @@ void svm_vmexit_handler(struct cpu_user_regs
> >> *regs)
> >>      case VMEXIT_EXCEPTION_DB:
> >>          if ( !v->domain->debugger_attached )
> >>              goto exit_and_crash;
> >> +        else
> >> +            regs->eflags &= ~X86_EFLAGS_TF;
> >>          domain_pause_for_debugger();
> >>          break;
> > 
> > 
> > I poked around debugger code and it looks to me that 
> > tools/debugger/gdbsx/xg:_change_TF() manages this flag.

_change_TF() only manages TF if XEN_DOMCTL_debug_op fails. Moreover, TF
handling is intended for PV. For HVM, xen provides 
XEN_DOMCTL_debug_op which sets v->arch.hvm_vcpu.single_step.

> Indeed it shouldn't be the hypervisor to deal with that (unless it had
> a built-in one), but the debugger attached.

Correct. But, the hyp provides abi hvm_debug_op 
(XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON) that it needs to honor for svm like
it does for vmx.

> That said, Mukesh, just as a side note: There's no point for an "else"
> after an "if" leading to a "goto".

Right. My "doh!".

Thanks
Mukesh


_______________________________________________
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®.