All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Vagin <avagin@virtuozzo.com>
To: Andrey Wagin <avagin@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, <kvm@vger.kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"criu@openvz.org" <criu@openvz.org>,
	Cyrill Gorcunov <gorcunov@openvz.org>
Subject: Re: [CRIU] x86: Hardware breakpoints are not always triggered
Date: Fri, 29 Jan 2016 14:21:30 -0800	[thread overview]
Message-ID: <20160129222130.GC10798@odin.com> (raw)
In-Reply-To: <20160128224224.GA10028@gmail.com>

On Thu, Jan 28, 2016 at 02:42:25PM -0800, Andrey Wagin wrote:
> On Thu, Jan 28, 2016 at 10:33:28PM +0100, Paolo Bonzini wrote:
> > 
> > 
> > On 28/01/2016 09:31, Andrey Wagin wrote:
> > > I tried to print drX registers after a break-point. Looks like they
> > > are set correctly.
> > 
> > Can you try this KVM patch?
> 
> Looks like it fixes a case when reproducers are running only in VM.

Actually Oleg's reproducer detects the bug with this patch when they are
rinning only in VM.

> 
> If I execute the reproducer a few times on the host and then execute it
> in VM, it exits very fast.
> 
> Thanks,
> Andrew
> 
> > 
> > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> > index c13a64b7d789..32bae1c70a50 100644
> > --- a/arch/x86/kvm/svm.c
> > +++ b/arch/x86/kvm/svm.c
> > @@ -1612,6 +1612,7 @@ static void svm_sync_dirty_debug_regs(struct kvm_vcpu *vcpu)
> >  	vcpu->arch.dr7 = svm->vmcb->save.dr7;
> >  
> >  	vcpu->arch.switch_db_regs &= ~KVM_DEBUGREG_WONT_EXIT;
> > +	vcpu->arch.switch_db_regs |= KVM_DEBUGREG_RELOAD;
> >  	set_dr_intercepts(svm);
> >  }
> >  
> > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> > index e2951b6edbbc..505a4663b9f4 100644
> > --- a/arch/x86/kvm/vmx.c
> > +++ b/arch/x86/kvm/vmx.c
> > @@ -5659,6 +5659,7 @@ static void vmx_sync_dirty_debug_regs(struct kvm_vcpu *vcpu)
> >  	vcpu->arch.dr7 = vmcs_readl(GUEST_DR7);
> >  
> >  	vcpu->arch.switch_db_regs &= ~KVM_DEBUGREG_WONT_EXIT;
> > +	vcpu->arch.switch_db_regs |= KVM_DEBUGREG_RELOAD;
> >  
> >  	cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
> >  	cpu_based_vm_exec_control |= CPU_BASED_MOV_DR_EXITING;
> > 
> > Paolo
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu

  reply	other threads:[~2016-01-29 22:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  8:31 x86: Hardware breakpoints are not always triggered Andrey Wagin
2016-01-28 11:01 ` Jan Kiszka
2016-01-28 20:53 ` Oleg Nesterov
2016-01-28 21:29   ` Paolo Bonzini
2016-01-28 22:01   ` Oleg Nesterov
2016-01-28 21:33 ` Paolo Bonzini
2016-01-28 22:42   ` Andrey Wagin
2016-01-29 22:21     ` Andrew Vagin [this message]
2016-01-31 11:01       ` [CRIU] " Paolo Bonzini
2016-02-03 18:18         ` Nadav Amit
2016-02-03 23:32           ` Nadav Amit
2016-02-04 11:28             ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160129222130.GC10798@odin.com \
    --to=avagin@virtuozzo.com \
    --cc=avagin@gmail.com \
    --cc=criu@openvz.org \
    --cc=gorcunov@openvz.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.