From patchwork Tue Jun 18 16:00:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 805284 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp276676wrx; Tue, 18 Jun 2024 09:12:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWCgWVxqL+yO2waxr1iCHiy/oclFSiRQ5Rsdw6h1Fxnz5guEtJdgtdn9FiBHZ08KZ18oa0gles4BIfPnTugYS8l X-Google-Smtp-Source: AGHT+IE4mjGFkFy+D2f49EV83aLd6VBGXttiCze80VzC4R8J7zqYtMPZe35ltYf6ExFu/iEASDuy X-Received: by 2002:a05:6359:5fa0:b0:1a1:d75e:9bd2 with SMTP id e5c5f4694b2df-1a1fd60c050mr24977555d.30.1718727154040; Tue, 18 Jun 2024 09:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718727154; cv=none; d=google.com; s=arc-20160816; b=untFmMsusIhnYqjyzz8wRUtDxLZ8SeRAzqXe7vpTtB2iV7erMmv5XaYXOkNuuvuAfH LnzaHvNVdBDkMZjene8kvUqGrewJtG3NldwvdnjVN0VvnDqjnM2RbeTmIqZ2mzoQEGSK tb9Rk9grRMXNBPOxYba+WFgLPAWtp8eThFloiPQS3JUOoW0iDgP7S6xt7GJDqsxIK+SR d5/7FxbQ39sUhlDUWziExOLISJp/ey2AgZamQuCMzWp3Buf25m9Q/cjQc/pKFUHEzTpz lrMrDvtjv9jF+W2DS0/daOAIx7JiYnEv9LWllm8xTZGlcfKMWzusn0Wm6QwqdcQ8W23z VQeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H4fKIHkIifq0nx9RAUE9jEIghQddp4LMxW3UC4IhhV4=; fh=Q+oQ03yQfuoTTxzUPDLJKoTd4xZYvGHM4rKHQJt4bQ4=; b=Rea/SJKcjYPdf1MuhaqTQ3Qs3qmi1IBpY6RJ4HMztjOdukgHXa7guCyt4K4N3x40Yb 8ST4dR35PUez5EVcQxVOCzwvovIau0zFaFHBJzjsSC3+mJtjBUqRbLDK98S2+kVHV0H2 tfFrGI2c44/MG+Yo4J5+1MHJFdQUbiSuAC0o14AmHUsrar3tnPjiHRO15lTeY3r9OD9V olrLaC474S3kdz1pvZBurNZSDYF2K0nDt1ZAgXxWN/TUgHOl9VJPwSPD9+vS39Bc++pl N3bSQIAuxfaJ2kW4w3z/sUOxoyQKf8138Kn5g3oOqQ8pei/PNy5JyRHKf7geDXOKTUv7 dTiQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ff53kd3V; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-798abd23418si1365820185a.479.2024.06.18.09.12.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2024 09:12:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ff53kd3V; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJbKN-00056h-UR; Tue, 18 Jun 2024 12:04:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJbKK-00054q-Cb for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:04:56 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJbKI-0007Kq-2n for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:04:56 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-57cbc2a2496so6076846a12.0 for ; Tue, 18 Jun 2024 09:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718726692; x=1719331492; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H4fKIHkIifq0nx9RAUE9jEIghQddp4LMxW3UC4IhhV4=; b=ff53kd3VH4CYl+x9AeDrZ21UhUghvLQ0LcA674onynN1+EqxXlaNL1HbXOVEJG64dd MRV/cboPvytytucICf4vP4MEJEIFnwyqZkUIPuEEIwKrQhsNNXXl7zxneDC+TpWtCx6a bp8jqltkSGLn+WJb8YhbxhSNyVfd8kcJxXGv6Ar5Bb+4GA7sHzF7+njRB2OjIIJcArNI cGYub8Vkjpp/jNSwHORKdpC65Vo5EDvOHtEmrRUnpZmRStlmCfdWId751c4JlRTPXt2d BKvF6znuIsF74PQFo6Sl649yPAPv2oQimAObVchdSWCz+KRUZ7p3Y3gw0G8AFJwLf8/c Z5JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718726692; x=1719331492; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H4fKIHkIifq0nx9RAUE9jEIghQddp4LMxW3UC4IhhV4=; b=kCSttbJo73sEn8scogVqK1CwjHYzn1DDnW4A4RBmVgcRyytnu+wc1pn3UAvNFJfL04 ovF2GU0DhyENK1tiil8R0LtUtUKjz4p6YFRPVtdm+wjCzq/JFOj83NXtM0pEmq/98+rT vr2pCaZiemqZaAhcr8Nkv5ruIA0P8gj3MqV8+ZqEU2Sc6RCRZONCfgP7qQbaV9U79uvZ 4UO6TNaNWEfVacqkKOmB/ZYFYu5DYX4qunYkaWmKZhyXZ8DA0D8yw/CwBZld8BTzTOCi 4IEc86Gh6geb/7RP3Z28j9Y4V7VPjCJbqRqVFvqu3jyp2SsUF4vsRZFjU17MAkEIFCYT cAvw== X-Gm-Message-State: AOJu0YyhaB12jyxoWKmRX3EIYTl5s+kTl//El5N6YvIdpx3lLJ31I/oS YmKRTA1McBshA4UVN/BVDPXyuiMpGOPFPgMwx56U7HefbKhlNW3QZPtU6nBZ6C3L2DbNK8w7e2F X X-Received: by 2002:a50:d59b:0:b0:57c:738c:2c84 with SMTP id 4fb4d7f45d1cf-57cbd66a4e3mr10532877a12.10.1718726692396; Tue, 18 Jun 2024 09:04:52 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.55]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb741e5aesm7826977a12.60.2024.06.18.09.04.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Jun 2024 09:04:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , =?utf-8?q?C=C3=A9dric?= =?utf-8?q?_Le_Goater?= , Harsh Prateek Bora Subject: [PULL 43/76] hw/ppc: Avoid using Monitor in xive2_end_queue_pic_print_info() Date: Tue, 18 Jun 2024 18:00:05 +0200 Message-ID: <20240618160039.36108-44-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240618160039.36108-1-philmd@linaro.org> References: <20240618160039.36108-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=philmd@linaro.org; helo=mail-ed1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Replace Monitor API by HumanReadableText one. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Cédric Le Goater Reviewed-by: Harsh Prateek Bora Message-Id: <20240610062105.49848-20-philmd@linaro.org> --- include/hw/ppc/xive2_regs.h | 2 +- hw/intc/xive2.c | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/hw/ppc/xive2_regs.h b/include/hw/ppc/xive2_regs.h index 37f572ed6d..4d32703c26 100644 --- a/include/hw/ppc/xive2_regs.h +++ b/include/hw/ppc/xive2_regs.h @@ -132,7 +132,7 @@ static inline uint64_t xive2_end_qaddr(Xive2End *end) void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon); void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, - Monitor *mon); + GString *buf); void xive2_end_eas_pic_print_info(Xive2End *end, uint32_t end_idx, GString *buf); diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index 23356acff7..6a15b4d1e4 100644 --- a/hw/intc/xive2.c +++ b/hw/intc/xive2.c @@ -11,6 +11,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h" @@ -40,8 +41,7 @@ void xive2_eas_pic_print_info(Xive2Eas *eas, uint32_t lisn, GString *buf) (uint32_t) xive_get_field64(EAS2_END_DATA, eas->w)); } -void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, - Monitor *mon) +void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, GString *buf) { uint64_t qaddr_base = xive2_end_qaddr(end); uint32_t qsize = xive_get_field32(END2_W3_QSIZE, end->w3); @@ -52,7 +52,7 @@ void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, /* * print out the [ (qindex - (width - 1)) .. (qindex + 1)] window */ - monitor_printf(mon, " [ "); + g_string_append_printf(buf, " [ "); qindex = (qindex - (width - 1)) & (qentries - 1); for (i = 0; i < width; i++) { uint64_t qaddr = qaddr_base + (qindex << 2); @@ -64,11 +64,11 @@ void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, HWADDR_PRIx "\n", qaddr); return; } - monitor_printf(mon, "%s%08x ", i == width - 1 ? "^" : "", - be32_to_cpu(qdata)); + g_string_append_printf(buf, "%s%08x ", i == width - 1 ? "^" : "", + be32_to_cpu(qdata)); qindex = (qindex + 1) & (qentries - 1); } - monitor_printf(mon, "]"); + g_string_append_printf(buf, "]"); } void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon) @@ -108,9 +108,14 @@ void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon) priority, nvp_blk, nvp_idx); if (qaddr_base) { + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; + monitor_printf(mon, " eq:@%08"PRIx64"% 6d/%5d ^%d", qaddr_base, qindex, qentries, qgen); - xive2_end_queue_pic_print_info(end, 6, mon); + xive2_end_queue_pic_print_info(end, 6, buf); + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } monitor_printf(mon, "\n"); }