From patchwork Tue Mar 29 15:49:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1610702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=MdU05ej/; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KSYtW4wQCz9sFk for ; Wed, 30 Mar 2022 02:50:27 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KSYtW42pRz2yMS for ; Wed, 30 Mar 2022 02:50:27 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=MdU05ej/; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::636; helo=mail-pl1-x636.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=MdU05ej/; dkim-atps=neutral Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4KSYtT24lSz2yJ5 for ; Wed, 30 Mar 2022 02:50:25 +1100 (AEDT) Received: by mail-pl1-x636.google.com with SMTP id p17so18005542plo.9 for ; Tue, 29 Mar 2022 08:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ublmn9OTvKUCE6QBlC3rW0VSwPOIHLKbrWtvZ2S8WJI=; b=MdU05ej/TpRHkI6Nk7IAc85fjBrQ9z4uv8A6SQS+mxEyK1k0JtV0byR1ZwWqAoS52W Ab/EYY6QS3G35OX1ZcwWv6zyW9OE3tsXDhtpApjzHe71SUoAhoKYeI6arvQAZsBYzX0X JUpumZkmt3bRD+8yvIZnRFvGw5+8VWA+v5zjB9MVk0MvcDP+1XQ6240K3mErF5M2aSuT M6zmCgCzKF4FOYGqlx916yA+/T04ndAMAW1EjlP1pUJeUaUkRFM+lE3o5M1efc9ivMq0 eCYUZLUnHR6NZKDDLCq0BsarQWHDfs4ZElq5Hcn69taoFgfQJGzBUyLM0ie/ow8fdIiE cJ3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ublmn9OTvKUCE6QBlC3rW0VSwPOIHLKbrWtvZ2S8WJI=; b=pkAG6iuGZzmOAGM2OBRMB4AysP84EWl5UTMx+4lX7IxgeKmqovITlYfMGt0iL3iT0h ut6hGHpzhrd5/aIfqe70fc+ix/8+jxUH8bPKXyMaX8WW6g+ncDq2SYvNMWHuCl/0zNuR Vv2fCo9J2WX7nlSeO5Snlm+itsk+k3AWUFfCO9Ld5lBpRnCiXuabQfOsmUXl9WxxeA2g eT9hRU9yoUpMQ5G53xPQCKPBqD7QLyFejvOD5cn1bw0SdPlN8TrztR6Un0hnz6Ft12Pa iVfv/2NsjJi0vtpB18d4Fbcj1EzSw5jQzJtPUMMrEHQVQeJOn02Lj7SYsLrKXcW5v8go ihqQ== X-Gm-Message-State: AOAM530trSV99hkWwi23HKkwOEaqqRxtQth6h24Gk7asx5/DM/Bm/O46 Qdefb/IuQuYwCaWx5fvzFRfCevv40t0= X-Google-Smtp-Source: ABdhPJwzI5dBrC2vtfXxMoVPGc8cyYZmOlNJ6NXv0Bw1oQ2ObX99i+pgNSTVhSUzisYRvSE8i8DzTA== X-Received: by 2002:a17:90b:4f86:b0:1c9:b52d:9713 with SMTP id qe6-20020a17090b4f8600b001c9b52d9713mr241800pjb.98.1648569023035; Tue, 29 Mar 2022 08:50:23 -0700 (PDT) Received: from bobo.ibm.com (58-6-255-110.tpgi.com.au. [58.6.255.110]) by smtp.gmail.com with ESMTPSA id s35-20020a056a001c6300b004fb20b5d6c1sm14163564pfw.40.2022.03.29.08.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Mar 2022 08:50:22 -0700 (PDT) From: Nicholas Piggin To: pdbg@lists.ozlabs.org Date: Wed, 30 Mar 2022 01:49:13 +1000 Message-Id: <20220329154931.493851-21-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220329154931.493851-1-npiggin@gmail.com> References: <20220329154931.493851-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v2 20/38] gdbserver: Add POWER10 support X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Reviewed-by: Joel Stanley Signed-off-by: Nicholas Piggin --- README.md | 2 +- src/pdbgproxy.c | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5c5c05d..0faa1bf 100644 --- a/README.md +++ b/README.md @@ -527,7 +527,7 @@ There are also low level htm commands which can also be used: - `dump` will dump the trace to a file. ### GDBSERVER -At the moment gdbserver is only supported on P8 and P9. +At the moment gdbserver is only supported on P8 and P9 and P10. Memory access can only be performed on kernel memory. diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c index b3bf5bd..eddf813 100644 --- a/src/pdbgproxy.c +++ b/src/pdbgproxy.c @@ -108,6 +108,9 @@ static void detach(uint64_t *stack, void *priv) #define POWER9_HID_ENABLE_ATTN PPC_BIT(3) #define POWER9_HID_FLUSH_ICACHE PPC_BIT(2) +#define POWER10_HID_ENABLE_ATTN PPC_BIT(3) +#define POWER10_HID_FLUSH_ICACHE PPC_BIT(2) + static int set_attn(bool enable) { uint64_t hid; @@ -136,6 +139,17 @@ static int set_attn(bool enable) hid &= ~POWER9_HID_ENABLE_ATTN; } hid |= POWER9_HID_FLUSH_ICACHE; + } else if (pdbg_target_compatible(thread_target, "ibm,power10-thread")) { + if (enable) { + if (hid & POWER10_HID_ENABLE_ATTN) + return 0; + hid |= POWER10_HID_ENABLE_ATTN; + } else { + if (!(hid & POWER10_HID_ENABLE_ATTN)) + return 0; + hid &= ~POWER10_HID_ENABLE_ATTN; + } + hid |= POWER10_HID_FLUSH_ICACHE; } else { return -1; } @@ -673,8 +687,9 @@ static int gdbserver(uint16_t port) } if (!pdbg_target_compatible(thread, "ibm,power8-thread") && - !pdbg_target_compatible(thread, "ibm,power9-thread")) { - PR_ERROR("GDBSERVER is only available on POWER8 and POWER9\n"); + !pdbg_target_compatible(thread, "ibm,power9-thread") && + !pdbg_target_compatible(thread, "ibm,power10-thread")) { + PR_ERROR("GDBSERVER is only available on POWER8,9,10\n"); return -1; }