From patchwork Tue Dec 8 18:32:30 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: 57891 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp201715lbb; Tue, 8 Dec 2015 10:35:13 -0800 (PST) X-Received: by 10.98.13.154 with SMTP id 26mr6919992pfn.149.1449599713664; Tue, 08 Dec 2015 10:35:13 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id uw2si6641370pac.223.2015.12.08.10.35.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2015 10:35:13 -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 1a6N5D-0000nZ-4E; Tue, 08 Dec 2015 18:33:51 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6N4j-0000Oz-Gy for linux-arm-kernel@lists.infradead.org; Tue, 08 Dec 2015 18:33:22 +0000 Received: by wmuu63 with SMTP id u63so192173774wmu.0 for ; Tue, 08 Dec 2015 10:32:59 -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=xhMm334pvs2gp/5tIS9n6CQs4KoTpm71kKgK0z33Umg=; b=ihr7U1BWww4gNmU5XuHxilH9RhtZB0jEM2HnezPaEZ4NgG/b1E744gjtv243j5coW4 8jqsyrq9aQgvgWep8Dvatr7NxqNBGd5TECAVrnKY0IXzUAhChqajUG8sRNpVBkxYbwSW D9jMJcDNVfrgyvMGZTlnS0pWi5GppyQxhWFtEQ7VbGePgeXxd3gX+lDyQOUpT8GXhpD0 m+8/LzmX3dAV+gGFr3AmSIJiR+N71wbC9/Dbn/JGY4M/UmMzu1o5U5CYSqPj0kLxnC7s A0Ni7F/5ai1qawL0w6IwQ7yiEj1OtUh6usEUKYLMkqPGMBS9GCEeFjrq+6hMoN52rL4/ BM+g== 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=xhMm334pvs2gp/5tIS9n6CQs4KoTpm71kKgK0z33Umg=; b=bQy08H0j0zdzQlVN6yI+SZBV065H4jxD/gZTErf6KGEB7yLNkrCVAgO67Gg+TTuvae VeKhDET3s365qML2ugGoP+fQoBrBMEakUMOdqg61IpN5V7Nz+HGFXufHWCERe4yjVodC m+9TP66gmhJqjDfbjMvfe16tD0TYBEgecLgQvnVkCahFe2j8zp1je1w3bkr5JIHpYqpR EK9Xj+lJYvfI7ykAVjTRdtgjPrFazXmMnoFH6YPfZnivjgP5bdf+yerfQGW/Iyge4cFB B46sHuSQJBzCi7RCyIoicbjQsQgi+rCUAyfuv+dEkMERvJ1EnBStSpkAVqATZdKVzuk8 9opw== X-Gm-Message-State: ALoCoQmAo7vzIFn5BfBx4NO4kEs9tJM47gT4crouUEu4XraOZPpEob1p+XuLzoN5D/21UsQKN6KYXzoym0fCz8iK+yTRLX+K9Q== X-Received: by 10.28.177.10 with SMTP id a10mr28577007wmf.4.1449599579877; Tue, 08 Dec 2015 10:32:59 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d66sm22544086wma.21.2015.12.08.10.32.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2015 10:32:58 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id B5CC03E0662; 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 3/6] target-arm: kvm - support for single step Date: Tue, 8 Dec 2015 18:32:30 +0000 Message-Id: <1449599553-24713-4-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_103321_782700_BBC904DA X-CRM114-Status: GOOD ( 14.09 ) 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:232 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 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. The actual setting of the KVM_GUESTDBG_SINGLESTEP flag is already in the common code. If the kernel doesn't support guest debug the ioctl will simply error. Signed-off-by: Alex Bennée --- v2 - convert to using HSR_EC v3 - use internals.h definitions v10 - fix arm32 build - remove redundent flag setting (done in main kvm.c) - more words on fail case --- target-arm/kvm64.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c index 3b3929d..5f96cde 100644 --- a/target-arm/kvm64.c +++ b/target-arm/kvm64.c @@ -534,6 +534,13 @@ bool kvm_arm_handle_debug(CPUState *cs, struct kvm_debug_exit_arch *debug_exit) 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;