From patchwork Tue Jun 18 15:59:56 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: 805240 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp274584wrx; Tue, 18 Jun 2024 09:08:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWFdmEchmhHQsR9GyZzOTvah7RJ4w3SozA+8smRXA3tKUubqj91hfJbwTLNp+ftgY2FitbJLMvHa2kyJ4DT5G8b X-Google-Smtp-Source: AGHT+IFGx+Ts9jFxrCRXOmRQPSL4+crXIcaCrV4U1ydMwgqlkMM+Jw0m1X3scPFDLHpJE1o6alRd X-Received: by 2002:a9d:6f02:0:b0:6f9:90de:c67f with SMTP id 46e09a7af769-700748c9d6fmr218273a34.10.1718726937952; Tue, 18 Jun 2024 09:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718726936; cv=none; d=google.com; s=arc-20160816; b=IdD12uwKd4taYgBaJmZExHeb1h11AABKYElfyj9zwaBBrGpr0bV1TzYSxpw0TG/as/ legHsfSKFEUkAzP3ORVONq6eUV/Y9AeckoiWOfF9vfK0e/0fJA/28ztwUYrRKYVvZ4qH RniH9pSK693cFwcHqZiP4+CUzseFBoZwFJMovUEJwXVT0SHPeer7teSL90fjl/1rYvGk Eg/qIkbn931fyMJg5nqo8fpe76gTEFDDaSG2GLb76+9OjPQKHnNf4x8D4+y/bb2IbhAi g3L0Ov+mdVqLdpwjfNueVx/p0ib7StbKQpLl6Sjt3p+mXx3UNMKJuDi/+q8D9gSVOif8 VU7g== 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=P/fRH20LiiHNd6n6UxrfG9EvHyIfE/d9iyXREJbBrfA=; fh=Q+oQ03yQfuoTTxzUPDLJKoTd4xZYvGHM4rKHQJt4bQ4=; b=d7wLESnUBi11dbxUW09hfh8sDVZRxButus1mTciNC0BoUpmBuRIBxS6CExlDBJ+Cc6 cADD7Y5EqiO7fYfqoOJNOPXrBTAI4yK6qfvlBdaJeQoIskfxvYcUOpP5Fxg5ynPQY5cJ S0/4QYOMmup/2al05jiv2JxBQ8ooz2JaI9kuchTKrQK0qdF3whQiJdXpVVeRP0qt9Jp3 iezkKOix+E3h8FlnLH8ooeMn4IXKa7LXdTY6iuYa3gJ4PGujJvkZF+u8WUMyYpcXVYTQ cJen88dTPeU0qwYQP93BxYmEPGgxepTAi3y6vwxtDgWpoHukT/DhIGKblA1XI1b370C9 S78Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gjRNJPIC; 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-6b2a5a37e96si129672906d6.129.2024.06.18.09.08.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2024 09:08:56 -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=gjRNJPIC; 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 1sJbJV-0002Z6-2m; Tue, 18 Jun 2024 12:04:05 -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 1sJbJU-0002WN-6Q for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:04:04 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJbJS-0007Dx-Ck for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:04:03 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-57cbc2a2496so6075232a12.0 for ; Tue, 18 Jun 2024 09:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718726640; x=1719331440; 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=P/fRH20LiiHNd6n6UxrfG9EvHyIfE/d9iyXREJbBrfA=; b=gjRNJPIC4JkJK2X+4gRfoHS9hknM3VAqW05NzP0e1N0Ge+N7kJgVJTuaF17B2xPrFw C43C77WZrTzUTxiRfTEw2Y8UwoWhsycE4iPlBo1UfrhRaz5wunrwKqZJxmz8nsPbWoji 168SW7XeJDDAczeT32YtTu9PXwjMujrOlLcxgc5nwISmheSNVD9R6Ot6DTZKXfFSX33z SNTHBP5SttqGtFguFoHUK/p26EGCKmtOIvv+tzS3ndcdlZd45yCi6pU9c9uEmeKMjR3Y LFkkSXHmN5+uujvQ59Qq1jp5YJAXPTX6Fxrd3iMm8Ni+ZtC4mJMtKCrdd4Q2TU2jRj2s 4wrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718726640; x=1719331440; 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=P/fRH20LiiHNd6n6UxrfG9EvHyIfE/d9iyXREJbBrfA=; b=eMYHjJwfNQ/XtwXKwdMUfyPW559D+NfiYxkoydxfj0XHUsrL3DmBakpPUsm7QLyOGu 93gONMmyb9l4i7BIZQndU1y15ZP5Uo/xnoAyXP2Ad+X1aDvH/VZXuJddUYme8G53cY/k RXgoVT4tMuj/UQmVbSyoM7jwjo+7mIwzUUWWgGfinLT5oJzhFi3PvtOj3GNCee/LlSib lyz0PM1hLQ9T8UvqnjK4/f4NJYt3dxxC8Hij56GVlJTupuVnApAOLvEvq0dMV19VopHw PB6HEymnkqIfEzgYd5hM9xmQHkxC4vyyFlzQeKf66/w01b/riFMUOkQZal7jFRs+HaI7 Fh/Q== X-Gm-Message-State: AOJu0Yxsyp6gxynib1xTqTZwJiOf0QgpY8BTDUxOe76xdG+dFUv/mauy vtJceatkArpuM1/kJ0PGxpOBjWTHgI/YExcsZmToIdytXnX7rd9OD3c8o1sov5RgyH4zyGIrmWk f X-Received: by 2002:a17:906:489:b0:a6f:2253:d1f7 with SMTP id a640c23a62f3a-a6f60dc5069mr999916866b.61.1718726640451; Tue, 18 Jun 2024 09:04:00 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.55]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56ecdd1fsm625207666b.102.2024.06.18.09.03.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Jun 2024 09:04:00 -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 34/76] hw/ppc: Avoid using Monitor in pnv_phb4_pic_print_info() Date: Tue, 18 Jun 2024 17:59:56 +0200 Message-ID: <20240618160039.36108-35-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::531; envelope-from=philmd@linaro.org; helo=mail-ed1-x531.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-11-philmd@linaro.org> --- 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; }