From patchwork Wed Apr 20 06:49:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1619348 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=T48ep1SW; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (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 4KjrtH1Sk4z9sG0 for ; Wed, 20 Apr 2022 16:51:19 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KjrtH0Qf0z2yn2 for ; Wed, 20 Apr 2022 16:51:19 +1000 (AEST) 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=T48ep1SW; 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::1030; helo=mail-pj1-x1030.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=T48ep1SW; dkim-atps=neutral Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (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 4KjrtD4wrdz2xnM for ; Wed, 20 Apr 2022 16:51:16 +1000 (AEST) Received: by mail-pj1-x1030.google.com with SMTP id j8-20020a17090a060800b001cd4fb60dccso1159033pjj.2 for ; Tue, 19 Apr 2022 23:51:16 -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=9ur4sQK+pdQW9E03ZKrmXTGMHRiG9Dg2N8mT7YKBefc=; b=T48ep1SWD9rhcHRUfNkfdxHtJl9ey8mvxDAssGmxSAIkbK9NceM7CHwEsTPehGzppT JTLZJ/e2mNwF5Ji7ftyHgzYCF5Vaz5Jg6HWGi0tp88qvjYDI7YbIh0G3J+8UvOmMW6PQ HZd4EjoTaAVTRo4VVmtaS6w7nz6Q0tILxRlbEj5FUDs7rOMx4OG0PvZ0pDaszXH6YboT 2lvY8Sp5n/7vcDavHk7jpha6ykggP4IJ/IOLlXKKEYsgE+pera2himqimXn3M/t8YM3R blfXiLf0qWm2xRI3chBa5tnyGe92gwhaOlKsf4BEwunN9IFgEW3O6KelvVHxRzagP7OG K62A== 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=9ur4sQK+pdQW9E03ZKrmXTGMHRiG9Dg2N8mT7YKBefc=; b=VIzibIOXsmstN0NNkBEsmayKNLRTJp7kB64tqQFTmHy1Rt5h/Y8XGD4o2TqqRq9khA EaOL6yMp0zVCGls8lxMz1U/qaydb59Mcj7SMcgxSbhEdjpkmtxqcCaaK3FUzMb62KI3r jWQFA7nALhcxwf2rKBNT6nLqocBCUM21dEgGIK1dh9f7fZm0kj7kAWbiLVox8pJEm92p DOET9Rb0Dw/o3EqDWtiZh2F4xrui5aGMIIcbUdM7hvUusRB26eTorSwGCEacS449/vPc grq5UjHh+OxNl+k3tYG0BoqhACdXNATdzmZRmcqx58OFgHmUu0rrYX+JQLZ+efAmxEii 6dvA== X-Gm-Message-State: AOAM533XwC8frYKRmHgyA/o43cH1ZCwwoPQFawrVEym1Bu6CIGJMZjmF ifOtAQTa1uORYsizrqVCPtYtv1DTwWOzDw== X-Google-Smtp-Source: ABdhPJxGL8AXwruG5vVRPufoPBc5OCDBsgAlFvyftoHczYcuKg+hF3HkGFHKxu4szc+eQ1UhfVNgpg== X-Received: by 2002:a17:90a:b10d:b0:1cb:a19b:1610 with SMTP id z13-20020a17090ab10d00b001cba19b1610mr2741207pjq.138.1650437474068; Tue, 19 Apr 2022 23:51:14 -0700 (PDT) Received: from bobo.ozlabs.ibm.com ([203.221.203.144]) by smtp.gmail.com with ESMTPSA id x20-20020aa79574000000b005061f4782c5sm18481235pfq.183.2022.04.19.23.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Apr 2022 23:51:13 -0700 (PDT) From: Nicholas Piggin To: pdbg@lists.ozlabs.org Date: Wed, 20 Apr 2022 16:49:55 +1000 Message-Id: <20220420065013.222816-22-npiggin@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220420065013.222816-1-npiggin@gmail.com> References: <20220420065013.222816-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v2 21/39] 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 ba17c613..c3447c35 100644 --- a/README.md +++ b/README.md @@ -534,7 +534,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 3028d418..23971c25 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; }