From patchwork Thu Nov 12 16:20:48 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: 7603481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8B19E9F1C2 for ; Thu, 12 Nov 2015 16:24:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6AED20809 for ; Thu, 12 Nov 2015 16:24:12 +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 D809F20810 for ; Thu, 12 Nov 2015 16:24:11 +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 1ZwudP-0006Hv-Ri; Thu, 12 Nov 2015 16:22:03 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zwucz-0005zE-BJ for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2015 16:21:39 +0000 Received: by wmec201 with SMTP id c201so99417780wme.1 for ; Thu, 12 Nov 2015 08:21:15 -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=+gBiMbAsmB/xtA1M0oavI74FJyHnDV/2vIockym0zMU=; b=XK7Zj6Ru2Yv4MJzezTCdAvDELbjU10f5oUJM5/dP89eeir73dZX+dvSi2oR5ZM52vT JkPfk4yuKjolvnLSYiWaO4EROL/Du3C7Nd3+oMKERngHSZGnsHqrYhHMbGLnstnzFvM9 yYPoQ5iaHB3xRq3427yLl4RwuhyJxvKsG2kCswdsSgqb9EGr+dLixNqzCZkzeOfifBon XRR6tOuyAlrL8QJK2efy1naF0k/qU69rQ3yUf3MG1Mavqb/hc2z5cpJayVRHaW56i0v6 majtg3ac5FGxpwNUe68W13Rwz+H5vjU1uKUEObLiAioTEIl8ZxLioANMVXlnf52+33SV bHWw== 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=+gBiMbAsmB/xtA1M0oavI74FJyHnDV/2vIockym0zMU=; b=gN4qOfV2i2KTTBClI+MBfMjwiMxcRGYgiqZTtAH7VMFhjhXcpzakoqGpvLq5vXJUTG 0Xh7Ozw9TkDExF70BNTxh1u9MyMknBl2v8uKBpPX4MVTGtLJqKb5uueKJ3+zW5TwnMx9 VTABSAnnlmnEtlhy2WAeRO6w1ToYGal4ekl4cf5FqUTm6JJcK+U/LfLr/j2oZ0GQT0YT YVyC+OC8xt/TrpsJ7/d5+K+mrMLAn8yVqeHRTYa7FAWv1sM+EGxlrYXRWGaepNGWvTHB fkhYH92ZeOT9SATQusLVoHWlIfMfZ9/18z3qTwwBdK9b6K1R8K8mCYsoRghRVICzPv2j oQAw== X-Gm-Message-State: ALoCoQnCaqH9NBRUOxBmjWrwgV1AIXUTVzlWcphkmFH/l5IJzkrwW2rBN1J9D5UFwv+yMX6JX7Te X-Received: by 10.28.137.210 with SMTP id l201mr47241366wmd.103.1447345275755; Thu, 12 Nov 2015 08:21:15 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h189sm23126715wme.1.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 AFE553E0534; 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 3/6] target-arm: kvm - support for single step Date: Thu, 12 Nov 2015 16:20:48 +0000 Message-Id: <1447345251-22625-4-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_082137_651983_AED61346 X-CRM114-Status: GOOD ( 13.85 ) 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: kvm@vger.kernel.org, marc.zyngier@arm.com, Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org 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 This adds support for single-step. There isn't much to do on the QEMU side as after we set-up the request for single step via the debug ioctl it is all handled within the kernel. Signed-off-by: Alex Bennée --- v2 - convert to using HSR_EC v3 - use internals.h definitions --- target-arm/kvm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target-arm/kvm.c b/target-arm/kvm.c index 50f70ef..d505a7e 100644 --- a/target-arm/kvm.c +++ b/target-arm/kvm.c @@ -535,6 +535,13 @@ static int kvm_handle_debug(CPUState *cs, struct kvm_run *run) kvm_cpu_synchronize_state(cs); switch (hsr_ec) { + case EC_SOFTWARESTEP: + if (cs->singlestep_enabled) { + return true; + } else { + error_report("Came out of SINGLE STEP when not enabled"); + } + break; case EC_AA64_BKPT: if (kvm_find_sw_breakpoint(cs, env->pc)) { return true; @@ -595,6 +602,9 @@ int kvm_arch_on_sigbus(int code, void *addr) void kvm_arch_update_guest_debug(CPUState *cs, struct kvm_guest_debug *dbg) { + if (cs->singlestep_enabled) { + dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_SINGLESTEP; + } if (kvm_sw_breakpoints_active(cs)) { dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP; }