From patchwork Thu Dec 13 11:55:01 2018 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: 153635 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp708441ljp; Thu, 13 Dec 2018 03:57:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/UsOyFrUt78dvxh+vi70pzAqLxU7AXI4c/3gPgoS2RSBE++ZZXu8liA0j+USF9V8B/27h0A X-Received: by 2002:ad4:50cc:: with SMTP id e12mr21694457qvq.20.1544702234730; Thu, 13 Dec 2018 03:57:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544702234; cv=none; d=google.com; s=arc-20160816; b=XxmpbAuwBUQbLw5+UZdWRqDol3XCLnb7pvkgYLcUv+5b9lYLx0MiAS+CfID9vnp1b1 rOth83sdyj0dV8ufAZSiwklZIs+7iIWoOTNilx2nXFvVwR+wbGTHKlhB+w+OIBsLaSFf /Uib59ucjWMJfvLHsdGeL8Pq2EHmwt6nhIyjxGIsLn8ftHt4reLgxxyPwRYANTzHOm/h d4z6HqTxYNtwF8Xe1J9xa1+eFH50qc8yb0eY5oHaHT4qYoCqeHhwyN1EcbqeW42HtnF+ fzxEa8nS1tmOdADtLQ6AMQorWU7of1v6VXMIIkM1eVjOWZNXVsGerxZPbpxMGOtdtpkP i93Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:message-id:date:to:from :dkim-signature; bh=x4bcDp9KrmSn6k2X8wEOLng/n2YqLMraJUqQOOmQW7s=; b=Gyq54t8B8NvZ07UfCmFEsGcLVpgmVbIusBGXeYgywu+eazlCOTO0yJsrl/r04+WOGa eNat2UyVZrAtHIvORGRvep4bU7b6gxbv3xRKTSWszuwo2YBxftMlAcOU7JEa4tDK4MS4 /E0C1RpS3CkwyT8ladRvREmM3qxGvvXbsYSgB62c/u2KCiIZ5DNWMLLhtU6htvBCUpAO 42boLBRstLx2lofdBLy1+lRwcOtP1OtfOgkbs8gkvMM4kuWvmrv01sJF5tnK2x9U519R 9x3bL+E0ixEyi50DV/Hm5MwYfEiI0DBmABZPYUWWKGHIZmWnzyZpU4XEpdXGejtc8ck5 ayTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="jv/RuO0o"; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i18si904644qtq.201.2018.12.13.03.57.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 13 Dec 2018 03:57:14 -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; dkim=fail header.i=@linaro.org header.s=google header.b="jv/RuO0o"; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXPcA-00008b-6N for patch@linaro.org; Thu, 13 Dec 2018 06:57:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXPaB-0007dO-RY for qemu-devel@nongnu.org; Thu, 13 Dec 2018 06:55:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXPa6-00006a-0e for qemu-devel@nongnu.org; Thu, 13 Dec 2018 06:55:10 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:55522) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXPa5-00004y-Qe for qemu-devel@nongnu.org; Thu, 13 Dec 2018 06:55:05 -0500 Received: by mail-wm1-x344.google.com with SMTP id y139so2023569wmc.5 for ; Thu, 13 Dec 2018 03:55:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=x4bcDp9KrmSn6k2X8wEOLng/n2YqLMraJUqQOOmQW7s=; b=jv/RuO0o0vWv5oeFx9ignI3m5DIi6GwpvF+paL7VyNGuKhEhW+MfNGTU3KXQEsRpXJ xdVC6k2SCT+AgMHXPdhII6ikiYH/hqy+mSwhnxz+zUOz7utPtSYDk89AnVoFBLo8rRJB Std915RB6Yb8hrjWPzTsBSVqf8UwPYStCDDJw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=x4bcDp9KrmSn6k2X8wEOLng/n2YqLMraJUqQOOmQW7s=; b=LALYxSS0Qmlmf8FKZgCybmUHzvtwhydkqwZ/mblw6TEVW30mipm4EK6f96rbr2LaKG K01VaWFOgh+mArHtN3ClW1B7G0RLRFK3gTittMqJATKAe8XGziVnEmgoFdYA7DIlRn7/ 6Yd2QMMrxXrurh1waFMIEPoNpgVWXzNap99qLfvhk19Qe8axFgb/NC8tT0F37kQYfRNO vpjXdL6wp+xEZ8vNcpzKSxJq8bS8hKrc5HNn81oIe49OzjlBzQyAn/4/Lf8xdYfhothq 7JiqNR/6QoqJ1qUVVt32aiv9vLJZ0OwIp/exf6DpSsmmNi3FkYVdRFoIRbmvkO2Pz9xd evuA== X-Gm-Message-State: AA+aEWZbjsgTcNpvvEMlw/8GWWqFPC1p1r92/ZcxWlxfr0LaUv5f4O13 JD7T3gT/AL2Hz3ZBxpzi+PFdWQ== X-Received: by 2002:a1c:2787:: with SMTP id n129mr10167783wmn.128.1544702104566; Thu, 13 Dec 2018 03:55:04 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id a1sm1062068wrw.76.2018.12.13.03.55.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Dec 2018 03:55:03 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 71ACD3E031D; Thu, 13 Dec 2018 11:55:03 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 11:55:01 +0000 Message-Id: <20181213115503.24188-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v1 0/2] Fix kvm guest debugging of AA32 guests on AA64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , ard.biesheuvel@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Hi, This is an attempt to fix debugging of AArch32 binaries when running under KVM on AArch64 hardware. There are two parts to this, the first is a handling the possibility of AArch32 software breakpoints with a heuristic based on the current execution mode. The second part is delaying the setup of aarch64 debugging until the shared arm_cpu_realize function is run by which point we have parsed and decoded the actual execution mode of the guest. This doesn't solve the problem of split mode guests which switch between an AA64 EL1 and an AA32 EL0 though. I still ran into a problem with single-step. Even with Mark's single-step fixup series: To: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu, Subject: [PATCH 0/2] kvm/arm: make singlestep behaviour consistent Date: Fri, 9 Nov 2018 15:07:09 +0000 Message-Id: <20181109150711.45864-1-mark.rutland@arm.com> some instructions do single-step but sometimes the single-step doesn't return leading to a runaway until it hits a breakpoint. I'm not sure why this is the case because the SS state machine shouldn't be instruction sensitive. However these two patches at least make it possible to debug an AArch32 guest. Alex Bennée (2): target/arm: kvm64 make guest debug AA32 break point aware target/arm: defer setting up of aarch64 gdb until arm_cpu_realize include/hw/arm/arm.h | 2 ++ target/arm/cpu.c | 4 ++++ target/arm/cpu64.c | 20 +++++++++++++++----- target/arm/kvm64.c | 13 ++++++++++--- 4 files changed, 31 insertions(+), 8 deletions(-) -- 2.17.1