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: 543427 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 463C514142D for ; Fri, 13 Nov 2015 03:23:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro_org.20150623.gappssmtp.com header.i=@linaro_org.20150623.gappssmtp.com header.b=XK7Zj6Ru; dkim-atps=neutral Received: from localhost ([::1]:47668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwueO-0003dQ-SP for incoming@patchwork.ozlabs.org; Thu, 12 Nov 2015 11:23:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwucg-0000T6-7g for qemu-devel@nongnu.org; Thu, 12 Nov 2015 11:21:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwuce-0003Lb-JZ for qemu-devel@nongnu.org; Thu, 12 Nov 2015 11:21:18 -0500 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:36671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwuce-0003L5-EJ for qemu-devel@nongnu.org; Thu, 12 Nov 2015 11:21:16 -0500 Received: by wmww144 with SMTP id w144so207575040wmw.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=Dqlee8HIyN+bh3oEXZW9oFJ+MzvPDBHTj8DnnoVNU0M6V/7qhDGjn5wYCoIb/X7azK g0hvAFTWBw6ghplxBqxPGK0taDJffwMyn6L2kGjJ4TlqE2y/jK+Xd+T6Ws9Vxvy0bST0 K4sH1jHHBBtSzhFC8u/f7Fuw1mR8i8Vv1wOLjyqmH19Sqt+wY/oBRwiDj5q+aG6jL+wU GdapE3XqHHGm88SzJqY1r+HQB387cPv+Jy3aDrwI/+B3wAgZQzCb+GzXB8dbjkkrzsc1 oiJEj9rB6m3yfuinmcksn9WNvEKhHsF4yqAkfMozKh7MF8tD0A0npTB5X+DyBddDjiwz mybQ== X-Gm-Message-State: ALoCoQkvBxvwPj9/pOKnkO+79oY4jQAvJJejR3NGWiiVVqa0yGadRW75pjIxAGKPVmV7nqjiJeee 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 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-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::22d 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 v9 3/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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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; }