From patchwork Fri May 29 15:19:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 49228 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1BA87218EC for ; Fri, 29 May 2015 15:20:15 +0000 (UTC) Received: by lbcue7 with SMTP id ue7sf19878606lbc.3 for ; Fri, 29 May 2015 08:20:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding:cc :subject:precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=3rX/H0FgKY9FX/2xUVfaYIueAwjcKR9lFbFcDt5KS1M=; b=UPUfqCLU1T2TSbz0L0FZdbzcBjQsAedKsJGmlj+2RCxo/D5nQ5L2z6vhUut80KIxEk xHJLdSYIE21/1M+jX0MRQFgCt4n8/TfFVKgp+e1u1zQKjymBnPg2QLym1Ztq2OVw7xkF 4SjRMvLbodD1z+0n6OPVo1QaD70Ds1vcGK/sLjnkY5mGD9YalLf2sTVVJz3K4PzLJEQ8 zaOVPn+ArSEHMGG6J5un9fQfHwSB9f407DGnibBQQHucuJKnSDm4YRE1Xs/FKIuFM0OA XLmUoyASsBThn3wGb4Nd2VeCIJrBFGAZZuT9sTdPSmm686C/ppQjbBNpU6JbmobHHXGG KoUA== X-Gm-Message-State: ALoCoQnzz86V5PBkDisa5J5YBu5j6W9g00YHkg88gpz8ySy87IzPugZojV1QU1VwQUSz8mMxjkuY X-Received: by 10.152.26.134 with SMTP id l6mr7741868lag.10.1432912813827; Fri, 29 May 2015 08:20:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.245.43 with SMTP id xl11ls165369lac.21.gmail; Fri, 29 May 2015 08:20:13 -0700 (PDT) X-Received: by 10.112.77.103 with SMTP id r7mr8368860lbw.63.1432912813559; Fri, 29 May 2015 08:20:13 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id yr11si4918871lab.125.2015.05.29.08.20.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 08:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbcue7 with SMTP id ue7so50647583lbc.0 for ; Fri, 29 May 2015 08:20:13 -0700 (PDT) X-Received: by 10.152.6.69 with SMTP id y5mr8412827lay.72.1432912813332; Fri, 29 May 2015 08:20:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp418470lbb; Fri, 29 May 2015 08:20:12 -0700 (PDT) X-Received: by 10.55.16.200 with SMTP id 69mr16386899qkq.98.1432912811739; Fri, 29 May 2015 08:20:11 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g36si5814825qgd.123.2015.05.29.08.20.11 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 29 May 2015 08:20:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:36630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyM4w-0000c4-OT for patch@linaro.org; Fri, 29 May 2015 11:20:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyM49-0008ED-E4 for qemu-devel@nongnu.org; Fri, 29 May 2015 11:19:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyM45-0000nd-8P for qemu-devel@nongnu.org; Fri, 29 May 2015 11:19:21 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:35677 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyM44-0000nF-VC for qemu-devel@nongnu.org; Fri, 29 May 2015 11:19:17 -0400 Received: from localhost ([127.0.0.1] helo=zen.linaroharston) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1YyNOP-0005fR-Q3; Fri, 29 May 2015 18:44:21 +0200 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, peter.maydell@linaro.org, christoffer.dall@linaro.org, zhichao.huang@linaro.org Date: Fri, 29 May 2015 16:19:20 +0100 Message-Id: <1432912764-7073-3-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.4.1 In-Reply-To: <1432912764-7073-1-git-send-email-alex.bennee@linaro.org> References: <1432912764-7073-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: alex.bennee@linaro.org X-SA-Exim-Scanned: No (on socrates.bennee.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 88.198.71.155 Cc: marc.zyngier@arm.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: [Qemu-devel] [PATCH v5 2/6] target-arm: kvm64: introduce kvm_arm_init_debug() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alex.bennee@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Reviewed-by: Peter Maydell --- 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" +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; @@ -107,6 +123,8 @@ int kvm_arch_init_vcpu(CPUState *cs) return ret; } + kvm_arm_init_debug(cs); + return kvm_arm_init_cpreg_list(cpu); }