From patchwork Tue Jun 18 16:00:02 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: 805229 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp273572wrx; Tue, 18 Jun 2024 09:07:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVYqbpyNQEb75v7LvyNBSQdyhULBUDsePqoxcN3DaJyX2nHBxJCZUgVNETt8sLxRLxM0NZQqcEMWAgNe4hDfG6E X-Google-Smtp-Source: AGHT+IE19hFRuxOp62sS4GGNzB9M++/X+PW7PFdgli14JN/r45OmEv/pPMx309K0blM0AD98vA0r X-Received: by 2002:a05:6808:648b:b0:3d2:15a5:99ff with SMTP id 5614622812f47-3d51b9e6506mr282152b6e.32.1718726835073; Tue, 18 Jun 2024 09:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718726835; cv=none; d=google.com; s=arc-20160816; b=s7JkrRLBI8xpbSQez09qGCmeAdryj6gm+M3C9USWqb4FSMlorUB2EWOGj69+7MW+C+ 74ZNEhn0Rl8YfAG3YaHuTwYIPjD9TKaCXqA8EmHq2JC5JfqgJ3v2r6sJ/cXaAUf8YxxJ j7bmQ1etPKnNMqSTURolMX4cSwoj+7ixwq1tZGp4/XuFd1MyU+ymUcjpeRojV83V90cx zh65PdOkc/3AHxkeFTKY9SioqTC/1eyjhFEsPraRVE/WZHEZirbW2aCARJeqJLivBkxU c8c3f3l3610kPIlaCFFM4SGl7zA+8E4YSjWJQ4Iegh1TO3L93c1FMAcrS7WEe8BW+24D pcBA== 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=qVtSo8VEN7VL+g7C38Zor1BdlGunwOz0xsqYxtmzihw=; fh=Q+oQ03yQfuoTTxzUPDLJKoTd4xZYvGHM4rKHQJt4bQ4=; b=R7HyX4EM6NagHiu3shjk6H9ON7hwJVIWv4MPcBZXy2kcC4pf4xRRgz5fcCEk2YzgBL Db6saiKXkyeJiO2k4aUBSfpZ7EuqFPIRrf/0IVv/A7CS70TZYXvKNd2PNLV/+hLIIXN/ PUObML9cpMzpo/CgyvoSlS45UjgbyOJXFIyiyC3gFEnRBHO9e8wXCyppWnxlYFzjph6W qT9qVHbFlLdjXsB4zbK6qrpc7GW01Ro2f0EKcTDHN9vm223mWRkoOUgUggG6HSjD6RQj hFcFcrvS8lspn26aVyX/Cu5F2TtHJNevmCDeN7P0lEvXdaWnyaUhRJVtuvhQmPWDrVMT b7ew==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hE+/VqK8"; 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 71dfb90a1353d-4ed3f1f802dsi1811046e0c.63.2024.06.18.09.07.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2024 09:07:15 -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="hE+/VqK8"; 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 1sJbKG-0004x9-29; Tue, 18 Jun 2024 12:04: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 1sJbK3-0004qc-VS for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:04:42 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJbK2-0007HR-3f for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:04:39 -0400 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-57c75464e77so6953614a12.0 for ; Tue, 18 Jun 2024 09:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718726676; x=1719331476; 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=qVtSo8VEN7VL+g7C38Zor1BdlGunwOz0xsqYxtmzihw=; b=hE+/VqK81K73qBgO7Y2KJqfW017ORMRdnibDWIyKo3N1qxuHY8BHLtV/UKv4H6ynXx WO5/Ctjbec364HyEpthragOkwrB3g1OULUkRKfh4tBiurfj+h0aOiejNpof1XQOmaUgF Bssysx9DuIZ7dBTwrYgYkrQpOzoWfO8BzhEfB0zl0wfDpC1+hut4Q+pL0GNB441SJkve SfhuTBEoqKILleF6c9myVdoInRiB08VOsHGxQp1H/lttoEEtLfCFqX+jb4CknnUdJQKM aQ6PqfjmfBThLRYnEvcsiDPHoqwjFJdhfwg2YpUUPZ0rfj2B2MRdvH2GphUqHZu5Ga0K J2dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718726676; x=1719331476; 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=qVtSo8VEN7VL+g7C38Zor1BdlGunwOz0xsqYxtmzihw=; b=fGsAcQ/kUqPoRCt9QkBTZKFkEy5iWUcxK5a2aJjhIgPxMvIUokVcSiBlwQ/jq62C9l NYD7MECjTgxgdNk9N3s1dgbGlvhK4Z9SRs8txUo9kZ+uYd0rrdPuLCu7Hsikiy/WASjR TN/mPMfQ0jZTIg/sEWKUmh1NwtPLVbzmOxNH2I6BIbmUC5w8Q5XU/4poGtHlNhWIDwpK sVixEPMH7/+nCWIk3kmpdeiNpge+EuraTo0LKShLhYDXNYs089XG/KtiaT0Y9h6LORfz fDP0zTF/q9I+TlHG1GI8qzzTaNJs1ioqX0iTtsMUMHW68o5E+hfXuYm6myGZVcbK0r06 fbjQ== X-Gm-Message-State: AOJu0YzL9IG8k80GEfvR5s6gqPuw+oZx3Y/qlMhHbjmVlnhha7wI5s9p oga2fXfx/vNy5Gd+9fFi6oQJ/qHPvHd5dyn4KI7cds2rVa4ihBQzwH+2ecUDRJv9n84DKjxd4Fd 1 X-Received: by 2002:a17:906:48d:b0:a6f:5fa8:1b7 with SMTP id a640c23a62f3a-a6f60cf333amr861278666b.15.1718726675685; Tue, 18 Jun 2024 09:04:35 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.55]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f9bbc2136sm62937066b.123.2024.06.18.09.04.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Jun 2024 09:04:35 -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 40/76] hw/ppc: Avoid using Monitor in pnv_psi_pic_print_info() Date: Tue, 18 Jun 2024 18:00:02 +0200 Message-ID: <20240618160039.36108-41-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::536; envelope-from=philmd@linaro.org; helo=mail-ed1-x536.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-17-philmd@linaro.org> --- include/hw/ppc/pnv_psi.h | 2 +- hw/ppc/pnv.c | 10 +++++++--- hw/ppc/pnv_psi.c | 9 +-------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/include/hw/ppc/pnv_psi.h b/include/hw/ppc/pnv_psi.h index 2a6f715350..cf7f95a6b1 100644 --- a/include/hw/ppc/pnv_psi.h +++ b/include/hw/ppc/pnv_psi.h @@ -110,6 +110,6 @@ typedef enum PnvPsiIrq { #define PSIHB9_IRQ_PSU 13 #define PSIHB9_NUM_IRQS 14 -void pnv_psi_pic_print_info(Pnv9Psi *psi, Monitor *mon); +void pnv_psi_pic_print_info(Pnv9Psi *psi, GString *buf); #endif /* PPC_PNV_PSI_H */ diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 7e6f923c7e..4a1a302a25 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -812,12 +812,11 @@ static void pnv_chip_power9_pic_print_info(PnvChip *chip, Monitor *mon) g_autoptr(HumanReadableText) info = NULL; pnv_xive_pic_print_info(&chip9->xive, buf); + pnv_psi_pic_print_info(&chip9->psi, buf); info = human_readable_text_from_str(buf); monitor_puts(mon, info->human_readable_text); - pnv_psi_pic_print_info(&chip9->psi, mon); - object_child_foreach_recursive(OBJECT(chip), pnv_chip_power9_pic_print_info_child, mon); } @@ -862,9 +861,14 @@ static void pnv_ipmi_bt_init(ISABus *bus, IPMIBmc *bmc, uint32_t irq) static void pnv_chip_power10_pic_print_info(PnvChip *chip, Monitor *mon) { Pnv10Chip *chip10 = PNV10_CHIP(chip); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; pnv_xive2_pic_print_info(&chip10->xive, mon); - pnv_psi_pic_print_info(&chip10->psi, mon); + + pnv_psi_pic_print_info(&chip10->psi, buf); + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); object_child_foreach_recursive(OBJECT(chip), pnv_chip_power9_pic_print_info_child, mon); diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c index 922ac07b2f..18cc76a7e4 100644 --- a/hw/ppc/pnv_psi.c +++ b/hw/ppc/pnv_psi.c @@ -25,8 +25,6 @@ #include "qemu/module.h" #include "sysemu/reset.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" -#include "monitor/monitor.h" #include "hw/ppc/fdt.h" @@ -978,11 +976,9 @@ static void pnv_psi_register_types(void) type_init(pnv_psi_register_types); -void pnv_psi_pic_print_info(Pnv9Psi *psi9, Monitor *mon) +void pnv_psi_pic_print_info(Pnv9Psi *psi9, GString *buf) { PnvPsi *psi = PNV_PSI(psi9); - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; uint32_t offset = (psi->regs[PSIHB_REG(PSIHB9_IVT_OFFSET)] >> PSIHB9_IVT_OFF_SHIFT); @@ -990,7 +986,4 @@ void pnv_psi_pic_print_info(Pnv9Psi *psi9, Monitor *mon) g_string_append_printf(buf, "PSIHB Source %08x .. %08x\n", offset, offset + psi9->source.nr_irqs - 1); xive_source_pic_print_info(&psi9->source, offset, buf); - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); }