From: Boris Ostrovsky Subject: Re: [V0 PATCH] SVM: set/unset TF flag for single_step Date: Tue, 1 Jul 2014 20:36:26 -0700 (PDT) Message-ID: <4c14b668-c76b-4a82-9236-9ed6840aefaa@default> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X2BLa-0007qQ-B9 for xen-devel@lists.xenproject.org; Wed, 02 Jul 2014 03:36:38 +0000 Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: mukesh.rathor@oracle.com Cc: xen-devel@lists.xenproject.org, keir.xen@gmail.com, Aravind.Gopalakrishnan@amd.com, JBeulich@suse.com, suravee.suthikulpanit@amd.com List-Id: xen-devel@lists.xenproject.org ----- mukesh.rathor@oracle.com wrote: > > Also strangely, when SVM VMEXIT_EXCEPTION_DB occurs, the TF flag is > not cleared. This patch addresses that too. .. > > diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c > index 76616ac..8addb94 100644 > --- 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. -boris