From patchwork Wed Apr 20 06:49:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1619335 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=Rz4FAa3p; 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 4Kjrsj5zk2z9sG0 for ; Wed, 20 Apr 2022 16:50:49 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Kjrsj55bTz2ym7 for ; Wed, 20 Apr 2022 16:50:49 +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=Rz4FAa3p; 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::436; helo=mail-pf1-x436.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=Rz4FAa3p; dkim-atps=neutral Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) (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 4Kjrsf6pvPz2ynx for ; Wed, 20 Apr 2022 16:50:46 +1000 (AEST) Received: by mail-pf1-x436.google.com with SMTP id y14so320546pfe.10 for ; Tue, 19 Apr 2022 23:50:46 -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=1x+QwRJZmb52R77u0JQAQrAhy5KGg6rYdb6MYPPphnE=; b=Rz4FAa3pElf+FaUXT0/bgUXhd3RfCYAd/iJBgWbbQAJlAV/Z+anEYk4i6QcPmNcuNI /Txl3utdYCtbVLw103xqDEc2M/PdfLaqj0PODCKkA2UXQiWi3T9ZfFBMozsSh/vwgz0X ibhiB9pVazDo1m9uj0fXpCANhszpuEeZH2t7hyY9MkU481nteFHc+B4YuQHRfpHGdOQd 0aOnl8ry2bkDWHRjkR80dc5qqDRujbs+B7ZWfh+HWIEG7XuJmtIdC6qJwcCW/8+BhaJh e1DVncaPIhfSK7DPhRM+Cy6mpWTrFUuU4b95qa4CTvw1pb4KfcRRCZmQOc4enukaupeX VUmQ== 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=1x+QwRJZmb52R77u0JQAQrAhy5KGg6rYdb6MYPPphnE=; b=fsNGRyB/9ykRCRcDqakhgR9J1gxmiHLR4vT1BM/qiXbOEzg1PWU6t/PIIUbsMtvnq0 q3IOdXaIzMGbnrOA3408cwKuwvqvBGMjZhsrNf75d3En+R5tOP5+9Chh0XtvXkXqDcdD XiWUgZwYQckZEFY5iGsrEU/PerzSqiHYd41xkqK3QSOKa9WgnuvqRrs9go5mcGXYEvEl 1QJAzXqPzZiNfW+ZJRXeAXQV0oWMw16njzqs2EyV7NYRmGuOoihtXVYJMfUaoWYrQODN RO5FQfsIp4My/UfPxxh0mi/NC77tkkIzU2hKgPU+uThZRHpStQkdwhgwkcZIssAaELsP jUHA== X-Gm-Message-State: AOAM532IC+jm3VgrrEhVJp70iv5I0tJosMUm2LHI6dCOgW7nYU/XSsuk gyzRVDkBXvgaEXvVuwKHpi/JhZQ4GEDqhw== X-Google-Smtp-Source: ABdhPJwtGGvXErOEUHau0lIPMRuc4/+jwK/nYPv8YsixL4DxP7Z/fsXFMgEehQkD/5uanJPKBnmyOg== X-Received: by 2002:a63:4412:0:b0:3a9:e7e1:81a6 with SMTP id r18-20020a634412000000b003a9e7e181a6mr13123978pga.532.1650437444751; Tue, 19 Apr 2022 23:50:44 -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.50.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Apr 2022 23:50:44 -0700 (PDT) From: Nicholas Piggin To: pdbg@lists.ozlabs.org Date: Wed, 20 Apr 2022 16:49:43 +1000 Message-Id: <20220420065013.222816-10-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 09/39] gdbserver: use standard compatibility test calls 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" p10.dts.m4 defines compatible = "ibm,power-thread", "ibm,power10-thread" which fails to match on a basic strcmp. Use pdbg_target_compatible() for matching threads. Also document another case in hwunit.c that is using strcmp (seems to be the only other place in the tree that does). Signed-off-by: Nicholas Piggin Reviewed-by: Joel Stanley --- libpdbg/hwunit.c | 1 + src/pdbgproxy.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libpdbg/hwunit.c b/libpdbg/hwunit.c index 074ddef5..f64ec440 100644 --- a/libpdbg/hwunit.c +++ b/libpdbg/hwunit.c @@ -44,6 +44,7 @@ static const struct hw_unit_info *find_driver(enum pdbg_backend backend, p = g_hw_unit[backend][i]; target = p->hw_unit; + // XXX: should this be using pdbg_target_compatible? if (!strcmp(target->compatible, compat)) return p; } diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c index 5a8b5f99..906ed2f6 100644 --- a/src/pdbgproxy.c +++ b/src/pdbgproxy.c @@ -532,8 +532,8 @@ static int gdbserver(uint16_t port) // // Temporary until I can get this working a bit smoother on p9 - if (strcmp(thread->compatible, "ibm,power8-thread")) { - PR_ERROR("GDBSERVER is only tested on POWER8\n"); + if (!pdbg_target_compatible(thread, "ibm,power8-thread")) { + PR_ERROR("GDBSERVER is only available on POWER8\n"); return -1; }