From patchwork Mon Jun 10 06:21:01 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: 802991 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799881wro; Sun, 9 Jun 2024 23:24:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVO+cpE2dDq+uXBEc90DlwnPvfSCzEEsTk8CD1KjYYDL/29w/P1NJ4tHVrTiUULwSy1xSiEpx+RDyRjaErjWySy X-Google-Smtp-Source: AGHT+IHvjaV5u8sWAPmFCJbu60pw3zIv+GnRaHAAy3NurIJQQxFhXi5MOb0lA4dKQMq6QiGsOZc0 X-Received: by 2002:a05:620a:3902:b0:795:5b8b:7a03 with SMTP id af79cd13be357-7955b8bbb68mr712061085a.16.1718000668862; Sun, 09 Jun 2024 23:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000668; cv=none; d=google.com; s=arc-20160816; b=EJf/PUvwutvVicVTFu90IWMqUIrb9YeaJ4jtBza8h1n+9Mw6sDE81oK6la5pKu6EAR WHqjgs0DnolG01Mx893LKIDI7j1P1qlmUO0hT4LEn707vZU0GBJwn1KwrsyodWKWD8fN LxXFpiHafdJrhvzNSrYE3bfIGCFSnxRrjFV8Aenj8PX3P68lqgpR59/FhDKl9B0xCS6l gYGu6OdGeMkFRtXq+LVdG/OXyfL0y6IHetSDz63VacglUmYHYVnCbsw+WJBZ6LIpCZRQ Kn8RfiEP9PrJlWUpWvo2hnHqLWyJm2ny2ANZZmel1hxAzwIHapPmseWWATe2Id+ms+eO qMDg== 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=jTFNp75u/pYhIEl6kZFuCvdor3PDAS+uCnAKSx/B1Hc=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=BtehGcP9Z7eKqI3n7uX9i765DMqCD1p8UiGwRVU02xBTPd+BgNIbbVswVvYJGNgYor jPmOWZjqSv+hcFlR7xOe3nXtxB0Pkce5aZv220bJnQuEbHGadZrDVAx+6vdl5YsWNZ6J othVPq11RH8Ul+QTTe1LIKAWKVroPedLCZUZEr/ohA/nn5JhuiRoS0solEMbH6Tg0H8X E+cD0z4a/No8w7/z9KOpkLRH/fqdrvOOQK0tnNHan478TiecEpwsPuOSfX3Cef6cXoy/ SYa1fC5BEH9fg2j2WP1aSsXYbIkOr0JhM54j1sKVL8p6mICEJbXeva6JR2vP9hlJsssb qdPA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZPfDM5hR; 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-795332ebf76si1074203985a.410.2024.06.09.23.24.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:24:28 -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=ZPfDM5hR; 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 1sGYRA-0000bp-Hn; Mon, 10 Jun 2024 02:23:24 -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 1sGYR8-0000I7-Oe for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:22 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYR6-0004iX-EU for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:22 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-35f1a7386d5so1022377f8f.3 for ; Sun, 09 Jun 2024 23:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000598; x=1718605398; 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=jTFNp75u/pYhIEl6kZFuCvdor3PDAS+uCnAKSx/B1Hc=; b=ZPfDM5hRm2u+SIPJapOsFbLVybOqWeXxOzwqk5cz99toE7JeBAF1PQ7AWFFCH+X80B mr8/I6OgcUF0VilzkRaXj9QQsI4W1ou3NDc/hNU1n75ehGHNILlsLQjy+vWJuggZYa7+ L0tePqiEzkIaMOzX7owwm+MHVb+jbtM0sTutlC8WBIU77917gfVuYHH4wklJv1GHAYrR hmKFl8D7qRiOuHfQYhPvIy/53QMLmdYUq8FPmCgzU6irhxS3WqGfGVIR1jTpILJ50eTG HganRqWuMZgXqQbvE21tY1VMecZoRbDKiFHBtrwlbWBdu6huP10U+2ezjkSEvB/l0cnL CfkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000598; x=1718605398; 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=jTFNp75u/pYhIEl6kZFuCvdor3PDAS+uCnAKSx/B1Hc=; b=Xvu8TccQmZcskAPDAXKUdlT79Q1bejzXKPZ/4m9VIyTgknfcuvZQiqDyrn1/dA0Xay sUs7ap5X6ToqvK4LaAJ6KvKNpbiEVRDuMHk9cwsLOXmAaV3yixOf5dLVDPu9JGSBeCxz uzItVAOPq01yqPhJz98APICKJ/6sQl8y2MgJFdLQE3lh+I/JGVN1iCN2TKBb69PJfyaC IxtFi0ZccANbJBtFX5us02yjAPmdhEWFF+GWcF7K4vMRorPoe0ON4CyXvAgtRG3RMcIi n32uSJM1dBT9cb1+QpFxPkWCerDCPvm5bPALRuldp7CMP/3+SlJxRkOX/EOgq1/sFvnx d9Nw== X-Gm-Message-State: AOJu0Yy2lD7kHMAtgNp6pyQvmcDRvf8I1k4pnkqSB2xSEzn1zdW3c6a0 MHBdtJ1OEZcuCqTAzTMY8ou2Nx66Qk8KtPmPF+9LLzI5r0WmiRJfrD32KAXJ/vB2sIoyJ/lEGk8 o X-Received: by 2002:a05:6000:18a2:b0:35f:1bcd:8e53 with SMTP id ffacd0b85a97d-35f1bcd8ec6mr3241468f8f.55.1718000598595; Sun, 09 Jun 2024 23:23:18 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35ef5d2da31sm10071613f8f.14.2024.06.09.23.23.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:23:18 -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 23/26] hw/ppc: Avoid using Monitor in SpaprInterruptControllerClass::print_info() Date: Mon, 10 Jun 2024 08:21:01 +0200 Message-ID: <20240610062105.49848-24-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::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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/spapr_irq.h | 2 +- hw/intc/spapr_xive.c | 9 +-------- hw/intc/xics_spapr.c | 9 +-------- hw/ppc/spapr_irq.c | 8 +++++++- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h index 4fd2d5853d..6e50470cff 100644 --- a/include/hw/ppc/spapr_irq.h +++ b/include/hw/ppc/spapr_irq.h @@ -73,7 +73,7 @@ struct SpaprInterruptControllerClass { /* These methods should only be called on the active intc */ void (*set_irq)(SpaprInterruptController *intc, int irq, int val); - void (*print_info)(SpaprInterruptController *intc, Monitor *mon); + void (*print_info)(SpaprInterruptController *intc, GString *buf); void (*dt)(SpaprInterruptController *intc, uint32_t nr_servers, void *fdt, uint32_t phandle); int (*post_load)(SpaprInterruptController *intc, int version_id); diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index 9d0d5948ff..283a6b8fd2 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -11,13 +11,11 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" #include "qemu/error-report.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/reset.h" #include "migration/vmstate.h" -#include "monitor/monitor.h" #include "hw/ppc/fdt.h" #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_cpu_core.h" @@ -701,12 +699,10 @@ static void spapr_xive_set_irq(SpaprInterruptController *intc, int irq, int val) } } -static void spapr_xive_print_info(SpaprInterruptController *intc, Monitor *mon) +static void spapr_xive_print_info(SpaprInterruptController *intc, GString *buf) { SpaprXive *xive = SPAPR_XIVE(intc); CPUState *cs; - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; CPU_FOREACH(cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -714,9 +710,6 @@ static void spapr_xive_print_info(SpaprInterruptController *intc, Monitor *mon) xive_tctx_pic_print_info(spapr_cpu_state(cpu)->tctx, buf); } spapr_xive_pic_print_info(xive, buf); - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } static void spapr_xive_dt(SpaprInterruptController *intc, uint32_t nr_servers, diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c index 1926373ebd..a0d97bdefe 100644 --- a/hw/intc/xics_spapr.c +++ b/hw/intc/xics_spapr.c @@ -34,8 +34,6 @@ #include "hw/ppc/xics_spapr.h" #include "hw/ppc/fdt.h" #include "qapi/visitor.h" -#include "qapi/type-helpers.h" -#include "monitor/monitor.h" /* * Guest interfaces @@ -397,12 +395,10 @@ static void xics_spapr_set_irq(SpaprInterruptController *intc, int irq, int val) ics_set_irq(ics, srcno, val); } -static void xics_spapr_print_info(SpaprInterruptController *intc, Monitor *mon) +static void xics_spapr_print_info(SpaprInterruptController *intc, GString *buf) { ICSState *ics = ICS_SPAPR(intc); CPUState *cs; - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; CPU_FOREACH(cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -410,9 +406,6 @@ static void xics_spapr_print_info(SpaprInterruptController *intc, Monitor *mon) icp_pic_print_info(spapr_cpu_state(cpu)->icp, buf); } ics_pic_print_info(ics, buf); - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } static int xics_spapr_post_load(SpaprInterruptController *intc, int version_id) diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index 97b2fc42ab..b43917e7fe 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -11,6 +11,7 @@ #include "qemu/log.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "hw/irq.h" #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_cpu_core.h" @@ -18,6 +19,7 @@ #include "hw/ppc/xics.h" #include "hw/ppc/xics_spapr.h" #include "hw/qdev-properties.h" +#include "monitor/monitor.h" #include "cpu-models.h" #include "sysemu/kvm.h" @@ -269,8 +271,12 @@ void spapr_irq_print_info(SpaprMachineState *spapr, Monitor *mon) { SpaprInterruptControllerClass *sicc = SPAPR_INTC_GET_CLASS(spapr->active_intc); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; - sicc->print_info(spapr->active_intc, mon); + sicc->print_info(spapr->active_intc, buf); + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } void spapr_irq_dt(SpaprMachineState *spapr, uint32_t nr_servers,