From patchwork Thu Nov 12 16:20:46 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: 56435 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp510311lbb; Thu, 12 Nov 2015 08:23:06 -0800 (PST) X-Received: by 10.66.66.166 with SMTP id g6mr23894261pat.152.1447345386563; Thu, 12 Nov 2015 08:23:06 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ua7si20869071pac.65.2015.11.12.08.23.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Nov 2015 08:23:06 -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 1Zwud2-00068r-OI; Thu, 12 Nov 2015 16:21:40 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zwucy-0005yp-ED for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2015 16:21:37 +0000 Received: by wmvv187 with SMTP id v187so41249950wmv.1 for ; Thu, 12 Nov 2015 08:21:14 -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=uIgjFJNCJTJLgTG12nw0dfEfq8x1tPxFI40UzlNzaFbGV+VZq+poia16AZEWr0+L7e qUkvKGHg/jv5bZuv5+UreERQP/pBbZsCU210t5KQu165mezj3qE/UkXYyQx69fFqGTzb 3KcBIcouOmqcG7U/4S9yVN1uTqNsU2oQPTS4eSpgxJMa1ktt1byi/20GeNFKIe4BlTp4 ZynVR9/yT8HRzobn1vGvOeJC1GF/EX9pWiuKXgfm57Dcx71tcBn4sgVHNg07r1TkEP4+ cQnKWjUOUyUpARhHIshiP+etNMfflTSwQs5ljxzcctC+JuTSQSBG35QWh25xdTHISAIx T4OQ== 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=dYxw0ygNzTLq/Z+skbyfHKO990uXZKAufI3lltT9w6WUOt6M9c4k0STeJ0BikVMyDh 7OdDkfN1KiTdTmQegcQ6JGIse95VF0TkStz4YO56AW/wIscG/CV4frUu6GpsXExBYmX+ TvvSOYi/t/gCQ4A6H0itxJo7CZD3OorU/zAvQB5Ci+mxp8cbTiCPOo1whWzdpZ0Mx9yx Eo5A0gtsqFV8JcqU/OWDMWtGwpYnOPBRPq+4K8SWzjie5yk9KEErQOUeQCa2ErlQuPyK hez84uv8i/kDeRLin9yFMr8pECygN9wkDSNgP1uysJdNfpXUsNTa3id8jtL+xXRxWak0 n80w== X-Gm-Message-State: ALoCoQmaP8CtcaiGKGU4d27Qn46YdlliVu28s/ZNyTvSBaSdyypqtBxbTop0YBUr3OVm9WoY996R X-Received: by 10.194.86.161 with SMTP id q1mr20235929wjz.88.1447345274638; Thu, 12 Nov 2015 08:21:14 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id w4sm15198496wje.49.2015.11.12.08.21.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Nov 2015 08:21:13 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 8E3373E044B; Thu, 12 Nov 2015 16:21:12 +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 v9 1/6] target-arm: kvm64 - introduce kvm_arm_init_debug() Date: Thu, 12 Nov 2015 16:20:46 +0000 Message-Id: <1447345251-22625-2-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1447345251-22625-1-git-send-email-alex.bennee@linaro.org> References: <1447345251-22625-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-20151112_082136_735378_91CF9BAC X-CRM114-Status: GOOD ( 12.30 ) 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:22d 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); }