From patchwork Mon Mar 14 04:17:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1604902 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=hy81rd2D; 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 4KH3Dn64stz9sG2 for ; Mon, 14 Mar 2022 15:18:17 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KH3Dn5Dhdz30F2 for ; Mon, 14 Mar 2022 15:18:17 +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=hy81rd2D; 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::435; helo=mail-pf1-x435.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=hy81rd2D; dkim-atps=neutral Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) (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 4KH3Dj5R3Cz30QX for ; Mon, 14 Mar 2022 15:18:13 +1100 (AEDT) Received: by mail-pf1-x435.google.com with SMTP id f8so13183437pfj.5 for ; Sun, 13 Mar 2022 21:18:13 -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=lp/Zcr58RdWXt+Ld6xTn+Irdopmzre244W6Ci3SBK7g=; b=hy81rd2DJV2idrd3TQ+lME7/au17hqWBszPk/dMxqcYuuuESnvyMuER/Hvo7CoVTRO MDp/F5D06NHfNiioIYyIz11xQrf+pWwQJhWQVMoeGxGA72g5lHPjiFvNADOGHt6azu9t tkG+jgn/Cy1ozL9+QZTPvwrmxD+EinulWp5EHMKokGEo64T42M0906+7cC60pg7bbHl2 DnBEiWCMHiAwh0gxypDsf2kSw4iBKhHQ7oc2DBJlgQYwPAHYANDy9yoZiWETuIdhf41w krnJgDTXeke6UmznMrrB0cirnFVupSAm3Fs3zMNNSiSebKl3Ci15MuheSKvGNNZ6Fis5 rUcw== 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=lp/Zcr58RdWXt+Ld6xTn+Irdopmzre244W6Ci3SBK7g=; b=Q67/wnuDB+PeFF8bVKj2yEj/Ujm9C/gCqU5OI2PPug7xGecxHNdWoW96L0STB3R9RH lGv7asKhawMfJwJnG24EGq0Cf8nYFr2r0Z25+OUWPEBO832f/rI/h3ew7nODBpZWApnL o9PANQFDsq6kXifI450KNUqWoHIMjxDazwSKd+aYHuFSa2Dgcw2+ror9wcZEADXtqxh0 qEAZRvrDtA6+PmBDYbe/tbD3PpPVp50uabTJixIJg8rMvibcdDkuU9jgVHU9IfDTJI0U ZS9N3rT7k7R9bNFPl06MEoa1ca8mR6UGl26hScapK5QjdY8DSOZBBOXswbdfK94O3sUc FuhQ== X-Gm-Message-State: AOAM531K4sc5GB4jX4myrnDfhAs5y+W6vATyZ8lC4xMV+t4l2V739ksk VGdS1XRN144AIY9OoL+8bWNL66eiVzQ= X-Google-Smtp-Source: ABdhPJwpAaZUwxisNVzX0mQiZkxqrVf20ryPBGPkWVaSHQZJu4mvtLs+eZuKVw/l5ygmQc/e6EQ5tw== X-Received: by 2002:a65:6a4a:0:b0:380:fd52:1677 with SMTP id o10-20020a656a4a000000b00380fd521677mr14789247pgu.597.1647231491639; Sun, 13 Mar 2022 21:18:11 -0700 (PDT) Received: from bobo.ibm.com (110-175-148-108.static.tpgi.com.au. [110.175.148.108]) by smtp.gmail.com with ESMTPSA id d16-20020a056a00245000b004f771b48736sm14283018pfj.194.2022.03.13.21.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Mar 2022 21:18:11 -0700 (PDT) From: Nicholas Piggin To: pdbg@lists.ozlabs.org Date: Mon, 14 Mar 2022 14:17:35 +1000 Message-Id: <20220314041735.542867-16-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220314041735.542867-1-npiggin@gmail.com> References: <20220314041735.542867-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 14/14] 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" Signed-off-by: Nicholas Piggin Reviewed-by: Joel Stanley --- src/pdbgproxy.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c index e8aab70..b44aea4 100644 --- a/src/pdbgproxy.c +++ b/src/pdbgproxy.c @@ -104,6 +104,8 @@ static void detach(uint64_t *stack, void *priv) } #define POWER8_HID_ENABLE_ATTN PPC_BIT(31) +#define POWER10_HID_ENABLE_ATTN PPC_BIT(3) +#define POWER10_HID_FLUSH_ICACHE PPC_BIT(2) static int set_attn(bool enable) { @@ -122,6 +124,17 @@ static int set_attn(bool enable) return 0; hid &= ~POWER8_HID_ENABLE_ATTN; } + } 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; } @@ -572,9 +585,12 @@ static int gdbserver(uint16_t port) } // - // Temporary until I can get this working a bit smoother on p9 - if (!pdbg_target_compatible(thread, "ibm,power8-thread")) { - PR_ERROR("GDBSERVER is only available on POWER8\n"); + // POWER9 appears to have problems with PSI interrupts when hitting + // an attn intstruction. Could just disallow breakpoints on P9. + // + if (!pdbg_target_compatible(thread, "ibm,power8-thread") && + !pdbg_target_compatible(thread, "ibm,power10-thread")) { + PR_ERROR("GDBSERVER is only available on POWER8 and POWER10\n"); return -1; }