From patchwork Mon Jun 10 06:20:39 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: 802976 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799483wro; Sun, 9 Jun 2024 23:22:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWc/m9P8rwp1Qa7OvWFXAFst2mnM28GSHWwHmZ+TP6jKqejCnuxAVi5VkYHaVWBBBZqdTfaAhZ7LfRS792z3kav X-Google-Smtp-Source: AGHT+IH2gUojrJk0TGVwInKXiv1xmqOJzxRjFWnx1vjm1I+w24i49BkwXATC1fiVPMRB8tGjawjd X-Received: by 2002:a05:622a:1aa1:b0:440:fe6d:d537 with SMTP id d75a77b69052e-440fe6dd828mr16562941cf.50.1718000574721; Sun, 09 Jun 2024 23:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000574; cv=none; d=google.com; s=arc-20160816; b=KT2SawXqS9pIMqtPwAVQSnbf0IkdVHOGFzirQiy4y+byCFua5jixoYaMywbzqOogy9 4tHz4Z/d7pAdapn18uwDPgOa52vd7+PxFMilR3biMNJVU9WAiSr0/zFkZbyad3qStqHO yo9/1iANfdkHJsxOr9sJijUTvSCSiz+JNW+k9j79luyEy4aWkQhjZJP2C5E551FUI6vP c9ZUy6BARcf4JB67G/SwnJbFJWg6tz9KYIo0IXeZ/13gjqPzHgKroQNpV/21VCtxzIfp WfpA8vNz6wjiGOBpsGAlOf6sxxSO5Rtx5rOdkSudrpvAOKKPQMc/5/iZ1WOxemZEnd/y WyZg== 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=AVbnHAOwxyh5BXz5KtV5BYAwaSvMfBTicRK4fg5tgIw=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=fSjk/NO1rhQqeDGO9bnsUgbmobYmBal1SbkeWtjzRFCsjuloeWng4ZY+H9+3OJOpog 2A2q0WDRBLbB5yBOvHfzWl/+cqdueBR+1/AfUC/CBl7MNk2plrhcNSv+n49SnWoggwcL Ssnm85IktmfQL8a/5ZvprbxnhHPfjtOdWFVY4sRYdhgqQsI6xTcor4DOX5ulFXyG16+e BWjN04IC1+CaKwEb7tu5Ot7qPYrwjYJKlfRdMLnv/GTWRbUlTT/Sj3JrY83/ovj4/ZFg 2f6ZOqBwcUXdahwUoPdTl7PDNQUHhI3YWZmcaRvGrJlm/kVTLW+pHAk6fGkaW//UCglb hjXQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SWp31WF4; 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 d75a77b69052e-44038b84e62si65174971cf.765.2024.06.09.23.22.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:22:54 -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=SWp31WF4; 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 1sGYPA-0002GQ-1v; Mon, 10 Jun 2024 02:21:20 -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 1sGYP8-0002F8-3q for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:18 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYP6-0004Iy-AM for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:17 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-35e5604abdcso3012911f8f.0 for ; Sun, 09 Jun 2024 23:21:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000474; x=1718605274; 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=AVbnHAOwxyh5BXz5KtV5BYAwaSvMfBTicRK4fg5tgIw=; b=SWp31WF48przDB7ggWxz5F0h/5Hs4cAWlO4gw9/D4Ew82+S2k6KpZ1jT9yHq05xIcU 70al6mHq1hkESfeNvmQi8RFml0owHg36kR/VrqMel3Md/ujqspfZXerpcXTwvDOI05wY MmZmEK7VCkG6GrVDn7jIeV5El3Vp3t/NcjLIAUNoE6Syeo1cvDSyyyyujri/U5kdw+cF 18Ug8/xdgxOffxoE1CGbt8xhwFteVk/s0Te05W7xf28JG2Rfyf9L6icYD1byCSKqVY+g +3X6a1uUyZbSfLPWi0/oXXzyZ8erLKy/Cv56vNtiEcJYeU4bbrfyp2vV1rdu967RbIL8 X9CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000474; x=1718605274; 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=AVbnHAOwxyh5BXz5KtV5BYAwaSvMfBTicRK4fg5tgIw=; b=SHG8eyzwSPT3nqISoILE7pt6HbFDabaX9EQVo9Cel5686FJyK7F+u14QNJFxHoZrqZ pMa7+be1363uzd3/kTV5IJ5MXO2yZpoe2s1aDbZISpxrSxA63g/tQmQU9NkddjhrVXqC UyqCqY0RZ2Lr6biSPv7efcf11E06wOllmnGPaACtwmKxsTSF4V1e4t5fOSR44bWVx4nw DrxmX+9mdBq/uTDpGBfIoK+HYMl0qziCvN2okFoa/YsLILHppX43+UykJUNLaOO71lzv H71tT8aenXh9g8ajpGdHUWxta2AZPsPrSV91ncnCspdhRfG1adRCfAXYSHDIdVfiVrUk 9fFw== X-Gm-Message-State: AOJu0YzKG+Z6HvzwPcYrbN5G3wtDmJZM960ak7d1mDTB5oDQ3i/e64jU tJkzG25/2WCbf389pXYZ+0xRElz30x5nD6+U8fEHg+z8WzqqyIV57YmCaHXYCi29mt32EEAhEa1 8 X-Received: by 2002:a5d:4dce:0:b0:35f:9ab:d06c with SMTP id ffacd0b85a97d-35f09abd1c7mr6504377f8f.5.1718000473976; Sun, 09 Jun 2024 23:21:13 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f1f109346sm3338253f8f.27.2024.06.09.23.21.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:21:13 -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 01/26] hw/ppc: Avoid using Monitor in pnv_phb3_msi_pic_print_info() Date: Mon, 10 Jun 2024 08:20:39 +0200 Message-ID: <20240610062105.49848-2-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::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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: Harsh Prateek Bora --- 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); } }