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: 7801281 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 29064BEEE1 for ; Tue, 8 Dec 2015 18:35:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47EC82040F for ; Tue, 8 Dec 2015 18:35:40 +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 4FFD4203B0 for ; Tue, 8 Dec 2015 18:35:39 +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 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-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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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. 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;