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); } } From patchwork Mon Jun 10 06:20:40 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: 802974 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799463wro; Sun, 9 Jun 2024 23:22:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUbuekewsoKeZhNjGDBxDx2CXxKlVNvD/q4yFQa0bTzI8jkDhKI12pNWmZIlmOAv9PfkoOxECqykifb8+SRzlqA X-Google-Smtp-Source: AGHT+IGsXvoQbHdvSk87WnY49HrIIldkm+rDYh3iR6m9K30hX7Ygr37hx3r2z7rGBKj/edLbKuFi X-Received: by 2002:a05:620a:3186:b0:797:a280:edc0 with SMTP id af79cd13be357-797a280ef76mr19863185a.16.1718000570181; Sun, 09 Jun 2024 23:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000570; cv=none; d=google.com; s=arc-20160816; b=jAhU1xqFhKAW5m+uvvMJm0U5LdcDNQZ0kF/FzRjgbSTK6G7eo362qBAfrNI6Fcif2d yMwy5sWnqK4Vtssc+5ZKmEAzWarc0RuTpYdEarYsA/36qgqrUC7os2ER9n37zp9hGtJ2 gHLLYlbv5PRHaOSLU+gvsKZD9t6l2zw1EM11pUj4G/PUqAfwrpZ0g75yWdwjeG6qCp2s vqu9kTbT5ncYxiQxpXIu9K0U5czEp3d0nKbJVY/d3dBMU4g6zhTEcLmAqDFF3cnLwgAF Cw+EkWRt4qT+agvrzxoUftfrIx9QWke2BkfZMg0Vnb4aZEu7OzTDfrRVP1YXixGcQ0nE rHbg== 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=bRaRL501WvQ0swv15S662THilyXH6kAx9FOW+Jx2/Sg=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=Wf95uE2do3XmdVV2k6rl770qfBOGLTqy2+exnI7JaJRqmzzfrH2bx+Jsk0KFm1Lax5 Bn+ekyq1T8/HvW4RnPKyQssIXJkphQeCZ8LMt6H70SO/LBwSxa+mGz0pAoNRPNHOIekB tZ4FhqRbHSYO6FzgcuhdHsuOo5ONgjicCy0iNu6ezn3ubV13KnJQHKHnAiZPwulGY+8J Zpqrti4SBW3DeVXhuapjW3rh0COrsSHuwQtw+JMiZx7oHffvk3lO4o56OiNGBBQEPpCm u0Rx+ASLeKQ76Y8PuNTxd8DYXbhEDHsiQe2RcSKrMikOUo8fS6V7stivPrcH35enR1sF GK/Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nn1nfKPY; 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-7955703b4d6si452841885a.24.2024.06.09.23.22.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:22:50 -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=Nn1nfKPY; 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 1sGYPJ-0002On-Bt; Mon, 10 Jun 2024 02:21:29 -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 1sGYPE-0002NF-01 for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:24 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYPB-0004Jt-JZ for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:23 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-421d32fda86so5119205e9.0 for ; Sun, 09 Jun 2024 23:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000479; x=1718605279; 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=bRaRL501WvQ0swv15S662THilyXH6kAx9FOW+Jx2/Sg=; b=Nn1nfKPYP3NxM3yM9Bj+MrQkjN+nMPYUgVfeDFkfOQBinbItZ87y8WdBc86g2U055G 6hVhPv7Alp+mlEoZb4aHwDHa03bS34xg0lKMkRoYdvWhV98BLpbaAPd0kxWvMf3+VhGs kVy/zHmJ5qVR/EN9e0jifUAsGKVc1cH75iBpBbLWY5NDwG8lTokg79mvgniUPlU28tXq zFEk9Ws0lPJQq4Ry0tAXdUEib5kvXCNi+1fVe2vyNnVdqhif2Oq8GSLsikXw+BPivIyx 1OlA+1Pd7m/4MS3lHSvDbmPNgkVV8htH+cSLWA4Em/N5eR/Vdpr5O1t7544p+xPg4Y9T u8zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000479; x=1718605279; 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=bRaRL501WvQ0swv15S662THilyXH6kAx9FOW+Jx2/Sg=; b=C8Y8o3wtT8iz4snk74XKWkKX+0owbX/tL6cVDsXdqOWTQQpcA3JWhpzu2Si1SpmgzQ T4XnYy08lFW3DByh31vgm1aBEg25HZQIIr6g5g2NMzUNo95jw4xCC9MEnd4CCC6/yUUR CjWucg9eUT7v9p1BXJ1h4OM7jzWANenV5TEuJ54aKqQbPqL0NIDMi+nyLLxi+mAwiQvi Upgub+cvTUz4dUVmYeAsWVH2WXyelj9j3whz+lCTWuA/wLKhhULonU0OTxKg3ND2Llrl 8OMvqr9iQBj2DHtTjurHNaTRiVDak9gTNGywPQMorUSrot2t7KVwqYX0yw6jbjFL3W33 E+1g== X-Gm-Message-State: AOJu0Yz7iMvYsTB8m0yI7k36hC9YcqpvCH4WBP+aMOxB/abfdh/ZWrnV yk2YccaO3dR2GovP+sTUD7j1dIjx80vVOzU4lbQOitAhA20VQe6LTb9DGFstvd3ML+Obwf9IBdP Z X-Received: by 2002:a05:600c:510b:b0:421:5a2d:b7d9 with SMTP id 5b1f17b1804b1-42164a0adf6mr87329745e9.20.1718000479680; Sun, 09 Jun 2024 23:21:19 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215c2c7396sm130025655e9.33.2024.06.09.23.21.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:21:19 -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 02/26] hw/ppc: Avoid using Monitor in icp_pic_print_info() Date: Mon, 10 Jun 2024 08:20:40 +0200 Message-ID: <20240610062105.49848-3-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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/xics.h | 2 +- hw/intc/xics.c | 8 ++++---- hw/intc/xics_spapr.c | 8 +++++++- hw/ppc/pnv.c | 8 +++++++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 95ead0dd7c..1116aa6953 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -171,7 +171,7 @@ static inline bool ics_irq_free(ICSState *ics, uint32_t srcno) } void ics_set_irq_type(ICSState *ics, int srcno, bool lsi); -void icp_pic_print_info(ICPState *icp, Monitor *mon); +void icp_pic_print_info(ICPState *icp, GString *buf); void ics_pic_print_info(ICSState *ics, Monitor *mon); void ics_resend(ICSState *ics); diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 9b3b7abaea..039e10a0e4 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -42,7 +42,7 @@ #include "sysemu/reset.h" #include "target/ppc/cpu.h" -void icp_pic_print_info(ICPState *icp, Monitor *mon) +void icp_pic_print_info(ICPState *icp, GString *buf) { int cpu_index; @@ -63,9 +63,9 @@ void icp_pic_print_info(ICPState *icp, Monitor *mon) icp_synchronize_state(icp); } - monitor_printf(mon, "CPU %d XIRR=%08x (%p) PP=%02x MFRR=%02x\n", - cpu_index, icp->xirr, icp->xirr_owner, - icp->pending_priority, icp->mfrr); + g_string_append_printf(buf, "CPU %d XIRR=%08x (%p) PP=%02x MFRR=%02x\n", + cpu_index, icp->xirr, icp->xirr_owner, + icp->pending_priority, icp->mfrr); } void ics_pic_print_info(ICSState *ics, Monitor *mon) diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c index 37b2d99977..bab9d88218 100644 --- a/hw/intc/xics_spapr.c +++ b/hw/intc/xics_spapr.c @@ -34,6 +34,8 @@ #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 @@ -399,12 +401,16 @@ static void xics_spapr_print_info(SpaprInterruptController *intc, Monitor *mon) { 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); - icp_pic_print_info(spapr_cpu_state(cpu)->icp, mon); + icp_pic_print_info(spapr_cpu_state(cpu)->icp, buf); } + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); ics_pic_print_info(ics, mon); } diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 5356a4e295..fa23b27a2b 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1130,7 +1130,13 @@ static void pnv_chip_power8_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) static void pnv_chip_power8_intc_print_info(PnvChip *chip, PowerPCCPU *cpu, Monitor *mon) { - icp_pic_print_info(ICP(pnv_cpu_state(cpu)->intc), mon); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; + + icp_pic_print_info(ICP(pnv_cpu_state(cpu)->intc), buf); + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } /* From patchwork Mon Jun 10 06:20:41 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: 802972 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799307wro; Sun, 9 Jun 2024 23:22:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVSHQrkLfAVtHcVoyL6TAgRgP9SaJl2eB5IrEbh76WF9SVDHHQEH66pcn0an4MjKiUpAQ4rCh4MbWLXOpYgGY2O X-Google-Smtp-Source: AGHT+IEN8RFUBZDxwFxRJ8Bt/Yq6+IGsLhE/1VtAzXvW/4yAUiYj1eo0w58PvGAohzQZrB6iN3pk X-Received: by 2002:a05:6214:3988:b0:6ab:6bf8:e0f7 with SMTP id 6a1803df08f44-6b059b378d6mr90230086d6.11.1718000536790; Sun, 09 Jun 2024 23:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000536; cv=none; d=google.com; s=arc-20160816; b=pvkJd8iAOQvS9+Ds8n2BhK6tgw754i4og7YZ/DszY5ntUPUeW2GLLeOyFh1HrIk2/w PXlXmvrybB0XKWXV2YywJv47f3XktU6BD8ndTxaItwdAtuvxLqeIMI/eSHecSH5NlTBN 9A+HW7izWdZE7yxk2QuY96+He0KMvXybK8Y1KFaP1yE/Nb2m+sEgPaTwMQdyT4kSQO42 YA294c3qMzZmBfTiCoYCn4+pE/DKnBOV0UkWJu4lQcvhGOP4zvnKe2++jQNkV0rARP60 2BnF5Gv85Erof6kkYKjEU1hlHdq1rhgyY/K5jc5Ol7/zYpZ/OXs7Q5D/Lm4uINI/m60l isCg== 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=D40FZcL+mJmpN95PJa44NQEo8v0tD6RGQ/QbhHM5uF8=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=mem0d6lxzKNT0UYsmk6Y9if8H4einYcoSjeIGwI+HkGEwloKfMfw7dAd+xYc3qoRSc ibmtFrnPA/i6msEKzYQCH8JR3XLx89tFKz7EjhvqJMzr0sq+V3RkGkug7a2C48LrDbO0 f2N6Tc2Y2Ae6O9HbhV+7Tl7jPpWCSrPB9ZeJ/mP7z7JcSINE8ZCSK8u7LYrzxZ5IIUT9 ugkg2GHYPNX6cl1IPO9xoIGbi+a+F/Xdt6jr5KpbwsHNSW9Es87kw5VFyUcUy+WIXprb 4txKG55h5padOYGgbRGTXxV6dh4Iz2ozNiJn+FjWCEp/XNXK7sLJWj1FQ2y0FQ3j6nNy JICg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TdkI0dEo; 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-6b04fa45b5dsi97335296d6.575.2024.06.09.23.22.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:22:16 -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=TdkI0dEo; 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 1sGYPP-0002WN-2J; Mon, 10 Jun 2024 02:21:35 -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 1sGYPJ-0002RF-3H for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:29 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYPH-0004KN-0l for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:28 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-35f1691b18fso1174373f8f.2 for ; Sun, 09 Jun 2024 23:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000485; x=1718605285; 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=D40FZcL+mJmpN95PJa44NQEo8v0tD6RGQ/QbhHM5uF8=; b=TdkI0dEovI4rdlmu66D00MViJvC/hnyE3cyZJJ9mtIBuPQm86tCsuG68koV2M0n9XN n8JGgxu61xH4UGvsUGf04Avkygnp1MxQZoLhZOIiFrmdKBxUJvibv0W3XSXUQ94NLz8r 9f0WK7cGtbviciYqA7UYTGIdXaFh8w5Ag3cHL3kn9WfEN58/zAPtRqkNluQ9GfH3sWVT Ilfw/9lOFWM0o9Sf5FxfvGYjmGlPLWChYDfbelbuFfRsknQ8r962Nf3ZxJ5td1R7aqKT rNySk0h7voE5GhWMKDgMzym0OaNSpaeXwRxZcxWa9nYUvrNCZ7wEAipQ4dsmtWYU6BLL 7mzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000485; x=1718605285; 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=D40FZcL+mJmpN95PJa44NQEo8v0tD6RGQ/QbhHM5uF8=; b=k3yXchfvcq36krM0qlwgbuo6VlqjUMq7aehV4lI2FlhwVh/oRPS/J6p4MMh6Yu7pUO 2PJvrvpVc16wGPNijTIOUWkWafyogncFl16nKMtD6E0CLWv+YUTQQ41FSd7rfm0jDcze POID2zXz9DhOvdyNJS8vwSwBXa585ll7KI/AjZcaa4VvKh5iAP+uoKqSFfvmftVPCpxR UUnCHMkztSePSLgMqmenCnW+LhC+nJUqAFgI+NCFrbPQgxSWYtY6K3LnPNCu0t7Jnu2D JRd1/O7TbbwEGTmksltRUI5tqMyJu6+p23MtFSRluwjjcGDNb8ih0Qa904rnodere6eM FCeg== X-Gm-Message-State: AOJu0YwMavEkpkZlntcsThU02YF8qTCrTtaWCJEE/TAUhX6at320KQkI xE5vO8vg1jOBSQZXMSP4OeW1nDtBNryCHMldIl/nJzkDRdX2o2rY4oA3ByfpneeXWKycQA1av3a T X-Received: by 2002:a05:6000:1ccf:b0:35f:16c9:aa9c with SMTP id ffacd0b85a97d-35f16c9abf1mr2720023f8f.40.1718000485254; Sun, 09 Jun 2024 23:21:25 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35ef5fc3197sm10185649f8f.101.2024.06.09.23.21.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:21:24 -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 03/26] hw/ppc: Avoid using Monitor in xive_tctx_pic_print_info() Date: Mon, 10 Jun 2024 08:20:41 +0200 Message-ID: <20240610062105.49848-4-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::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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é --- include/hw/ppc/xive.h | 2 +- hw/intc/spapr_xive.c | 7 ++++++- hw/intc/xive.c | 11 ++++++----- hw/ppc/pnv.c | 16 ++++++++++++++-- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index f120874e0f..bc1cbad8a8 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -528,7 +528,7 @@ void xive_tctx_tm_write(XivePresenter *xptr, XiveTCTX *tctx, hwaddr offset, uint64_t xive_tctx_tm_read(XivePresenter *xptr, XiveTCTX *tctx, hwaddr offset, unsigned size); -void xive_tctx_pic_print_info(XiveTCTX *tctx, Monitor *mon); +void xive_tctx_pic_print_info(XiveTCTX *tctx, GString *buf); Object *xive_tctx_create(Object *cpu, XivePresenter *xptr, Error **errp); void xive_tctx_reset(XiveTCTX *tctx); void xive_tctx_destroy(XiveTCTX *tctx); diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index d7e56bfb20..b7c12aa432 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -11,6 +11,7 @@ #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" @@ -703,12 +704,16 @@ static void spapr_xive_print_info(SpaprInterruptController *intc, Monitor *mon) { 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); - xive_tctx_pic_print_info(spapr_cpu_state(cpu)->tctx, mon); + xive_tctx_pic_print_info(spapr_cpu_state(cpu)->tctx, buf); } + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); spapr_xive_pic_print_info(xive, mon); } diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 057b308ae9..a0d7e7ca67 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -669,7 +669,7 @@ static const char * const xive_tctx_ring_names[] = { xpc->in_kernel ? xpc->in_kernel(xptr) : false; \ })) -void xive_tctx_pic_print_info(XiveTCTX *tctx, Monitor *mon) +void xive_tctx_pic_print_info(XiveTCTX *tctx, GString *buf) { int cpu_index; int i; @@ -693,13 +693,14 @@ void xive_tctx_pic_print_info(XiveTCTX *tctx, Monitor *mon) } } - monitor_printf(mon, "CPU[%04x]: QW NSR CPPR IPB LSMFB ACK# INC AGE PIPR" - " W2\n", cpu_index); + g_string_append_printf(buf, "CPU[%04x]: " + "QW NSR CPPR IPB LSMFB ACK# INC AGE PIPR W2\n", + cpu_index); for (i = 0; i < XIVE_TM_RING_COUNT; i++) { char *s = xive_tctx_ring_print(&tctx->regs[i * XIVE_TM_RING_SIZE]); - monitor_printf(mon, "CPU[%04x]: %4s %s\n", cpu_index, - xive_tctx_ring_names[i], s); + g_string_append_printf(buf, "CPU[%04x]: %4s %s\n", + cpu_index, xive_tctx_ring_names[i], s); g_free(s); } } diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index fa23b27a2b..5854358f65 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1223,7 +1223,13 @@ static void pnv_chip_power9_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) static void pnv_chip_power9_intc_print_info(PnvChip *chip, PowerPCCPU *cpu, Monitor *mon) { - xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), mon); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; + + xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), buf); + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } static void pnv_chip_power10_intc_create(PnvChip *chip, PowerPCCPU *cpu, @@ -1267,7 +1273,13 @@ static void pnv_chip_power10_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) static void pnv_chip_power10_intc_print_info(PnvChip *chip, PowerPCCPU *cpu, Monitor *mon) { - xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), mon); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; + + xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), buf); + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } /* From patchwork Mon Jun 10 06:20:42 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: 802977 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799503wro; Sun, 9 Jun 2024 23:22:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXa+kUswctThqrG9Xjdyo0x22okRkYfoyN+0sfFsclIhJLncZetwbMtvVvkq9vwq58PBzhtERSwXEDgsXRP+2D6 X-Google-Smtp-Source: AGHT+IH+b8wuWlwW6GYNt36/W3F3GFDmHBVG7ksrcBQa3OZkeeoYx1uHsPBwXn4Mnz3qPl69IAVM X-Received: by 2002:a05:6214:4b0b:b0:6b0:668e:9d2c with SMTP id 6a1803df08f44-6b0668e9e24mr81806006d6.34.1718000577755; Sun, 09 Jun 2024 23:22:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000577; cv=none; d=google.com; s=arc-20160816; b=MgKSFPQ+XhLwRNcO1iJcfPfEIvqS2G9y0FCYGJPeSgAM3logXjsnWluFJsrBN9MS7i rDcS1ID9u4HqAL6EAjHi21pTt3auZW3bZEbIoKuPTm9ahYd1RCLkc+II3br35vgWOyWg WFKA+B3luG7Otr5ycuQNSpvqpCSh/OCr95A+tRjsNO8vJDiMvDSmd9c+ClsOXrak96GL z5aPQ/6iMPQlbwHVfnbp9xjA9G77rbEJoZ+7h8VhGj4Wew7URuzqw9962a0j/MQetBXI HBkUj+QUAGbAxoFrH6+4v/5XgJJqtk0ruTycMbhBLMOBSH+z69K0XC+bGzAaYbggN0ax 7wRA== 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=F3whwfc3MxBP/Dl6fgI6kmvp8DpuAv6UONsu09faipM=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=Mix0sKesd/oAJDxx6lPRa0XpWQtGcxxuS4i0mjUm7z7S3mLlNUh7HSgqzdbrsiNdIt jVkgCbcCjlLxJMlmLKGHyPv1CtolpX05/G5gSXuy2M9WJCRa4+uHPA1fZTncOKgGcpEM /izNR+jCWFeipwtzn2jdIvSmKd9iH6JiQQxoCFMrEoj1hlMya6KnNoDfLjIK7OQjkdA9 vZrqsxIl+483nSAGpz+toQjxV4Wzb5GdVkE2wj3GX/BufaJJsjWZUlK2ek8dBKoMeZFf ILlsvGdHU9DE0jo+pCQyeatkIQKhXRL73Ig7As/oi/bBWVVHvT9Y2aodpra3HDPv5E0t 3S+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M4mCSfWP; 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-6b0713356cesi42960576d6.485.2024.06.09.23.22.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:22:57 -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=M4mCSfWP; 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 1sGYPR-0002b6-EC; Mon, 10 Jun 2024 02:21:38 -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 1sGYPO-0002WD-SR for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:34 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYPN-0004Ky-4S for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:34 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2e72224c395so36848891fa.3 for ; Sun, 09 Jun 2024 23:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000491; x=1718605291; 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=F3whwfc3MxBP/Dl6fgI6kmvp8DpuAv6UONsu09faipM=; b=M4mCSfWPSgVHO2J0i7Zq5Bi62VUq/1UlCokJwA8gpDKJzS0X+AQu0AdhdHg9Mc0vBA f7jBbCCilTXkpCR5JF6qkYPdtAp9dRKI4MzZu6lbMk+ICUKTtEL43Jz6RBhlYkr2XlKp DZwmecaU7NxvBEPbcyWQQeBXy3nqv5CyFWbM7oddPA66wHFoBaRDz4+gUg1bovGQb1Qq XqqxXqyy9RiUQuUEUL9Sn4PXHXsAWNRRWgTn9iBmrzH6iXOy3b7v7abBHJ7YQtTtPiTj WGJmZ5E1HkxD5CZGmSNcdHZFLfeQ5jsAIE3++0BahkmIFbUHxgXchjyBZx9OhvsdJ/sb sVdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000491; x=1718605291; 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=F3whwfc3MxBP/Dl6fgI6kmvp8DpuAv6UONsu09faipM=; b=uTJA0oeWDawzoGezdiA3V8O5UWkci33ofdKBMn9OBlheS89JOfEfzkvSb34qd8Ef1h nNLXLofo5Rh1tHSqkzctWu42mh9GFjf5OsaJrqYP5w+kATRDO9KRgJB1UlehZK2+jw9X rt00Iy5FCHHffI2uBuMGpoKQXyzaC1lgWMp6katLUd/CX1RQixkyMo0Ze4+Nw0Z6KQCb EiZvvR5E06AJrW61Hfvqm4ZnZ+BsuKkJNfb4b20/qRRUQ8DL1VbN8TJ6Vd9TPpD6VcTG Sn4LqMYfEBTkbl06SCHu7KY1jkQ8+UUXpBrzDiRjdPbNNzvifgwvV+Lq6bE+CUmmOTx/ ASBQ== X-Gm-Message-State: AOJu0YwK3vpFcpqQaKEWiEQyG0zz3bUzN47mQ5PPBuvcB8KDzqUuv/I1 apZbsy24ejN9DFlaW25p9nUF6Lv+jwerxDglIZizjEb9GFzmSzD3nBKH6V+su/HhWyKF+0L2uXp 7 X-Received: by 2002:a05:651c:1a20:b0:2ea:83b5:40cf with SMTP id 38308e7fff4ca-2eadce1e0e8mr70589411fa.3.1718000490837; Sun, 09 Jun 2024 23:21:30 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421661ecda2sm101183575e9.2.2024.06.09.23.21.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:21:30 -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 04/26] hw/ppc: Avoid using Monitor in ics_pic_print_info() Date: Mon, 10 Jun 2024 08:20:42 +0200 Message-ID: <20240610062105.49848-5-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::236; envelope-from=philmd@linaro.org; helo=mail-lj1-x236.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/xics.h | 2 +- hw/intc/xics.c | 17 ++++++++--------- hw/intc/xics_spapr.c | 4 ++-- hw/ppc/pnv.c | 15 ++++++++------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 1116aa6953..e94d53405f 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -172,7 +172,7 @@ static inline bool ics_irq_free(ICSState *ics, uint32_t srcno) void ics_set_irq_type(ICSState *ics, int srcno, bool lsi); void icp_pic_print_info(ICPState *icp, GString *buf); -void ics_pic_print_info(ICSState *ics, Monitor *mon); +void ics_pic_print_info(ICSState *ics, GString *buf); void ics_resend(ICSState *ics); void icp_resend(ICPState *ss); diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 039e10a0e4..6f4d5271ea 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -35,7 +35,6 @@ #include "qemu/module.h" #include "qapi/visitor.h" #include "migration/vmstate.h" -#include "monitor/monitor.h" #include "hw/intc/intc.h" #include "hw/irq.h" #include "sysemu/kvm.h" @@ -68,12 +67,12 @@ void icp_pic_print_info(ICPState *icp, GString *buf) icp->pending_priority, icp->mfrr); } -void ics_pic_print_info(ICSState *ics, Monitor *mon) +void ics_pic_print_info(ICSState *ics, GString *buf) { uint32_t 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); if (!ics->irqs) { return; @@ -89,11 +88,11 @@ void ics_pic_print_info(ICSState *ics, Monitor *mon) if (!(irq->flags & XICS_FLAGS_IRQ_MASK)) { continue; } - monitor_printf(mon, " %4x %s %02x %02x\n", - ics->offset + i, - (irq->flags & XICS_FLAGS_IRQ_LSI) ? - "LSI" : "MSI", - irq->priority, irq->status); + g_string_append_printf(buf, " %4x %s %02x %02x\n", + ics->offset + i, + (irq->flags & XICS_FLAGS_IRQ_LSI) ? + "LSI" : "MSI", + irq->priority, irq->status); } } diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c index bab9d88218..1926373ebd 100644 --- a/hw/intc/xics_spapr.c +++ b/hw/intc/xics_spapr.c @@ -409,10 +409,10 @@ 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); - - ics_pic_print_info(ics, mon); } static int xics_spapr_post_load(SpaprInterruptController *intc, int version_id) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 5854358f65..3eaf674efa 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -770,20 +770,21 @@ static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon) Pnv8Chip *chip8 = PNV8_CHIP(chip); int i; - ics_pic_print_info(&chip8->psi.ics, mon); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; + + ics_pic_print_info(&chip8->psi.ics, buf); 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); - - ics_pic_print_info(&phb3->lsis, mon); + ics_pic_print_info(&phb3->lsis, buf); } + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } static int pnv_chip_power9_pic_print_info_child(Object *child, void *opaque) From patchwork Mon Jun 10 06:20:43 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: 802990 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799844wro; Sun, 9 Jun 2024 23:24:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU6jYYhf4/TX7u53VWBX5sFPgnswJwRw6/JHEIp8tZtsqA+8F0O+9VUxiQ+6rjn282FR8pagaN419elXUTKaQZ6 X-Google-Smtp-Source: AGHT+IGII+jv2er0DrBfK5SRrE1WAuMvwwJVRXUAGFlsrRKj3giOt0c7lxIwEnTUGmZewZsfh4w6 X-Received: by 2002:a05:6808:2008:b0:3d2:28f8:c7ce with SMTP id 5614622812f47-3d228f8cd32mr2306853b6e.29.1718000659872; Sun, 09 Jun 2024 23:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000659; cv=none; d=google.com; s=arc-20160816; b=lsBiD+E5G4s1jfzb0HRh/1Fcn/8X/Dz/GyEfqibu0PLO9w3KycMGMcaRX9UnpIwORO +4f03Xd+o/NQ0zZZQo8ecAKh64TBJ22c6O+sS3kXbpZsXkM16jNMU6bHtJW1taOcF9db IFsWRmh8Eg/Zx2lYsPss6EqafJw/rG9uCV97MbnKQYnNFBcdZwaqHiGL0e6gPxFsh5GH +Wyz4owwSBuPMpvS8SPvqhRhClgumnLeBOdg+BHzNfXIEszYVgNL391SWomkgVqbUaj4 9SKIg7MDI3tBa2x9Uc41iyCqr0KegcaN/8sd2j3S8u/Y41DDeox1DdTPgYgI//SsuG6z 4m7A== 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=zUkjBdMn0Xwkp4SAMe6a316u0vtim0sUUdnsa/RAHC8=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=CQksUoUXKzmYADVEzF6D/K0YqNn7kHUmqVGsXEklVUZ331suOvETV4qVoLLgG/NTvb vwoWWbczKRzNhAr2WUq7cjkdYqdHIYjXV8FFz1wl8Ge1qdYKyFaJBkwOO9gjMQHC1DP6 qJb56s/e1mjpY06O9sqDX7DtH7SjGduX32mobMAlhHHZlFVrisuz3pjDzdM8+4J+Fg6p QZMKXzF7C+N3UXd2/vwT70GOLhNv9bwiBFMuFnmgHm4v9hP4nSJXYvZY8fzBKBpH9w4z 1BGOZUeVpMpcfYBJZGAi5gkHjATDlTT73m4QubVFbXwIEGRVsiJl3TxkRb6FKYBmQeXL efgg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DGTLrgYu; 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-79554cd8ff6si483748285a.122.2024.06.09.23.24.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:24:19 -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=DGTLrgYu; 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 1sGYPX-0002nm-2e; Mon, 10 Jun 2024 02:21:43 -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 1sGYPU-0002ic-Tm for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:40 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYPS-0004NN-M0 for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:40 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42138eadf64so34770175e9.3 for ; Sun, 09 Jun 2024 23:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000496; x=1718605296; 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=zUkjBdMn0Xwkp4SAMe6a316u0vtim0sUUdnsa/RAHC8=; b=DGTLrgYuEHYE57zMic3K4hmrXFGAf2rBJMk494a1vImKdYVzbaq7F7qyv0XUV68D92 HMiPD210In2UUYcAHk3ykbxCXx/hplXwSF4tPH/hJiNBID3LGZf3Qxuv4Jq20yEWzMid 6r5lL02c3uRMKYVoc/dSdcKs5+X2TJdKqbvRCHQqFnf6QBCCNKp9ZZuggZzsIfAt34Kv Tjwzc1bV8ernXqS6lJ/iDXdsMIkxE9HiNqK6Q8HO1ZaMOS8wS1Pkm86Sp76RlRBo8twe F0eO1a7grX6A+TILhoCPMRnFWcQiqPyh1j+evtM6pLcGy40ossuN/tKIFQxVbeuwjxSi gxPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000496; x=1718605296; 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=zUkjBdMn0Xwkp4SAMe6a316u0vtim0sUUdnsa/RAHC8=; b=Xc7eLCwV6g5hrdb1JrXxqGm0IlNa6QRbN+Hue5s5FQFHLkTOdDBQsi0k/ktoT6eiNv g5Cy1mvU99yb+32dKe/LaHR69tVxsAQ2vAoqG3t8wXhCM1VAvHyTvaGmf1DShx/hkUaj z0wrhYf+qpyvaP4sDhlCl8VA6coCVthkSZL9DLUYRs77SiACma0tMbAVPoEuMNfzhA2T ISvnFjj/EHLY9Ewjdce9pFLj+dhZg8HuiMe2nR1ZmWhKIANCtDzloDt+8fv/KgkWbSG7 FLFPyxjEIzo+Fjgs0PxjaPNFZmbouQeMuGYFLQqrWaF/s1mops5XGcG54btZo7V72uPC 8L3Q== X-Gm-Message-State: AOJu0YzdDZPPtr63u6vPW8RdrrIZ4Ui6oAI/xEBIP0jBg+wER0yeflxV y1EfvN2oIg6Dt/mRcTi8tUYLNOx4QW+NisTnl9hu1q4cfA1JvZK+FhbQLRyLdc3WtbgWgoNpPh0 j X-Received: by 2002:a05:600c:1ca6:b0:421:a575:99b1 with SMTP id 5b1f17b1804b1-421a5759c17mr16675555e9.29.1718000496455; Sun, 09 Jun 2024 23:21:36 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f118f5423sm5662871f8f.98.2024.06.09.23.21.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:21:36 -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 05/26] hw/ppc: Avoid using Monitor in PnvChipClass::intc_print_info() Date: Mon, 10 Jun 2024 08:20:43 +0200 Message-ID: <20240610062105.49848-6-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::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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/pnv_chip.h | 2 +- hw/ppc/pnv.c | 30 ++++++++---------------------- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/include/hw/ppc/pnv_chip.h b/include/hw/ppc/pnv_chip.h index 8589f3291e..a5e428be7c 100644 --- a/include/hw/ppc/pnv_chip.h +++ b/include/hw/ppc/pnv_chip.h @@ -151,7 +151,7 @@ struct PnvChipClass { void (*intc_create)(PnvChip *chip, PowerPCCPU *cpu, Error **errp); void (*intc_reset)(PnvChip *chip, PowerPCCPU *cpu); void (*intc_destroy)(PnvChip *chip, PowerPCCPU *cpu); - void (*intc_print_info)(PnvChip *chip, PowerPCCPU *cpu, Monitor *mon); + void (*intc_print_info)(PnvChip *chip, PowerPCCPU *cpu, GString *buf); ISABus *(*isa_create)(PnvChip *chip, Error **errp); void (*dt_populate)(PnvChip *chip, void *fdt); void (*pic_print_info)(PnvChip *chip, Monitor *mon); diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 3eaf674efa..aed6767c8d 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1129,15 +1129,9 @@ static void pnv_chip_power8_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) } static void pnv_chip_power8_intc_print_info(PnvChip *chip, PowerPCCPU *cpu, - Monitor *mon) + GString *buf) { - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; - icp_pic_print_info(ICP(pnv_cpu_state(cpu)->intc), buf); - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } /* @@ -1222,15 +1216,9 @@ static void pnv_chip_power9_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) } static void pnv_chip_power9_intc_print_info(PnvChip *chip, PowerPCCPU *cpu, - Monitor *mon) + GString *buf) { - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; - xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), buf); - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } static void pnv_chip_power10_intc_create(PnvChip *chip, PowerPCCPU *cpu, @@ -1272,15 +1260,9 @@ static void pnv_chip_power10_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) } static void pnv_chip_power10_intc_print_info(PnvChip *chip, PowerPCCPU *cpu, - Monitor *mon) + GString *buf) { - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; - xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), buf); - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } /* @@ -2363,14 +2345,18 @@ static void pnv_pic_print_info(InterruptStatsProvider *obj, PnvMachineState *pnv = PNV_MACHINE(obj); int i; CPUState *cs; + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; CPU_FOREACH(cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); /* XXX: loop on each chip/core/thread instead of CPU_FOREACH() */ PNV_CHIP_GET_CLASS(pnv->chips[0])->intc_print_info(pnv->chips[0], cpu, - mon); + buf); } + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); for (i = 0; i < pnv->num_chips; i++) { PNV_CHIP_GET_CLASS(pnv->chips[i])->pic_print_info(pnv->chips[i], mon); From patchwork Mon Jun 10 06:20:44 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: 802984 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799652wro; Sun, 9 Jun 2024 23:23:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVFAqIBTik4bQlhdQX6sJmhzaiMUyjKEA304ohLu+i3d7EQbYJiPLg0JzjmYcUhSeeEUjjkpJgIPjJXoaf87CHJ X-Google-Smtp-Source: AGHT+IHaM6I8oZg4V7UqKl5DYHW9i7sUuB7X0aQcz7lBcorvpVCi2jd1ablzd7xvK13cIvvIhRIg X-Received: by 2002:a05:620a:271e:b0:797:9485:3ac9 with SMTP id af79cd13be357-79794853c37mr61690985a.68.1718000606934; Sun, 09 Jun 2024 23:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000606; cv=none; d=google.com; s=arc-20160816; b=DhAz3nrXIymwA2Pcf4SKrHflco11olpNlGHaqQeT/ufcYSkAO7n0Appdvg/gcxR7Wv VAt+itlUNjhqNfLP421W6ntM3VbDW/4NOGG6X5Una6f7MaWEScNSruE7zOz/xfOoKvvr PNv11YqdsT0us5SBlyF/ShqQvv7tnmR4TTYBzY77kI5R6bx44A3sZslOS+oP28HSHg3J eL3aJZM9MVvo7CQTSHB7kGrcqFwM/eUGjiY8almLeiCbtFfIxmeydlJykl/cCTYcnXDV hskZPPLGI5p6PfCFg2Al6um05O2NrVEIGwrSNAAJKtknjYZ+56fyW4lmsHgAfXzYPw3D kidg== 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=GEjq60mSB1k+iK2O63J7dIULjBqZlGimJusHgoahxX0=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=KrIxJr9FVdoOLXMW+90YZoYit/R3FYOUc/dQfb5Z/A4plyiAZ4+Jvm7PkOCfwNjCCT KIoBwf/V6sLYdcEXNpAXWTVgaygFptBF96L0v1i0OyU7Q1t8H9iWMUR27k3QsR6rfANY QWlx5ORIUJwdlxIdQXJfqbEVJfCv0gjWRmQLDWeVq4HExeYUPmSGosFOob7KyMGlqb2B UB0Io7NehOaJ+s+ywsZJAm7iy84b5sKKFo4Xa0Vzv+/kIZ7Oyzd+n3TVvzt+Amdq8eSQ goINCTcuRRbhDOnrjTIBd8SwmILm437nx3kxpQCi2/sLk9gpEuKcIcSvU1sIcOyzTtMW Cesg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pa67ms1l; 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-79533331d9fsi1004123785a.518.2024.06.09.23.23.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:23:26 -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=pa67ms1l; 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 1sGYPc-0002sH-KO; Mon, 10 Jun 2024 02:21:48 -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 1sGYPZ-0002os-Qr for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:45 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYPY-0004OK-24 for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:45 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-35f188e09a8so1035245f8f.2 for ; Sun, 09 Jun 2024 23:21:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000502; x=1718605302; 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=GEjq60mSB1k+iK2O63J7dIULjBqZlGimJusHgoahxX0=; b=pa67ms1l+PkFd+wIBnzjsbJ+RnpmMuxJNsomNViHzg1CtIV9s1pbGAcbxoYe6r8Ybf mupAb5DnHSOXiIfWRpUE1+xcnE2BwuvQqC0rQI+FMUgReeWScr5bQu4JcfeEJCBbqwhf Qrwz9ClCRWfu5ugUw9+Ty/tgQJyUDBpQCP89uX8TH4ZQ5oYBsScFdeAWOy0HXdz5oSYD fvsN1Hh/5bjTvHfpa4UKBbP0yhYileCYFBOpp045XiWMvegdpuHK9OWh7LUhKckm/DS/ VGcvC7DLD9fiMVo9C9iiGPEGrcYEGUkLSt/7Jw0vjs2RD0uRVRZSNL3omfhVX4MWoycz BzaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000502; x=1718605302; 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=GEjq60mSB1k+iK2O63J7dIULjBqZlGimJusHgoahxX0=; b=BB/SZdL7kA+xZ/M/3S/lnTb0ISsHlvj58fAjxt2Jw2+2I7U6WAqsqtyxjYGDnh80m5 +WOphbT5WomhuPBoJk7Cm8wy/s1xMYeLUeQ67PQPk+4XF2sLHnohuUGafnqIj87aTNsf ETTjGwHC3xApEHa8GnAOYEz2DF9N3J6NvKSAnE6dcn5OHhl/zS2xHoauS1+flvbstRcQ N/5cMk1Wtc/8nB3QcmhYmZjcNKSB/pWC5eiG2QlP68Q2M1rF4o3XAR8pPxYtHlRGOn4r ej4Jijzay/r3xex5yDuqg0XY3hHDAWJZiZSm8tyMCaIRw2HdVj4UR66i/whIcVRnILy2 FxcQ== X-Gm-Message-State: AOJu0YyqKvnX3xOYZGjd1sM63W1V6X0qw4hij1eZGUAyfoG3Zf4uNKUc XkDrKPFBu/Nm2NX34/GsYbaSt8Fo96TEH1IMafUcj9GgjEFmw+WGJf2n5OZbD0Ll1jNsB9XIYFm J X-Received: by 2002:adf:eb4a:0:b0:35e:83f4:3e83 with SMTP id ffacd0b85a97d-35efed08be2mr4774612f8f.11.1718000502217; Sun, 09 Jun 2024 23:21:42 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f25dc3f07sm1135062f8f.79.2024.06.09.23.21.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:21:41 -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 06/26] hw/ppc: Avoid using Monitor in xive_end_queue_pic_print_info() Date: Mon, 10 Jun 2024 08:20:44 +0200 Message-ID: <20240610062105.49848-7-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::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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/xive_regs.h | 2 +- hw/intc/spapr_xive.c | 7 ++++++- hw/intc/xive.c | 17 +++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/include/hw/ppc/xive_regs.h b/include/hw/ppc/xive_regs.h index 4a3c9badd3..51e9a2152e 100644 --- a/include/hw/ppc/xive_regs.h +++ b/include/hw/ppc/xive_regs.h @@ -262,7 +262,7 @@ static inline uint64_t xive_end_qaddr(XiveEND *end) } void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon); -void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, Monitor *mon); +void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, GString *buf); void xive_end_eas_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon); /* Notification Virtual Target (NVT) */ diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index b7c12aa432..3357f6325f 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -142,12 +142,17 @@ static void spapr_xive_end_pic_print_info(SpaprXive *xive, XiveEND *end, uint32_t qentries = 1 << (qsize + 10); uint32_t nvt = xive_get_field32(END_W6_NVT_INDEX, end->w6); uint8_t priority = xive_get_field32(END_W7_F0_PRIORITY, end->w7); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; monitor_printf(mon, "%3d/%d % 6d/%5d @%"PRIx64" ^%d", spapr_xive_nvt_to_target(0, nvt), priority, qindex, qentries, qaddr_base, qgen); - xive_end_queue_pic_print_info(end, 6, mon); + xive_end_queue_pic_print_info(end, 6, buf); + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } /* diff --git a/hw/intc/xive.c b/hw/intc/xive.c index a0d7e7ca67..260a94e2ca 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -11,6 +11,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h" @@ -1323,7 +1324,7 @@ static const TypeInfo xive_source_info = { * XiveEND helpers */ -void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, Monitor *mon) +void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, GString *buf) { uint64_t qaddr_base = xive_end_qaddr(end); uint32_t qsize = xive_get_field32(END_W0_QSIZE, end->w0); @@ -1334,7 +1335,7 @@ void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, Monitor *mon) /* * print out the [ (qindex - (width - 1)) .. (qindex + 1)] window */ - monitor_printf(mon, " [ "); + g_string_append_printf(buf, " [ "); qindex = (qindex - (width - 1)) & (qentries - 1); for (i = 0; i < width; i++) { uint64_t qaddr = qaddr_base + (qindex << 2); @@ -1346,11 +1347,11 @@ void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, Monitor *mon) HWADDR_PRIx "\n", qaddr); return; } - monitor_printf(mon, "%s%08x ", i == width - 1 ? "^" : "", - be32_to_cpu(qdata)); + g_string_append_printf(buf, "%s%08x ", i == width - 1 ? "^" : "", + be32_to_cpu(qdata)); qindex = (qindex + 1) & (qentries - 1); } - monitor_printf(mon, "]"); + g_string_append_c(buf, ']'); } void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon) @@ -1365,6 +1366,8 @@ void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon) uint32_t nvt_idx = xive_get_field32(END_W6_NVT_INDEX, end->w6); uint8_t priority = xive_get_field32(END_W7_F0_PRIORITY, end->w7); uint8_t pq; + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; if (!xive_end_is_valid(end)) { return; @@ -1389,8 +1392,10 @@ void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon) if (qaddr_base) { monitor_printf(mon, " eq:@%08"PRIx64"% 6d/%5d ^%d", qaddr_base, qindex, qentries, qgen); - xive_end_queue_pic_print_info(end, 6, mon); + xive_end_queue_pic_print_info(end, 6, buf); } + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); monitor_printf(mon, "\n"); } From patchwork Mon Jun 10 06:20:45 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: 802979 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799548wro; Sun, 9 Jun 2024 23:23:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWFwgcHCzuhZv73n7CLffdlwjiqZsKtvESXNh9pEEa60B06mqq3NpNMLtmVXFWdEDL4eoVe0XyFaoCxbXUDj6Ud X-Google-Smtp-Source: AGHT+IGlJNBVazJCwKoLiB0IEWd/Gr2EAitm/a23A7jymSFsvGqJk2z1i7NRXfH2ydxfQZkFIgk7 X-Received: by 2002:a67:fb48:0:b0:48c:403b:85ce with SMTP id ada2fe7eead31-48c403b862amr2689341137.13.1718000588240; Sun, 09 Jun 2024 23:23:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000588; cv=none; d=google.com; s=arc-20160816; b=AxyEiFV0QlDNaiXaOR0D+WD4JkLLCuDwSt9rMekmSK3UAS945rErnDpygIdsa5RlCj NzaRgcuncLLsnWiWv2CA6xYQgbeEIW0pDJEroo+rSgeExHABBPxjS0AK6REmGBtXhmCZ Z69OinfJqOUoFTCb09iTJOLz8I9J/gESeBwhgvDry3D69uI1AqzZuxKoU5Mu8e8Cg11L ipnMnu58P3pw/KzxcAgO5/9y5DshBh0waVuU2WSIyx6D0axhWVUNv7LPbgTh0p7gltGm LLfqR91bRugNqdBU0nFvihwfibfagUEYZou4nRf7B351TY0cU0YRWSjmcELTRzh7oBxJ 4z3g== 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=q3AV06pPtzbI7+PF3PUt7wjEhH3sPFaxkZhNhMweE8Y=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=v/9L9Ja7q4zJ0Ne+IztX/d1UiJfM14O/BmFkGm9eLvxVKeeEe8Z5GWbTslgwMkLDgz TVTAhBoIZbUDiaWPi1rdJJVS8uh8K10J6+nxjuxa47g6JniNQC6ECZQSNmrepjYpx2/q mpbmNAh0VVs4dP/mjdxp0WTM1MsP2S0Mz02MDQwIY40lwhT1kNLxJHIaccVXe5saBz2x 1OfTdUfnK6WMOjdxC2ZjGLC/pIWOcZANAOsy5fCkYZo+r8vEN6LFgsfnRQ+wY47QKTY1 xrz6GoOQxtCIVX3FB1/1PUvXXxX1feF70kqnqGTrwdOxSR2LbOf98cULS6l8XuutcZyi vVvQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cAwLqkYz; 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-795521ab773si512041085a.4.2024.06.09.23.23.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:23:08 -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=cAwLqkYz; 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 1sGYPh-0002up-NU; Mon, 10 Jun 2024 02:21:53 -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 1sGYPf-0002tf-QQ for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:51 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYPd-0004Oy-Rc for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:51 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-52c7f7fdd24so1589636e87.1 for ; Sun, 09 Jun 2024 23:21:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000508; x=1718605308; 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=q3AV06pPtzbI7+PF3PUt7wjEhH3sPFaxkZhNhMweE8Y=; b=cAwLqkYz6vYy4hcNpJIAcyW05v+LMU0h5cqSZ7OLPMcfcdMsca3P+kofFB2yf0KwYg IGABAK2/7eOAxw2E88MlJbbhybOnRhYrFVvNsZ7eVI9hDGQk4NDTUYuLdOYa3P1Me7CU qFEUBmAlhf6RL6aMaMfQwWEwRmKqYEQ0bZTHPF0w4zAB0FUGjTVzDpXUoy+VQrrAdo3y jPNbiK8QNM8aF0yJ/gPGPtNj2yoBFQgGi50DHjioMZz+io4xBEQr2BxTfEdCtVsQyv+i BSWyQtVloddKAQuR3kJBPk6DuKOZcjAtqWQ8FAlmqQo4yHGbM/bmONslhCKw/dhL8DIU gXiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000508; x=1718605308; 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=q3AV06pPtzbI7+PF3PUt7wjEhH3sPFaxkZhNhMweE8Y=; b=gCfOMldz5nZe6EZjQESZM8xkV29jXS7E5JP6vbuUV7vW7rlksrZGYl3IVMkmH5J//7 sj/uLg/DOZcQs5ms4vjcnJN9pvVi4IugJvLj7bXpVz7FHyWYe+YUXdZRfIy+KVDDJYX2 6N4eJw+3pJPzRJvK7z3qnLawiUN7kjek1csTRcItCwzltaqbd4Oh2GQMh8UoSpRxkqcV 03knfsU9X9rLvxQj0wWX3qQLga5ZyDAFeCDB5dL87F4bBbSkZ35mgRLfwrSRjDJ+D3Fa GxqxQEkm8zY/C+701+JAwMpIBu9+hK13qpETb9vawKbFKd8bRGBOTc/Iy3LFhHfa2T9K eJDA== X-Gm-Message-State: AOJu0Yz4MZkZMU8SRpRFJwKtxEseQ7b0xGzJu6N4ItRdLB+LtULOBoE8 bkxJ1YurjfPKAuIJA4G0fgBxx4H4FzuptiyvWHbbQRvXNGQKh2GSufsmF1u11d72wTiWg9fxl2n H X-Received: by 2002:ac2:490b:0:b0:51d:1c86:a274 with SMTP id 2adb3069b0e04-52bb9f818ebmr4502494e87.34.1718000507785; Sun, 09 Jun 2024 23:21:47 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421f23d06ddsm11564355e9.8.2024.06.09.23.21.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:21:47 -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 07/26] hw/ppc: Avoid using Monitor in spapr_xive_end_pic_print_info() Date: Mon, 10 Jun 2024 08:20:45 +0200 Message-ID: <20240610062105.49848-8-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::134; envelope-from=philmd@linaro.org; helo=mail-lf1-x134.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é --- hw/intc/spapr_xive.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index 3357f6325f..d571645e9e 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -133,7 +133,7 @@ static int spapr_xive_target_to_end(uint32_t target, uint8_t prio, * structure dumping only the information related to the OS EQ. */ static void spapr_xive_end_pic_print_info(SpaprXive *xive, XiveEND *end, - Monitor *mon) + GString *buf) { uint64_t qaddr_base = xive_end_qaddr(end); uint32_t qindex = xive_get_field32(END_W1_PAGE_OFF, end->w1); @@ -142,17 +142,12 @@ static void spapr_xive_end_pic_print_info(SpaprXive *xive, XiveEND *end, uint32_t qentries = 1 << (qsize + 10); uint32_t nvt = xive_get_field32(END_W6_NVT_INDEX, end->w6); uint8_t priority = xive_get_field32(END_W7_F0_PRIORITY, end->w7); - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; - monitor_printf(mon, "%3d/%d % 6d/%5d @%"PRIx64" ^%d", - spapr_xive_nvt_to_target(0, nvt), - priority, qindex, qentries, qaddr_base, qgen); + g_string_append_printf(buf, "%3d/%d % 6d/%5d @%"PRIx64" ^%d", + spapr_xive_nvt_to_target(0, nvt), + priority, qindex, qentries, qaddr_base, qgen); xive_end_queue_pic_print_info(end, 6, buf); - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } /* @@ -198,13 +193,18 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon) if (!xive_eas_is_masked(eas)) { uint32_t end_idx = xive_get_field64(EAS_END_INDEX, eas->w); XiveEND *end; + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; assert(end_idx < xive->nr_ends); end = &xive->endt[end_idx]; if (xive_end_is_valid(end)) { - spapr_xive_end_pic_print_info(xive, end, mon); + spapr_xive_end_pic_print_info(xive, end, buf); } + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } monitor_printf(mon, "\n"); } From patchwork Mon Jun 10 06:20:46 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: 802982 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799640wro; Sun, 9 Jun 2024 23:23:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXlLJtvxVvL9FdD61EtuKXuerQsPAzfdPqu8nNGvPUmtDCR9uPGv8jIRUquhbE30iAa3Y5Gl/3gJ95p9vWk62mq X-Google-Smtp-Source: AGHT+IGpv7YLeTxtqOEAFuMDXFzRGPDorlugiPFn6MxqJGTOmA8t3mJo616m3YI1O6yxJr2Y0Khr X-Received: by 2002:ac8:5acc:0:b0:43f:f615:c5d6 with SMTP id d75a77b69052e-440362c1ebamr222195451cf.21.1718000605426; Sun, 09 Jun 2024 23:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000605; cv=none; d=google.com; s=arc-20160816; b=foOY/glI7m/UnS7jtiDZpgkPYxDqer90W0/PWLB1ivGLY/YbnwtVaeZeS0XWlc1Au4 oLE9YftzsER3mizyyElpwhx6IWvkfVYeeD+PKS+qb7UV7DaN9CewQChMymNPtS7UZz5f 6MEbACkZKRSbs2pxLnHfY9IIeSBhRRh5uf/3MKwMfMKoyI1IXnwsKarBdstkqLMpAXrn QOl0DrkN/maU2REujpTGMbuP8DIzki4SNy2qqq5b7ZPvdBZmQWpgCsj+VZpXtZ5QHgdu HqVWdC/+6utiw/8FfPIEcjL5AHCPePSLsYB4TZbP46ElklYd98HfMc6+mvR8Wutd29fV HNVQ== 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=jX2GHhOc9H8vjkcZGjrbxVcD9p/2Wp7GIx+OlbcBx8Y=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=o7AGbB865mmpmjmw1zs3mq4J73fFVaUzEQ9tTJXiViKXTdfOMrIloJbY+bEWpbU1LD +Mc9dA1jeETi1IcQY9YLAmLMQW0guGIOV29mrIepMb0RsL24I0oaMvWCALFDc57AyRvr 9r8//h9UuwygYyH/+K7rMDmEF5e2k2hr5tugrCKa5UuZgCSTyQQ44g2jA2sKbNWTRV9c Hna2M+jt3MW34clcS2w6H/sqrUn4QZrkBG8SvGsrMDOgiPa603he5U5+Xdu0ohQfzMzz 8yUCTYRoeDMZu4mhlArPKZo7xOndcVBDTn8YPAdZDgKV9PlQ3uTMaosiTkmRDz3kksrk zkuQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KR6gQkBn; 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-44038a86b1esi70182021cf.207.2024.06.09.23.23.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:23:25 -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=KR6gQkBn; 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 1sGYPn-0002wO-6J; Mon, 10 Jun 2024 02:21:59 -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 1sGYPk-0002vk-Tn for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:56 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYPj-0004Pk-9T for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:21:56 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-35f1dc4ab9aso901073f8f.3 for ; Sun, 09 Jun 2024 23:21:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000513; x=1718605313; 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=jX2GHhOc9H8vjkcZGjrbxVcD9p/2Wp7GIx+OlbcBx8Y=; b=KR6gQkBnnojbV93o3AsEemouJeR/04eF9ceHa5sYu0+9T7LXjs41lbGkWuERLwiCac GehJGTUc+uZVbuBdYWyzXAbEP99/px7JarzULMsUGaIr0aCdpsxRsLNzFFBMzu/Idhqi lW/1tt9DBSs0X30Kmjfmh/WuqaSCtr+df1u53/fs7310n7QzfHqXYivTfUvY6+pigw9b oN4xBq9QqTS/xEqkSBueZeX762m2G3JNX29bl7akbU1Nj3KgL297toHQ5hjKIFjyepKi YsbW+FlPQkLUTp7ix/0nLJLk4uhTjHV8Pkisadm8ikkn0L6BZH+4uYJHk+U+gJib/zd+ XmBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000513; x=1718605313; 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=jX2GHhOc9H8vjkcZGjrbxVcD9p/2Wp7GIx+OlbcBx8Y=; b=JQoB58BZKQeqvfLbD45OGE1Lv0FBcTEjg/mR4RHpYFcBGLWPWm9n2GcQYef5GO+qF1 eEQBqEDsozQjEmu7f7CKQIUIuFaYV8LFMvg6zPVfgXMBU1Sjtj4phcUwJTjUYZLcFgxY NNGSPPOfO2peHdpvsoWn300qUUvZT4sKo2mVHh3k3bP04HLkFvklH1+xJkRE63QNOHeP FGyTKaseu27nK6YksPpO8v4pYq/77ZnwHHEcfGAbuVYc2x3mfOKmIgG7d9XAqijKvazl V+uBab/tn+3AHubrfDX3YnrPTgAR+YpCiWTn1YXz/9/o+bzqP9UTeApqYN8qQIyNE+9C Mw9g== X-Gm-Message-State: AOJu0Ywa+Bos10aclJLrkkitkXXLzlDglpXkkrcwhTRn3XJgwZ1NJYLb jH6j7HjJYOYDZcYdxE3aR+5rGmzrQf9YC1B++CmEejDeyVtUcwjbLX1qrpOwSekFyO1r1yGrORK I X-Received: by 2002:a05:6000:1a8d:b0:35f:2621:e4b0 with SMTP id ffacd0b85a97d-35f2621e572mr626127f8f.2.1718000513539; Sun, 09 Jun 2024 23:21:53 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f209c4a4asm2866920f8f.43.2024.06.09.23.21.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:21:53 -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 08/26] hw/ppc: Avoid using Monitor in spapr_xive_pic_print_info() Date: Mon, 10 Jun 2024 08:20:46 +0200 Message-ID: <20240610062105.49848-9-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::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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é --- hw/intc/spapr_xive.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index d571645e9e..9d0d5948ff 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -157,7 +157,7 @@ static void spapr_xive_end_pic_print_info(SpaprXive *xive, XiveEND *end, #define spapr_xive_in_kernel(xive) \ (kvm_irqchip_in_kernel() && (xive)->fd != -1) -static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon) +static void spapr_xive_pic_print_info(SpaprXive *xive, GString *buf) { XiveSource *xsrc = &xive->source; int i; @@ -172,7 +172,7 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon) } } - monitor_printf(mon, " LISN PQ EISN CPU/PRIO EQ\n"); + g_string_append_printf(buf, " LISN PQ EISN CPU/PRIO EQ\n"); for (i = 0; i < xive->nr_irqs; i++) { uint8_t pq = xive_source_esb_get(xsrc, i); @@ -182,19 +182,17 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon) continue; } - monitor_printf(mon, " %08x %s %c%c%c %s %08x ", i, - xive_source_irq_is_lsi(xsrc, i) ? "LSI" : "MSI", - pq & XIVE_ESB_VAL_P ? 'P' : '-', - pq & XIVE_ESB_VAL_Q ? 'Q' : '-', - xive_source_is_asserted(xsrc, i) ? 'A' : ' ', - xive_eas_is_masked(eas) ? "M" : " ", - (int) xive_get_field64(EAS_END_DATA, eas->w)); + g_string_append_printf(buf, " %08x %s %c%c%c %s %08x ", i, + xive_source_irq_is_lsi(xsrc, i) ? "LSI" : "MSI", + pq & XIVE_ESB_VAL_P ? 'P' : '-', + pq & XIVE_ESB_VAL_Q ? 'Q' : '-', + xive_source_is_asserted(xsrc, i) ? 'A' : ' ', + xive_eas_is_masked(eas) ? "M" : " ", + (int) xive_get_field64(EAS_END_DATA, eas->w)); if (!xive_eas_is_masked(eas)) { uint32_t end_idx = xive_get_field64(EAS_END_INDEX, eas->w); XiveEND *end; - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; assert(end_idx < xive->nr_ends); end = &xive->endt[end_idx]; @@ -203,10 +201,8 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon) spapr_xive_end_pic_print_info(xive, end, buf); } - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } - monitor_printf(mon, "\n"); + g_string_append_c(buf, '\n'); } } @@ -717,10 +713,10 @@ 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); - - spapr_xive_pic_print_info(xive, mon); } static void spapr_xive_dt(SpaprInterruptController *intc, uint32_t nr_servers, From patchwork Mon Jun 10 06:20: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: 802988 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799753wro; Sun, 9 Jun 2024 23:23:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUU7LOVIyr2+uJScbtTKfmXGv3Z7lgif4bdqxBoJ9p2ah6H7sFv5sBvOY8Byuk1DB+F9ro2/GrTTRKrNOGNdPGX X-Google-Smtp-Source: AGHT+IHkDzcScfGYI4/ZObacu3nv0J399UhpdrS7vpjGuTU6r4d2YepSWyHBBWHjLd9LD9k8R0Pe X-Received: by 2002:a9d:5a04:0:b0:6f9:599a:b681 with SMTP id 46e09a7af769-6f9599ab87cmr7791536a34.17.1718000635172; Sun, 09 Jun 2024 23:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000635; cv=none; d=google.com; s=arc-20160816; b=MjGp1AcFJIcGE+tdv3QOmubdfj3oO7AnFpegLb9U5zludYx3qSd5y7w+2Sf/NRRc30 +1B4QQvTpSEt2fYhFMWklzbueUW2tgASnldutWNLPkjEZFphMIsLyfcRfOM7dd3W6kBq Z46LXyCVzll6puziIfIMzWSdCCXmrAlGAU2CgleWwRn9oy9tkZbwn/d9SOQ6Ontu937l ej//2Yg5M79HQ8N2uHFMLK4K2PI9xvhn/rpf9yu5Sr8lpkl6DGaiGEZmfYNA0OsqIS/K UG+X2xWAm9jDrtmBKGaa8JH2kzDhZpcmJ2q1Ejeod5rnEoZ4fjPBDJsFXeHBs9X55biN tDaQ== 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=z6td0QzB0OX12yCkGcEdYwy+GAJGeNI6h457pOg9Qi4=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=XjR3NMzDSuIKw3z3Pzr4I2sMAlpbFz4jROYeb/IWQWYHuZtrHxtlv2A5t/ScyvbfFU nTgae9PyBZUKewFA5hu9U210UHYcYkEA0nsucgsHUII0FuAgVl6a9nvLI+V0RL0T9zvd /NIlNCj/5VFFFBYXifgCxp+6+8WJsb2w2yvS+XY2lElQIP5qWfo/Ac+tKd1Yr+tigHpn hvM5atjlPz0ChvhEfeVAK1kzjCkf3Vi6VwENX2+pQ9JMZ/4gSHzagDCOaFmUz1ijg1Hx 5Gy25H08wI/DtgThQwdglLAmy+xICyRfAsfARuESDMouHkVN5CjlwI27QpT4AnbAeO9F UN4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="U9u/GWoG"; 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-6b083430cacsi4651906d6.571.2024.06.09.23.23.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:23:55 -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="U9u/GWoG"; 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 1sGYPs-0002z2-Ga; Mon, 10 Jun 2024 02:22:04 -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 1sGYPr-0002y1-5P for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:03 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYPp-0004Qh-7j for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:02 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4217c7eb6b4so9999685e9.2 for ; Sun, 09 Jun 2024 23:22:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000519; x=1718605319; 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=z6td0QzB0OX12yCkGcEdYwy+GAJGeNI6h457pOg9Qi4=; b=U9u/GWoGxRyaT0DBJP9zcFG73m4fj3nCxS874/iHrQ7EeaoEx8f9WTrpjwEXTKuDRH rcqoJdxejovezMdsPsEaVKb2QHcNk6/OdxXXmfhogMfR84P3lI+wCxg9MASehLVULa0z CKRI53qQUMfOlffXZQZWNEFcYRHbgixp1xzXrO8B1klB8aZl/SA3cvPWqnyiZKUa1JAn NFg9Tgj6iW6ZG/YcM+s6djPZRrYBk7B15jk0izhuPKtK2BedQX8SV6cw4DIdoHk6Hoeu +9GLGUMu7XTAp/67UPhrVNljpExHkhlOsNgCsA4Z8RIUfknfMOYpouf0NkTFo3OxQQSq nNVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000519; x=1718605319; 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=z6td0QzB0OX12yCkGcEdYwy+GAJGeNI6h457pOg9Qi4=; b=rfWfIJyV6gtlSf/PqthRyAIwl42djo2ZLAHYhuQVhGdBLA9tiKEsYOTrw0Fe6bxE2/ Fg5PQj2clY7dB5gqaa4iSMrEbnL3hQhjcgPNa8RQwQbC7FSQmz/3o1e2Iied3/7jTkdp yxdjvXcfFu6kYiCJQlApdRYS2keNdfc54H/pKuBCX7v+Nyj52X299WABfFKrhIzOFxFX zNirdQr5/ox58gL2jYD0qAZ6sjE39F+xpOOoRdX8o6ntLa30ZYrWDca4yMu6RgilJiEW BRf04X2lz89tTnp7tr7SnLNoceDjGc0m6St4PrzPS0oP8xzxy+2oEeO6FH01leHug7tb rBmw== X-Gm-Message-State: AOJu0YxnA2GfCXIeH4chtEjDTkX3F/gI/ERuHhzQi9Q2jNObw2Hu/z5A GHdM4IVDtvIcwlAvLrXgndv/1n2NXlu2IoopRGOqFj4nHmuWFF92fi6nG11FuKnTW8T0iKxM7KJ E X-Received: by 2002:a05:600c:1e0d:b0:418:f5a9:b91c with SMTP id 5b1f17b1804b1-42164a32c03mr70524075e9.33.1718000519447; Sun, 09 Jun 2024 23:21:59 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421727aac08sm89259285e9.43.2024.06.09.23.21.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:21:59 -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 09/26] hw/ppc: Avoid using Monitor in xive_source_pic_print_info() Date: Mon, 10 Jun 2024 08:20:47 +0200 Message-ID: <20240610062105.49848-10-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::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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/xive.h | 2 +- hw/intc/pnv_xive.c | 11 ++++++++--- hw/intc/pnv_xive2.c | 8 +++++++- hw/intc/xive.c | 16 +++++++--------- hw/pci-host/pnv_phb4.c | 20 ++++++++++++++------ hw/ppc/pnv_psi.c | 12 +++++++++--- 6 files changed, 46 insertions(+), 23 deletions(-) diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index bc1cbad8a8..28c181faa2 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -314,7 +314,7 @@ static inline bool xive_source_is_asserted(XiveSource *xsrc, uint32_t srcno) } void xive_source_pic_print_info(XiveSource *xsrc, uint32_t offset, - Monitor *mon); + GString *buf); static inline bool xive_source_irq_is_lsi(XiveSource *xsrc, uint32_t srcno) { diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index da10deceb8..520d7e0acd 100644 --- a/hw/intc/pnv_xive.c +++ b/hw/intc/pnv_xive.c @@ -11,6 +11,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h" @@ -1857,10 +1858,14 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) XiveNVT nvt; int i; uint64_t xive_nvt_per_subpage; + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; - monitor_printf(mon, "XIVE[%x] #%d Source %08x .. %08x\n", chip_id, blk, - srcno0, srcno0 + nr_ipis - 1); - xive_source_pic_print_info(&xive->ipi_source, srcno0, mon); + g_string_append_printf(buf, "XIVE[%x] #%d Source %08x .. %08x\n", + chip_id, blk, srcno0, srcno0 + nr_ipis - 1); + xive_source_pic_print_info(&xive->ipi_source, srcno0, buf); + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); monitor_printf(mon, "XIVE[%x] #%d EAT %08x .. %08x\n", chip_id, blk, srcno0, srcno0 + nr_ipis - 1); diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c index 4b8d0a5d81..83e0f6b09f 100644 --- a/hw/intc/pnv_xive2.c +++ b/hw/intc/pnv_xive2.c @@ -10,6 +10,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h" @@ -2116,10 +2117,15 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon) Xive2Nvp nvp; int i; uint64_t xive_nvp_per_subpage; + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; monitor_printf(mon, "XIVE[%x] Source %08x .. %08x\n", blk, srcno0, srcno0 + nr_esbs - 1); - xive_source_pic_print_info(&xive->ipi_source, srcno0, mon); + xive_source_pic_print_info(&xive->ipi_source, srcno0, buf); + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); monitor_printf(mon, "XIVE[%x] EAT %08x .. %08x\n", blk, srcno0, srcno0 + nr_esbs - 1); diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 260a94e2ca..1adb0439c5 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -1209,22 +1209,20 @@ void xive_source_set_irq(void *opaque, int srcno, int val) } } -void xive_source_pic_print_info(XiveSource *xsrc, uint32_t offset, Monitor *mon) +void xive_source_pic_print_info(XiveSource *xsrc, uint32_t offset, GString *buf) { - int i; - - for (i = 0; i < xsrc->nr_irqs; i++) { + for (unsigned i = 0; i < xsrc->nr_irqs; i++) { uint8_t pq = xive_source_esb_get(xsrc, i); if (pq == XIVE_ESB_OFF) { continue; } - monitor_printf(mon, " %08x %s %c%c%c\n", i + offset, - xive_source_irq_is_lsi(xsrc, i) ? "LSI" : "MSI", - pq & XIVE_ESB_VAL_P ? 'P' : '-', - pq & XIVE_ESB_VAL_Q ? 'Q' : '-', - xive_source_is_asserted(xsrc, i) ? 'A' : ' '); + g_string_append_printf(buf, " %08x %s %c%c%c\n", i + offset, + xive_source_irq_is_lsi(xsrc, i) ? "LSI" : "MSI", + pq & XIVE_ESB_VAL_P ? 'P' : '-', + pq & XIVE_ESB_VAL_Q ? 'Q' : '-', + xive_source_is_asserted(xsrc, i) ? 'A' : ' '); } } diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 075499d36d..4b453997e7 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -10,6 +10,7 @@ #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" @@ -1807,11 +1808,18 @@ void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon) 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; - monitor_printf(mon, "PHB4[%x:%x] Source %08x .. %08x %s @%"HWADDR_PRIx"\n", - phb->chip_id, phb->phb_id, - offset, offset + phb->xsrc.nr_irqs - 1, - abt ? "ABT" : "", - notif_port); - xive_source_pic_print_info(&phb->xsrc, 0, mon); + g_string_append_printf(buf, + "PHB4[%x:%x] Source %08x .. %08x " + "%s @%"HWADDR_PRIx"\n", + phb->chip_id, phb->phb_id, + offset, offset + phb->xsrc.nr_irqs - 1, + 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_psi.c b/hw/ppc/pnv_psi.c index 26460d210d..922ac07b2f 100644 --- a/hw/ppc/pnv_psi.c +++ b/hw/ppc/pnv_psi.c @@ -25,6 +25,7 @@ #include "qemu/module.h" #include "sysemu/reset.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "monitor/monitor.h" @@ -980,11 +981,16 @@ type_init(pnv_psi_register_types); void pnv_psi_pic_print_info(Pnv9Psi *psi9, Monitor *mon) { PnvPsi *psi = PNV_PSI(psi9); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; uint32_t offset = (psi->regs[PSIHB_REG(PSIHB9_IVT_OFFSET)] >> PSIHB9_IVT_OFF_SHIFT); - monitor_printf(mon, "PSIHB Source %08x .. %08x\n", - offset, offset + psi9->source.nr_irqs - 1); - xive_source_pic_print_info(&psi9->source, offset, mon); + g_string_append_printf(buf, "PSIHB Source %08x .. %08x\n", + offset, offset + psi9->source.nr_irqs - 1); + xive_source_pic_print_info(&psi9->source, offset, buf); + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } 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; } From patchwork Mon Jun 10 06:20:49 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: 802987 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799685wro; Sun, 9 Jun 2024 23:23:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVcE2ajnZ4Il44WncDY09AvNrE5V73r49W8MEUVbR6lwbkkE5wLtr+ekS+R84PmdPGp5stRpuK+4fo+vXVWbJxe X-Google-Smtp-Source: AGHT+IHkYvhy66mlCSHvjWm/BQPV2wW2pJW4WxHCpQm28agW3y2n7gz+569dCsJbslmLP8vc0NHw X-Received: by 2002:a05:622a:1310:b0:43a:e9a6:47e2 with SMTP id d75a77b69052e-44041b9596emr103525711cf.36.1718000615522; Sun, 09 Jun 2024 23:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000615; cv=none; d=google.com; s=arc-20160816; b=RmtbzocCNBlMscQl6Gtauq9TBcOoV1PQw99I3AQimhW94wlS6wFA1Sn/df8SntFZf8 xBWpW5+fh3uZvGbfKg+3ZvXpb5XRgp8tdKzKnvNWu0Ik+Fri8fErFOk2arHfdGKWxdJ2 mIutajfDB4vwkaHtquxeak48vvDLXuyhBA3sWtFlMosJq4Hau4EtxtdLnWer81VC2Emr obYcM9463TM5cqXYcZjwpK4sd0PpEnkixllLS1h4GHtZ+MnCNB4sA/ZwQrnWlthE2sQ9 Zfcgsxx92WWvQY8L0ayjgxQUJqM0YZ2jEasYTTwaSCo021m+eJrssilEuk+C+n+n/lz3 6/Vw== 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=O4OQnqhZPPe0S3e5bkGivQbSupbVDgnVRofBomnV0rI=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=i54jOMOUAsNXUf918gO2NzTYmbCNcYb09Iepeb0nMjXErBpzETHLgow00looTPfu13 WDNWGUJZIjeUH05sjh7JleaavppvmmvhoiNnjzamvO65CB/s5enKivGrmgjJog6fcvNa lHsvBnVCKy6lsVYo/wsZSC6OVeci5isWvUTw45DKUR/GOLiQe3ssgi7a3kDPfNvf4TXt VVn/1fzAw1meFk18ioMDiCIPGK5YYReNDC3pxzAhtEmK3ctXiamUMq2hvfCmdTijdXI0 afifOde7m64yGkiQPTtJNMIYHoqTl9SsGOHprj0/2w3B+qe30qJaEtjY981fQ/JvPXV1 UBsQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ovp38pmP; 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-440a1e1a1e5si22092231cf.262.2024.06.09.23.23.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:23:35 -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=ovp38pmP; 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 1sGYQI-00044b-Sq; Mon, 10 Jun 2024 02:22:32 -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 1sGYQ5-0003Mw-H8 for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:20 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQ0-0004Tk-NV for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:14 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-52c85a7f834so1086080e87.0 for ; Sun, 09 Jun 2024 23:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000531; x=1718605331; 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=O4OQnqhZPPe0S3e5bkGivQbSupbVDgnVRofBomnV0rI=; b=ovp38pmPvo3JYc//WTmyxUARhTc8Y/k+Mp9QN/lIU7oq+oZTKk+gPlVMDZP4+RgK42 AUQgtGKZ1dHCPfGYOhUBnu11D+N1N6nFriPIXKZbDR1BMuqRgtFhfCd7zgM1DucpV3CU 7irXbMcK8uDOH33O2xEPavH6JGUBFCCEPmbIUIQoFtdjyiE8v1Zz+0m9RbGp99gZ3t8y OQ6ezaMcx2P+d/MIjoWr4Nv/w7bOg9sk+JmIRrLKxBAjJA5vzsPt2QSVJjfBMgspNadT xQh+WRbZGpiCCv/l7bx1zEN+48H6E/9Yrweh+v5VXBsNJQKZYM3aBAPnc1M/9yKk08n7 hEqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000531; x=1718605331; 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=O4OQnqhZPPe0S3e5bkGivQbSupbVDgnVRofBomnV0rI=; b=YnC9jUohdDQsYxMkOcHoCOQmXgxAioNN3yY6BS51aNaULaG6E2DT0Ewx6oF33bnYTM l+MBrOIT9OyfASkgzrpbtnDcMFCPuaKFvLQle4C+KlSyu2KzBUt86e+iOVSoYZ9hUYqi WYPHyfNjnhu88TP/ceKCD9h+CNlwLGL09FvgCD+AxAhmw5rGeUmt7yzFxu2CX6jllIEA NkogqkdUALg7aIj+ldJlqbfW1qq7Z8isp4RX6NgaLhZ6I02WLsOgdnqEiSrbjzCKtrLf QZbeZIew7YihtgK9nHhu/jCahEQI1/YXXDSb24M/s22WX3zYsGbCcSOKy58Czh0EHF1m T1HQ== X-Gm-Message-State: AOJu0YzqUScYbyYLi7Utk10GYv5AZbNT3mPxoEfVqnmZunOAkDElaBpv lYY/ldPMbIxutLaSmDTRvhb3NyF3Upq+baWthmNIfbs68QhsjhaysOn7nkWThhs7pw3eLDnHFeR / X-Received: by 2002:ac2:4d1b:0:b0:52b:84bd:345e with SMTP id 2adb3069b0e04-52bb9fc46fcmr4392918e87.43.1718000530791; Sun, 09 Jun 2024 23:22:10 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f25907f15sm1290544f8f.45.2024.06.09.23.22.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:10 -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 11/26] hw/ppc: Avoid using Monitor in xive_eas_pic_print_info() Date: Mon, 10 Jun 2024 08:20:49 +0200 Message-ID: <20240610062105.49848-12-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::136; envelope-from=philmd@linaro.org; helo=mail-lf1-x136.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/xive_regs.h | 2 +- hw/intc/pnv_xive.c | 10 +++++----- hw/intc/xive.c | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/hw/ppc/xive_regs.h b/include/hw/ppc/xive_regs.h index 51e9a2152e..dd4a76bcf0 100644 --- a/include/hw/ppc/xive_regs.h +++ b/include/hw/ppc/xive_regs.h @@ -167,7 +167,7 @@ typedef struct XiveEAS { #define xive_eas_is_valid(eas) (be64_to_cpu((eas)->w) & EAS_VALID) #define xive_eas_is_masked(eas) (be64_to_cpu((eas)->w) & EAS_MASKED) -void xive_eas_pic_print_info(XiveEAS *eas, uint32_t lisn, Monitor *mon); +void xive_eas_pic_print_info(XiveEAS *eas, uint32_t lisn, GString *buf); static inline uint64_t xive_get_field64(uint64_t mask, uint64_t word) { diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index 520d7e0acd..c377823522 100644 --- a/hw/intc/pnv_xive.c +++ b/hw/intc/pnv_xive.c @@ -1864,19 +1864,19 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) g_string_append_printf(buf, "XIVE[%x] #%d Source %08x .. %08x\n", chip_id, blk, srcno0, srcno0 + nr_ipis - 1); xive_source_pic_print_info(&xive->ipi_source, srcno0, buf); - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); - monitor_printf(mon, "XIVE[%x] #%d EAT %08x .. %08x\n", chip_id, blk, - srcno0, srcno0 + nr_ipis - 1); + g_string_append_printf(buf, "XIVE[%x] #%d EAT %08x .. %08x\n", + chip_id, blk, srcno0, srcno0 + nr_ipis - 1); for (i = 0; i < nr_ipis; i++) { if (xive_router_get_eas(xrtr, blk, i, &eas)) { break; } if (!xive_eas_is_masked(&eas)) { - xive_eas_pic_print_info(&eas, i, mon); + xive_eas_pic_print_info(&eas, i, buf); } } + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); monitor_printf(mon, "XIVE[%x] #%d ENDT\n", chip_id, blk); i = 0; diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 1adb0439c5..b2203b721b 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -1921,17 +1921,17 @@ static const TypeInfo xive_router_info = { } }; -void xive_eas_pic_print_info(XiveEAS *eas, uint32_t lisn, Monitor *mon) +void xive_eas_pic_print_info(XiveEAS *eas, uint32_t lisn, GString *buf) { if (!xive_eas_is_valid(eas)) { return; } - monitor_printf(mon, " %08x %s end:%02x/%04x data:%08x\n", - lisn, xive_eas_is_masked(eas) ? "M" : " ", - (uint8_t) xive_get_field64(EAS_END_BLOCK, eas->w), - (uint32_t) xive_get_field64(EAS_END_INDEX, eas->w), - (uint32_t) xive_get_field64(EAS_END_DATA, eas->w)); + g_string_append_printf(buf, " %08x %s end:%02x/%04x data:%08x\n", + lisn, xive_eas_is_masked(eas) ? "M" : " ", + (uint8_t) xive_get_field64(EAS_END_BLOCK, eas->w), + (uint32_t) xive_get_field64(EAS_END_INDEX, eas->w), + (uint32_t) xive_get_field64(EAS_END_DATA, eas->w)); } /* From patchwork Mon Jun 10 06:20:50 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: 802981 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799601wro; Sun, 9 Jun 2024 23:23:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVm4hALRhMUjlpxVXhuU/bCUqc9qa0uarNlBtQS/hTIRIIVEIL4e9tLn5oVlrdfMVWn8A7kLTyvRbs+qLiJmtQX X-Google-Smtp-Source: AGHT+IGK8ItPLDHHibDtfkR73N3WmYAvS+bAd703hYJ52kdqtxKYEFYqxkwN5ygh2NihErZHr9Db X-Received: by 2002:a05:620a:454b:b0:795:5e01:74f2 with SMTP id af79cd13be357-7955e01793dmr363022485a.21.1718000595092; Sun, 09 Jun 2024 23:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000595; cv=none; d=google.com; s=arc-20160816; b=ByX/ZshXvTTGrY/PNX0Tg+PuViZNv1Gw3nFVeKW8CBCSXa/lLt5qM/CpjaBlKduQr0 BNnibhzSjrlEws2e1Wt8yqfqV2TZcYDwHvY5BK2m+4Uz8wgUukRSs9ZnwO3+gSBclt/3 k8noRWk7Xm0jkaFK3UDLmLsYyoKshrZcjhxwy1i+albr40XXi1p3lqfIgBt5MZd3gG38 /6KA0KZaffEnorBSdYj6I306oFKIlLz4aLVYjW4jKfDJIJopkKBH9MrhmsW6g7j8oo3h dAUUOCj4Hu6sJh2NyGiavZpr0J7VjbvN4GpGt3PQy5WkgwDaR8Lu54tBTseXv7ctHbZC Bkgg== 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=ImJWDtZBqlp+bMUJJjr4+M/fZWCSgOtIT3msJaq+OWA=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=hBeXNXZcOijBSwcu5sra04BoY+4NeQJR8R2dTZ0IY5S7c9oOrET1koG7AtkdePZexI BgWdIF+DxMQI729INa6FH2YBicJgDE3UDwlOzQsYl/rVOTt/v2sKYgk3KnXB+nobBTCD Z1OrPwd2EiBWry/V62TR9YXzdcczaccmt70X/RVHKHnqrnJihiu8kCLgiHvgd0Sd+zoP z2kB+fiZpFdQTxBrUBMrdA3h4+pUH/CZ15qFYrOnhBBuVep0ynIr0kFwKyus4oPJMqQT TnzQTXLGU8pkTVP9IOQpE41FIrLV3cgOPIBC80GeeWZ4Og4GgLBBF7MAxM1cuvRqrPNC M/tg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cTFduaCY; 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-79554cd8ff6si483628385a.122.2024.06.09.23.23.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:23:15 -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=cTFduaCY; 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 1sGYQb-0004jG-Lt; Mon, 10 Jun 2024 02:22:49 -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 1sGYQ8-0003Rh-UK for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:23 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQ6-0004Y6-Gp for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:20 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-35e1fcd0c0fso3399859f8f.0 for ; Sun, 09 Jun 2024 23:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000536; x=1718605336; 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=ImJWDtZBqlp+bMUJJjr4+M/fZWCSgOtIT3msJaq+OWA=; b=cTFduaCYDhpeg0kWwsPhbcTK5fs4WbMzqP559sjnBeIX8fIxNyxkxRC1XrXbTN9MbQ pAALOK+X9Nm9T0ibZEdWMd3GfMHlQpvWVdj//T1+e6ZzTWT9zqBplVNLabwlk6UxhyA3 Brae7q+YzCwiiJtnfJbCkX1ejZwq3FxJy3FPWQOJp3DcXgk6whYyFvouAaTXkqwPpQ11 givmqyxfpXWp4v/SOKT+EWBt7fXISzNrwQ8CFHW/kYfxQ9bs9hvir0CGc9IZ2lWkzECY hk930inO25Cdnw83/o+rp6JvKo/4MtY/4JLNnEP0rn9l+YdNUEvVrzVVdGIKc7OJodOC ksGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000536; x=1718605336; 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=ImJWDtZBqlp+bMUJJjr4+M/fZWCSgOtIT3msJaq+OWA=; b=b37+bD/tah4FMNrfMJbdi2WmmMj7Kzxd3/K1o6mQpZgdREWzFB1NzNiy8b4wFoBkTW M+/QObpgABS8GPYw9ZBD8pabMySeoaGNj4RcGqalbIpGaFkLzEAwL+E3RPiOPcmF9YwM zTVNpWkdN+Wrt7zop3eMsXc09mWsV/ISvys+0mgu6K75m//kF7pp35EXx+NckMYN1mzs wGLZuAsyhcb5i94Qz8j2as1PYNCCx1oszOC0VacHUMpSW240UKiOyP76mZ42tSL53+Xj jnPL+N3xN806TbrXrfQR7mN+410dFawCmkL0byRIyEm/mnQ7CP+tVYAXUTxqVtl4hq5U yAZQ== X-Gm-Message-State: AOJu0YwROmZZYq+k/5DWBv/Ganogutxe4pRSZr4IVQejpTEJdr+9Wtgu knNJLUF4rY+0f6RSvYNsctfIfDvwq133efbkWg01AKx7C9o7KLMcNfFot0k/3eGS0rGQy+S5rCW 0 X-Received: by 2002:a5d:6c69:0:b0:35f:22cd:120d with SMTP id ffacd0b85a97d-35f22cd1271mr1400315f8f.21.1718000536431; Sun, 09 Jun 2024 23:22:16 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f1846574esm5122917f8f.117.2024.06.09.23.22.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:16 -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 12/26] hw/ppc: Avoid using Monitor in xive_end_pic_print_info() Date: Mon, 10 Jun 2024 08:20:50 +0200 Message-ID: <20240610062105.49848-13-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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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/xive_regs.h | 2 +- hw/intc/pnv_xive.c | 8 ++++---- hw/intc/xive.c | 40 +++++++++++++++++--------------------- 3 files changed, 23 insertions(+), 27 deletions(-) diff --git a/include/hw/ppc/xive_regs.h b/include/hw/ppc/xive_regs.h index dd4a76bcf0..5e6f9d1be4 100644 --- a/include/hw/ppc/xive_regs.h +++ b/include/hw/ppc/xive_regs.h @@ -261,7 +261,7 @@ static inline uint64_t xive_end_qaddr(XiveEND *end) be32_to_cpu(end->w3); } -void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon); +void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, GString *buf); void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, GString *buf); void xive_end_eas_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon); diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index c377823522..1dddbf7827 100644 --- a/hw/intc/pnv_xive.c +++ b/hw/intc/pnv_xive.c @@ -1875,14 +1875,14 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) xive_eas_pic_print_info(&eas, i, buf); } } - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); - monitor_printf(mon, "XIVE[%x] #%d ENDT\n", chip_id, blk); + g_string_append_printf(buf, "XIVE[%x] #%d ENDT\n", chip_id, blk); i = 0; while (!xive_router_get_end(xrtr, blk, i, &end)) { - xive_end_pic_print_info(&end, i++, mon); + xive_end_pic_print_info(&end, i++, buf); } + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); monitor_printf(mon, "XIVE[%x] #%d END Escalation EAT\n", chip_id, blk); i = 0; diff --git a/hw/intc/xive.c b/hw/intc/xive.c index b2203b721b..f631d7cd6e 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -11,7 +11,6 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h" @@ -1352,7 +1351,7 @@ void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, GString *buf) g_string_append_c(buf, ']'); } -void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon) +void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, GString *buf) { uint64_t qaddr_base = xive_end_qaddr(end); uint32_t qindex = xive_get_field32(END_W1_PAGE_OFF, end->w1); @@ -1364,8 +1363,6 @@ void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon) uint32_t nvt_idx = xive_get_field32(END_W6_NVT_INDEX, end->w6); uint8_t priority = xive_get_field32(END_W7_F0_PRIORITY, end->w7); uint8_t pq; - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; if (!xive_end_is_valid(end)) { return; @@ -1373,28 +1370,27 @@ void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon) pq = xive_get_field32(END_W1_ESn, end->w1); - monitor_printf(mon, " %08x %c%c %c%c%c%c%c%c%c%c prio:%d nvt:%02x/%04x", - end_idx, - pq & XIVE_ESB_VAL_P ? 'P' : '-', - pq & XIVE_ESB_VAL_Q ? 'Q' : '-', - xive_end_is_valid(end) ? 'v' : '-', - xive_end_is_enqueue(end) ? 'q' : '-', - xive_end_is_notify(end) ? 'n' : '-', - xive_end_is_backlog(end) ? 'b' : '-', - xive_end_is_escalate(end) ? 'e' : '-', - xive_end_is_uncond_escalation(end) ? 'u' : '-', - xive_end_is_silent_escalation(end) ? 's' : '-', - xive_end_is_firmware(end) ? 'f' : '-', - priority, nvt_blk, nvt_idx); + g_string_append_printf(buf, + " %08x %c%c %c%c%c%c%c%c%c%c prio:%d nvt:%02x/%04x", + end_idx, + pq & XIVE_ESB_VAL_P ? 'P' : '-', + pq & XIVE_ESB_VAL_Q ? 'Q' : '-', + xive_end_is_valid(end) ? 'v' : '-', + xive_end_is_enqueue(end) ? 'q' : '-', + xive_end_is_notify(end) ? 'n' : '-', + xive_end_is_backlog(end) ? 'b' : '-', + xive_end_is_escalate(end) ? 'e' : '-', + xive_end_is_uncond_escalation(end) ? 'u' : '-', + xive_end_is_silent_escalation(end) ? 's' : '-', + xive_end_is_firmware(end) ? 'f' : '-', + priority, nvt_blk, nvt_idx); if (qaddr_base) { - monitor_printf(mon, " eq:@%08"PRIx64"% 6d/%5d ^%d", - qaddr_base, qindex, qentries, qgen); + g_string_append_printf(buf, " eq:@%08"PRIx64"% 6d/%5d ^%d", + qaddr_base, qindex, qentries, qgen); xive_end_queue_pic_print_info(end, 6, buf); } - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); - monitor_printf(mon, "\n"); + g_string_append_c(buf, '\n'); } static void xive_end_enqueue(XiveEND *end, uint32_t data) From patchwork Mon Jun 10 06:20:51 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: 802994 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1800051wro; Sun, 9 Jun 2024 23:25:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVdQWVIeaceCkFLLXBtJ1kpq5TY20BTgFBVnaCw+g2jrkbNSVCd/T6ErXx9mTAbs1TLN9u5GgN/wiohk6aOKbdY X-Google-Smtp-Source: AGHT+IFctziT5bdtpFaqwwkTXUb8er3PiZUiJgZ34fX6BZU8Xlwtd/3tg1iTgq6w9/WM8gjIdsXR X-Received: by 2002:a05:620a:2485:b0:795:b102:7a8a with SMTP id af79cd13be357-795b1027dafmr273161485a.52.1718000717504; Sun, 09 Jun 2024 23:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000717; cv=none; d=google.com; s=arc-20160816; b=OXfp9l1oLxG5xX8eqAry0TP/EuYSWb+/Z9j+4YyvubF1uMr34Px8diE5wQ2El26oXW 8kXJ3a1Wq6pY5qpFFBtLl9STzwucaURDT2mqygifKyUuNGfULeft6vZmkX7iCO2Egp1a x05mSC38W0yt3Ryo000Q798R5HhWRF/cKE3OXGnhFRZWrxBgL4PbgkrMOzMz19lZnnrz Y+G91Th6ofkrJmwY8OvGFMHwyJsIO3cV/IEkHY5lQVNZh93C+e3ahLZjIC+B2veEHu57 aj6m4420/ORr8Xp69yOzoWrZ9FNahue2Xg4OGJHlwSMl2ALczkaMMtezdemVC7lRQp9L /OuA== 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=YDceS+tqCYF0MQZ5iXvWhCNVizg2COfjxHxnorTwaDQ=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=MBBSLd7+HVPyvrZ3IssWudm/ftLIqXLiH7sqrZMFYzFxe+JTfxcLzuvFMXhYdxdzVd 5MVaE6e6DFXV3HbwZJ5/4bgxbdkM535noeJoAGbt9tvcRa96wPTyTXAoehZ7vYqpKYt9 YcceLBkrWdCw+Xq4lIp6H5R/oAISoPYtU75cIlJdgnPy4CcbS/GT5y/YFmDIKtAym9ZY JGo06npCXUChS7lvW1TYoXsfbijCHBbPuydAY3ur2UTqu2ZaYDNUSTxZ8BgH6+zEflAr X647WDoaTKxlpd3cfLY7s/UR07NehDvAK03OtUFrVl6ucrVMYfi3RGHBN8C8kBmiQqIA agQg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YG45/8c9"; 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-44038b412a6si74965871cf.500.2024.06.09.23.25.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:25:17 -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="YG45/8c9"; 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 1sGYQT-0004Hf-TP; Mon, 10 Jun 2024 02:22:42 -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 1sGYQE-0003hb-La for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:26 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQC-0004Yu-HP for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:25 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-52c819f6146so1840266e87.1 for ; Sun, 09 Jun 2024 23:22:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000542; x=1718605342; 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=YDceS+tqCYF0MQZ5iXvWhCNVizg2COfjxHxnorTwaDQ=; b=YG45/8c9iFaJ6HAh39T3fAbHBw390MggBqe+TwTmWFYAayI8coeIE2aVn/ZkyFoPO+ F3lpGgrwVI5x3N6xHBtK0Y32CRNktRZLV3tGdLIGH24v6GqNHd1PfOUxTsR4aZqp52kF JnKnbClPGW7hw5zce2V+6EY6X5gf2IIezV34felr4tDtJCXFyMFxXzJ0FGO9BCLgboN1 OWBL+C9hIsk22LH/p1Q72s3CJK4mKprc1ZCwh71wcP7HSBCx47MPKVC74DOnPlwDuPVw WmNkHUwNgg+s0HdQ9/Pv57mGnTQIGsXkxnwwcMM8IpLM0l3IGRmVfzDw9SjTxchRoFic 8j8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000542; x=1718605342; 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=YDceS+tqCYF0MQZ5iXvWhCNVizg2COfjxHxnorTwaDQ=; b=FtLcom27Qkg4azpC40YZqAAYm747eVkeAbuW8+4szDnnErXPhUOAdvmXytJCTPeItT XWenfigd7skIXPLHbFPGD9lF7sJOaA2pjmryKvOHuhU5+u9QTy+4fOQfyw2plSWENTrW lQMRVZPGMcjYuAhf5Gcq+LFkmYJoPs82UYX5IoQptWg7TGDbXGNioT62/dwZE3cQSAJR Hn6ePFlacSqAkQrXDJj9emCxC+hxjIVBftVKsDBHMI1dcGJh6pVnMrnjOH5NcVPHjvrE hOGjaUVtqmTX2spgacuKiEFLL98hNoCyvTSN7BHGTvOUvWFjiD3hEREJwxZm+cKXbRy4 UTwg== X-Gm-Message-State: AOJu0YzMWmm8WH7zSvfyEp2M+UvB52NDkUU61iDary9VInX0Lr0Ez8hd YHW3iXJearo6CgDKzE8x0amF6ndwVUxEvfakxBuJDlmUcWwj4MbFvxLD2zgW35CvjzI4+Em4Llg F X-Received: by 2002:ac2:551b:0:b0:52c:80db:bfe3 with SMTP id 2adb3069b0e04-52c80dbc19dmr3017287e87.21.1718000542112; Sun, 09 Jun 2024 23:22:22 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215c19e572sm130895795e9.10.2024.06.09.23.22.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:21 -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 13/26] hw/ppc: Avoid using Monitor in xive_end_eas_pic_print_info() Date: Mon, 10 Jun 2024 08:20:51 +0200 Message-ID: <20240610062105.49848-14-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::134; envelope-from=philmd@linaro.org; helo=mail-lf1-x134.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/xive_regs.h | 2 +- hw/intc/pnv_xive.c | 9 +++++---- hw/intc/xive.c | 22 ++++++++++------------ 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/include/hw/ppc/xive_regs.h b/include/hw/ppc/xive_regs.h index 5e6f9d1be4..b9db7abc2e 100644 --- a/include/hw/ppc/xive_regs.h +++ b/include/hw/ppc/xive_regs.h @@ -263,7 +263,7 @@ static inline uint64_t xive_end_qaddr(XiveEND *end) void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, GString *buf); void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, GString *buf); -void xive_end_eas_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon); +void xive_end_eas_pic_print_info(XiveEND *end, uint32_t end_idx, GString *buf); /* Notification Virtual Target (NVT) */ typedef struct XiveNVT { diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index 1dddbf7827..a0c6dee5db 100644 --- a/hw/intc/pnv_xive.c +++ b/hw/intc/pnv_xive.c @@ -1881,14 +1881,15 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) while (!xive_router_get_end(xrtr, blk, i, &end)) { xive_end_pic_print_info(&end, i++, buf); } - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); - monitor_printf(mon, "XIVE[%x] #%d END Escalation EAT\n", chip_id, blk); + g_string_append_printf(buf, "XIVE[%x] #%d END Escalation EAT\n", + chip_id, blk); i = 0; while (!xive_router_get_end(xrtr, blk, i, &end)) { - xive_end_eas_pic_print_info(&end, i++, mon); + xive_end_eas_pic_print_info(&end, i++, buf); } + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); monitor_printf(mon, "XIVE[%x] #%d NVTT %08x .. %08x\n", chip_id, blk, 0, XIVE_NVT_COUNT - 1); diff --git a/hw/intc/xive.c b/hw/intc/xive.c index f631d7cd6e..70f11f993b 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -17,7 +17,6 @@ #include "sysemu/reset.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" -#include "monitor/monitor.h" #include "hw/irq.h" #include "hw/ppc/xive.h" #include "hw/ppc/xive2.h" @@ -1419,8 +1418,7 @@ static void xive_end_enqueue(XiveEND *end, uint32_t data) end->w1 = xive_set_field32(END_W1_PAGE_OFF, end->w1, qindex); } -void xive_end_eas_pic_print_info(XiveEND *end, uint32_t end_idx, - Monitor *mon) +void xive_end_eas_pic_print_info(XiveEND *end, uint32_t end_idx, GString *buf) { XiveEAS *eas = (XiveEAS *) &end->w4; uint8_t pq; @@ -1431,15 +1429,15 @@ void xive_end_eas_pic_print_info(XiveEND *end, uint32_t end_idx, pq = xive_get_field32(END_W1_ESe, end->w1); - monitor_printf(mon, " %08x %c%c %c%c end:%02x/%04x data:%08x\n", - end_idx, - pq & XIVE_ESB_VAL_P ? 'P' : '-', - pq & XIVE_ESB_VAL_Q ? 'Q' : '-', - xive_eas_is_valid(eas) ? 'V' : ' ', - xive_eas_is_masked(eas) ? 'M' : ' ', - (uint8_t) xive_get_field64(EAS_END_BLOCK, eas->w), - (uint32_t) xive_get_field64(EAS_END_INDEX, eas->w), - (uint32_t) xive_get_field64(EAS_END_DATA, eas->w)); + g_string_append_printf(buf, " %08x %c%c %c%c end:%02x/%04x data:%08x\n", + end_idx, + pq & XIVE_ESB_VAL_P ? 'P' : '-', + pq & XIVE_ESB_VAL_Q ? 'Q' : '-', + xive_eas_is_valid(eas) ? 'V' : ' ', + xive_eas_is_masked(eas) ? 'M' : ' ', + (uint8_t) xive_get_field64(EAS_END_BLOCK, eas->w), + (uint32_t) xive_get_field64(EAS_END_INDEX, eas->w), + (uint32_t) xive_get_field64(EAS_END_DATA, eas->w)); } /* From patchwork Mon Jun 10 06:20:52 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: 802978 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799517wro; Sun, 9 Jun 2024 23:23:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVsX+5nZ/y5QxcqNtNHV9Pg9aAlcKErRztGQvkdnfNyE/Afk1YVIm0VaqEL8srrwf/Ipzdoy9zIytU9ZYDgHO3Y X-Google-Smtp-Source: AGHT+IEbs77+iI2iTts3R0o/LECbviriXXWpMBIuC76wpmcKAxWdgU9BC6zL67ca9Ugfo5Tvy466 X-Received: by 2002:ac8:5f89:0:b0:43d:f946:faed with SMTP id d75a77b69052e-44041b6b8f0mr124672031cf.26.1718000580734; Sun, 09 Jun 2024 23:23:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000580; cv=none; d=google.com; s=arc-20160816; b=IsEWM1e2gqooI4Va01tGLAYpD4mp8fZroVyTjeUtILRE80mGv7CSdf+lNJrul068BY lSL2syyXyrmeTBdHkkidbqXB2YamfRJzfSxl0eEFc+6rtSC3fjOVg4s4Stmw32faDa+x KF/K9iulNtEQXuKJA2kLc8YTqvniBZY9Q+++ASr2qF+v09FWqDoVWGoG+PU6q2z5c+b0 kzrHvIsX3EUgKonSLuLh8WlHD/ZovrHHgvHngWR+TAz31cucTNak7sUUPwNnJFf3uNCA G04NSShylw2ncTQEZs4DsuDOZL7HuU3tfM9lk6CZvU+VN2vCZZm0/fZKttVA9LvzZ0xx RW1Q== 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=i1X43X3u1MNBxinpMUxBqMIlo7Li/da4jfz1xla7hBs=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=eVs/Cfw7b0OZx2eLCHlxTkG21aSUtO2TJncYyxMMgljL97QPJy6HInb4csHyUv9u6J lLbFIohhmqDjnhTBZJ7+TEritf5nci2u2iRu1VZjr6tEdzxX9+OdfeilCHM4i3Hy5Iav /zlhR5kk5N3JRxECEfypIEvd4kyAGo9zWrv58MYvFjh23gis1voyAXP+0sX0do87QfPy mSS2N/duEYuFuno7p8aZ1593WdBInr2J5WwtcL0TPqDg+sIL0cn8Q7OQH1oqww8i5CXd D/t7neFC8VZomB7WSBZTF+2m9Pgv+8V7QXrA3Ir9DHpoXF1qIu5IpKG5N29IdGTHw+uq 0WLA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ukfSLDMw; 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-440605dc3cbsi34851611cf.625.2024.06.09.23.23.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:23:00 -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=ukfSLDMw; 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 1sGYQc-0004mG-VT; Mon, 10 Jun 2024 02:22:51 -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 1sGYQL-0004BT-UC for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:35 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQJ-0004Zb-47 for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:33 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-35f1a7386d5so1021837f8f.3 for ; Sun, 09 Jun 2024 23:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000548; x=1718605348; 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=i1X43X3u1MNBxinpMUxBqMIlo7Li/da4jfz1xla7hBs=; b=ukfSLDMw7I0TYktrQ3H7XYQNb28ArGlld5E5baKOH9ruGsgIKmAoc7SRBGvJo4GwG0 q4bBBC9F3sAEu8n6Yoo6JR5avZHj1uSwiEQWr1MtxR26Az7GPk2G+mAOfUm8UYzb+1c5 64+Z/p/ejJsK1fMT1Rw1MKK77II/ZJlHLlXrfj/11JxFjo28WokqxR8Yc9sLfv1la+6g kti0y0GZNR4VZHsW1HoiJcZv8xQFoSreWMi7n/7K7ydmwa3htYh0eYZoGvzndCY/+Fc3 k7doD9ERtAf5pbM21wvPHc0MUcU5FZMnLMi2MX4pUlqegsAfThnaFruwK9+sUKb9mgu0 0mZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000548; x=1718605348; 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=i1X43X3u1MNBxinpMUxBqMIlo7Li/da4jfz1xla7hBs=; b=HI31tSkEmWqSIaxNs7Nn3RwHAH4xy6YLBm6oN9fIkzfJbKUIJDSlaAotZ1dn1pQpDm y2z4f0PUBcSGbaHFe9Int1JE5cDSWlQa9QUwyFBKW+vIrjU92Re5Njrd+gGG79e/1X19 y8lrf9rVIJYd7hhxfFxXdMPOIhEwGk6K4yPDfOWi6LPQdXeLO2GU33yFe7fzNNdL53UJ G8EXcEllQu6HpEB9yz/xPDOQFRihmyQHAO4R3/+i2RQUc/ULKHY0NslpZpI4cnLcA4y4 pSnd54DYhEiOvw+Hib5D4sQLVESIGtfGVnA2fli99tOX4MOvGYrjkDQ3XpBPAFuyAjj9 vtdA== X-Gm-Message-State: AOJu0YwrATAMLdlDUIfZWO/+rr7CdthS+fbvTXoV0rvBIURF82WJcdcr kd6QGt8oihRZI//9MK6Lr+gqRjMjINeemMcdu2pWF7HKB1y0HJD4nyDd0FXF9RGzTTs8DYH5Qmw 5 X-Received: by 2002:a5d:5009:0:b0:35f:1176:ae72 with SMTP id ffacd0b85a97d-35f1176af9cmr2634603f8f.6.1718000547771; Sun, 09 Jun 2024 23:22:27 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f223dfce9sm2549837f8f.21.2024.06.09.23.22.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:27 -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 14/26] hw/ppc: Avoid using Monitor in xive_nvt_pic_print_info() Date: Mon, 10 Jun 2024 08:20:52 +0200 Message-ID: <20240610062105.49848-15-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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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é --- hw/intc/pnv_xive.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index a0c6dee5db..3ad4ac8e7d 100644 --- a/hw/intc/pnv_xive.c +++ b/hw/intc/pnv_xive.c @@ -1832,7 +1832,7 @@ static const MemoryRegionOps pnv_xive_pc_ops = { }; static void xive_nvt_pic_print_info(XiveNVT *nvt, uint32_t nvt_idx, - Monitor *mon) + GString *buf) { uint8_t eq_blk = xive_get_field32(NVT_W1_EQ_BLOCK, nvt->w1); uint32_t eq_idx = xive_get_field32(NVT_W1_EQ_INDEX, nvt->w1); @@ -1841,9 +1841,9 @@ static void xive_nvt_pic_print_info(XiveNVT *nvt, uint32_t nvt_idx, return; } - monitor_printf(mon, " %08x end:%02x/%04x IPB:%02x\n", nvt_idx, - eq_blk, eq_idx, - xive_get_field32(NVT_W4_IPB, nvt->w4)); + g_string_append_printf(buf, " %08x end:%02x/%04x IPB:%02x\n", + nvt_idx, eq_blk, eq_idx, + xive_get_field32(NVT_W4_IPB, nvt->w4)); } void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) @@ -1888,17 +1888,18 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) while (!xive_router_get_end(xrtr, blk, i, &end)) { xive_end_eas_pic_print_info(&end, i++, buf); } - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); - monitor_printf(mon, "XIVE[%x] #%d NVTT %08x .. %08x\n", chip_id, blk, - 0, XIVE_NVT_COUNT - 1); + g_string_append_printf(buf, "XIVE[%x] #%d NVTT %08x .. %08x\n", + chip_id, blk, 0, XIVE_NVT_COUNT - 1); xive_nvt_per_subpage = pnv_xive_vst_per_subpage(xive, VST_TSEL_VPDT); for (i = 0; i < XIVE_NVT_COUNT; i += xive_nvt_per_subpage) { while (!xive_router_get_nvt(xrtr, blk, i, &nvt)) { - xive_nvt_pic_print_info(&nvt, i++, mon); + xive_nvt_pic_print_info(&nvt, i++, buf); } } + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } static void pnv_xive_reset(void *dev) From patchwork Mon Jun 10 06:20:53 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: 802998 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1800160wro; Sun, 9 Jun 2024 23:25:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW1TNMQ2Z4mCzmtYrhqqm2uOJg+QTdB/hJujRD59GYM3vAIVpnlckxvatA3fNx4saYwwSULGoRpUNGeTuE6ZVBW X-Google-Smtp-Source: AGHT+IF8j9ewVJVtGfRKCJPB52bgbZ7IYZ+ETzdpKzJ5AB0rZz/jqsxCEgWvVIWQPRzl82ASFj+7 X-Received: by 2002:a0d:fc42:0:b0:618:859e:3eeb with SMTP id 00721157ae682-62cd5653165mr75867327b3.32.1718000745466; Sun, 09 Jun 2024 23:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000745; cv=none; d=google.com; s=arc-20160816; b=AKo8bQsG10L/CoURqzHK3qVNcm0B5qQyxFCscJD6dR6BwtBX1M3JzGTXi2iWWzaout CdY0sIsOrsdTx8faAQiUBaVLlD3GCzcMn+rSOp/WLPY5GZmnOlKzpH+0VHbykNTp9b8J UZgPTDzuS+ydeRlVBEdgbjQYlW6gxt21ac4LYzOPlouWUpWpbSQWC+7qGizdmLXSFVWN poCDt8YDHTOhSbDbuIe9c71ae5WJOThLWpbXNIoVCJWmGOVlK6r2mCq2kUrLh+k7jLLV 8DYe/ll9Q4eJoOJDPEWYLPwWkWXS6CzQVAXRyl4KidpSoPXVDz+aDbh0OgqMHs8PCz/4 iayQ== 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=Y42ro60ATUXrF8F/0Mk1uGOj6R38Ep469XOeFB/EH6M=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=NmB7ebtW7wadB+2c0RB2Jk0sQrBT2Lb3aj0ZEFESYyYOsmTa9aCr48zSrC3nEQxac4 Cfp2rbixKmJ5YbM5UbzrdLhjA7AJB6CUutqKQ5kY/0pPdYdcGENTd4vz+rK91XwKUq9K 95griePUNMTo3Mx21E5RbZCyghwaImPpf9e7BaJVdpOnH0r/scInORuY5d/WGiAv1pqG HqzknwR5zDUtzDvAW97IQ2bTtoFp8yZ1rXXHQ6hEA5n6pC61cPT3yNLqo7S7Y9OCsmtS Q8adoc8N+7nT/TLIICRJtf+1dUGqjK80G9ENQlgGyBwc6TmpxbVSXnHBZM/nKRUPlO06 Qmng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ya5bGNoA; 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-6b04f9ae113si99309456d6.361.2024.06.09.23.25.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:25:45 -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=ya5bGNoA; 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 1sGYQd-0004rP-GH; Mon, 10 Jun 2024 02:22:51 -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 1sGYQQ-0004HJ-7O for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:38 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQN-0004aL-HW for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:37 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-42179dafd6bso9445665e9.0 for ; Sun, 09 Jun 2024 23:22:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000553; x=1718605353; 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=Y42ro60ATUXrF8F/0Mk1uGOj6R38Ep469XOeFB/EH6M=; b=ya5bGNoAPLBrJCpiuG5mIYSTh2vme96IFkxP/lJsDBWB/vzA7f4FmK8TPQmV83vaGJ UAnHwU988K7CM6J1RRmrulse26hh+hhjBiWaSs/H+tWv5nRuKoX21MKMOhQ1yv7Wk+Kd CgrBX71EkbmQoeE7zhzwsIERwp3iIM+UwmYU/kG5VPTFoFAeNBga+Op4YSrbzLyIxR/I GDhv7snlWSC9TqhZya5pn9UyFn/PnRZCixAFYCt3j3goaF0xoTo26lm18N7YOvymMN/J WY7WmBZHt/ENd23mNYKXK7NlwrB2V2KE+TuwJYCX6+StEafyTXYgEoKzs1ol+Uu6mfwZ sbqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000553; x=1718605353; 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=Y42ro60ATUXrF8F/0Mk1uGOj6R38Ep469XOeFB/EH6M=; b=RR1+uBIwPlG1Ul1QOftQ3wsIfMSzYHWVNklnLSbbl3FKvo7HTsAo3C33V3xaT6/0Oq E/ZgWmv+8Ad9vhPFwqTCWgx51p+w1ooa7Wgf4+1npZvHod9JmZPyFCxcFaoiVRLVp5i3 2mQbSR30mX3ujrzgkCpXDYnz72z6/o8vFwjrKl7oCikJ0gnvWqNq/BfDzvcb9BbPlVll cq4/PLBXQ2lB8vo8dhOaJUp3gcHWEJjsCu7WRHtFoecItti1urwzdLj2Re33WRgp1OBb KVY4GbMBoFlpkSrxNDjghL1+aKYacMjkCNoNhWPutpaqH8piNJitV2u7DZheI7c23+sm 9L6w== X-Gm-Message-State: AOJu0YwK+5c6pJ2swlm+j3DqDjdcmJJYeRlNUMSLIFZpy4JUOb3u1ZHA 56sF7PepThmY+nhnskG9S7zTqsQ3gpjaxMIK4h91pxp/TPy08ovHjaUVqI25iz/QVKUkCiPW20B E X-Received: by 2002:a05:600c:198a:b0:421:81b1:7f45 with SMTP id 5b1f17b1804b1-42181b17f87mr30836005e9.12.1718000553471; Sun, 09 Jun 2024 23:22:33 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215c19e572sm130900745e9.10.2024.06.09.23.22.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:33 -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 15/26] hw/ppc: Avoid using Monitor in pnv_xive_pic_print_info() Date: Mon, 10 Jun 2024 08:20:53 +0200 Message-ID: <20240610062105.49848-16-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::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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é --- include/hw/ppc/pnv_xive.h | 2 +- hw/intc/pnv_xive.c | 9 +-------- hw/ppc/pnv.c | 8 +++++++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/hw/ppc/pnv_xive.h b/include/hw/ppc/pnv_xive.h index 9c48430ee4..7d634e469c 100644 --- a/include/hw/ppc/pnv_xive.h +++ b/include/hw/ppc/pnv_xive.h @@ -93,7 +93,7 @@ struct PnvXiveClass { DeviceRealize parent_realize; }; -void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon); +void pnv_xive_pic_print_info(PnvXive *xive, GString *buf); /* * XIVE2 interrupt controller (POWER10) diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index 3ad4ac8e7d..5bacbce6a4 100644 --- a/hw/intc/pnv_xive.c +++ b/hw/intc/pnv_xive.c @@ -11,12 +11,10 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h" #include "sysemu/reset.h" -#include "monitor/monitor.h" #include "hw/ppc/fdt.h" #include "hw/ppc/pnv.h" #include "hw/ppc/pnv_chip.h" @@ -1846,7 +1844,7 @@ static void xive_nvt_pic_print_info(XiveNVT *nvt, uint32_t nvt_idx, xive_get_field32(NVT_W4_IPB, nvt->w4)); } -void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) +void pnv_xive_pic_print_info(PnvXive *xive, GString *buf) { XiveRouter *xrtr = XIVE_ROUTER(xive); uint8_t blk = pnv_xive_block_id(xive); @@ -1858,8 +1856,6 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) XiveNVT nvt; int i; uint64_t xive_nvt_per_subpage; - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; g_string_append_printf(buf, "XIVE[%x] #%d Source %08x .. %08x\n", chip_id, blk, srcno0, srcno0 + nr_ipis - 1); @@ -1897,9 +1893,6 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon) xive_nvt_pic_print_info(&nvt, i++, buf); } } - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } static void pnv_xive_reset(void *dev) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index df187c5180..7e6f923c7e 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -808,8 +808,14 @@ static int pnv_chip_power9_pic_print_info_child(Object *child, void *opaque) static void pnv_chip_power9_pic_print_info(PnvChip *chip, Monitor *mon) { Pnv9Chip *chip9 = PNV9_CHIP(chip); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; + + pnv_xive_pic_print_info(&chip9->xive, buf); + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); - pnv_xive_pic_print_info(&chip9->xive, mon); pnv_psi_pic_print_info(&chip9->psi, mon); object_child_foreach_recursive(OBJECT(chip), From patchwork Mon Jun 10 06:20:54 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: 802995 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1800066wro; Sun, 9 Jun 2024 23:25:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXYzRlmg3RNW9XQ+3tG6rEAUEwWmTLgZeJtHxTevlsCHxXTyY/baIXfyoLc89JS60/zPaYdpjJnqxEq8K4LIatG X-Google-Smtp-Source: AGHT+IESDzyUU1z1IdWiugbjuiErVdVyT48jpuAw6HMymW+Y95b4DOB5lsry83eLTYgxaBNc8XBG X-Received: by 2002:a05:622a:1345:b0:440:53b8:477b with SMTP id d75a77b69052e-44053b849e6mr75722291cf.10.1718000721747; Sun, 09 Jun 2024 23:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000721; cv=none; d=google.com; s=arc-20160816; b=srqgBdbBS0xV9QTdj1mbgyzw7jw/mvgHT2eLIyE4C2svzw8PzWtTQLt+dlNynEI5nL PryaN58y8HL2sBsfV5uIoxAw43kqTF3jPA/zbiccwr4msI80bUa4mbG+QrnJ3goIbI3I io8eM9s3GgJC2/0f5u5gDLnjJOOa8odAJtdl3RQi+Yav0WG8YSsYBWz8L0KoBpIYWhUD aDDSxU+dp3NzMXmItVrg0GGpCqyf2Rc/X/ItEHB9S40fvqdUmF0kNfSlD+GKQSTA3NOP DCc0aNSO8C664JqbgFYPfFKKFBN+K6muVym5LNjr+9i8K+IwnSnYP0yGiGgtvaDTso7X gpHQ== 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=l+GiPim6gWmrm3Tb8xJuU7kWpbX6sNLw7skHH6nD9WA=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=aWLKeSVLIYIcCAMTrXZtnvJDubaIyNQ82DMlYmV7f4Q4gBLM1wZQe7l/2E8WX0Bdjy 8SDOl4Pz0ypkqqKRNqUebXIdomfzzK9XYGxE+lRqJ/wpRrtlEWPElhySHKYoADMxDjde g/dzPAmYhTlZeKBI2i1yQtlM5Yp/qrrps7/OmNAHRG0WPhOVdIApprIFbZlxkfZSzEV/ PwZmavypL4ggDvtd40Vy1ZG5GbHL/a3VrDw8jfvRV2lix+7kKYa4zr3gnhtBxnD6fxQX jbP+4lVhIRsDWpYyuy5a0WkYQygBbJuSL3/OqFdA0xVO5Eb/ord6nEDeYa9HiwHGNzJV 97KQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S7O8eL54; 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-44103b7e852si8167201cf.309.2024.06.09.23.25.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:25:21 -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=S7O8eL54; 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-00057m-46; Mon, 10 Jun 2024 02:22:53 -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 1sGYQV-0004QH-KX for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:44 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQT-0004cQ-QA for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:43 -0400 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-52c32d934c2so1558414e87.2 for ; Sun, 09 Jun 2024 23:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000559; x=1718605359; 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=l+GiPim6gWmrm3Tb8xJuU7kWpbX6sNLw7skHH6nD9WA=; b=S7O8eL54P4j7Mk58p+kPwlw5q2HrLNNUjJXOx/8O8Tg/ai2mYxSslbRsCwKwgM0SxO TAGm7lYXDf/2G1Eb08KJ7AsaPvuIBr2w3mq+c3PLg9JujH2vNs94f6qef2OPPMIlYIhd Rb2j7ofkNG9QUap/QhxB8xsX9AAKBxXBgqrzKSv6/ovhsn9c5cvmgCCe3VMt4TtaqvlU dSpwt6oYyhngrz7Hp6uRMfOBya3L7EKjGeDaqesEEY20Bmv9SmzsLYa+am6HWRK5VR3F zVppbP83CfXbRFTnnquZcUS7PyLViuotJ+L3NTclPJXF/TuUDhmtuJAr+n2YtmiCp+j9 pq/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000559; x=1718605359; 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=l+GiPim6gWmrm3Tb8xJuU7kWpbX6sNLw7skHH6nD9WA=; b=mpEImv56HWGLVwh1xNYtkphCZ62qB3huWVsqs0dLPZRkvNxSwV3JboNkUPIc5DhGwe hQP9NA9M2lOavkFztvV4kPKNpLV7lPK/rNgaYGM899/OOj6eAXlR0uFfe9p5XVgFCNcA D2+XeooFwkGCX5hMYFaiW9MpgZoBZ85y9FC2QcM/nEdIetm74AdL3TpiLTJzw5kIGP+M Ah0NeQDeCuflNp4/BUKauvUInSDrkt3xlRFoyDyfSsEB27aIWGTc8Uk8+9P/y5xxa5sH nGVK1Dcaam/YOCwCNzWDKSyonjjHW4VgeIOplBzrRUXk/sTerLIhLZze8h6Tf6l+ZaTM Zi+g== X-Gm-Message-State: AOJu0YyPSa18j9L84zKmQTwHNsj0PBRvA6k7V6mrV76RWVkLVhBFgZNE ZlwK1HRbpxkpUaKhYP2p3SmBw4NQ9LsEVBogk95uzM23nIKW6CCxdBTF1KXFb9oumvP9hpv2kOS d X-Received: by 2002:ac2:5f7a:0:b0:52c:84b9:1bb3 with SMTP id 2adb3069b0e04-52c84b91e8bmr1639342e87.0.1718000559204; Sun, 09 Jun 2024 23:22:39 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421e2cbc602sm17616515e9.22.2024.06.09.23.22.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:38 -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 16/26] hw/ppc: Avoid using Monitor in pnv_psi_pic_print_info() Date: Mon, 10 Jun 2024 08:20:54 +0200 Message-ID: <20240610062105.49848-17-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::132; envelope-from=philmd@linaro.org; helo=mail-lf1-x132.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/pnv_psi.h | 2 +- hw/ppc/pnv.c | 10 +++++++--- hw/ppc/pnv_psi.c | 9 +-------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/include/hw/ppc/pnv_psi.h b/include/hw/ppc/pnv_psi.h index 2a6f715350..cf7f95a6b1 100644 --- a/include/hw/ppc/pnv_psi.h +++ b/include/hw/ppc/pnv_psi.h @@ -110,6 +110,6 @@ typedef enum PnvPsiIrq { #define PSIHB9_IRQ_PSU 13 #define PSIHB9_NUM_IRQS 14 -void pnv_psi_pic_print_info(Pnv9Psi *psi, Monitor *mon); +void pnv_psi_pic_print_info(Pnv9Psi *psi, GString *buf); #endif /* PPC_PNV_PSI_H */ diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 7e6f923c7e..4a1a302a25 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -812,12 +812,11 @@ static void pnv_chip_power9_pic_print_info(PnvChip *chip, Monitor *mon) g_autoptr(HumanReadableText) info = NULL; pnv_xive_pic_print_info(&chip9->xive, buf); + pnv_psi_pic_print_info(&chip9->psi, buf); info = human_readable_text_from_str(buf); monitor_puts(mon, info->human_readable_text); - pnv_psi_pic_print_info(&chip9->psi, mon); - object_child_foreach_recursive(OBJECT(chip), pnv_chip_power9_pic_print_info_child, mon); } @@ -862,9 +861,14 @@ static void pnv_ipmi_bt_init(ISABus *bus, IPMIBmc *bmc, uint32_t irq) static void pnv_chip_power10_pic_print_info(PnvChip *chip, Monitor *mon) { Pnv10Chip *chip10 = PNV10_CHIP(chip); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; pnv_xive2_pic_print_info(&chip10->xive, mon); - pnv_psi_pic_print_info(&chip10->psi, mon); + + pnv_psi_pic_print_info(&chip10->psi, buf); + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); object_child_foreach_recursive(OBJECT(chip), pnv_chip_power9_pic_print_info_child, mon); diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c index 922ac07b2f..18cc76a7e4 100644 --- a/hw/ppc/pnv_psi.c +++ b/hw/ppc/pnv_psi.c @@ -25,8 +25,6 @@ #include "qemu/module.h" #include "sysemu/reset.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" -#include "monitor/monitor.h" #include "hw/ppc/fdt.h" @@ -978,11 +976,9 @@ static void pnv_psi_register_types(void) type_init(pnv_psi_register_types); -void pnv_psi_pic_print_info(Pnv9Psi *psi9, Monitor *mon) +void pnv_psi_pic_print_info(Pnv9Psi *psi9, GString *buf) { PnvPsi *psi = PNV_PSI(psi9); - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; uint32_t offset = (psi->regs[PSIHB_REG(PSIHB9_IVT_OFFSET)] >> PSIHB9_IVT_OFF_SHIFT); @@ -990,7 +986,4 @@ void pnv_psi_pic_print_info(Pnv9Psi *psi9, Monitor *mon) g_string_append_printf(buf, "PSIHB Source %08x .. %08x\n", offset, offset + psi9->source.nr_irqs - 1); xive_source_pic_print_info(&psi9->source, offset, buf); - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } From patchwork Mon Jun 10 06:20:55 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: 802997 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1800148wro; Sun, 9 Jun 2024 23:25:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWOkUb49Exm4M8Nt/WX8sW4gAjuQ1oFbB0x7SKUYDQRMOVnE2OlAlILkgj0u8iTB3ATialNJEYskwzB4gvCDK83 X-Google-Smtp-Source: AGHT+IGD3BgJMS4mvg2GIAfETRKi4xCFHtJAXD3AvDa8Bwv8YSYAaNPhDXxRGrWCJZklUEpcPGZy X-Received: by 2002:a05:6808:f8c:b0:3d2:1f72:d6b2 with SMTP id 5614622812f47-3d21f72db37mr5270230b6e.38.1718000741537; Sun, 09 Jun 2024 23:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000741; cv=none; d=google.com; s=arc-20160816; b=XSSQI/cmSWl85BD8MMpE873P7QbprdH/4YeXFBL/NvFeqRfHPz9e3k3R8Jake5RIT+ b3AaXTOqCL0JPXYuvFoTlh9pQsovM3t7jakoa9l8RcL89tD72RxFjGiN7xmjKETPnJr1 mFFSrAhZozuUcCF5eRjyx6JeaDQnvdCSb72sw+OV4FqBz+sxFm5JIAwn+TapB+FA15za xee/rVycxtMLX+13CbZZMeIQNZ1b/6uEc2qRdwI+ZWnpkYQ46LmfDutJWvDv0soYW06x crfWlh2F+GXaBjlbQ6qyLJkujO+16QbQ8X6ZwLmkLNkaN1zMJuhMBNDGUD3xQi2QxtBZ Z+ow== 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=bxe7HfN8JjME6wSReRSlFJ2qLete6tZ4Y332w2hrNvs=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=Fd1oSih1gtKa39wt9HKdCX+AO7gUhSumK2OaqGQYlKzQ7965PQSszUVOyeeeaVyFsL P3XI8V7PRQo86j3ACZwuh3HttiBunhADgRsOnW4/hJrs87vmBoaCecbiSWpKnhz9hluK mhS1UkjVymCKjHgyravaxuzlK7zid7dtckIlEAEsTZgpuWXnT8iTsJbFqBWOM9c1ziPS 9BJlkH/n+ZqXYLGikj9MlLmwfGeaTpvG32r329Kgs6tMZ6VNbleEvWC1rnQIoWxBr7Vg acrhEhjIpnNV59jKYWZENWt4IP9OhHxGvm472F93HWxArfjW5UK+PpaBpraDD4LJzXC8 LJGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w27ACW4w; 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-7954de508ebsi626731985a.685.2024.06.09.23.25.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:25:41 -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=w27ACW4w; 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 1sGYQe-00054P-Ej; Mon, 10 Jun 2024 02:22:52 -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 1sGYQa-0004iR-Rb for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:48 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQZ-0004dI-0Q for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:48 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-35f1c567ae4so992638f8f.1 for ; Sun, 09 Jun 2024 23:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000565; x=1718605365; 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=bxe7HfN8JjME6wSReRSlFJ2qLete6tZ4Y332w2hrNvs=; b=w27ACW4wOTkGroFwxSNxuYlFpqPVNBW5T15CNkVtvBi4DX5do9HL+MS2/6di7kkydk 7q5NCTqWtUcGZcp2qq1a/Kj1JCOSqtsxuSKqjFZukYoN84rg1RCOyRJ63X58w+UMCIGB D9ZncqZPq4n3x4uQdA3eJsqUahv4Agq9dMR6A9WurUhLodaVCY+gGusOWvc/2J1iBZlX ebuoFhVPiTJ6tOU53dWbGaxXZ773Dw3oUvajS3ET2jWkizw2a9HSZqO4GZ13N7XbRAbp BS0vfXEIF1v6HuBvLSYdYVJx2ueCi6wOR9XeqOgUR8F7pePOAMeCRhu2vTNc5vny8Zbz pYtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000565; x=1718605365; 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=bxe7HfN8JjME6wSReRSlFJ2qLete6tZ4Y332w2hrNvs=; b=HY0X4pKZI1/hyDvdrXSD7aA880zY4GjLzewRWJLvRJxwWcKocNMrXLi4ohsKo0UWX7 aK4ZF/v/GGvIHHfElDDqrjKxYgcug7E7oOxttaW49BMmQrK6IYivvgY2h9xs+VjfHHXa /C/g3ujfG2rtMhcRLMqgMhjm34/6kUJJ79an583eGwEYK3NylMQgkTA7PUk9KMDdJf2B nzErm0hbtOhZCuMja9wurKKJu59a7JDBfJeryucKTJPLdpxnkMjE1kNobGx05fiZBTGW 8y9PYjgpDEBhDB9wSpw0IUFLQLZFM3sBlkoSWfXRhxOQKBsnyOGOPmozw+nIWYp/sQGf lC9g== X-Gm-Message-State: AOJu0YzldFbQ1pisxuelic3tvAJzXdZizQgGeR1OcDWM4K7hEsdd+njE nvAgS1SRztbqtdDgu5Tg78vNTxYmE51qCTIgR/szPyn+dvGFflta3MzCY6IfNYNz66DPjn7P/es 3 X-Received: by 2002:a05:6000:1743:b0:356:491f:27ec with SMTP id ffacd0b85a97d-35efed51586mr5175689f8f.39.1718000564777; Sun, 09 Jun 2024 23:22:44 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f0ccc5f03sm6855921f8f.88.2024.06.09.23.22.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:44 -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 17/26] hw/ppc: Avoid using Monitor in xive2_eas_pic_print_info() Date: Mon, 10 Jun 2024 08:20:55 +0200 Message-ID: <20240610062105.49848-18-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::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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/xive2_regs.h | 2 +- hw/intc/pnv_xive2.c | 16 ++++++++-------- hw/intc/xive2.c | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/hw/ppc/xive2_regs.h b/include/hw/ppc/xive2_regs.h index 816f5d0e84..f662f0e325 100644 --- a/include/hw/ppc/xive2_regs.h +++ b/include/hw/ppc/xive2_regs.h @@ -48,7 +48,7 @@ typedef struct Xive2Eas { #define xive2_eas_is_valid(eas) (be64_to_cpu((eas)->w) & EAS2_VALID) #define xive2_eas_is_masked(eas) (be64_to_cpu((eas)->w) & EAS2_MASKED) -void xive2_eas_pic_print_info(Xive2Eas *eas, uint32_t lisn, Monitor *mon); +void xive2_eas_pic_print_info(Xive2Eas *eas, uint32_t lisn, GString *buf); /* * Event Notifification Descriptor (END) diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c index 83e0f6b09f..649e5001fd 100644 --- a/hw/intc/pnv_xive2.c +++ b/hw/intc/pnv_xive2.c @@ -2120,24 +2120,24 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon) g_autoptr(GString) buf = g_string_new(""); g_autoptr(HumanReadableText) info = NULL; - monitor_printf(mon, "XIVE[%x] Source %08x .. %08x\n", blk, srcno0, - srcno0 + nr_esbs - 1); + g_string_append_printf(buf, "XIVE[%x] Source %08x .. %08x\n", + blk, srcno0, srcno0 + nr_esbs - 1); xive_source_pic_print_info(&xive->ipi_source, srcno0, buf); - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); - - monitor_printf(mon, "XIVE[%x] EAT %08x .. %08x\n", blk, srcno0, - srcno0 + nr_esbs - 1); + g_string_append_printf(buf, "XIVE[%x] EAT %08x .. %08x\n", + blk, srcno0, srcno0 + nr_esbs - 1); for (i = 0; i < nr_esbs; i++) { if (xive2_router_get_eas(xrtr, blk, i, &eas)) { break; } if (!xive2_eas_is_masked(&eas)) { - xive2_eas_pic_print_info(&eas, i, mon); + xive2_eas_pic_print_info(&eas, i, buf); } } + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); + monitor_printf(mon, "XIVE[%x] #%d END Escalation EAT\n", chip_id, blk); i = 0; while (!xive2_router_get_end(xrtr, blk, i, &end)) { diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index 98c0d8ba44..0154ebb59c 100644 --- a/hw/intc/xive2.c +++ b/hw/intc/xive2.c @@ -27,17 +27,17 @@ uint32_t xive2_router_get_config(Xive2Router *xrtr) return xrc->get_config(xrtr); } -void xive2_eas_pic_print_info(Xive2Eas *eas, uint32_t lisn, Monitor *mon) +void xive2_eas_pic_print_info(Xive2Eas *eas, uint32_t lisn, GString *buf) { if (!xive2_eas_is_valid(eas)) { return; } - monitor_printf(mon, " %08x %s end:%02x/%04x data:%08x\n", - lisn, xive2_eas_is_masked(eas) ? "M" : " ", - (uint8_t) xive_get_field64(EAS2_END_BLOCK, eas->w), - (uint32_t) xive_get_field64(EAS2_END_INDEX, eas->w), - (uint32_t) xive_get_field64(EAS2_END_DATA, eas->w)); + g_string_append_printf(buf, " %08x %s end:%02x/%04x data:%08x\n", + lisn, xive2_eas_is_masked(eas) ? "M" : " ", + (uint8_t) xive_get_field64(EAS2_END_BLOCK, eas->w), + (uint32_t) xive_get_field64(EAS2_END_INDEX, eas->w), + (uint32_t) xive_get_field64(EAS2_END_DATA, eas->w)); } void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, From patchwork Mon Jun 10 06:20: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: 802996 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1800079wro; Sun, 9 Jun 2024 23:25:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXnYFzBMzZgMFOMkG4xhS8DxgmDEhh0n+AIBGwSMk6ab6vpcmTFF3K5C2Ff9bzgWVeEo+2fs2NBU+wW2gaDKzM8 X-Google-Smtp-Source: AGHT+IFpZ/NMGtAdxCAle99LxBUx9xF/FvYYJYSzuHOxq/FKAihGyIMXvfqD7IXrIm9DOtfj6rKT X-Received: by 2002:a05:620a:2944:b0:797:df6:edc with SMTP id af79cd13be357-7970df611f4mr126008785a.14.1718000725492; Sun, 09 Jun 2024 23:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000725; cv=none; d=google.com; s=arc-20160816; b=X4bAELoPqXReFuSUxsVNbj6Or/UJoFXu2QOcev2WzfcdnEJupif+VGnUyrh6q7/bYa 79BuCqbgUbNvYBiLVyiRe4ae1mV7F8px9cGYJJWUFQauGiWTNfLmkf9grKGHg0RhU/k7 xITlSDP9BIHA5Lq9ZwlFdiUVnjEszjmw231Peu2fKdd0RQlRC3VgIlT271HCKvwqchAD IhTXQkAVPOwMQHZ6S8bwU5219vr8xDa3gCMHkU0WrMkM7h3MWb4pXB1qGNJdADYnHPjo mzGcUkVH8o72S9zS/FEZ50pJeqBnUf60B02hvKDCUO6mybkZpQ5I7stmsmZFWLMVsS1g GATQ== 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=X3rr/CUsYOR7MAOeZf0Zr5EWpEoeic30FuIkZJmnou0=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=W9U5RRa3QOFet3etEZe8sXggKqEangRSoa5eiZZBFKXV5UWanmP5OmMUxxzV0IKUJK 4W3DOE6C0qYZ983FvSSl6PlnwpuGgLz7YlDaX5j2MZ0g4YU2VEQ4h/DpDRfGHTrlVVdq bDU/j258trSlVUwL+NupdcDUX+pXowju490hELlPrqQ6UtARnHsiVNpWTA7wIc7OLt04 xqtltoOroXqCW8R4AXVpRM8BCuUL8mazg8+qING2V3ueHMfGOi8P1xGFX7r7E3x04EAP vceTpzb/lpvWVsXFD/alQZ0YSbYrvNHLx/SOE1tAe8rErzPNeCsuMD+ntkSU8LRIzAF5 eePw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CHzwY+KX; 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-79550a14333si561720685a.242.2024.06.09.23.25.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:25:25 -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=CHzwY+KX; 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 1sGYQi-0005Xu-1a; Mon, 10 Jun 2024 02:22:56 -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 1sGYQg-0005II-7C for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:54 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQe-0004e6-BL for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:53 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-35f1cb7a40fso999881f8f.0 for ; Sun, 09 Jun 2024 23:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000570; x=1718605370; 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=X3rr/CUsYOR7MAOeZf0Zr5EWpEoeic30FuIkZJmnou0=; b=CHzwY+KXqWUGtFbB/QYxZjXDRRXm9c0IqK8NEjku3a50njY7eWNeP20dtZ38SMvrzf mylnizxlyjpqlNTeIebQYMnGDy2+9e7NJhy2nTqdjoDiPekYOF28VH21At1JTysD0LxG nw+sn/BrgOEj0zeHJkw5bdu7CmkCpJduXq/RhO76eVE/Q5u53n1oKFvx8OKq+ChkgUJ6 grHf1TVGOvqJ2LHlKIWADYpMRTO2im7CGWRgRcotftqSZ0ULcB84Yuwcjzj8HT+0dSbw 0/yqlmsVIJMuJUyyeLKXLwZfoDShUDv2J171l22wTvHcluHqxFIf/fcj/wVwxetK/bED 6tTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000570; x=1718605370; 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=X3rr/CUsYOR7MAOeZf0Zr5EWpEoeic30FuIkZJmnou0=; b=RJUPM8fiBHJYWkVatuFYfkVWlh/l3Le7oKiXq8PyBXgvTERcj2U4uGMOSpJAhTwOHG QLrLdbkFwxsP4CnWgvrZulWW2VX1tqxqUwjkw1D72FMjgXcjKQii4sjVRXGTaC2r7hZp AikP+0c+5HN22oCvc2VnmCl8sKmU0yJMa1Sr17sWPPBEVyl0lGW17vOBcl/oU+zgaeR8 DEyDfuBuq6bE4+dcKv0/nwnntfkMcB2Jrxaa8rFR6B85lXVRx88z8Y1Ewzh6Qq2zjBXA g6KCFHt0QoW6gcMwS5X7dvXDn6Z6vPiTIaQRIdRlttOJ+byC5injjH7itVEA0wtRibRt 8UWw== X-Gm-Message-State: AOJu0YwkDoezBpmHzxU1kt/wdZ9IYWVUAJUE0d/AzvzX78X7Z4PryX5i PMCyiu8d+45SirBnFwfaWmhxdRG/Lw2VAX5ql8DdDO2rNGB6ES0dCb/AHq9kL44W7+C8l8lI0iF a X-Received: by 2002:adf:ec02:0:b0:35d:bfac:1aae with SMTP id ffacd0b85a97d-35efed1b8d0mr5555434f8f.12.1718000570396; Sun, 09 Jun 2024 23:22:50 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f252193d9sm1510358f8f.54.2024.06.09.23.22.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:49 -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 18/26] hw/ppc: Avoid using Monitor in xive2_end_eas_pic_print_info() Date: Mon, 10 Jun 2024 08:20:56 +0200 Message-ID: <20240610062105.49848-19-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::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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/xive2_regs.h | 2 +- hw/intc/pnv_xive2.c | 10 +++++----- hw/intc/xive2.c | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/hw/ppc/xive2_regs.h b/include/hw/ppc/xive2_regs.h index f662f0e325..37f572ed6d 100644 --- a/include/hw/ppc/xive2_regs.h +++ b/include/hw/ppc/xive2_regs.h @@ -134,7 +134,7 @@ void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon); void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, Monitor *mon); void xive2_end_eas_pic_print_info(Xive2End *end, uint32_t end_idx, - Monitor *mon); + GString *buf); /* * Notification Virtual Processor (NVP) diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c index 649e5001fd..9535f60828 100644 --- a/hw/intc/pnv_xive2.c +++ b/hw/intc/pnv_xive2.c @@ -2135,14 +2135,14 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon) } } - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); - - monitor_printf(mon, "XIVE[%x] #%d END Escalation EAT\n", chip_id, blk); + g_string_append_printf(buf, "XIVE[%x] #%d END Escalation EAT\n", + chip_id, blk); i = 0; while (!xive2_router_get_end(xrtr, blk, i, &end)) { - xive2_end_eas_pic_print_info(&end, i++, mon); + xive2_end_eas_pic_print_info(&end, i++, buf); } + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); monitor_printf(mon, "XIVE[%x] #%d ENDT\n", chip_id, blk); i = 0; diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index 0154ebb59c..23356acff7 100644 --- a/hw/intc/xive2.c +++ b/hw/intc/xive2.c @@ -116,7 +116,7 @@ void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon) } void xive2_end_eas_pic_print_info(Xive2End *end, uint32_t end_idx, - Monitor *mon) + GString *buf) { Xive2Eas *eas = (Xive2Eas *) &end->w4; uint8_t pq; @@ -127,15 +127,15 @@ void xive2_end_eas_pic_print_info(Xive2End *end, uint32_t end_idx, pq = xive_get_field32(END2_W1_ESe, end->w1); - monitor_printf(mon, " %08x %c%c %c%c end:%02x/%04x data:%08x\n", - end_idx, - pq & XIVE_ESB_VAL_P ? 'P' : '-', - pq & XIVE_ESB_VAL_Q ? 'Q' : '-', - xive2_eas_is_valid(eas) ? 'v' : ' ', - xive2_eas_is_masked(eas) ? 'M' : ' ', - (uint8_t) xive_get_field64(EAS2_END_BLOCK, eas->w), - (uint32_t) xive_get_field64(EAS2_END_INDEX, eas->w), - (uint32_t) xive_get_field64(EAS2_END_DATA, eas->w)); + g_string_append_printf(buf, " %08x %c%c %c%c end:%02x/%04x data:%08x\n", + end_idx, + pq & XIVE_ESB_VAL_P ? 'P' : '-', + pq & XIVE_ESB_VAL_Q ? 'Q' : '-', + xive2_eas_is_valid(eas) ? 'v' : ' ', + xive2_eas_is_masked(eas) ? 'M' : ' ', + (uint8_t) xive_get_field64(EAS2_END_BLOCK, eas->w), + (uint32_t) xive_get_field64(EAS2_END_INDEX, eas->w), + (uint32_t) xive_get_field64(EAS2_END_DATA, eas->w)); } static void xive2_end_enqueue(Xive2End *end, uint32_t data) From patchwork Mon Jun 10 06:20:57 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: 802985 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799655wro; Sun, 9 Jun 2024 23:23:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU+9LvyLJMqLCPwCKTbdjNOWj+Cz946uxZBQGTURVTK9+WuukyXsF09GjLVwKlamgAXMJTsJUHYd8Ling2MOC0i X-Google-Smtp-Source: AGHT+IFDvKAuA11bMN+aTZR5DBI0CJ9wnGiKUtC8l3f7nXJm3u87v7d3xFWY6Lq/5WRSTJZPAOGE X-Received: by 2002:a05:620a:8392:b0:795:5ac9:f042 with SMTP id af79cd13be357-7955ac9f1b8mr515765585a.59.1718000607648; Sun, 09 Jun 2024 23:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000607; cv=none; d=google.com; s=arc-20160816; b=u0drK2pVGeTpC+Ekw0VsIooxRzAs76nTDafUgqIYz1IFZH0Tw4aMYFTFkU1nTg5g6y W66/sWemqkAQlIlup+uYnqyiuuQVSGCIJyqAmQcGA/HRbnx5rgCNMHXMnneFTYoGOAfb kZQREOvApnRod0Xk0+FaMDDwG+lLTGSwQzSs4QGT904ITyXqdA352CKK3TElqBbNaaok 00XcsZBfzbHBooZe556czvAekX6LWq+JFw4mwlyPeNlyTTIYFAKm9tiEvyFdYyd3kJUc n4N0mef6WwNPhWPzbfzZ14x+9sn/AbXlVGIkLiHsqsMsvQg6kbmeQKk/f9z42jtw+v3E Ubqg== 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=km+J4/bxGtBeLJ5xF5e7gXgDE+TBo1niqUyibMuzvFY=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=0t+6uQpzLeTwo1BPOkVUb546+uuy3RDLjK8UbqqA5LoxdmlOw9YY9qccvkZm2Neh6a j5bzaxkhJS/aiZ2cDwgPd7K4CDowUBWz8AgxyOlYNewQ4HlcmBW8/qg0psyb3Eb7zSIb eqUGWqOrcLN5vTcveTc6Lh+hCnJ1S4U2iTs8Cu4xWjFfQ+9fOppPdyIySrjuN8XibFTy V6drpeRyxYDac3CyjlJ4qku/dsRVBWsWGD3LvTnjw46J1mDMIu1GRyEC8+Y7am3ttobw as7Tx/Jzj6sqPQIOgQVNMFP2PqTb6HjouSeCxi2296KVIHDQGR5ct7+bf6Fs7oGkurJ9 i2tA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bVAYOUp5; 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-44038b8dd9bsi100653921cf.803.2024.06.09.23.23.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:23:27 -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=bVAYOUp5; 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 1sGYQs-0006f8-Gf; Mon, 10 Jun 2024 02:23:07 -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 1sGYQl-00069r-Et for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:59 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQj-0004f3-NL for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:22:59 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-35f236a563cso498206f8f.2 for ; Sun, 09 Jun 2024 23:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000576; x=1718605376; 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=km+J4/bxGtBeLJ5xF5e7gXgDE+TBo1niqUyibMuzvFY=; b=bVAYOUp5aWMcCTzJ5/l/vYB3goZW3gdoDUq6DHlKHoINjGdZ/nytaqMGA+0UD+aQOF pmoL6ryFztpdabwwN0bVxZZ9Hu87LCMGMHXqudURqziEjG8KJNOZLdJAeuuR4NHvy86O 0CkmbCZmhJgdMcpCOrKXh/4gZaAX3UfCcMy7ZHZFG69Ot36H19eQ+7e0F4i4QSteyNPB i6J1j+0SOCHH/lGns4HtgjcAhSzL3TbCeOExZidtVgld95jNAaNDNBvQhBNpq4/T6hZi mDQlI2P40sIJ1OnPhwOQTPE5OOFoLSKMgxlQGx3C2pwqLouojOi+0d88mAyUSRCdsNrc tqhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000576; x=1718605376; 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=km+J4/bxGtBeLJ5xF5e7gXgDE+TBo1niqUyibMuzvFY=; b=OCzk2ryupn7z1PoO5tV3sypr+OUTNc0/s6kARXasaduzJtVd6uj55+35QPPrPxvaWa rGQOd/2LVOcd0RVom4MdLfbpwaH0E/eGCkfNpy5yAKwBGZOIgWccaseleGsY7z+c58Uo uV7aetl8uRt2xp6c1v3K67Ld4b4+wPpPfBTKN551o5Wizcr0oKeP1Y741toDlownlFFv gRrEDNNZaxz7XbofkVQ42g+EZ3cnMX7oeqVGOC7+QoxreoH9CO9dfbkQiMX+Gb4NkVyG agyfYrJOhrdR+IPk2b2moEr/sW27DHLW6OAuk7nXY2ZC7vFDU1ez3OfFKoL+YaZuy0Ht Trxg== X-Gm-Message-State: AOJu0Yy/Dxui0NFAyBmT+GFlNz24b39vJYCy+gkCkZ900xGfnbpo/O1W sk7ZBjPRBKMBWgZvROunQpdxy8o7bPSkey/SYiCw/TaQ02ixAJOYifcYqCzjo07iTSAZuXZHZZC r X-Received: by 2002:a05:6000:186c:b0:35f:1c3c:56b8 with SMTP id ffacd0b85a97d-35f1c3c5723mr3525178f8f.36.1718000576053; Sun, 09 Jun 2024 23:22:56 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f271ead7bsm766337f8f.20.2024.06.09.23.22.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:22:55 -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 19/26] hw/ppc: Avoid using Monitor in xive2_end_queue_pic_print_info() Date: Mon, 10 Jun 2024 08:20:57 +0200 Message-ID: <20240610062105.49848-20-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::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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/xive2_regs.h | 2 +- hw/intc/xive2.c | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/hw/ppc/xive2_regs.h b/include/hw/ppc/xive2_regs.h index 37f572ed6d..4d32703c26 100644 --- a/include/hw/ppc/xive2_regs.h +++ b/include/hw/ppc/xive2_regs.h @@ -132,7 +132,7 @@ static inline uint64_t xive2_end_qaddr(Xive2End *end) void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon); void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, - Monitor *mon); + GString *buf); void xive2_end_eas_pic_print_info(Xive2End *end, uint32_t end_idx, GString *buf); diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index 23356acff7..6a15b4d1e4 100644 --- a/hw/intc/xive2.c +++ b/hw/intc/xive2.c @@ -11,6 +11,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h" @@ -40,8 +41,7 @@ void xive2_eas_pic_print_info(Xive2Eas *eas, uint32_t lisn, GString *buf) (uint32_t) xive_get_field64(EAS2_END_DATA, eas->w)); } -void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, - Monitor *mon) +void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, GString *buf) { uint64_t qaddr_base = xive2_end_qaddr(end); uint32_t qsize = xive_get_field32(END2_W3_QSIZE, end->w3); @@ -52,7 +52,7 @@ void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, /* * print out the [ (qindex - (width - 1)) .. (qindex + 1)] window */ - monitor_printf(mon, " [ "); + g_string_append_printf(buf, " [ "); qindex = (qindex - (width - 1)) & (qentries - 1); for (i = 0; i < width; i++) { uint64_t qaddr = qaddr_base + (qindex << 2); @@ -64,11 +64,11 @@ void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, HWADDR_PRIx "\n", qaddr); return; } - monitor_printf(mon, "%s%08x ", i == width - 1 ? "^" : "", - be32_to_cpu(qdata)); + g_string_append_printf(buf, "%s%08x ", i == width - 1 ? "^" : "", + be32_to_cpu(qdata)); qindex = (qindex + 1) & (qentries - 1); } - monitor_printf(mon, "]"); + g_string_append_printf(buf, "]"); } void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon) @@ -108,9 +108,14 @@ void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon) priority, nvp_blk, nvp_idx); if (qaddr_base) { + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; + monitor_printf(mon, " eq:@%08"PRIx64"% 6d/%5d ^%d", qaddr_base, qindex, qentries, qgen); - xive2_end_queue_pic_print_info(end, 6, mon); + xive2_end_queue_pic_print_info(end, 6, buf); + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } monitor_printf(mon, "\n"); } From patchwork Mon Jun 10 06:20:58 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: 802980 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799600wro; Sun, 9 Jun 2024 23:23:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWdA2S8OkIBYI2OshZWpua9o6FwsE/E9NDsU0f1lUrIemm++ELWwn0PXJCk3sQi9RQoKshtMCMLmy8fw+kLkXRb X-Google-Smtp-Source: AGHT+IEdrmDP3bCAPbvgm/SV878gvLZAHS3dwNOlssgfpjWj+X6A+yQCamnvBRoJc+SRNajJiZzN X-Received: by 2002:a05:6214:4506:b0:6b0:668c:7b2f with SMTP id 6a1803df08f44-6b0668c812emr91939686d6.59.1718000595087; Sun, 09 Jun 2024 23:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000595; cv=none; d=google.com; s=arc-20160816; b=0hpcwpThweWmpL6kj7WDCNmTAbRkf+vJSEh7jFJzccMU14em7BObKSmCt7xRTd9Yss CocWeBqG9piRgcHD93UvjO635rUhMZZyl9YK3pOTC8OFsiRH+0FUO6h4bWZyz+pcqyTH Da7Y1ErmijbWAAfOoFfj/sybeezDOs4EmA747RE2kBYtxM0lDkRhC3kA/f9QxIj17/7b JmvCjD1lD7zvdA52tS3520V6L2uzluSEwFpNZwidwD692HbBCg3QY43j/hSalpAusx7p iy/P2WZ23VvvHfqblZtYk4aepAFBv4uqpIbGvG0DRvHt/GdL4WXT7aO+0M2Ku0cKRQD7 Sa8w== 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=8q+0Y0d43Q0CvsJjXe52jKMwNCokmUXcUWl+GpELRic=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=zKoKXDslMRfpG4oeuB+h54GN5EzWDArLoO6oWf8p/uwbqlOHheRlaAFkWnY/Iu7JOe SbJUmcR2n/nSDsebffBwOg/EJiG08V9AwxGalJXstB4A6IXxicVYpe+qb6Yj28g6CTNo m8Ahre0duk0WRKrfvV8kd1XFdT8/+IIWwXiN4f4hCBe+1tBJG36eCrL3otfCt85EGmZ3 SpUhrfexdyuMRshm/l25o8eylOI/OZSrlhZdL/q9gqDUG7Dxg1Rc6/3IedJxu88Djl2U TdIlrLW6bK4gEGSicYa9JvkG8m6SMN4yASfiYoQDHGqgCGJuGkrAjKuhyGpVF/JFCcbb E3cg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bfQKoPwB; 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-6b04f998061si71780686d6.343.2024.06.09.23.23.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:23:15 -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=bfQKoPwB; 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 1sGYQw-0006tt-US; Mon, 10 Jun 2024 02:23:12 -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 1sGYQr-0006iN-Qq for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:06 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQp-0004fr-F2 for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:05 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-421820fc26dso6641615e9.2 for ; Sun, 09 Jun 2024 23:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000582; x=1718605382; 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=8q+0Y0d43Q0CvsJjXe52jKMwNCokmUXcUWl+GpELRic=; b=bfQKoPwBxNrN1BCjEOpTXg/11ccETZw3f0utIEJyUjtNd6dtbZYjO0RiQhjfyXa9nN BfAd3d3gi+Jlq2Vi/ieox/8YsfaSciR3I++7wD0U0FpNK9RsVD2A0LWbabw+lAH2kxLg NjiqA++Uu61AFeETyz9YoNp4p6faU/10knEeRE3FgBiIin2utraiPcfJzAecMmiZW3Qx Fe4upOvtZLHj8wSpr99rxbBJcBCFWEs3wPZSe848pbiZZRikdMI4h2VLFlTvn6WAbbqz U24xOyyd1e9hMCO1F5YKRuzC4YiSMN4901gVUgQnV+Vb8a3Dt1QjjpaVv+NniywldIXi DVTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000582; x=1718605382; 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=8q+0Y0d43Q0CvsJjXe52jKMwNCokmUXcUWl+GpELRic=; b=HOvmPZNuYdaMu4B6vIxB1FxOnzoHE858xSMje1796a5pwbNmn3gQfBR/joNL/FIEog DDVIoApY8YXR06yGqx9/4rv3447uhbx0syFYGP+947aVpSksR9RU2qI3qv/e62VzIar0 I9qU1PisQTRxzDfiFXuTLaWkqdtL+Qkwg4UU3rpcYsYoxNFadtW+pb5JmCXPgM5p1ERa 8e0r/LRFrxJki5F/ZYxIco4bahAXi7qMayJX7ioX5FFe9pNMnCjddWUiFe43oD08t3sy VM5MJoZumQOCT9cPL/lQUPzuduDoMSDRm9fxNFs/wA4MJwyr2w7Xyd7Vdzq5N+4AgP0r GLEg== X-Gm-Message-State: AOJu0YzhwyzjJESSBKqi1wl9BWS6s754gAYgtOuQJ8IBpfaxnMHXNWA7 5E20hf0NjH6nYcy1aFQAE187VfCXs3TX7zhyeRgzcmp6gLGADEW2Mb0TQksmth8gPlfUjTFc99E 6 X-Received: by 2002:a05:600c:190a:b0:421:7476:6ba1 with SMTP id 5b1f17b1804b1-42174766d4fmr56860135e9.38.1718000581766; Sun, 09 Jun 2024 23:23:01 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4216b398fd8sm96058135e9.23.2024.06.09.23.23.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:23:01 -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 20/26] hw/ppc: Avoid using Monitor in xive2_end_pic_print_info() Date: Mon, 10 Jun 2024 08:20:58 +0200 Message-ID: <20240610062105.49848-21-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::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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é --- include/hw/ppc/xive2_regs.h | 2 +- hw/intc/pnv_xive2.c | 8 +++---- hw/intc/xive2.c | 48 ++++++++++++++++--------------------- 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/include/hw/ppc/xive2_regs.h b/include/hw/ppc/xive2_regs.h index 4d32703c26..4e5e17cd89 100644 --- a/include/hw/ppc/xive2_regs.h +++ b/include/hw/ppc/xive2_regs.h @@ -130,7 +130,7 @@ static inline uint64_t xive2_end_qaddr(Xive2End *end) (be32_to_cpu(end->w3) & END2_W3_EQ_ADDR_LO); } -void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon); +void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, GString *buf); void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, GString *buf); void xive2_end_eas_pic_print_info(Xive2End *end, uint32_t end_idx, diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c index 9535f60828..52505fd1a4 100644 --- a/hw/intc/pnv_xive2.c +++ b/hw/intc/pnv_xive2.c @@ -2141,14 +2141,14 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon) while (!xive2_router_get_end(xrtr, blk, i, &end)) { xive2_end_eas_pic_print_info(&end, i++, buf); } - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); - monitor_printf(mon, "XIVE[%x] #%d ENDT\n", chip_id, blk); + g_string_append_printf(buf, "XIVE[%x] #%d ENDT\n", chip_id, blk); i = 0; while (!xive2_router_get_end(xrtr, blk, i, &end)) { - xive2_end_pic_print_info(&end, i++, mon); + xive2_end_pic_print_info(&end, i++, buf); } + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); monitor_printf(mon, "XIVE[%x] #%d NVPT %08x .. %08x\n", chip_id, blk, 0, XIVE2_NVP_COUNT - 1); diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index 6a15b4d1e4..3e7238c663 100644 --- a/hw/intc/xive2.c +++ b/hw/intc/xive2.c @@ -11,12 +11,10 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h" #include "hw/qdev-properties.h" -#include "monitor/monitor.h" #include "hw/ppc/xive.h" #include "hw/ppc/xive2.h" #include "hw/ppc/xive2_regs.h" @@ -71,7 +69,7 @@ void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, GString *buf) g_string_append_printf(buf, "]"); } -void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon) +void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, GString *buf) { uint64_t qaddr_base = xive2_end_qaddr(end); uint32_t qindex = xive_get_field32(END2_W1_PAGE_OFF, end->w1); @@ -90,34 +88,30 @@ void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon) pq = xive_get_field32(END2_W1_ESn, end->w1); - monitor_printf(mon, - " %08x %c%c %c%c%c%c%c%c%c%c%c%c prio:%d nvp:%02x/%04x", - end_idx, - pq & XIVE_ESB_VAL_P ? 'P' : '-', - pq & XIVE_ESB_VAL_Q ? 'Q' : '-', - xive2_end_is_valid(end) ? 'v' : '-', - xive2_end_is_enqueue(end) ? 'q' : '-', - xive2_end_is_notify(end) ? 'n' : '-', - xive2_end_is_backlog(end) ? 'b' : '-', - xive2_end_is_escalate(end) ? 'e' : '-', - xive2_end_is_escalate_end(end) ? 'N' : '-', - xive2_end_is_uncond_escalation(end) ? 'u' : '-', - xive2_end_is_silent_escalation(end) ? 's' : '-', - xive2_end_is_firmware1(end) ? 'f' : '-', - xive2_end_is_firmware2(end) ? 'F' : '-', - priority, nvp_blk, nvp_idx); + g_string_append_printf(buf, + " %08x %c%c %c%c%c%c%c%c%c%c%c%c " + "prio:%d nvp:%02x/%04x", + end_idx, + pq & XIVE_ESB_VAL_P ? 'P' : '-', + pq & XIVE_ESB_VAL_Q ? 'Q' : '-', + xive2_end_is_valid(end) ? 'v' : '-', + xive2_end_is_enqueue(end) ? 'q' : '-', + xive2_end_is_notify(end) ? 'n' : '-', + xive2_end_is_backlog(end) ? 'b' : '-', + xive2_end_is_escalate(end) ? 'e' : '-', + xive2_end_is_escalate_end(end) ? 'N' : '-', + xive2_end_is_uncond_escalation(end) ? 'u' : '-', + xive2_end_is_silent_escalation(end) ? 's' : '-', + xive2_end_is_firmware1(end) ? 'f' : '-', + xive2_end_is_firmware2(end) ? 'F' : '-', + priority, nvp_blk, nvp_idx); if (qaddr_base) { - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; - - monitor_printf(mon, " eq:@%08"PRIx64"% 6d/%5d ^%d", - qaddr_base, qindex, qentries, qgen); + g_string_append_printf(buf, " eq:@%08"PRIx64"% 6d/%5d ^%d", + qaddr_base, qindex, qentries, qgen); xive2_end_queue_pic_print_info(end, 6, buf); - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } - monitor_printf(mon, "\n"); + g_string_append_c(buf, '\n'); } void xive2_end_eas_pic_print_info(Xive2End *end, uint32_t end_idx, From patchwork Mon Jun 10 06:20:59 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: 802983 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799648wro; Sun, 9 Jun 2024 23:23:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUl8fi/9hJdh1XwQYQXK74cZ5ImucHe7dbC91lNvfSN4Ntp1RytkAw+tc9IynSBxzc4b81E6FvUJPZVIwUH8GB9 X-Google-Smtp-Source: AGHT+IHId6fePMw4G/GHgo6xxpgdhF79mAEGRjVmHtmhymy9l017XZ65/0R25wsATO96dgzOe3cs X-Received: by 2002:a25:ac01:0:b0:dee:6323:e8e7 with SMTP id 3f1490d57ef6-dfaf65e68ecmr8356163276.6.1718000606525; Sun, 09 Jun 2024 23:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000606; cv=none; d=google.com; s=arc-20160816; b=L2jXZLHg6ffubYcYwHOKsaU9YZXaIdD3ItYw3ZOFflWf9w7ROZJH+pWnjwHkXm+ET1 +pODgrYbjLmqhnfmq2RVoyTXTKPo+9q6HT7o+mrlhTmg2yRFEIW6V/AOJGTIG8K7HRmf fzs3e3UmXBlcTYnFaysGOss4bYWQVNnxktNPhoBZ8Aob1pbmMtnCnq1YKqt/J5Sa731l F0smzMRvZN9TiKdn1Z1eGf44Uh6Iic/FbdFhSlaUew7LZIAE+heAujbkikLclQunHiNf wx4UdVaT0tAVa8l2da22TiPt1APGe9GGW+UUQfbeIHGyzcQccz9AxSxv3jSwKDav7Zv9 OOoA== 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=Mz5qepmIMKoMtRNgH2g47GTUqOjYTHfYVOjGTI79PvM=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=Je+Sqo+6Pfk95ZfYwHehGBgVWQzfjPb5wE3W4bskn/LO5sr7DGCLCIaaX1OwMwt3mc AK8UPnuS0rLDW3+R2yzwNLCX4FdIyx06g4nILA0HX9dE5vZDN9vMsQXX1JXdbm1EsovM /bXaaqTBdkGOFRblbQQXvXt+PJhO95jGejVoW6j0EPAzWxnLJ8aYUSToFWKR97i93D6r HucUeCZLpBKB8dnoGWGoxnIFAsgEmRtCVet5/qRP9s0UuymrT8ezgfDl/Ejpl/3IQU4x EDgCmIolpODT7elc6YxxCWsLVMnDuzTCHBpu3Dcgn5IcGErSlqGwQx5soxCWS1uB6czo 15wQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YoREaMCy; 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-44061894fe1si37874531cf.749.2024.06.09.23.23.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:23:26 -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=YoREaMCy; 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 1sGYR2-0007ez-C3; Mon, 10 Jun 2024 02:23:16 -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 1sGYQy-00077Y-8M for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:12 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYQv-0004ge-4I for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:11 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-35f1c490c13so1331393f8f.3 for ; Sun, 09 Jun 2024 23:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000587; x=1718605387; 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=Mz5qepmIMKoMtRNgH2g47GTUqOjYTHfYVOjGTI79PvM=; b=YoREaMCy4UphPB4ViB0APqwxUlW49X/BkinFtNoetmImPJn3g9aUep92u5ziZrqOBK 8lz04d+bLx4m5C6rqYg3vpSNGH95PUPWeE110zxNBCn7kqRXq8xPYB/JEbfDNNquVbkq Xh+giqPwhhjs5bcaZ1+uS0bYmCIjRTj1SQelJShqCcalrJlWAU5tSEApVFCd3k6GiIcb 5Z8O8LUZPtOWB+LgUm7Oa+SAS2dIh8mSMmRUKXCMgRK3WbHTweKopI8+x3dGa2HtOZBs NXbhwZD3Do8EKIzPzemnNLlK741V6aLm5MJdzt3y/cIzZlNofFKfEOy3mQCUYlFrgF5S oqgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000587; x=1718605387; 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=Mz5qepmIMKoMtRNgH2g47GTUqOjYTHfYVOjGTI79PvM=; b=iNGP1380mLiY6UdbqSwKnwc2TJBnuwnGQRlI8CkMAWR2cFRxyrpiA24tFXLDJOYHe1 qxWQOvQ1MZsG5zfzLTIxLx0VC1LkSQcM1mKHdaTyIjhwP6YheEle47jAfgH4nvRfbK7S a+IB99gmZladvnssT90UZ9jAIDrA4iU2bQLyHDowE324ERdUSwIgHNvPn3saguKsGRAe 5omU/J8QgyCqfWhGPBj/jKhjYkZFf9H3Pje8C9XcGFi9lpE4lPGw4lt51wnOP1wk3wjs OuWlob7qS/RNr2JTF+oAQX11EDj3naScUtGpIM/hSFww12DiDv02jg957y1Wn6iU3REm lglA== X-Gm-Message-State: AOJu0Yx6R7yiJdG2I5zUrpKyLqUCyXiaYkDtvl17thvKNZdPfPqDDrD1 49yZms5oNN268+TfoHKdWD6Seok47NfheYudmy6SYZUl9Kt3nXBWbH0XPQgNMBEc88IYNFStDVW 0 X-Received: by 2002:a05:6000:2ae:b0:35f:1ff8:32db with SMTP id ffacd0b85a97d-35f1ff833a5mr2837574f8f.62.1718000587438; Sun, 09 Jun 2024 23:23:07 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f08b280d0sm7354482f8f.86.2024.06.09.23.23.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:23:07 -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 21/26] hw/ppc: Avoid using Monitor in xive2_nvp_pic_print_info() Date: Mon, 10 Jun 2024 08:20:59 +0200 Message-ID: <20240610062105.49848-22-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::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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é --- hw/intc/pnv_xive2.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c index 52505fd1a4..10914b04df 100644 --- a/hw/intc/pnv_xive2.c +++ b/hw/intc/pnv_xive2.c @@ -2028,7 +2028,7 @@ static void pnv_xive2_register_types(void) type_init(pnv_xive2_register_types) static void xive2_nvp_pic_print_info(Xive2Nvp *nvp, uint32_t nvp_idx, - Monitor *mon) + GString *buf) { uint8_t eq_blk = xive_get_field32(NVP2_W5_VP_END_BLOCK, nvp->w5); uint32_t eq_idx = xive_get_field32(NVP2_W5_VP_END_INDEX, nvp->w5); @@ -2037,21 +2037,21 @@ static void xive2_nvp_pic_print_info(Xive2Nvp *nvp, uint32_t nvp_idx, return; } - monitor_printf(mon, " %08x end:%02x/%04x IPB:%02x", - nvp_idx, eq_blk, eq_idx, - xive_get_field32(NVP2_W2_IPB, nvp->w2)); + g_string_append_printf(buf, " %08x end:%02x/%04x IPB:%02x", + nvp_idx, eq_blk, eq_idx, + xive_get_field32(NVP2_W2_IPB, nvp->w2)); /* * When the NVP is HW controlled, more fields are updated */ if (xive2_nvp_is_hw(nvp)) { - monitor_printf(mon, " CPPR:%02x", - xive_get_field32(NVP2_W2_CPPR, nvp->w2)); + g_string_append_printf(buf, " CPPR:%02x", + xive_get_field32(NVP2_W2_CPPR, nvp->w2)); if (xive2_nvp_is_co(nvp)) { - monitor_printf(mon, " CO:%04x", - xive_get_field32(NVP2_W1_CO_THRID, nvp->w1)); + g_string_append_printf(buf, " CO:%04x", + xive_get_field32(NVP2_W1_CO_THRID, nvp->w1)); } } - monitor_printf(mon, "\n"); + g_string_append_c(buf, '\n'); } /* @@ -2147,15 +2147,16 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon) while (!xive2_router_get_end(xrtr, blk, i, &end)) { xive2_end_pic_print_info(&end, i++, buf); } - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); - monitor_printf(mon, "XIVE[%x] #%d NVPT %08x .. %08x\n", chip_id, blk, - 0, XIVE2_NVP_COUNT - 1); + g_string_append_printf(buf, "XIVE[%x] #%d NVPT %08x .. %08x\n", + chip_id, blk, 0, XIVE2_NVP_COUNT - 1); xive_nvp_per_subpage = pnv_xive2_vst_per_subpage(xive, VST_NVP); for (i = 0; i < XIVE2_NVP_COUNT; i += xive_nvp_per_subpage) { while (!xive2_router_get_nvp(xrtr, blk, i, &nvp)) { - xive2_nvp_pic_print_info(&nvp, i++, mon); + xive2_nvp_pic_print_info(&nvp, i++, buf); } } + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } From patchwork Mon Jun 10 06:21:00 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: 802986 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799672wro; Sun, 9 Jun 2024 23:23:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVDVceka6l1fothSbrWlbFOyerxngRqUrLc8LdreydPwd7IWEEjfzkt+8RWJONCa+3QNZogrnmHL0SdIzhpcqUz X-Google-Smtp-Source: AGHT+IEhjRhvpV3FFo071TM56Wqj2XhxzLqP95+BFI9H5+1no5xULuCfDpCmNKox1oC60xaHSpzE X-Received: by 2002:a67:f790:0:b0:48c:376f:fbfe with SMTP id ada2fe7eead31-48c376ffd33mr4682888137.14.1718000612931; Sun, 09 Jun 2024 23:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000612; cv=none; d=google.com; s=arc-20160816; b=eIurEg1ajbkVZForI2fBok5MrybbL1QATLvTi28MZ3KB/5iV0fTzNEVp7MIvoQ3jqz VAFq79JIFwKYSKnfu2PFtE5TKdhEAO/TBzOAtJ2Ror+ivC9MNcg4ncO0osEvv6ZlHobK eM1PrpsCsHiLI+kpHnsBxo8lxBC1SfB8UX2QygzUhGZuUywyeBD24/xs7nEsZYyUgVmI kR4Kd/jEKrcfeETNMx4n8aZHM3qypg/lH5lasAVc63GorEr0mnrIZOAVgrg3ULPy/7Y1 xZOFnQ1F4xQwdC3j2GRu3nJwMpDAi17Kk+N3BJ8as0Ffh0NfKskLj8foidaL8M+DYFSc 9M9Q== 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=4n9OOqL7M+4IkKSuwlfUH4OM5K7RDG2/fYwnLrV93N8=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=U0UI2u3lOoqHL8VLLYyM1hVFhOg426FDNwC6zr7zri+T5LkCbcc784/fhRkHq+2q3s FJagQcWmqCzpKWLsj4vXF1CQ7DxA/2XguyR0zSLPino281RWt+y4hpRGRvcUGXo0fAxV HUHjB0e/E58x6CpWNxjOFnGBKnqS55Wx6d8Izxfg3bnu07584/87MNEpT33Rynew/lEB Ig5nzkVIKSNtIxOPevlQdUmdwpzL6iSPobZpcH+Chntvjz7/6XWgSBAtU/37W1pgJMtT 889KlkbSIG2d6fDrOYQn7Z8W3UR+LZPjQlJ44ruQqmq5+SwC+5udgb7f7DC3m3vXJJ0G +tbA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D0FM79fc; 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-44038b7a6e0si99594341cf.683.2024.06.09.23.23.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:23:32 -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=D0FM79fc; 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 1sGYR4-0007xZ-2Q; Mon, 10 Jun 2024 02:23:18 -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 1sGYR2-0007gU-IW for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:16 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYR0-0004hZ-P6 for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:16 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-35f14af40c2so1092484f8f.0 for ; Sun, 09 Jun 2024 23:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000593; x=1718605393; 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=4n9OOqL7M+4IkKSuwlfUH4OM5K7RDG2/fYwnLrV93N8=; b=D0FM79fc2UXMYFo088bpazc4Gp+Ah9m0pvNrZmA/Fk3Ga+hNrVwaxU9RbPYUn7UWOb uxWqUUl5iED3ozQTkDKzTLrXOvww9gkZEjgPYq59T/dYB1ZfuAVSyRuY4DvaB80a2TyN v9lfKnZ8XLrzO92NtoueAFu/kWdPmN1Gw6QCQeJOCG67auCqLzL1V1g0w3e/Xczo3d7h PDmcVeFfIqxc+ZtXPw8NN2Vx9K/V3T293hegHoNjp8OI8bJRmJkO3L6613mZaaPamKe6 RRmG1m7Yyu7co+kMt9PSmM84hcJslXhZ1f0MZpQLa9vb+Rg162PCwLwE6I1+tqhuLx+/ s1Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000593; x=1718605393; 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=4n9OOqL7M+4IkKSuwlfUH4OM5K7RDG2/fYwnLrV93N8=; b=Bo6fAOcY9mhgFQOj6IUyxcyIE0O8cWWYl+Du9oBliIiv1LawhC9CK7XyB5Lx+DvDWC Wvo/0ILAjZ59TRjNHvAjZgqhY+rl2+zcMnlRU4YrRNpuTHH5ePPKNuELdhydmhlJYBDS Ne8N6Nw14WO5kppPhXj4u0CzM40WKHG/A41srqrB04oIV7RwyH9RxAgKurOIOyp2GVoe xKXbvGh46DtHsTvkMAik7BtJxORg1sr9R1sGA0RzNkWqk22oS6OIjDB/O7BCmSIMOrtV DJm8/+5I0ok7i8JM5/4Zr4GcItuJeIV7CzuwddEBLTgtAi0EA1BGPJbPTJdCP7M26qjw LOJA== X-Gm-Message-State: AOJu0YxqFvU9LlZ5K+Bk1ZtCw/p20c0FAWpY2jY8ZHLDFKdEIIr+6N6I 4jv0j7QgxhLMtXwvUsLcffVtxS32rl8tcQaEtKQauo40hevrgbuHiMYnmhXJToucTT/ABUBmefC Z X-Received: by 2002:a05:6000:22f:b0:35f:caa:1eb9 with SMTP id ffacd0b85a97d-35f0caa1f21mr3378081f8f.4.1718000593001; Sun, 09 Jun 2024 23:23:13 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f224d5151sm2527449f8f.3.2024.06.09.23.23.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:23:12 -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 22/26] hw/ppc: Avoid using Monitor in pnv_xive2_pic_print_info() Date: Mon, 10 Jun 2024 08:21:00 +0200 Message-ID: <20240610062105.49848-23-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::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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/pnv_xive.h | 2 +- hw/intc/pnv_xive2.c | 9 +-------- hw/ppc/pnv.c | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/include/hw/ppc/pnv_xive.h b/include/hw/ppc/pnv_xive.h index 7d634e469c..5b4cb4167b 100644 --- a/include/hw/ppc/pnv_xive.h +++ b/include/hw/ppc/pnv_xive.h @@ -163,6 +163,6 @@ typedef struct PnvXive2Class { DeviceRealize parent_realize; } PnvXive2Class; -void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon); +void pnv_xive2_pic_print_info(PnvXive2 *xive, GString *buf); #endif /* PPC_PNV_XIVE_H */ diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c index 10914b04df..2fb4fa29d4 100644 --- a/hw/intc/pnv_xive2.c +++ b/hw/intc/pnv_xive2.c @@ -10,11 +10,9 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h" -#include "monitor/monitor.h" #include "hw/ppc/fdt.h" #include "hw/ppc/pnv.h" #include "hw/ppc/pnv_chip.h" @@ -2105,7 +2103,7 @@ static uint64_t pnv_xive2_vst_per_subpage(PnvXive2 *xive, uint32_t type) return (1ull << page_shift) / info->size; } -void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon) +void pnv_xive2_pic_print_info(PnvXive2 *xive, GString *buf) { Xive2Router *xrtr = XIVE2_ROUTER(xive); uint8_t blk = pnv_xive2_block_id(xive); @@ -2117,8 +2115,6 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon) Xive2Nvp nvp; int i; uint64_t xive_nvp_per_subpage; - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; g_string_append_printf(buf, "XIVE[%x] Source %08x .. %08x\n", blk, srcno0, srcno0 + nr_esbs - 1); @@ -2156,7 +2152,4 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon) xive2_nvp_pic_print_info(&nvp, i++, 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 4a1a302a25..5b9dbff754 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -864,7 +864,7 @@ static void pnv_chip_power10_pic_print_info(PnvChip *chip, Monitor *mon) g_autoptr(GString) buf = g_string_new(""); g_autoptr(HumanReadableText) info = NULL; - pnv_xive2_pic_print_info(&chip10->xive, mon); + pnv_xive2_pic_print_info(&chip10->xive, buf); pnv_psi_pic_print_info(&chip10->psi, buf); info = human_readable_text_from_str(buf); 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, From patchwork Mon Jun 10 06:21:02 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: 802989 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799784wro; Sun, 9 Jun 2024 23:24:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV0HUXe0XHTpKqemVRyVd17J4P2ERPrb2EyhwdYDK889FwkD1IIVtXvLgOf1bIZCZcnlSOjl38TQGyeWn8wIh5s X-Google-Smtp-Source: AGHT+IEE8fKgWqPBAYolVF+DxVkYudYOTzLDc3brmWjKXtrDU7l4fxoPTB07lfEdUnewu+kzu7Wd X-Received: by 2002:a05:6214:3992:b0:6b0:6629:bdf1 with SMTP id 6a1803df08f44-6b06629bf93mr70870436d6.17.1718000641527; Sun, 09 Jun 2024 23:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000641; cv=none; d=google.com; s=arc-20160816; b=k8MgVawbRHTd3l8RiQL/J41V2HhRkfkYtTL2uG2+ttRldzp1IjO2pXHovKcmvQmnu/ syqiM4siXbN6Mb7QevGCZ106q5YS5RwKQucs5u07/P0dDNoPaRVPOeGSAv7+67w/8TZc qHoTvo60MQunZW/THzYN0DEDSREI5DnZ7+KFnhAycYHK52jM1VZnCuhQdZLRQKEkNb0f e2hwPIAILqDISN3tPgSjvSi1LR34uqOWIxiEnwhtV09MWRjWmTqzBV8iNlXe4E7yp9zn QyA2q/R/1E8dF5LctkBLK/fXGw39pXe1BDqZF6MwW7cVQVTLNvcBW1lmq5b6qPlbL49I U0fg== 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=UCDgKLBaeeDvn2QqbIauKDYEeh4Bef/zoBzza2n2iFc=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=qGxvGjGjsdzFY4fZISXpViiS5VUX7xFlqXbUudKQKkLuvv6oyZDe6tcTP6vHj/43LE 68koY/Oq6mpGMzbKd3BNDeG7mgeq03Et13Bf+2wcYaT/rnCh235HU6Cv7LFaGkGG8U5K 7JsduN1NZ6O2RmN2cRUHhP1vJjLCKNTbFuVmn4viKyl57QV4qxLGNCILw+kJDXWKJYNB p1HEU6DYTXUXNZu3d9h7igjwl7e607mKNQo7isg7SU8uLaSrk89c9lqbgesolJmKLdrQ zHp9wPuqDXlxACUKZuEmAHlmjgd3evKMGrmgyqzq3vIuY79zp958ryPK0QYMm/Q1BnvT kWTQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C8tPthBn; 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-6b07f5361efsi14563286d6.141.2024.06.09.23.24.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:24:01 -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=C8tPthBn; 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 1sGYRG-0001SH-5f; Mon, 10 Jun 2024 02:23:30 -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 1sGYRE-0001Iu-LC for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:28 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYRC-0004jY-Cy for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:28 -0400 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-52c6f381434so2311493e87.2 for ; Sun, 09 Jun 2024 23:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000604; x=1718605404; 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=UCDgKLBaeeDvn2QqbIauKDYEeh4Bef/zoBzza2n2iFc=; b=C8tPthBnRiLirn5ZC4CF08Rs63uO5ltvd+Dh5jFoLz7kL1j/YCToXbZOLN1IMzxBlN eRyHcTCykKTLUvKXXJwUpeYkomQ6rqj36crqg0VYWeVd1DZilq7khsxFXvAAO/EQIgl8 z4j77fqNNzxWvGv/VYzME7FuYTFWCC049HtaybGeCkzgNhZ7iDA1ZnBuroYARGmcBpS7 8y+t9kQvJw1VJu67ZEq2T3Jj1Q+pM2EEnvk5WKtYUpp6j4RH6blnsSoIsi8gucoyItT1 Bis8T+qOiFNeyQ+jNei9N4rC7mckpgzuSLbpdjOpsBE0N93GYoZOUg8XQaUwhrGaNYCp 4eUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000604; x=1718605404; 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=UCDgKLBaeeDvn2QqbIauKDYEeh4Bef/zoBzza2n2iFc=; b=uUwW7wAKQSY/6gGU8ZQ5EY+H8Vkosv1HnUp9JQvKtdgk7PV+KaBCAjUkaw+Ia5vcHv rX46n/ALwV7tNqNISHBAUqrr84PXdAkbsYV8j8Y7O6yLYpA0A87m0vv+26dUSPGjvNbU ll4ifVXPIC9gYY6vr2hxEfTriCSJIYRejJPoZGtyyzk2syFAhzlWfCP2uhj25vi6ew8H wZOG97MRRjUqwlzmMM1e822hI9DKFnc/Foijev91I1yQ6CQ99mt7/RXHGst0e5hCcb/3 tEUrdqAcLPOvkxTUHVqzDf2XbDPjjQLfztkshRYjgBOrWrCLFne051zF79pLeiBcGk9Q B2Tw== X-Gm-Message-State: AOJu0YzBQ2rIf5Fxxq9tpK5WQ/FrHFOA17bBKOp67PsNYp2Kp58K+Cv0 +1clpoLEUl03VjOlcFV5VLu40J8Sv/oOMfR6vSPXwPV+X3dxjpfMfPU5o1srMooMAS+aP0Rc9/7 f X-Received: by 2002:a05:6512:1285:b0:51b:1e76:4ea9 with SMTP id 2adb3069b0e04-52bb9f663f0mr8935766e87.4.1718000604159; Sun, 09 Jun 2024 23:23:24 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f1ed08253sm3424416f8f.24.2024.06.09.23.23.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:23:23 -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 24/26] hw/ppc: Avoid using Monitor in spapr_irq_print_info() Date: Mon, 10 Jun 2024 08:21:02 +0200 Message-ID: <20240610062105.49848-25-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::12c; envelope-from=philmd@linaro.org; helo=mail-lf1-x12c.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/ppc/spapr.c | 11 ++++++++--- hw/ppc/spapr_irq.c | 8 +------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h index 6e50470cff..cb9a85f657 100644 --- a/include/hw/ppc/spapr_irq.h +++ b/include/hw/ppc/spapr_irq.h @@ -85,7 +85,7 @@ int spapr_irq_cpu_intc_create(struct SpaprMachineState *spapr, PowerPCCPU *cpu, Error **errp); void spapr_irq_cpu_intc_reset(struct SpaprMachineState *spapr, PowerPCCPU *cpu); void spapr_irq_cpu_intc_destroy(struct SpaprMachineState *spapr, PowerPCCPU *cpu); -void spapr_irq_print_info(struct SpaprMachineState *spapr, Monitor *mon); +void spapr_irq_print_info(struct SpaprMachineState *spapr, GString *buf); void spapr_irq_dt(struct SpaprMachineState *spapr, uint32_t nr_servers, void *fdt, uint32_t phandle); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 81a187f126..cd9b811ac6 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -31,6 +31,7 @@ #include "qapi/error.h" #include "qapi/qapi-events-machine.h" #include "qapi/qapi-events-qdev.h" +#include "qapi/type-helpers.h" #include "qapi/visitor.h" #include "sysemu/sysemu.h" #include "sysemu/hostmem.h" @@ -4530,10 +4531,14 @@ static void spapr_pic_print_info(InterruptStatsProvider *obj, Monitor *mon) { SpaprMachineState *spapr = SPAPR_MACHINE(obj); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; - spapr_irq_print_info(spapr, mon); - monitor_printf(mon, "irqchip: %s\n", - kvm_irqchip_in_kernel() ? "in-kernel" : "emulated"); + spapr_irq_print_info(spapr, buf); + g_string_append_printf(buf, "irqchip: %s\n", + kvm_irqchip_in_kernel() ? "in-kernel" : "emulated"); + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } /* diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index b43917e7fe..aebd7eaabb 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -11,7 +11,6 @@ #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" @@ -19,7 +18,6 @@ #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" @@ -267,16 +265,12 @@ static void spapr_set_irq(void *opaque, int irq, int level) sicc->set_irq(spapr->active_intc, irq, level); } -void spapr_irq_print_info(SpaprMachineState *spapr, Monitor *mon) +void spapr_irq_print_info(SpaprMachineState *spapr, GString *buf) { 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, 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, From patchwork Mon Jun 10 06:21:03 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: 802992 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799884wro; Sun, 9 Jun 2024 23:24:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVtXUtu1jAp+PK4dFFqoNtIwg71EAtuDk5onU/hwA4Y6luYKD1I1yKoNm2pRc0MEiBmIdCWSV4FydJlfw3jRVeT X-Google-Smtp-Source: AGHT+IGl2Q9D5BsYBWjk/ctmjbjhOumPW6fg0J1ev1lagzui37HsEAM2eAZNySl4MB2BMGxe5TWg X-Received: by 2002:a05:6102:54a3:b0:48c:5447:762 with SMTP id ada2fe7eead31-48c54471043mr2374774137.10.1718000669716; Sun, 09 Jun 2024 23:24:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000669; cv=none; d=google.com; s=arc-20160816; b=uLia5zw7lqBW+1bNzEA8rbz3yI1ucaU0/I0QuYZfv0fZ1LMfMmtuXytPBAhZmEAZlX LJ1WPI5665WJZ0LFFFpXmeILundJdxEmXBF98XtN6LmHYlVzuMyCRckwKfdr8/MJHHcn uLbypM7Xy5w4lgG3QuCpQWT5IE+srizTrDHm+n7miqnFvpc0KjudbQQBWLHOXbf0Cd19 IYd6eDbo/Sa65UKJaMxqFhkf9E0bGL7zKTsJvz9DVqDov1FpDsV+g83PkX/kqTAEBXRB 8F+sZ6IK5YQHjoxAre5SPipBvEnDjGIMKrGw3OgKrW5ks88L5QdZmvFxJEpfYDyGJnxR Z41w== 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=BYilv7Qw7hhLPwOWxXzn16HBO3Z9l6H4QsXbLEJ0kt4=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=QgHrMMWVdvXLXzcFuMsM8Wbg0+2uSOIQuBHDE632YR+diidGh9a7ydXFdL7dYbgPDA 8u1KV5IwVJCULVFQXRHDPVpn0/hVG8ZQmNy7qUKUmLczm6OpFuDtLOS50ZC8HShGNaXe IbkWKz6ZEszdlZYg8LhKsy5IUOSSWn9M7yvcJ9dxKL9ZxwTj5UcglmVY0p0vDZCZamqI IwU7ZFS2QX0pTlx6XiIY0GPT/V7Axv/dQVmIsAW3DECokZZr2wIE1+phyuxZUzw3IPMP CtNeM7+uBfGQ+oBVn2MXnZCQqLg2AmxoddplHkzSf0+RDJfvbescvIoNEYVw5iiZAw5X 60MQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eP4kWX8Y; 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-7953284e764si683631585a.110.2024.06.09.23.24.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:24:29 -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=eP4kWX8Y; 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 1sGYRf-00049X-Pm; Mon, 10 Jun 2024 02:23:55 -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 1sGYRe-0003zO-K9 for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:54 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYRc-0004ps-Lw for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:54 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-421b9068274so5264165e9.1 for ; Sun, 09 Jun 2024 23:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000631; x=1718605431; 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=BYilv7Qw7hhLPwOWxXzn16HBO3Z9l6H4QsXbLEJ0kt4=; b=eP4kWX8Y9Qlb56BlFMvfXKlFq6nW/zJc6LoTZpJA7vURfiBCfYN1uxl+A0fZQ79qbx +hxeI8kt39fk+kEXjihdeBt7vm99SAxCEFCOd8xollQHx1DOJxLq86WiIwTd271RFimU SRAHJnEce5ydT8f/fVShN6hIgDCg1TOQ6lzZ8CXdQHzkwxvgyhKqycX8Yzlf7ixmmkwO ntIT0pn72fYcMT/FDvkne34aazjeXxM3PmPMQ8zrj2UyJ8MdTEO/i5etSSgKeIrr+GMk wNqWsbpyHeYUq+d+2YEV4jzr3bALtFDv25LNBleHaq22Cin1IPTGRDWLR19OXClbBoTj Dmzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000631; x=1718605431; 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=BYilv7Qw7hhLPwOWxXzn16HBO3Z9l6H4QsXbLEJ0kt4=; b=m0QNVTeIy3cnwkvMgsBX3w6I1n7yUh07NKkdw/ySMNmu2Spy8DZMArhb8KZUQE7CjS LGJS4MJtsyGoKxk1fwkAaZPECQT/Ge4wjs8Aq4Fz+jb9sGPzPrCofX/C5bWBsTD5KRtW QuOzuv5Rc5eMjU8GOy09Wz1ufNwaFDnoGfJpSregw7a8hYB5mquVZK0dx3BgLHldMF9y jam6xnaER/FxhGqZf3NgZpaLM5EgflUVrziJerzAKm/tdYlpT+9Q5HLwK7qo7NnfdK6D 4zLV6DScOKGixRXjbZhrcW4Is/OLD1tOCNiwBfVI7tGtz3d0J+/OM/bZOJvtY0CVd32U vocA== X-Gm-Message-State: AOJu0YwkaoEai85oDXPXRKeZJJKtKKCI00fxXZ6BX1YEqkA89dH8o7YT j50Jx/k62u/ASJoLk6swYQZiZyGfeg3BbtQShtsvm136C+mCUaipqKeC8jTo2xgA22RUXmv2x1r Z X-Received: by 2002:a05:600c:4f07:b0:421:6cb5:c914 with SMTP id 5b1f17b1804b1-4216cb5cb49mr59850335e9.37.1718000609739; Sun, 09 Jun 2024 23:23:29 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215c1aa1desm131072945e9.11.2024.06.09.23.23.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:23:29 -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 25/26] hw/ppc: Avoid using Monitor in pnv_chip_power9_pic_print_info_child() Date: Mon, 10 Jun 2024 08:21:03 +0200 Message-ID: <20240610062105.49848-26-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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é --- hw/ppc/pnv.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 5b9dbff754..9039c1777a 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -789,18 +789,14 @@ static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon) static int pnv_chip_power9_pic_print_info_child(Object *child, void *opaque) { - Monitor *mon = opaque; + GString *buf = 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), buf); - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); return 0; } @@ -813,12 +809,11 @@ static void pnv_chip_power9_pic_print_info(PnvChip *chip, Monitor *mon) pnv_xive_pic_print_info(&chip9->xive, buf); pnv_psi_pic_print_info(&chip9->psi, buf); + object_child_foreach_recursive(OBJECT(chip), + pnv_chip_power9_pic_print_info_child, buf); info = human_readable_text_from_str(buf); monitor_puts(mon, info->human_readable_text); - - object_child_foreach_recursive(OBJECT(chip), - pnv_chip_power9_pic_print_info_child, mon); } static uint64_t pnv_chip_power8_xscom_core_base(PnvChip *chip, @@ -865,13 +860,12 @@ static void pnv_chip_power10_pic_print_info(PnvChip *chip, Monitor *mon) g_autoptr(HumanReadableText) info = NULL; pnv_xive2_pic_print_info(&chip10->xive, buf); - pnv_psi_pic_print_info(&chip10->psi, buf); + object_child_foreach_recursive(OBJECT(chip), + pnv_chip_power9_pic_print_info_child, buf); + info = human_readable_text_from_str(buf); monitor_puts(mon, info->human_readable_text); - - object_child_foreach_recursive(OBJECT(chip), - pnv_chip_power9_pic_print_info_child, mon); } /* Always give the first 1GB to chip 0 else we won't boot */ From patchwork Mon Jun 10 06:21:04 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: 802993 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1799915wro; Sun, 9 Jun 2024 23:24:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVmUwxOGaxxfzUZibWPGX+SnRBUzKXCM16BQi0M0YrSqfFEM3xND7//c/u/ALBcuUAvsPsHD8hVIDHyqVrogC4b X-Google-Smtp-Source: AGHT+IHlUFTzPRRQYCAzJFFumphSrqoR8hgZVZ30e2ipF0beByJ8pASN1Fq/Mr2IEsXe4KiE0FIb X-Received: by 2002:a0d:f104:0:b0:618:b08:2ab6 with SMTP id 00721157ae682-62cd56684a4mr68980657b3.47.1718000680467; Sun, 09 Jun 2024 23:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718000680; cv=none; d=google.com; s=arc-20160816; b=GkOO5slf7csQVCXs/WT2vGXCWvnfbiYrodNFb3mY1fwxdWtNjqCLhi2IlZMojDAACB 8CrgXRkfkSGXtbki24e7Rsk4hjAfRSGpb6WAn2wv+ElPgqoAkoNNVBORPhrC27iPIO4D HWSvNoG9PrczO0PA2du9uDbgU2OcVaIqrMmDlUmtEXHGMaNFWRn7lTloOVVsF8xKTxF/ RORt/c3V3vGVryweG+ja/P7js9VuhOCB9TwfCRhvVahTUS/IliIUechawHEcidb2adJw PeNAqM+XpvMyNSsOfeTM+/XapVdJiqNrL68cy9++beTDkWrcMaXDFQgssq/lqjpyTVj0 E2/Q== 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=6FsCsc3YL666+vUJoyQnqHvmBLXa/5gUhEMcQhABiuI=; fh=hC5FiRCNiggiG2AJlogWERqCtylTs4whX75JZ3qP4Qc=; b=dTFQTPYMBtjhyGAEcWRBD5Ee2X5CBB562/uTJ5XrlPV96kV4NpfheuGazg5YoYn34x YZwFa21pVahI6nTHy67nLVEQt042hqUfT4KjvTXVrG6yu+ImxEGKvIi4JNbYx9l2u/dP yyW2h51pU72NO32SBuZcm6IohetDCNzUPVvegabU794qoBUMJ66B/h+oVPMlqlLorJKR mmBmYejccjTrN83ulTD0jMrl2uMH/dy4Fn9UnkWiectMnUOoXC4lyw408cfTr/U3DUJ3 i9aI7qkvT7HaFvmARuK/v6LPgYVq467qPuXtmGNRZopogSeNwxj+1UbNgEahJtSJwqVB 6PTQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fzVxKqRT; 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-6b081741d11si9744336d6.554.2024.06.09.23.24.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jun 2024 23:24:40 -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=fzVxKqRT; 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 1sGYRT-0002mQ-6a; Mon, 10 Jun 2024 02:23:43 -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 1sGYRR-0002ZV-94 for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:41 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGYRP-0004lV-CQ for qemu-devel@nongnu.org; Mon, 10 Jun 2024 02:23:41 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-52c85a7f834so1086768e87.0 for ; Sun, 09 Jun 2024 23:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718000615; x=1718605415; 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=6FsCsc3YL666+vUJoyQnqHvmBLXa/5gUhEMcQhABiuI=; b=fzVxKqRTiFb6tDTVLQ+IQgQBWumDvcG70FS3OOR003eBO4sKvbq4rundXroQzSC4JE /8Moh4JuFVm1t/Q6PPEV5Rsq88ThSvs4DvJ4a7JuES1YQXt7vm4QPOZfnI0FXJXpmmGw +j/Pho2ZSz2/tMzChaBR7JJvOvJnXhqoPfL6aOcj3CWnsuvyCygWWnhXDqownUV+NMdz Sc5wTZSp+WltEyG+2UBI+X0BZyMzwQdYWTg75yg2jiaQJ9wNgOL7UAFdgaTG/2wnIuea qZvgAUxVIwDwW+OMpuY2FRyOxNwk3doYMfZHwSkcxe9gIVsJ1lqQ3JewFjDbO5M3iRoV jABw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718000615; x=1718605415; 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=6FsCsc3YL666+vUJoyQnqHvmBLXa/5gUhEMcQhABiuI=; b=YlXoULzMJ/L2M60/MmTcpQoqFI20oPV828rCatkWsGTxkNAN2J80EYRVajzF6gGnHR 8QpPcDd2RI/w/IgYxH6bl212qc7m8VXZSMsPUAorf/USruGgh8QZHK2DozvdjaX9Tmb6 SFQ5kTIIiQnNpWh8gA5pG0YsCD/nUWCu9Ayl/lR4oexZUPQgj3VSU8hfjvcRuGtH7jh+ VaGfxQf2PXc7cq/9qYMgkBzjekXc5d0wPbPMp8i4/C1HlpZRReOCUZWkcBzkTZwuCIn9 4nrdqdiJJXo9jSg67SYWjshncN84snFHmsbxORZC8Czx/UqQBecQs09GFxOa37B3B37e dr8g== X-Gm-Message-State: AOJu0YyaODs4kUXTgnTc9+mlJ3bdqR8cPfuj0oCTkIlPqdBGN7B6aHAG 19ry97nQQPztRZ6+IpXVM2m+Hmwj9t9t9rZjKcBQTclyec79QRF/rzcmzyc8zS7dTk02PQFMaLc M X-Received: by 2002:a05:6512:3c9e:b0:52c:8c91:da8d with SMTP id 2adb3069b0e04-52c8c91dc01mr664820e87.66.1718000615237; Sun, 09 Jun 2024 23:23:35 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215c2cd247sm133446155e9.40.2024.06.09.23.23.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Jun 2024 23:23:34 -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 26/26] hw/ppc: Avoid using Monitor in pic_print_info() Date: Mon, 10 Jun 2024 08:21:04 +0200 Message-ID: <20240610062105.49848-27-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::12e; envelope-from=philmd@linaro.org; helo=mail-lf1-x12e.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é --- include/hw/ppc/pnv_chip.h | 2 +- hw/ppc/pnv.c | 29 +++++++---------------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/include/hw/ppc/pnv_chip.h b/include/hw/ppc/pnv_chip.h index a5e428be7c..a4ed17ac59 100644 --- a/include/hw/ppc/pnv_chip.h +++ b/include/hw/ppc/pnv_chip.h @@ -154,7 +154,7 @@ struct PnvChipClass { void (*intc_print_info)(PnvChip *chip, PowerPCCPU *cpu, GString *buf); ISABus *(*isa_create)(PnvChip *chip, Error **errp); void (*dt_populate)(PnvChip *chip, void *fdt); - void (*pic_print_info)(PnvChip *chip, Monitor *mon); + void (*pic_print_info)(PnvChip *chip, GString *buf); uint64_t (*xscom_core_base)(PnvChip *chip, uint32_t core_id); uint32_t (*xscom_pcba)(PnvChip *chip, uint64_t addr); }; diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 9039c1777a..df74f032d7 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -765,14 +765,11 @@ static ISABus *pnv_isa_create(PnvChip *chip, Error **errp) return PNV_CHIP_GET_CLASS(chip)->isa_create(chip, errp); } -static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon) +static void pnv_chip_power8_pic_print_info(PnvChip *chip, GString *buf) { Pnv8Chip *chip8 = PNV8_CHIP(chip); int i; - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; - ics_pic_print_info(&chip8->psi.ics, buf); for (i = 0; i < chip8->num_phbs; i++) { @@ -782,9 +779,6 @@ static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon) pnv_phb3_msi_pic_print_info(&phb3->msis, buf); ics_pic_print_info(&phb3->lsis, buf); } - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } static int pnv_chip_power9_pic_print_info_child(Object *child, void *opaque) @@ -801,19 +795,14 @@ static int pnv_chip_power9_pic_print_info_child(Object *child, void *opaque) return 0; } -static void pnv_chip_power9_pic_print_info(PnvChip *chip, Monitor *mon) +static void pnv_chip_power9_pic_print_info(PnvChip *chip, GString *buf) { Pnv9Chip *chip9 = PNV9_CHIP(chip); - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; pnv_xive_pic_print_info(&chip9->xive, buf); pnv_psi_pic_print_info(&chip9->psi, buf); object_child_foreach_recursive(OBJECT(chip), pnv_chip_power9_pic_print_info_child, buf); - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } static uint64_t pnv_chip_power8_xscom_core_base(PnvChip *chip, @@ -853,19 +842,14 @@ static void pnv_ipmi_bt_init(ISABus *bus, IPMIBmc *bmc, uint32_t irq) isa_realize_and_unref(dev, bus, &error_fatal); } -static void pnv_chip_power10_pic_print_info(PnvChip *chip, Monitor *mon) +static void pnv_chip_power10_pic_print_info(PnvChip *chip, GString *buf) { Pnv10Chip *chip10 = PNV10_CHIP(chip); - g_autoptr(GString) buf = g_string_new(""); - g_autoptr(HumanReadableText) info = NULL; pnv_xive2_pic_print_info(&chip10->xive, buf); pnv_psi_pic_print_info(&chip10->psi, buf); object_child_foreach_recursive(OBJECT(chip), pnv_chip_power9_pic_print_info_child, buf); - - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); } /* Always give the first 1GB to chip 0 else we won't boot */ @@ -2363,12 +2347,13 @@ static void pnv_pic_print_info(InterruptStatsProvider *obj, PNV_CHIP_GET_CLASS(pnv->chips[0])->intc_print_info(pnv->chips[0], cpu, buf); } - info = human_readable_text_from_str(buf); - monitor_puts(mon, info->human_readable_text); for (i = 0; i < pnv->num_chips; i++) { - PNV_CHIP_GET_CLASS(pnv->chips[i])->pic_print_info(pnv->chips[i], mon); + PNV_CHIP_GET_CLASS(pnv->chips[i])->pic_print_info(pnv->chips[i], buf); } + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } static int pnv_match_nvt(XiveFabric *xfb, uint8_t format,