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); }