From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v5 2/6] target-arm: kvm64: introduce kvm_arm_init_debug() Date: Fri, 29 May 2015 16:19:20 +0100 Message-ID: <1432912764-7073-3-git-send-email-alex.bennee@linaro.org> References: <1432912764-7073-1-git-send-email-alex.bennee@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, peter.maydell@linaro.org, christoffer.dall@linaro.org, zhichao.huang@linaro.org Return-path: Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:57972 "EHLO socrates.bennee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756137AbbE2PTR (ORCPT ); Fri, 29 May 2015 11:19:17 -0400 In-Reply-To: <1432912764-7073-1-git-send-email-alex.bennee@linaro.org> Sender: kvm-owner@vger.kernel.org List-ID: 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=C3=A9e --- target-arm/kvm64.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c index 93c1ca8..61592d2 100644 --- a/target-arm/kvm64.c +++ b/target-arm/kvm64.c @@ -25,6 +25,22 @@ #include "internals.h" #include "hw/arm/arm.h" =20 +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 =3D kvm_check_extension(cs->kvm_state, + KVM_CAP_SET_GUEST_DEBUG); + return; +} + static inline void set_feature(uint64_t *features, int feature) { *features |=3D 1ULL << feature; @@ -107,6 +123,8 @@ int kvm_arch_init_vcpu(CPUState *cs) return ret; } =20 + kvm_arm_init_debug(cs); + return kvm_arm_init_cpreg_list(cpu); } =20 --=20 2.4.1