From patchwork Fri May 29 15:19:22 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: 49229 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8DD84218EC for ; Fri, 29 May 2015 15:20:16 +0000 (UTC) Received: by lbbti3 with SMTP id ti3sf19966158lbb.1 for ; Fri, 29 May 2015 08:20:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding:cc :subject:precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=ZMidYVnnAkwhMS7eqycRgMvNWDMfq27pHRiE/o8LWH8=; b=Kjnl3BeE1Pyr/5U86EO/MHXt2OqU1RSvjQe6Uc8qZDVQtSbSZt3WSpkfn52O1nxrmT D12zF9k/Hb/eK0M+Cd9rmk+0KJi6uHY5sK0b+ZNwXHYVeKjhVrcoN+WuKTB/mTbDZBdJ 8OovujhschnzloM0p4zQoXxjE46aCuWVIXC1queOALwYnykR9pmHqxbQV/PHxMaAe9V1 zfCmq4XbaMK70N2VG7C/KokstCrQc3qlUY2yyqLnGthFexnowvk0Mz7YqInNUwtJwYJ1 H63pm9gwh+R49VaPpN0W/rSiOxJ/Kr2GYKNzgKn1/12XYkO8MTdD0N0r7VbC8Je3yRkL XICA== X-Gm-Message-State: ALoCoQldadhzBUU5BE7JXwJ3al/sT5S6OlTIrJCgdH7/XIv6aIvB97jS6ggC36NmT3iW5WLoOA4N X-Received: by 10.152.22.71 with SMTP id b7mr6559667laf.3.1432912815106; Fri, 29 May 2015 08:20:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.2.193 with SMTP id 1ls368755law.41.gmail; Fri, 29 May 2015 08:20:14 -0700 (PDT) X-Received: by 10.112.72.132 with SMTP id d4mr8520718lbv.1.1432912814961; Fri, 29 May 2015 08:20:14 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id bj8si4928024lbc.93.2015.05.29.08.20.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 08:20:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbqq2 with SMTP id qq2so50609438lbb.3 for ; Fri, 29 May 2015 08:20:14 -0700 (PDT) X-Received: by 10.152.21.136 with SMTP id v8mr8537282lae.19.1432912814216; Fri, 29 May 2015 08:20:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp418488lbb; Fri, 29 May 2015 08:20:13 -0700 (PDT) X-Received: by 10.55.31.27 with SMTP id f27mr16984736qkf.9.1432912812586; Fri, 29 May 2015 08:20:12 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g196si5840800qhc.80.2015.05.29.08.20.11 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 29 May 2015 08:20:12 -0700 (PDT) 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; Received: from localhost ([::1]:36631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyM4x-0000dF-LS for patch@linaro.org; Fri, 29 May 2015 11:20:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyM49-0008EF-EZ for qemu-devel@nongnu.org; Fri, 29 May 2015 11:19:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyM45-0000oG-Tj for qemu-devel@nongnu.org; Fri, 29 May 2015 11:19:21 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:35681 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyM45-0000o7-O9 for qemu-devel@nongnu.org; Fri, 29 May 2015 11:19:17 -0400 Received: from localhost ([127.0.0.1] helo=zen.linaroharston) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1YyNOQ-0005fR-Ss; Fri, 29 May 2015 18:44:23 +0200 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, peter.maydell@linaro.org, christoffer.dall@linaro.org, zhichao.huang@linaro.org Date: Fri, 29 May 2015 16:19:22 +0100 Message-Id: <1432912764-7073-5-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.4.1 In-Reply-To: <1432912764-7073-1-git-send-email-alex.bennee@linaro.org> References: <1432912764-7073-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: alex.bennee@linaro.org X-SA-Exim-Scanned: No (on socrates.bennee.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 88.198.71.155 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 Subject: [Qemu-devel] [PATCH v5 4/6] 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 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alex.bennee@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 c3bad6f..de2865a 100644 --- a/target-arm/kvm.c +++ b/target-arm/kvm.c @@ -528,6 +528,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; @@ -588,6 +595,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; }