From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers Date: Tue, 7 Jul 2015 11:24:06 +0100 Message-ID: <20150707102405.GE23879@arm.com> References: <1434969694-7432-1-git-send-email-zhichao.huang@linaro.org> <1434969694-7432-9-git-send-email-zhichao.huang@linaro.org> <20150630092020.GP11332@cbox> <20150703115611.GB14220@lvm> <5A7DE9A0-E7A6-40B0-80F9-896F7DED0E47@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "kvm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , Marc Zyngier , "alex.bennee@linaro.org" , Christoffer Dall , "huangzhichao@huawei.com" To: Zhichao Huang Return-path: Received: from foss.arm.com ([217.140.101.70]:34872 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753325AbbGGKYK (ORCPT ); Tue, 7 Jul 2015 06:24:10 -0400 Content-Disposition: inline In-Reply-To: <5A7DE9A0-E7A6-40B0-80F9-896F7DED0E47@linaro.org> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jul 07, 2015 at 11:06:57AM +0100, Zhichao Huang wrote: > Chazy and me are talking about how to reduce the saving/restoring > overhead for debug registers. > We want to add a state in hw_breakpoint.c to indicate whether the host > enable any hwbrpts or not (might export a fuction that kvm can call), > then we can read this state from memory instead of reading from real > hardware registers, and to decide whether we need a world switch or > not. > Does it acceptable? Maybe, hard to tell without the code. There are obvious races to deal with if you use variables to indicate whether resources are in use -- why not just trap debug access from the host as well? Then you could keep track of the "owner" in kvm and trap accesses from everybody else. Will