From nobody Tue Feb 10 07:22:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541777023711207.40674835867867; Fri, 9 Nov 2018 07:23:43 -0800 (PST) Received: from localhost ([::1]:34718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL8dK-0003Nm-Cg for importer@patchew.org; Fri, 09 Nov 2018 10:23:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gL8bC-0001CK-3u for qemu-devel@nongnu.org; Fri, 09 Nov 2018 10:21:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gL8b8-0002y2-PD for qemu-devel@nongnu.org; Fri, 09 Nov 2018 10:21:29 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:32810) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gL8b6-0002Zo-V4 for qemu-devel@nongnu.org; Fri, 09 Nov 2018 10:21:25 -0500 Received: by mail-wr1-x441.google.com with SMTP id u9-v6so2313312wrr.0 for ; Fri, 09 Nov 2018 07:21:22 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n131-v6sm2941449wmd.7.2018.11.09.07.21.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Nov 2018 07:21:19 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 2C27C3E045E; Fri, 9 Nov 2018 15:21:19 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G7ixcBUZkpRFWN8NapKcCGRdRfATrFNt/wg7PFUgvMM=; b=iMQN8RsZQqkRb2yrEcDy8aT4Nm5AhXKx8Y8X8fQKDiJlRuQow/gZt8oiqUZWP4pUms rr33kuvdg/a/UG8kjmDZNiIfmPxvLugA2vRyGVJnAj1QVQbKRVjwEXuXQPT6tbwCDLd3 0vEvjzA7f1R6dfbj5476re9avkpzeKOsOlQxM= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=G7ixcBUZkpRFWN8NapKcCGRdRfATrFNt/wg7PFUgvMM=; b=oaqgMs6m30Ch7M3H651S7krshw7m8IgmVEvZIKmJt8P0kjphO1+fShYxoCIrfMKDBk xZVrVeGH7yRIny6LSOb6w6i3DIThd26GkEy07cJ/+mOxhGc4nlboIVkOKVmfGFmBQBu9 qIMuinbObEC5M/Z6VtKMcP9ED2nIQeqUMetB0w1pLt7tsCCrj3AJxTGJwB/w3Qm1gNdQ 3UFjRw7PbxS2pyzqdZ67g7p7A/EIrvZsKP1r94anL+uiUNGkF+tBh/hLCgKJhj8Ohdqq zDG7Z6ViYFs+9BUYkBOgGlzq2f5lDC58padvj+sSROnPnEiBa7SE3fugvyC3GdQWY9Rt nWCw== X-Gm-Message-State: AGRZ1gIUVO4YewVoTEnIHpBPyqYKOqym+WGoY1+qszLveu0ra9ZdZjqT Sywgr2Nv+JNVSstVrlncPLbp8Q== X-Google-Smtp-Source: AJdET5e61tnArnmvBIKmtzU1hTKyVcsHcLfE14ztQ7tIR/ArnY/987i8sJRmHrp+70QnKg+s189ySw== X-Received: by 2002:adf:e983:: with SMTP id h3-v6mr8244654wrm.58.1541776880758; Fri, 09 Nov 2018 07:21:20 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 9 Nov 2018 15:21:13 +0000 Message-Id: <20181109152119.9242-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181109152119.9242-1-alex.bennee@linaro.org> References: <20181109152119.9242-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH v3 1/7] target/arm64: properly handle DBGVR RESS bits 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: peter.maydell@linaro.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This only fails with some (broken) versions of gdb but we should treat the top bits of DBGBVR as RESS. Properly sign extend QEMU's reference copy of dbgbvr and also update the register descriptions in the comment. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- v2 - sanitise register on insertion - update reference description v3 - fix bogus sextract64 --- target/arm/kvm64.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 5de8ff0ac5..6351a54b28 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -103,7 +103,7 @@ static void kvm_arm_init_debug(CPUState *cs) * capable of fancier matching but that will require exposing that * fanciness to GDB's interface * - * D7.3.2 DBGBCR_EL1, Debug Breakpoint Control Registers + * DBGBCR_EL1, Debug Breakpoint Control Registers * * 31 24 23 20 19 16 15 14 13 12 9 8 5 4 3 2 1 0 * +------+------+-------+-----+----+------+-----+------+-----+---+ @@ -115,12 +115,25 @@ static void kvm_arm_init_debug(CPUState *cs) * SSC/HMC/PMC: Security, Higher and Priv access control (Table D-12) * BAS: Byte Address Select (RES1 for AArch64) * E: Enable bit + * + * DBGBVR_EL1, Debug Breakpoint Value Registers + * + * 63 53 52 49 48 2 1 0 + * +------+-----------+----------+-----+ + * | RESS | VA[52:49] | VA[48:2] | 0 0 | + * +------+-----------+----------+-----+ + * + * Depending on the addressing mode bits the top bits of the register + * are a sign extension of the highest applicable VA bit. Some + * versions of GDB don't do it correctly so we ensure they are correct + * here so future PC comparisons will work properly. */ + static int insert_hw_breakpoint(target_ulong addr) { HWBreakpoint brk =3D { .bcr =3D 0x1, /* BCR E=3D1, enable */ - .bvr =3D addr + .bvr =3D sextract64(addr, 0, 53) }; =20 if (cur_hw_bps >=3D max_hw_bps) { --=20 2.17.1