From patchwork Mon Jun 10 06:20:48 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: 802975 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799477wro; Sun, 9 Jun 2024 23:22:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUWPto+MZBkgAEhnM8hdojM4WSQEirIyVUVN/Wh9KC1vM/XvgJrdpewPKYlmUFp/lCWTdAaSex1gWFWyhVZ1O2F X-Google-Smtp-Source: AGHT+IHbv15VLRjQPVbSgl5G2UpCXcWKPqygaLp/fNu8ZAPXBLoJcqKt7lG1CQAxJFUpg7S8WkFa X-Received: by 2002:a25:807:0:b0:df0:5c1c:2d59 with SMTP id 3f1490d57ef6-dfaf64e5d10mr7733468276.39.1718000573077; Sun, 09 Jun 2024 23:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000573; cv=none; d=google.com; s=arc-20160816; b=bdaEzCfZEZdxospLwX0qdsr1KzM9qLZhuq3muUnJBhv5sbmPp0d+Jn0bj2iFYbpO91 pligRnhJNlNRV3jhUUdlsGK59rC8mSLbP1ignj9FSO32oEa3sypwbXvQ4EeEmZKEItSN dUhXZCVgngimSb9OCm48iMUdlI1HaevUoBX7zjEHvl9qOtKPmr+mArJCC3tCZ0iAmWyo PY7gbpKBPtnkxlgHzzdJ23xORlgfoDeZzEUR3EbWHwd9Tym9KBs6CE32y9bbn7akvCjm MXD/RwZwgvwh04P8NS+nNj6nYeZdMLfXAF07gWNUTgDH8jzcU1/ItzO6Xs7BADGYuN1N YoYg== 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=rw+kbtFvGBPcHZTq2AbRKqK9FSuZ88ZupuV0Vb6iIFg=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=wb6Hbuu5bPPSSyFytTyhWIWVuIClBF5HBtXXSKqd1OyRFILspYE1PLKt+lt+0AZWEz g/H4KdLBWnqHdmWIU9oz111wtWC7ParIm0lHMzf3gtYCUIoGPAhYTPc7h0wsW6BbZ/1g hN5h4/qLoq5LPFOKT9yka3fdK1nou//XvFhY4mOLyw1t3+/nWtIVqR4UUpEQuUtCS9F7 KWTqbbQ8tejN2ts7DEN6JTyDEyacwaW5nBxubEYi/UL+1Re0vhzZl25+jocu4RmV6ZMQ Q94SQpd27hr9lE20b2wB+r6LXJQJKhXUCPkvF+4DaqeejFog/HwazYtvDBf95XBMCalO nCyA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HMRgfTPK; 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-6b04f9fb118si102249076d6.420.2024.06.09.23.22.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:22:53 -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=HMRgfTPK; 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 1sGYQF-0003nh-Cn; Mon, 10 Jun 2024 02:22:27 -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 1sGYQ0-00038N-ER for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:12 -0400 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYPv-0004RP-3u for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:08 -0400 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2ebe40673e8so8307361fa.3 for ; Sun, 09 Jun 2024 23:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000525; x=1718605325; 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=rw+kbtFvGBPcHZTq2AbRKqK9FSuZ88ZupuV0Vb6iIFg=; b=HMRgfTPKDDN0uDnu2JRqbAYfQHKSWUfrxFiyyOQyi7OEWdDf7U1u3qs/wH8pjZTWLO J1+Dwxrt4GsLH/I+eI2jdNRq+TU32dj5a/bGJL9s5bilsNmo908x0qgHqbhu2GSEFkJv 4AV4b8fQh5LYZMahma590DBE7rD1edCP7NWoRWVRn/sNLKDTUx2NX5Mhp9aqh4ayaBAW nUReXEDNoPFWRluLFrSSGaGhHqPunkthmiLBLN5jYoHw9r5wZ6qdDrdqBvkup0Z88FJj FrPuoQCksM7a5y01BPUQMv7yUM/zDi4/xuGVxqmZDl8Zn3bkIEEWoKJeya+DvLyTKJtr kteg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000525; x=1718605325; 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=rw+kbtFvGBPcHZTq2AbRKqK9FSuZ88ZupuV0Vb6iIFg=; b=Ij3e2aejzOx14PmzKUVws0w5WXHiWRp+tboLlRCCHgQk4hik0eokY15cz9Uy8ut2JE Y0L7WKG0VnfVPm1bCQRhSOWslHAoj7zuKFgG7ievI9yk7zdY65JkAJyRG9lSxQ9hlkk9 zG1AUW26PT2S7LJSXAsBPES6oc5Qcag5oHBhOq1r9EqfYMgbVVnkXpQCnAoPImQ/71eS 36Ay/Jrw9H1hzg+UVFbA1gFovnyJmdMIZOY4z4bHUfoGisLgCotVIZDe2Dh16cDfh489 1ZRKrr3mkRTC/BLIR+MpeuOSNtgrmAxTRUOUfwiDugO5kLsfCiaROj1x5sUemnwDK00g N36g== X-Gm-Message-State: AOJu0YyM1icJdOVQpKvfPRPGzHgUoAefrz4RKkbPO+YFLP4Ov6yJ3hU/ sS4S8eTqVAtquHp/dW5u21EwaCp3qo7Bkf28h/c7BwmuMYzTXIs1TIE0VQkIwFXJVrUCW2bZtoJ V X-Received: by 2002:a05:6512:3b09:b0:523:91af:12d9 with SMTP id 2adb3069b0e04-52bb9f66a7bmr7170529e87.9.1718000525125; Sun, 09 Jun 2024 23:22:05 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f23fe7a64sm1839557f8f.89.2024.06.09.23.22.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:04 -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 10/26] hw/ppc: Avoid using Monitor in pnv_phb4_pic_print_info() Date: Mon, 10 Jun 2024 08:20:48 +0200 Message-ID: <20240610062105.49848-11-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::233; envelope-from=philmd@linaro.org; helo=mail-lj1-x233.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/pci-host/pnv_phb4.h | 2 +- hw/pci-host/pnv_phb4.c | 9 +-------- hw/ppc/pnv.c | 6 +++++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index 3212e68160..8abee78e4d 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -155,7 +155,7 @@ struct PnvPHB4 { QLIST_HEAD(, PnvPhb4DMASpace) dma_spaces; }; -void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon); +void pnv_phb4_pic_print_info(PnvPHB4 *phb, GString *buf); int pnv_phb4_pec_get_phb_id(PnvPhb4PecState *pec, int stack_index); PnvPhb4PecState *pnv_pec_add_phb(PnvChip *chip, PnvPHB *phb, Error **errp); void pnv_phb4_bus_init(DeviceState *dev, PnvPHB4 *phb); diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 4b453997e7..99991008c1 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -10,8 +10,6 @@ #include "qemu/log.h" #include "qapi/visitor.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" -#include "monitor/monitor.h" #include "target/ppc/cpu.h" #include "hw/pci-host/pnv_phb4_regs.h" #include "hw/pci-host/pnv_phb4.h" @@ -1802,14 +1800,12 @@ static void pnv_phb4_register_types(void) type_init(pnv_phb4_register_types); -void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon) +void pnv_phb4_pic_print_info(PnvPHB4 *phb, GString *buf) { uint64_t notif_port = phb->regs[PHB_INT_NOTIFY_ADDR >> 3] & ~PHB_INT_NOTIFY_ADDR_64K; uint32_t offset = phb->regs[PHB_INT_NOTIFY_INDEX >> 3]; bool abt = !!(phb->regs[PHB_CTRLR >> 3] & PHB_CTRLR_IRQ_ABT_MODE); - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; g_string_append_printf(buf, "PHB4[%x:%x] Source %08x .. %08x " @@ -1819,7 +1815,4 @@ void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon) abt ? "ABT" : "", notif_port); xive_source_pic_print_info(&phb->xsrc, 0, buf); - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index aed6767c8d..df187c5180 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -791,12 +791,16 @@ static int pnv_chip_power9_pic_print_info_child(Object *child, void *opaque) { Monitor *mon = opaque; PnvPHB *phb = (PnvPHB *) object_dynamic_cast(child, TYPE_PNV_PHB); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; if (!phb) { return 0; } - pnv_phb4_pic_print_info(PNV_PHB4(phb->backend), mon); + pnv_phb4_pic_print_info(PNV_PHB4(phb->backend), buf); + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); return 0; }