Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1344189

Re: [PATCH] KVM: x86: fix missed hardware breakpoints

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] KVM: x86: fix missed hardware breakpoints
Date Fri, 26 Feb 2016 12:50:02 +0100
Message-ID <r6p4e-2AD-5@gated-at.bofh.it> (permalink)
References <r3QX0-3RC-13@gated-at.bofh.it> <r6o8a-1Sy-25@gated-at.bofh.it>
X-Original-To Xiao Guangrong <guangrong.xiao@linux.intel.com>, linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=Vmf2AeEbgXslUVu6fsFaP8LXY0lytNyvx0iIT1tR7L8=; b=N4PxwSrWgO2XUF123j5+9X7M/lZJCLONUFYKUGyMJvHupicLhFP9zP2sreDZ87OXa6 ad0C0nJxvvzrlgJ3iltmKTCn5CTq7pzpk+NmB13DESNeoHv2kX/ecjNmFsUw3Qya1zas zC7SGf0wS7wO5PyHhuYVMgkD6Q0baAtePSSQrgHoRvHmG9SWe2Q2vJ8Cs3nlwYg0frAR kJRSdH/a1TqNq6bPO8CzmO2lDnn3Er1eDXh0H3jEjumPi3X+aBZjYMllpOCZi1KE5v6U hMwik4uGc5PRfUM+B/z2x1vmjIdL8bjelSUwg71ADdfgXBgB++NwSsQPoNMvi0XmW2gF IN/w==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Vmf2AeEbgXslUVu6fsFaP8LXY0lytNyvx0iIT1tR7L8=; b=DxQVnlfh8wmqPMvoW4GdcjcRUw80Q3APLUdhBKnynzAi7kswLuE2HTXg7LzvoEiuyv i2mrJlGYLaAOmVLIG5L4uABPQsLvxEPmtyOwFZWRJNYdOPMTrOEeQcL8DZ6XfZUEtlAV GZGnMDd3Kjm5dr9R8A2rmOl+xf6b07cEQDhzvCkBxgnal+OIEmGp1r8KqVhg0Qr3LH8J SxkyQWWXxpyA4aGcpmCAlxxRRpKD5d5VQSDlhk3EaV6SpsxKgXEmvoIe/JF06t/LeWzR ua1mRiUTzxOJ2ar/Dno6yQlm8VgaE9QaV6Crpn4unj8s8AJnnRpo2T2oHMY6acRx1xoJ VjnA==
X-Gm-Message-State AD7BkJLBFNvP3PVPS4Z14q5s3AOou38qs/YFaJFt0vYJC1cdAcLnPVR5OhXd0hStw8qCmw==
X-Received by 10.194.71.177 with SMTP id w17mr1473733wju.36.1456486837080; Fri, 26 Feb 2016 03:40:37 -0800 (PST)
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 23
Organization linux.* mail to news gateway
X-Original-Cc oleg@redhat.com, namit@cs.technion.ac.il, avagin@gmail.com, stable@vger.kernel.org
X-Original-Date Fri, 26 Feb 2016 12:40:33 +0100
X-Original-Message-ID <56D039B1.2030309@redhat.com>
X-Original-References <1455879402-23009-1-git-send-email-pbonzini@redhat.com> <56D02C01.2040400@linux.intel.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1344189

Show key headers only | View raw



On 26/02/2016 11:42, Xiao Guangrong wrote:
>>
>> +    vcpu->arch.switch_db_regs |= KVM_DEBUGREG_RELOAD;
> 
> Er, i do not understand how it works. The BP is enabled in this test case so
> the debug registers are always reloaded before entering guest as
> KVM_DEBUGREG_BP_ENABLED bit is always set on switch_db_regs. What did i
> miss?
> 
> Another impact of this fix is when vcpu is rescheduled we need to always
> reload debug registers even if guest does not enable it, it is really needed?

Hi,

I have looked further at the bug and the issue is that the lazy debug
register optimization doesn't call kvm_update_dr7 and thus does not set
KVM_DEBUGREG_BP_ENABLED.  I will post a better patch shortly.  However,
I still think this one is simpler to have in stable kernel releases,
because it doesn't have any dependencies.

Paolo

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH] KVM: x86: fix missed hardware breakpoints Xiao Guangrong <guangrong.xiao@linux.intel.com> - 2016-02-26 11:50 +0100
  Re: [PATCH] KVM: x86: fix missed hardware breakpoints Nadav Amit <nadav.amit@gmail.com> - 2016-02-26 12:30 +0100
    Re: [PATCH] KVM: x86: fix missed hardware breakpoints Xiao Guangrong <guangrong.xiao@linux.intel.com> - 2016-02-26 12:50 +0100
    Re: [PATCH] KVM: x86: fix missed hardware breakpoints Paolo Bonzini <pbonzini@redhat.com> - 2016-02-26 13:00 +0100
  Re: [PATCH] KVM: x86: fix missed hardware breakpoints Paolo Bonzini <pbonzini@redhat.com> - 2016-02-26 12:50 +0100

csiph-web