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: 7603471 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 B3512BF90C for ; Thu, 12 Nov 2015 16:23:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7989206D6 for ; Thu, 12 Nov 2015 16:23:52 +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 172B7203E3 for ; Thu, 12 Nov 2015 16:23:52 +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 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-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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 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 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); }