From patchwork Tue Dec 8 18:32:28 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: 7801251 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EBB2BBEEE1 for ; Tue, 8 Dec 2015 18:35:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E5D4203F4 for ; Tue, 8 Dec 2015 18:35:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 50294203AE for ; Tue, 8 Dec 2015 18:35:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6N4z-0000gK-2h; Tue, 08 Dec 2015 18:33:37 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6N4i-0000OX-HY for linux-arm-kernel@lists.infradead.org; Tue, 08 Dec 2015 18:33:21 +0000 Received: by wmec201 with SMTP id c201so41358259wme.1 for ; Tue, 08 Dec 2015 10:32:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=OnAOHdq306jSCCWLJgd0IX74fikYkqH1KT+6Qz3YWR4=; b=KZ+AmJurc5d9CnaOsPjRqO/HpZt50OxhrX/+ALB/CFRod8pQHtc+RV7IkpCXT6i1du 3v59WlKTNgs/2U9v5aJ+4ex83YnvuyE16MoRM2d/eyjft65QlkKCN9/MYQI7eSywA6Sw GAEITO2eKXXlQmcP771a/pNyDcqMfy6BwY7ggmMxXL0fSxlTCjMAbkUeD7Q6NDpFjufw tJRlGHvdGLGPi7filqsT9B2Ov2IUv61x1vq+J+gmazKBup5AhPlWceDdhSi6+Ey5z3Bm 5tOt2AiMBac6R291L/mvaYwrQXUcYaNK/cYUnbftkaXTAsVxHRWivAtHFULhX4Rxma4K ALKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=OnAOHdq306jSCCWLJgd0IX74fikYkqH1KT+6Qz3YWR4=; b=DbE0AFaCFrkQc497cPNuEY+uv9v82nm7pRrQNGS5JMlur90GmBI2NDGZSQfW0X7sO2 DW/P2+NZoWBD8Lprro+9xPBwnuBSwjuePSVSEs/h6Srrcr4x41E475NMA2rHPJi6ka9o RoMypP//oIO8UguZCjAFfgooIYX2LIfBdbkFBNa1PjAFmLhZ0MQxgjobQNN2f8AUKh/t 2IgC5BVsOV5RvBUwieDN10qzXg+4tlsgq6Zm4mUJUiR0CtGbDSOu6U7WcjhEf50S26A0 r5qhtHr5RN85PJCAoH09KniyUe6SJIIURM51zka1E1EhUL0zpySQAk7F5z5rznSl15dZ 2tGA== X-Gm-Message-State: ALoCoQlu1vzrfZf3H3Moc2T60CGy7LdVuNlIGhT10YzkQFRuJ/6GH2bnjP7E1IOh5uuGPh7zK39DEZ+VDnzz+jYtfeS95TpZHw== X-Received: by 10.194.110.5 with SMTP id hw5mr1253706wjb.154.1449599578737; Tue, 08 Dec 2015 10:32:58 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l128sm22341251wmf.10.2015.12.08.10.32.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2015 10:32:57 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 8E4DD3E04DD; Tue, 8 Dec 2015 18:32:56 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, christoffer.dall@linaro.org, zhichao.huang@linaro.org Subject: [PATCH v10 1/6] target-arm: kvm64 - introduce kvm_arm_init_debug() Date: Tue, 8 Dec 2015 18:32:28 +0000 Message-Id: <1449599553-24713-2-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1449599553-24713-1-git-send-email-alex.bennee@linaro.org> References: <1449599553-24713-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151208_103320_859169_AA20FA96 X-CRM114-Status: GOOD ( 12.29 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }