From: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
To: "Alex Bennée" <alex.bennee-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
"kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org"
<kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org>,
"christoffer.dall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
<christoffer.dall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Marc Zyngier <Marc.Zyngier-5wv7dgnIgG8@public.gmane.org>,
"peter.maydell-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
<peter.maydell-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"agraf-l3A5Bk7waGM@public.gmane.org"
<agraf-l3A5Bk7waGM@public.gmane.org>,
"drjones-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
<drjones-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
"pbonzini-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
<pbonzini-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
"zhichao.huang-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
<zhichao.huang-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"jan.kiszka-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org"
<jan.kiszka-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org>,
"dahi-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org"
<dahi-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
"r65777-KZfg59tc24xl57MIdRCFDg@public.gmane.org"
<r65777-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
"bp-l3A5Bk7waGM@public.gmane.org"
<bp-l3A5Bk7waGM@public.gmane.org>,
Gleb Natapov <gleb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Jonathan Corbet <corbet-T1hC0tSOHrs@public.gmane.org>,
Catalin Marinas <Catalin.Marinas-5wv7dgnIgG8@public.gmane.org>,
Lorenzo Pieralisi
<Lorenzo.Pieralisi-5wv7dgnIgG8@public.gmane.org>,
Ingo Molnar <mingo@kernel.o
Subject: Re: [PATCH v7 09/11] KVM: arm64: guest debug, HW assisted debug support
Date: Thu, 2 Jul 2015 09:48:47 +0100 [thread overview]
Message-ID: <20150702084847.GB3418@arm.com> (raw)
In-Reply-To: <1435775343-20034-10-git-send-email-alex.bennee-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
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-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Reviewed-by: Christoffer Dall <christoffer.dall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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
next prev parent reply other threads:[~2015-07-02 8:48 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-01 18:28 [PATCH v7 00/11] KVM Guest Debug support for arm64 Alex Bennée
2015-07-01 18:28 ` [PATCH v7 01/11] KVM: add comments for kvm_debug_exit_arch struct Alex Bennée
2015-07-01 18:28 ` [PATCH v7 02/11] KVM: arm64: guest debug, define API headers Alex Bennée
2015-07-01 18:28 ` [PATCH v7 03/11] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl Alex Bennée
2015-07-01 18:28 ` [PATCH v7 04/11] KVM: arm: introduce kvm_arm_init/setup/clear_debug Alex Bennée
2015-07-01 18:28 ` [PATCH v7 05/11] KVM: arm64: guest debug, add SW break point support Alex Bennée
2015-07-01 18:28 ` [PATCH v7 06/11] KVM: arm64: guest debug, add support for single-step Alex Bennée
2015-07-01 18:28 ` [PATCH v7 07/11] KVM: arm64: re-factor hyp.S debug register code Alex Bennée
2015-07-01 18:29 ` [PATCH v7 08/11] KVM: arm64: introduce vcpu->arch.debug_ptr Alex Bennée
2015-07-02 18:34 ` Christoffer Dall
2015-07-03 7:14 ` Alex Bennée
2015-07-03 21:46 ` Christoffer Dall
2015-07-03 21:43 ` Christoffer Dall
2015-07-01 18:29 ` [PATCH v7 09/11] KVM: arm64: guest debug, HW assisted debug support Alex Bennée
[not found] ` <1435775343-20034-10-git-send-email-alex.bennee-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-07-02 8:48 ` Will Deacon [this message]
2015-07-02 13:50 ` Alex Bennée
2015-07-03 9:23 ` Will Deacon
2015-07-03 16:07 ` Alex Bennée
2015-07-06 8:51 ` Will Deacon
2015-07-06 9:02 ` Alex Bennée
2015-07-06 9:31 ` Christoffer Dall
2015-07-01 18:29 ` [PATCH v7 10/11] KVM: arm64: enable KVM_CAP_SET_GUEST_DEBUG Alex Bennée
2015-07-01 18:29 ` [PATCH v7 11/11] KVM: arm64: add trace points for guest_debug debug Alex Bennée
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=20150702084847.GB3418@arm.com \
--to=will.deacon-5wv7dgnigg8@public.gmane.org \
--cc=Catalin.Marinas-5wv7dgnIgG8@public.gmane.org \
--cc=Lorenzo.Pieralisi-5wv7dgnIgG8@public.gmane.org \
--cc=Marc.Zyngier-5wv7dgnIgG8@public.gmane.org \
--cc=agraf-l3A5Bk7waGM@public.gmane.org \
--cc=alex.bennee-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=bp-l3A5Bk7waGM@public.gmane.org \
--cc=christoffer.dall-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=corbet-T1hC0tSOHrs@public.gmane.org \
--cc=dahi-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=drjones-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=gleb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=jan.kiszka-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org \
--cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=mingo@kernel.o \
--cc=pbonzini-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=peter.maydell-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=r65777-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=zhichao.huang-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).