From patchwork Mon Jun 10 06:20:55 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: 802997 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1800148wro; Sun, 9 Jun 2024 23:25:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWOkUb49Exm4M8Nt/WX8sW4gAjuQ1oFbB0x7SKUYDQRMOVnE2OlAlILkgj0u8iTB3ATialNJEYskwzB4gvCDK83 X-Google-Smtp-Source: AGHT+IGD3BgJMS4mvg2GIAfETRKi4xCFHtJAXD3AvDa8Bwv8YSYAaNPhDXxRGrWCJZklUEpcPGZy X-Received: by 2002:a05:6808:f8c:b0:3d2:1f72:d6b2 with SMTP id 5614622812f47-3d21f72db37mr5270230b6e.38.1718000741537; Sun, 09 Jun 2024 23:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000741; cv=none; d=google.com; s=arc-20160816; b=XSSQI/cmSWl85BD8MMpE873P7QbprdH/4YeXFBL/NvFeqRfHPz9e3k3R8Jake5RIT+ b3AaXTOqCL0JPXYuvFoTlh9pQsovM3t7jakoa9l8RcL89tD72RxFjGiN7xmjKETPnJr1 mFFSrAhZozuUcCF5eRjyx6JeaDQnvdCSb72sw+OV4FqBz+sxFm5JIAwn+TapB+FA15za xee/rVycxtMLX+13CbZZMeIQNZ1b/6uEc2qRdwI+ZWnpkYQ46LmfDutJWvDv0soYW06x crfWlh2F+GXaBjlbQ6qyLJkujO+16QbQ8X6ZwLmkLNkaN1zMJuhMBNDGUD3xQi2QxtBZ Z+ow== 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=bxe7HfN8JjME6wSReRSlFJ2qLete6tZ4Y332w2hrNvs=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=Fd1oSih1gtKa39wt9HKdCX+AO7gUhSumK2OaqGQYlKzQ7965PQSszUVOyeeeaVyFsL P3XI8V7PRQo86j3ACZwuh3HttiBunhADgRsOnW4/hJrs87vmBoaCecbiSWpKnhz9hluK mhS1UkjVymCKjHgyravaxuzlK7zid7dtckIlEAEsTZgpuWXnT8iTsJbFqBWOM9c1ziPS 9BJlkH/n+ZqXYLGikj9MlLmwfGeaTpvG32r329Kgs6tMZ6VNbleEvWC1rnQIoWxBr7Vg acrhEhjIpnNV59jKYWZENWt4IP9OhHxGvm472F93HWxArfjW5UK+PpaBpraDD4LJzXC8 LJGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w27ACW4w; 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-7954de508ebsi626731985a.685.2024.06.09.23.25.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:25:41 -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=w27ACW4w; 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 1sGYQe-00054P-Ej; Mon, 10 Jun 2024 02:22:52 -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 1sGYQa-0004iR-Rb for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:48 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQZ-0004dI-0Q for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:48 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-35f1c567ae4so992638f8f.1 for ; Sun, 09 Jun 2024 23:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000565; x=1718605365; 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=bxe7HfN8JjME6wSReRSlFJ2qLete6tZ4Y332w2hrNvs=; b=w27ACW4wOTkGroFwxSNxuYlFpqPVNBW5T15CNkVtvBi4DX5do9HL+MS2/6di7kkydk 7q5NCTqWtUcGZcp2qq1a/Kj1JCOSqtsxuSKqjFZukYoN84rg1RCOyRJ63X58w+UMCIGB D9ZncqZPq4n3x4uQdA3eJsqUahv4Agq9dMR6A9WurUhLodaVCY+gGusOWvc/2J1iBZlX ebuoFhVPiTJ6tOU53dWbGaxXZ773Dw3oUvajS3ET2jWkizw2a9HSZqO4GZ13N7XbRAbp BS0vfXEIF1v6HuBvLSYdYVJx2ueCi6wOR9XeqOgUR8F7pePOAMeCRhu2vTNc5vny8Zbz pYtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000565; x=1718605365; 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=bxe7HfN8JjME6wSReRSlFJ2qLete6tZ4Y332w2hrNvs=; b=HY0X4pKZI1/hyDvdrXSD7aA880zY4GjLzewRWJLvRJxwWcKocNMrXLi4ohsKo0UWX7 aK4ZF/v/GGvIHHfElDDqrjKxYgcug7E7oOxttaW49BMmQrK6IYivvgY2h9xs+VjfHHXa /C/g3ujfG2rtMhcRLMqgMhjm34/6kUJJ79an583eGwEYK3NylMQgkTA7PUk9KMDdJf2B nzErm0hbtOhZCuMja9wurKKJu59a7JDBfJeryucKTJPLdpxnkMjE1kNobGx05fiZBTGW 8y9PYjgpDEBhDB9wSpw0IUFLQLZFM3sBlkoSWfXRhxOQKBsnyOGOPmozw+nIWYp/sQGf lC9g== X-Gm-Message-State: AOJu0YzldFbQ1pisxuelic3tvAJzXdZizQgGeR1OcDWM4K7hEsdd+njE nvAgS1SRztbqtdDgu5Tg78vNTxYmE51qCTIgR/szPyn+dvGFflta3MzCY6IfNYNz66DPjn7P/es 3 X-Received: by 2002:a05:6000:1743:b0:356:491f:27ec with SMTP id ffacd0b85a97d-35efed51586mr5175689f8f.39.1718000564777; Sun, 09 Jun 2024 23:22:44 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f0ccc5f03sm6855921f8f.88.2024.06.09.23.22.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora , qemu-ppc@nongnu.org, Nicholas Piggin , =?utf-8?b?RnLDqWTDqXJpYyBCYXJyYXQ=?= , David Gibson , =?utf-8?q?Daniel_P_=2E_Berrang?= =?utf-8?q?=C3=A9?= , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 17/26] hw/ppc: Avoid using Monitor in xive2_eas_pic_print_info() Date: Mon, 10 Jun 2024 08:20:55 +0200 Message-ID: <20240610062105.49848-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240610062105.49848-1-philmd@linaro.org> References: <20240610062105.49848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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=unavailable 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é --- include/hw/ppc/xive2_regs.h | 2 +- hw/intc/pnv_xive2.c | 16 ++++++++-------- hw/intc/xive2.c | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/hw/ppc/xive2_regs.h b/include/hw/ppc/xive2_regs.h index 816f5d0e84..f662f0e325 100644 --- a/include/hw/ppc/xive2_regs.h +++ b/include/hw/ppc/xive2_regs.h @@ -48,7 +48,7 @@ typedef struct Xive2Eas { #define xive2_eas_is_valid(eas) (be64_to_cpu((eas)->w) & EAS2_VALID) #define xive2_eas_is_masked(eas) (be64_to_cpu((eas)->w) & EAS2_MASKED) -void xive2_eas_pic_print_info(Xive2Eas *eas, uint32_t lisn, Monitor *mon); +void xive2_eas_pic_print_info(Xive2Eas *eas, uint32_t lisn, GString *buf); /* * Event Notifification Descriptor (END) diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c index 83e0f6b09f..649e5001fd 100644 --- a/hw/intc/pnv_xive2.c +++ b/hw/intc/pnv_xive2.c @@ -2120,24 +2120,24 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon) g_autoptr(GString) buf = g_string_new(""); g_autoptr(HumanReadableText) info = NULL; - monitor_printf(mon, "XIVE[%x] Source %08x .. %08x\n", blk, srcno0, - srcno0 + nr_esbs - 1); + g_string_append_printf(buf, "XIVE[%x] Source %08x .. %08x\n", + blk, srcno0, srcno0 + nr_esbs - 1); xive_source_pic_print_info(&xive->ipi_source, srcno0, buf); - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); - - monitor_printf(mon, "XIVE[%x] EAT %08x .. %08x\n", blk, srcno0, - srcno0 + nr_esbs - 1); + g_string_append_printf(buf, "XIVE[%x] EAT %08x .. %08x\n", + blk, srcno0, srcno0 + nr_esbs - 1); for (i = 0; i < nr_esbs; i++) { if (xive2_router_get_eas(xrtr, blk, i, &eas)) { break; } if (!xive2_eas_is_masked(&eas)) { - xive2_eas_pic_print_info(&eas, i, mon); + xive2_eas_pic_print_info(&eas, i, buf); } } + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); + monitor_printf(mon, "XIVE[%x] #%d END Escalation EAT\n", chip_id, blk); i = 0; while (!xive2_router_get_end(xrtr, blk, i, &end)) { diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index 98c0d8ba44..0154ebb59c 100644 --- a/hw/intc/xive2.c +++ b/hw/intc/xive2.c @@ -27,17 +27,17 @@ uint32_t xive2_router_get_config(Xive2Router *xrtr) return xrc->get_config(xrtr); } -void xive2_eas_pic_print_info(Xive2Eas *eas, uint32_t lisn, Monitor *mon) +void xive2_eas_pic_print_info(Xive2Eas *eas, uint32_t lisn, GString *buf) { if (!xive2_eas_is_valid(eas)) { return; } - monitor_printf(mon, " %08x %s end:%02x/%04x data:%08x\n", - lisn, xive2_eas_is_masked(eas) ? "M" : " ", - (uint8_t) xive_get_field64(EAS2_END_BLOCK, eas->w), - (uint32_t) xive_get_field64(EAS2_END_INDEX, eas->w), - (uint32_t) xive_get_field64(EAS2_END_DATA, eas->w)); + g_string_append_printf(buf, " %08x %s end:%02x/%04x data:%08x\n", + lisn, xive2_eas_is_masked(eas) ? "M" : " ", + (uint8_t) xive_get_field64(EAS2_END_BLOCK, eas->w), + (uint32_t) xive_get_field64(EAS2_END_INDEX, eas->w), + (uint32_t) xive_get_field64(EAS2_END_DATA, eas->w)); } void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width,