From patchwork Thu Dec 17 11:50:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 58572 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp314338lbb; Thu, 17 Dec 2015 03:56:25 -0800 (PST) X-Received: by 10.140.25.227 with SMTP id 90mr66279059qgt.73.1450353384726; Thu, 17 Dec 2015 03:56:24 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a52si11034782qga.61.2015.12.17.03.56.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 17 Dec 2015 03:56:24 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:52442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9XAW-0005pn-Bp for patch@linaro.org; Thu, 17 Dec 2015 06:56:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9X4v-0005m7-Ir for qemu-devel@nongnu.org; Thu, 17 Dec 2015 06:50:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9X4q-0002Ik-Nk for qemu-devel@nongnu.org; Thu, 17 Dec 2015 06:50:37 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:59156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9X4q-0002FS-C5 for qemu-devel@nongnu.org; Thu, 17 Dec 2015 06:50:32 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1a9X4f-0003QX-LN for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:50:21 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 17 Dec 2015 11:50:13 +0000 Message-Id: <1450353020-13076-19-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1450353020-13076-1-git-send-email-peter.maydell@linaro.org> References: <1450353020-13076-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 18/25] target-arm: kvm - support for single step X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Alex Bennée 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 Message-id: 1449599553-24713-4-git-send-email-alex.bennee@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target-arm/kvm64.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 1.9.1 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;