From: Nadav Amit <nadav.amit@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Andrew Vagin <avagin@virtuozzo.com>,
Andrey Wagin <avagin@gmail.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: Wed, 3 Feb 2016 15:32:46 -0800 [thread overview]
Message-ID: <D0C68AD3-0BF2-4F39-88AB-4BABCE92FDFF@gmail.com> (raw)
In-Reply-To: <D2A0BC47-AA2D-4697-8F0C-F9176874DE25@gmail.com>
Sorry for spamming. The correct fix appears to reload the DRs (set
KVM_DEBUGREG_RELOAD) in kvm_arch_vcpu_load .
(for me it works)
Regards,
Nadav
Nadav Amit <nadav.amit@gmail.com> wrote:
> I think the problem lies here:
>
> /*
> * If the guest has used debug registers, at least dr7
> * will be disabled while returning to the host.
> * If we don't have active breakpoints in the host, we don't
> * care about the messed up debug address registers. But if
> * we have some of them active, restore the old state.
> */
> if (hw_breakpoint_active()) {
> hw_breakpoint_restore();
> }
>
> First we need to reload the DRs after we do hw_breakpoint_restore(), no?
> vcpu->arch.switch_db_regs |= KVM_DEBUGREG_RELOAD;
>
> Second, I am unsure whether hw_breakpoint_active() is the correct condition.
>
> In my defense note that my tests did not his this case since I set affinity
> of the VCPUs to physical cores, and prevented other processes from running.
>
> Regards,
> Nadav
>
> Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>> On 29/01/2016 23:21, Andrew Vagin wrote:
>>> 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.
>>
>> That's actually a good thing, because the patch was a long shot and I
>> had no clue _why_ it would have fixed the bug. Oleg's reproducer
>> spanning host and a VM actually gives me an idea of what is going on,
>> I'll try to reproduce this week.
>>
>> Paolo
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-02-03 23:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-28 8:31 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 ` [CRIU] " Andrew Vagin
2016-01-31 11:01 ` Paolo Bonzini
2016-02-03 18:18 ` Nadav Amit
2016-02-03 23:32 ` Nadav Amit [this message]
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=D0C68AD3-0BF2-4F39-88AB-4BABCE92FDFF@gmail.com \
--to=nadav.amit@gmail.com \
--cc=avagin@gmail.com \
--cc=avagin@virtuozzo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome