Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-07-13 Thread zichao
On 2015/7/9 19:50, Christoffer Dall wrote: > On Tue, Jul 07, 2015 at 11:24:06AM +0100, Will Deacon wrote: >> 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 s

Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-07-09 Thread Zhichao Huang
On July 9, 2015 1:08:55 AM GMT+08:00, Will Deacon wrote: >On Wed, Jul 08, 2015 at 11:50:22AM +0100, Zhichao Huang wrote: >> Are you happy with this?: > >You miss the reserved breakpoint, I think. Sorry, I can't quite understand. What is the reserved breakpoint? When arch_[iu]ninstall_hw_breakp

Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-07-09 Thread Christoffer Dall
On Tue, Jul 07, 2015 at 11:24:06AM +0100, Will Deacon wrote: > 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

Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-07-08 Thread Will Deacon
On Wed, Jul 08, 2015 at 11:50:22AM +0100, Zhichao Huang wrote: > Are you happy with this?: You miss the reserved breakpoint, I think. I also still don't understand why this is preferable to trapping. Will -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message t

Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-07-08 Thread Zhichao Huang
Hi, Will, Are you happy with this?: diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c +bool hw_breakpoint_enabled(void) +{ +struct perf_event **slots; +int i; + +slots = this_cpu_ptr(bp_on_reg); +for (i = 0; i < core_num_brps; i++) { +if (slot

Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-07-07 Thread Will Deacon
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 ca

Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-07-07 Thread Zhichao Huang
Hi, Will, 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

Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-07-03 Thread Christoffer Dall
On Fri, Jul 03, 2015 at 05:54:47PM +0800, Zhichao Huang wrote: > > > On June 30, 2015 5:20:20 PM GMT+08:00, Christoffer Dall > wrote: > >On Mon, Jun 22, 2015 at 06:41:31PM +0800, Zhichao Huang wrote: > >> The trapping code keeps track of the state of the debug registers, > >> allowing for the s

Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-07-03 Thread Zhichao Huang
On June 30, 2015 5:20:20 PM GMT+08:00, Christoffer Dall wrote: >On Mon, Jun 22, 2015 at 06:41:31PM +0800, Zhichao Huang wrote: >> The trapping code keeps track of the state of the debug registers, >> allowing for the switch code to implement a lazy switching strategy. >> >> Signed-off-by: Zhic

Re: [PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-06-30 Thread Christoffer Dall
On Mon, Jun 22, 2015 at 06:41:31PM +0800, Zhichao Huang wrote: > The trapping code keeps track of the state of the debug registers, > allowing for the switch code to implement a lazy switching strategy. > > Signed-off-by: Zhichao Huang > --- > arch/arm/include/asm/kvm_asm.h | 3 +++ > arch/arm

[PATCH v3 08/11] KVM: arm: implement dirty bit mechanism for debug registers

2015-06-22 Thread Zhichao Huang
The trapping code keeps track of the state of the debug registers, allowing for the switch code to implement a lazy switching strategy. Signed-off-by: Zhichao Huang --- arch/arm/include/asm/kvm_asm.h | 3 +++ arch/arm/include/asm/kvm_host.h | 3 +++ arch/arm/kernel/asm-offsets.c | 1 + arc