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: 56436 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp510535lbb; Thu, 12 Nov 2015 08:23:30 -0800 (PST) X-Received: by 10.69.17.66 with SMTP id gc2mr24519982pbd.24.1447345410045; Thu, 12 Nov 2015 08:23:30 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id am2si20818903pad.210.2015.11.12.08.23.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Nov 2015 08:23:30 -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 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-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:229 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: 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+patch=linaro.org@lists.infradead.org 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; }