From patchwork Mon Jun 10 06:20:53 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: 802998 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1800160wro; Sun, 9 Jun 2024 23:25:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW1TNMQ2Z4mCzmtYrhqqm2uOJg+QTdB/hJujRD59GYM3vAIVpnlckxvatA3fNx4saYwwSULGoRpUNGeTuE6ZVBW X-Google-Smtp-Source: AGHT+IF8j9ewVJVtGfRKCJPB52bgbZ7IYZ+ETzdpKzJ5AB0rZz/jqsxCEgWvVIWQPRzl82ASFj+7 X-Received: by 2002:a0d:fc42:0:b0:618:859e:3eeb with SMTP id 00721157ae682-62cd5653165mr75867327b3.32.1718000745466; Sun, 09 Jun 2024 23:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000745; cv=none; d=google.com; s=arc-20160816; b=AKo8bQsG10L/CoURqzHK3qVNcm0B5qQyxFCscJD6dR6BwtBX1M3JzGTXi2iWWzaout CdY0sIsOrsdTx8faAQiUBaVLlD3GCzcMn+rSOp/WLPY5GZmnOlKzpH+0VHbykNTp9b8J UZgPTDzuS+ydeRlVBEdgbjQYlW6gxt21ac4LYzOPlouWUpWpbSQWC+7qGizdmLXSFVWN poCDt8YDHTOhSbDbuIe9c71ae5WJOThLWpbXNIoVCJWmGOVlK6r2mCq2kUrLh+k7jLLV 8DYe/ll9Q4eJoOJDPEWYLPwWkWXS6CzQVAXRyl4KidpSoPXVDz+aDbh0OgqMHs8PCz/4 iayQ== 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=Y42ro60ATUXrF8F/0Mk1uGOj6R38Ep469XOeFB/EH6M=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=NmB7ebtW7wadB+2c0RB2Jk0sQrBT2Lb3aj0ZEFESYyYOsmTa9aCr48zSrC3nEQxac4 Cfp2rbixKmJ5YbM5UbzrdLhjA7AJB6CUutqKQ5kY/0pPdYdcGENTd4vz+rK91XwKUq9K 95griePUNMTo3Mx21E5RbZCyghwaImPpf9e7BaJVdpOnH0r/scInORuY5d/WGiAv1pqG HqzknwR5zDUtzDvAW97IQ2bTtoFp8yZ1rXXHQ6hEA5n6pC61cPT3yNLqo7S7Y9OCsmtS Q8adoc8N+7nT/TLIICRJtf+1dUGqjK80G9ENQlgGyBwc6TmpxbVSXnHBZM/nKRUPlO06 Qmng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ya5bGNoA; 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 6a1803df08f44-6b04f9ae113si99309456d6.361.2024.06.09.23.25.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:25:45 -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=ya5bGNoA; 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 1sGYQd-0004rP-GH; Mon, 10 Jun 2024 02:22:51 -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 1sGYQQ-0004HJ-7O for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:38 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQN-0004aL-HW for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:37 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-42179dafd6bso9445665e9.0 for ; Sun, 09 Jun 2024 23:22:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000553; x=1718605353; 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=Y42ro60ATUXrF8F/0Mk1uGOj6R38Ep469XOeFB/EH6M=; b=ya5bGNoAPLBrJCpiuG5mIYSTh2vme96IFkxP/lJsDBWB/vzA7f4FmK8TPQmV83vaGJ UAnHwU988K7CM6J1RRmrulse26hh+hhjBiWaSs/H+tWv5nRuKoX21MKMOhQ1yv7Wk+Kd CgrBX71EkbmQoeE7zhzwsIERwp3iIM+UwmYU/kG5VPTFoFAeNBga+Op4YSrbzLyIxR/I GDhv7snlWSC9TqhZya5pn9UyFn/PnRZCixAFYCt3j3goaF0xoTo26lm18N7YOvymMN/J WY7WmBZHt/ENd23mNYKXK7NlwrB2V2KE+TuwJYCX6+StEafyTXYgEoKzs1ol+Uu6mfwZ sbqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000553; x=1718605353; 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=Y42ro60ATUXrF8F/0Mk1uGOj6R38Ep469XOeFB/EH6M=; b=RR1+uBIwPlG1Ul1QOftQ3wsIfMSzYHWVNklnLSbbl3FKvo7HTsAo3C33V3xaT6/0Oq E/ZgWmv+8Ad9vhPFwqTCWgx51p+w1ooa7Wgf4+1npZvHod9JmZPyFCxcFaoiVRLVp5i3 2mQbSR30mX3ujrzgkCpXDYnz72z6/o8vFwjrKl7oCikJ0gnvWqNq/BfDzvcb9BbPlVll cq4/PLBXQ2lB8vo8dhOaJUp3gcHWEJjsCu7WRHtFoecItti1urwzdLj2Re33WRgp1OBb KVY4GbMBoFlpkSrxNDjghL1+aKYacMjkCNoNhWPutpaqH8piNJitV2u7DZheI7c23+sm 9L6w== X-Gm-Message-State: AOJu0YwK+5c6pJ2swlm+j3DqDjdcmJJYeRlNUMSLIFZpy4JUOb3u1ZHA 56sF7PepThmY+nhnskG9S7zTqsQ3gpjaxMIK4h91pxp/TPy08ovHjaUVqI25iz/QVKUkCiPW20B E X-Received: by 2002:a05:600c:198a:b0:421:81b1:7f45 with SMTP id 5b1f17b1804b1-42181b17f87mr30836005e9.12.1718000553471; Sun, 09 Jun 2024 23:22:33 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215c19e572sm130900745e9.10.2024.06.09.23.22.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:33 -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 15/26] hw/ppc: Avoid using Monitor in pnv_xive_pic_print_info() Date: Mon, 10 Jun 2024 08:20:53 +0200 Message-ID: <20240610062105.49848-16-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::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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é --- include/hw/ppc/pnv_xive.h | 2 +- hw/intc/pnv_xive.c | 9 +-------- hw/ppc/pnv.c | 8 +++++++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/hw/ppc/pnv_xive.h b/include/hw/ppc/pnv_xive.h index 9c48430ee4..7d634e469c 100644 --- a/include/hw/ppc/pnv_xive.h +++ b/include/hw/ppc/pnv_xive.h @@ -93,7 +93,7 @@ struct PnvXiveClass { DeviceRealize parent_realize; }; -void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon); +void pnv_xive_pic_print_info(PnvXive *xive, GString *buf); /* * XIVE2 interrupt controller (POWER10) diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index 3ad4ac8e7d..5bacbce6a4 100644 --- a/hw/intc/pnv_xive.c +++ b/hw/intc/pnv_xive.c @@ -11,12 +11,10 @@ #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" #include "sysemu/reset.h" -#include "monitor/monitor.h" #include "hw/ppc/fdt.h" #include "hw/ppc/pnv.h" #include "hw/ppc/pnv_chip.h" @@ -1846,7 +1844,7 @@ static void xive_nvt_pic_print_info(XiveNVT *nvt, uint32_t nvt_idx, xive_get_field32(NVT_W4_IPB, nvt->w4)); } -void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) +void pnv_xive_pic_print_info(PnvXive *xive, GString *buf) { XiveRouter *xrtr = XIVE_ROUTER(xive); uint8_t blk = pnv_xive_block_id(xive); @@ -1858,8 +1856,6 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) XiveNVT nvt; int i; uint64_t xive_nvt_per_subpage; - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; g_string_append_printf(buf, "XIVE[%x] #%d Source %08x .. %08x\n", chip_id, blk, srcno0, srcno0 + nr_ipis - 1); @@ -1897,9 +1893,6 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) xive_nvt_pic_print_info(&nvt, i++, buf); } } - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } static void pnv_xive_reset(void *dev) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index df187c5180..7e6f923c7e 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -808,8 +808,14 @@ static int pnv_chip_power9_pic_print_info_child(Object *child, void *opaque) static void pnv_chip_power9_pic_print_info(PnvChip *chip, Monitor *mon) { Pnv9Chip *chip9 = PNV9_CHIP(chip); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; + + pnv_xive_pic_print_info(&chip9->xive, buf); + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); - pnv_xive_pic_print_info(&chip9->xive, mon); pnv_psi_pic_print_info(&chip9->psi, mon); object_child_foreach_recursive(OBJECT(chip),