[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150702084847.GB3418@arm.com>
Date: Thu, 2 Jul 2015 09:48:47 +0100
From: Will Deacon <will.deacon@....com>
To: Alex Bennée <alex.bennee@...aro.org>
Cc: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"kvmarm@...ts.cs.columbia.edu" <kvmarm@...ts.cs.columbia.edu>,
"christoffer.dall@...aro.org" <christoffer.dall@...aro.org>,
Marc Zyngier <Marc.Zyngier@....com>,
"peter.maydell@...aro.org" <peter.maydell@...aro.org>,
"agraf@...e.de" <agraf@...e.de>,
"drjones@...hat.com" <drjones@...hat.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"zhichao.huang@...aro.org" <zhichao.huang@...aro.org>,
"jan.kiszka@...mens.com" <jan.kiszka@...mens.com>,
"dahi@...ux.vnet.ibm.com" <dahi@...ux.vnet.ibm.com>,
"r65777@...escale.com" <r65777@...escale.com>,
"bp@...e.de" <bp@...e.de>, Gleb Natapov <gleb@...nel.org>,
Jonathan Corbet <corbet@....net>,
Catalin Marinas <Catalin.Marinas@....com>,
Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
"open list:ABI/API" <linux-api@...r.kernel.org>
Subject: Re: [PATCH v7 09/11] KVM: arm64: guest debug, HW assisted debug
support
Hi Alex,
On Wed, Jul 01, 2015 at 07:29:01PM +0100, Alex Bennée wrote:
> This adds support for userspace to control the HW debug registers for
> guest debug. In the debug ioctl we copy an IMPDEF registers into a new
> register set called host_debug_state.
>
> We use the recently introduced vcpu parameter debug_ptr to select which
> register set is copied into the real registers when world switch occurs.
>
> I've made some helper functions from hw_breakpoint.c more widely
> available for re-use.
>
> As with single step we need to tweak the guest registers to enable the
> exceptions so we need to save and restore those bits.
>
> Two new capabilities have been added to the KVM_EXTENSION ioctl to allow
> userspace to query the number of hardware break and watch points
> available on the host hardware.
>
> Signed-off-by: Alex Bennée <alex.bennee@...aro.org>
> Reviewed-by: Christoffer Dall <christoffer.dall@...aro.org>
[...]
> diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
> index e7d934d..ac07f2a 100644
> --- a/arch/arm64/kernel/hw_breakpoint.c
> +++ b/arch/arm64/kernel/hw_breakpoint.c
> @@ -50,13 +50,13 @@ static int core_num_brps;
> static int core_num_wrps;
>
> /* Determine number of BRP registers available. */
> -static int get_num_brps(void)
> +int get_num_brps(void)
> {
> return ((read_cpuid(ID_AA64DFR0_EL1) >> 12) & 0xf) + 1;
> }
>
> /* Determine number of WRP registers available. */
> -static int get_num_wrps(void)
> +int get_num_wrps(void)
> {
> return ((read_cpuid(ID_AA64DFR0_EL1) >> 20) & 0xf) + 1;
> }
Sorry, just noticed this, but we already have a public interface for
figuring these numbers out as required by perf. Can't you use
hw_breakpoint_slots(...) instead of exposing these internal helpers?
Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists