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: 57890 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp201564lbb; Tue, 8 Dec 2015 10:34:57 -0800 (PST) X-Received: by 10.66.182.165 with SMTP id ef5mr1893657pac.95.1449599697463; Tue, 08 Dec 2015 10:34:57 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id va5si6665869pac.165.2015.12.08.10.34.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2015 10:34:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com 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-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22b listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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+patch=linaro.org@lists.infradead.org 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); }