From patchwork Tue Jun 18 15:59:47 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: 805243 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp274602wrx; Tue, 18 Jun 2024 09:08:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXwdkwtSiFF6CD/wzfOJcpmRVNgTdJ9hLKYGKmLeZFW2GdnM7/ydhvgiIybHeuouTd6zMw9xNzgbv3p0MerNC1c X-Google-Smtp-Source: AGHT+IEqVpgbVKnvE5NW5D3I6ETcI2UTzplTY07AUoEroGkKzrqMb2bdviBo4xnhacav+4KGV0bW X-Received: by 2002:a05:6358:3115:b0:19f:45ca:c1cb with SMTP id e5c5f4694b2df-1a1fd35d52bmr31581755d.7.1718726939038; Tue, 18 Jun 2024 09:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718726939; cv=none; d=google.com; s=arc-20160816; b=MFISVStFVN/5WcQOE64vzn7+ASx8dWysS3g9uryDGhXyO81kuYJl7vrk9fwx0TcN7Z 9rc0OTBWVWnzeBHeSqS7a++VBQUMLU9NGvAOkJ30CDXDBXgloLjeU9sGAQT71bevgx8v qDZCxiQwPsIiCO/NBtgkHAxQnj/mXz2S8HNxKu3ST211lgM/bmtV9OQHaywan3+fplMp P40mXT0OCS1HpZghoyYyp225iETM6CUVbLBSxgIN6dVo9OdQLxLp9yV/qlkOmVgd7msN I39t3a4f3l1OkA+gC4U9R944Tz1DrajL6XzZYJMwaD/Ew4fim5s+lGccl0oOemRTAYBB MQIw== 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=qA5Ge8ZtgAa4V9zb3xBkrJO7P0viojUBuVQA89Wmlaw=; fh=Q+oQ03yQfuoTTxzUPDLJKoTd4xZYvGHM4rKHQJt4bQ4=; b=kOjMqz3GRm0hn/ltCIP2ivix91YJBUPzWYwNUndmOd7wUQaxfZIshy3QyA2TBDHxp2 sZEs/ijHhFn2cx/K3ZQHdGjjR/kCZy35+SAeXgbP2cAF604k3lKW8i6w/0k7k6P0az7K mGp5t2gDt7Lsmnf9x2OEOyvGMWyJz9FDQUbB9kCv5XIh5IsPaOK1f0AWi9TT2iClv9mq mM3hHxdqeul7BRNfi43bbqzA94kXYlYZHG08nROqILs5/r9qV5qPUAWPvCuwsZXtMsxR pmt/va/Lip3Gkg63JSRX8oDTpboijLUMb6DqoMnYG0ulHUpmH3G7GrJ+XoJzMoqjgxa3 /QjA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mmpgc3qs; 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 ada2fe7eead31-48da43bfec4si1947371137.191.2024.06.18.09.08.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2024 09:08:59 -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=mmpgc3qs; 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 1sJbIo-0007Nn-Id; Tue, 18 Jun 2024 12:03: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 1sJbIf-0007Cf-Bq for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:03:14 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJbId-00078I-CF for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:03:12 -0400 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-57cad452f8bso6398504a12.2 for ; Tue, 18 Jun 2024 09:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718726589; x=1719331389; 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=qA5Ge8ZtgAa4V9zb3xBkrJO7P0viojUBuVQA89Wmlaw=; b=mmpgc3qscMeX33sSISLRWxVI6CMrUo9Qk9QPYcFgWBmwl4IvqJBPb7Y7xhr/9toVZk 4PGhu8xVEhdup/VIfJbjlu0h9kffXeeliSNpVy8yubXCrYtxG3DFkVo8ltoqkeOpWu4m M7Zv4jJxleuA6WuMmLxHCvlg0g/50mLXivomcuMzh7+YAwyxgDh9rsxFqkaM7n/s0aLI M5HCLqNYrQJ+gvODsUZ3+kDAJrTXQzUoLpvmGc8lrYKuVCCkis//O1qr+wiIS4g3LWMm O+qkTdsho3gyGJr/kj4e8oDbSsufyLryixaEuNDhI05PGq+h73z7Dhi3RRBfPhCPKkgW 70cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718726589; x=1719331389; 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=qA5Ge8ZtgAa4V9zb3xBkrJO7P0viojUBuVQA89Wmlaw=; b=oHH5pDKUwcj9wY/sTbG9gRGPqMIM2cvelwZ5NeHokOvztXcSZCGN8adUqxKf62CEwf 7chgegV4C141zWhQXuuEFV3j41Jg+wHgUCAgKD1zk9VgOEQLp+0Dq2ZyPxmLXMBqxjzB VI+8fBXFXzarO2TOSaYKUB5hMUJclIsafzZIF1C3M9Hw5w6Yk+z/1SU+jbAiXJI7A2TW XukqgwFXLsvE6Y3uMUHWRhJ1w9eYAtgY8VRw5EILoMRLgHEtABUhmWeV5fap6RE4vDvI WIBH5Wa6bxiaJec4DVyWicU4RAjJkZfawEYlh9fukt1BYR2bqMMik5Rn6n6aajUiovMo T6UA== X-Gm-Message-State: AOJu0YwC/+HkxDI1jnhTjfwojlN7FVkooYXkj1xSv0LLAtt1nVuo+2qg Gy2mXSKqmXaEA1w/lYIGswT0PRBu2sqOmYkrBmNDlLCdrGr7o/2XX7fAXjyN3o/mUzNpQeXDkU1 0 X-Received: by 2002:a50:d681:0:b0:57d:579:3ca8 with SMTP id 4fb4d7f45d1cf-57d05793e00mr449766a12.22.1718726589417; Tue, 18 Jun 2024 09:03:09 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.55]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb743ade6sm7856056a12.95.2024.06.18.09.03.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Jun 2024 09:03:09 -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 25/76] hw/ppc: Avoid using Monitor in pnv_phb3_msi_pic_print_info() Date: Tue, 18 Jun 2024 17:59:47 +0200 Message-ID: <20240618160039.36108-26-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::535; envelope-from=philmd@linaro.org; helo=mail-ed1-x535.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-2-philmd@linaro.org> --- include/hw/pci-host/pnv_phb3.h | 2 +- hw/pci-host/pnv_phb3_msi.c | 21 ++++++++++----------- hw/ppc/pnv.c | 8 +++++++- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/include/hw/pci-host/pnv_phb3.h b/include/hw/pci-host/pnv_phb3.h index d62b3091ac..24ca3dddaa 100644 --- a/include/hw/pci-host/pnv_phb3.h +++ b/include/hw/pci-host/pnv_phb3.h @@ -40,7 +40,7 @@ void pnv_phb3_msi_update_config(Phb3MsiState *msis, uint32_t base, void pnv_phb3_msi_send(Phb3MsiState *msis, uint64_t addr, uint16_t data, int32_t dev_pe); void pnv_phb3_msi_ffi(Phb3MsiState *msis, uint64_t val); -void pnv_phb3_msi_pic_print_info(Phb3MsiState *msis, Monitor *mon); +void pnv_phb3_msi_pic_print_info(Phb3MsiState *msis, GString *buf); /* diff --git a/hw/pci-host/pnv_phb3_msi.c b/hw/pci-host/pnv_phb3_msi.c index a6d827f903..77d673da54 100644 --- a/hw/pci-host/pnv_phb3_msi.c +++ b/hw/pci-host/pnv_phb3_msi.c @@ -13,7 +13,6 @@ #include "hw/pci-host/pnv_phb3.h" #include "hw/ppc/pnv.h" #include "hw/pci/msi.h" -#include "monitor/monitor.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "sysemu/reset.h" @@ -316,13 +315,13 @@ static void pnv_phb3_msi_register_types(void) type_init(pnv_phb3_msi_register_types); -void pnv_phb3_msi_pic_print_info(Phb3MsiState *msi, Monitor *mon) +void pnv_phb3_msi_pic_print_info(Phb3MsiState *msi, GString *buf) { ICSState *ics = ICS(msi); int i; - monitor_printf(mon, "ICS %4x..%4x %p\n", - ics->offset, ics->offset + ics->nr_irqs - 1, ics); + g_string_append_printf(buf, "ICS %4x..%4x %p\n", + ics->offset, ics->offset + ics->nr_irqs - 1, ics); for (i = 0; i < ics->nr_irqs; i++) { uint64_t ive; @@ -335,12 +334,12 @@ void pnv_phb3_msi_pic_print_info(Phb3MsiState *msi, Monitor *mon) continue; } - monitor_printf(mon, " %4x %c%c server=%04x prio=%02x gen=%d\n", - ics->offset + i, - GETFIELD(IODA2_IVT_P, ive) ? 'P' : '-', - GETFIELD(IODA2_IVT_Q, ive) ? 'Q' : '-', - (uint32_t) GETFIELD(IODA2_IVT_SERVER, ive) >> 2, - (uint32_t) GETFIELD(IODA2_IVT_PRIORITY, ive), - (uint32_t) GETFIELD(IODA2_IVT_GEN, ive)); + g_string_append_printf(buf, " %4x %c%c server=%04x prio=%02x gen=%d\n", + ics->offset + i, + GETFIELD(IODA2_IVT_P, ive) ? 'P' : '-', + GETFIELD(IODA2_IVT_Q, ive) ? 'Q' : '-', + (uint32_t) GETFIELD(IODA2_IVT_SERVER, ive) >> 2, + (uint32_t) GETFIELD(IODA2_IVT_PRIORITY, ive), + (uint32_t) GETFIELD(IODA2_IVT_GEN, ive)); } } diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 6e3a5ccdec..5356a4e295 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -38,6 +38,7 @@ #include "hw/loader.h" #include "hw/nmi.h" #include "qapi/visitor.h" +#include "qapi/type-helpers.h" #include "monitor/monitor.h" #include "hw/intc/intc.h" #include "hw/ipmi/ipmi.h" @@ -774,8 +775,13 @@ static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon) for (i = 0; i < chip8->num_phbs; i++) { PnvPHB *phb = chip8->phbs[i]; PnvPHB3 *phb3 = PNV_PHB3(phb->backend); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; + + pnv_phb3_msi_pic_print_info(&phb3->msis, buf); + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); - pnv_phb3_msi_pic_print_info(&phb3->msis, mon); ics_pic_print_info(&phb3->lsis, mon); } }