From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZznX7-0007Oi-Te for qemu-devel@nongnu.org; Fri, 20 Nov 2015 10:23:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZznX4-0000Au-R9 for qemu-devel@nongnu.org; Fri, 20 Nov 2015 10:23:29 -0500 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:36750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZznX4-0000A6-LM for qemu-devel@nongnu.org; Fri, 20 Nov 2015 10:23:26 -0500 Received: by wmww144 with SMTP id w144so23569273wmw.1 for ; Fri, 20 Nov 2015 07:23:25 -0800 (PST) References: <1447345251-22625-1-git-send-email-alex.bennee@linaro.org> <1447345251-22625-2-git-send-email-alex.bennee@linaro.org> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: Date: Fri, 20 Nov 2015 15:23:24 +0000 Message-ID: <877flcitjn.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v9 1/6] target-arm: kvm64 - introduce kvm_arm_init_debug() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: kvm-devel , Marc Zyngier , QEMU Developers , qemu-arm@nongnu.org, Christoffer Dall , Zhichao Huang , "kvmarm@lists.cs.columbia.edu" , arm-mail-list Peter Maydell writes: > On 20 November 2015 at 15:05, Peter Maydell wrote: >> On 12 November 2015 at 16:20, Alex Bennée wrote: >>> As we haven't always had guest debug support we need to probe for it. >>> Additionally we don't do this in the start-up capability code so we >>> don't fall over on old kernels. >>> >>> Signed-off-by: Alex Bennée >>> --- >>> target-arm/kvm64.c | 18 ++++++++++++++++++ >>> 1 file changed, 18 insertions(+) >>> >>> diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c >>> index ceebfeb..d087794 100644 >>> --- a/target-arm/kvm64.c >>> +++ b/target-arm/kvm64.c >>> @@ -25,6 +25,22 @@ >>> #include "internals.h" >>> #include "hw/arm/arm.h" >>> >>> +static bool have_guest_debug; >>> + >>> +/** >>> + * kvm_arm_init_debug() >>> + * @cs: CPUState >>> + * >>> + * Check for guest debug capabilities. >>> + * >>> + */ >>> +static void kvm_arm_init_debug(CPUState *cs) >>> +{ >>> + have_guest_debug = kvm_check_extension(cs->kvm_state, >>> + KVM_CAP_SET_GUEST_DEBUG); >>> + return; >>> +} >>> + >>> static inline void set_feature(uint64_t *features, int feature) >>> { >>> *features |= 1ULL << feature; >>> @@ -121,6 +137,8 @@ int kvm_arch_init_vcpu(CPUState *cs) >>> } >>> cpu->mp_affinity = mpidr & ARM64_AFFINITY_MASK; >>> >>> + kvm_arm_init_debug(cs); >>> + >>> return kvm_arm_init_cpreg_list(cpu); >>> } >> >> I assume in practice the kernel guarantees that either all >> CPUs have the SET_GUEST_DEBUG cap, or none do :-) >> >> Reviewed-by: Peter Maydell > > ...except I've just noticed that nothing else in this patchset > ever reads the have_guest_debug bool we just set, so what is > the purpose of this patch? Oops, maybe to point out my stupidity ;-) But yes the SET_GUEST_DEBUG cap is kernel wide. > > thanks > -- PMM -- Alex Bennée