From patchwork Tue Jun 18 16:00:07 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: 805266 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp276040wrx; Tue, 18 Jun 2024 09:11:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU+E9WW74P0IjI+oWP+7nFRNRhdtXFvv2a+sqjkam08+OqFbT0cHx1xWCc237JFNF9J0ET1cXnaceM8DolKJBRm X-Google-Smtp-Source: AGHT+IHO30n7gEEd7BckOCLHAqw8EkFKTJATIYN/S5ptQbIEpoYpJb+HYAvwl4Akf92bn1DYhNG2 X-Received: by 2002:a05:6808:10d5:b0:3d2:2e87:c108 with SMTP id 5614622812f47-3d51ba766e8mr221765b6e.35.1718727089807; Tue, 18 Jun 2024 09:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718727089; cv=none; d=google.com; s=arc-20160816; b=hFdopuOclp/WXPM4Zpopug+baiVkhq0zQ/yznYhIqvMOqF+AIV0e7KXAwuejb18AAn AI2MW3wDyZD3OWc6jAD1KlBEDb0BOch9WPeKJ70QzmM/mNre7N5q+YiHXuOa/OUq8qpI AB2zHheP+0Pbx+f6uyrO7gVATclfvX0shj0klTaIKgvp6XGthDw8X+DDv1IDkKp51CCy oOiW4fsUeQH5XTy98en7kjzdq+dAnT6otcFYQgQme3/S0R0WGJ1dG2zv9BtpKHYQynJs kaKCdBEphunAwCFULIZtoR9jImzhZuzGBd0OvTF6T/wfYoN4zJ/2RjwNLakuxQeQHchA 6A3Q== 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=MLTZXMk8f7jCos7Oua6eYCL2IKl5sjVIn9SYnGqK2mg=; fh=Q+oQ03yQfuoTTxzUPDLJKoTd4xZYvGHM4rKHQJt4bQ4=; b=BtePgyZundd9np+BxOJ06fKPOSYu6o0EK1lYvVNboqxwjXwGCSXH+f6yFM3hSF1T9v DgCglHA5REjbfj3980fF+bElj4zeTDtzz1VeF/3ZEkJhpVvfpw2lEl9Pp5IjsDasNZIV ScQIVyBUgViixiFcV2RC25P2HFz7mr9zW8cWDpiLbMfOObefLuAe+gk7wy+pQ8bExUlJ oMA0cXUXOJ3j6X/vkEMFnwhWCn2HfAOKH8hknwHRyB5BFjPj33mBI01fr3IiakJoYjc8 aqCGHUz4/xbfTVV/NkgKEUTrf04C7Rf391mcse4NV57LmDL+RwKyznDhxHDtyEjEAWHQ d56A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ed9tuF9a; 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 a1e0cc1a2514c-80d7871d4cbsi1846593241.90.2024.06.18.09.11.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2024 09:11: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=Ed9tuF9a; 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 1sJbKa-0005Si-UI; Tue, 18 Jun 2024 12:05: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 1sJbKW-0005L2-3a for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:05:08 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJbKU-0007Xd-66 for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:05:07 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a6f8ebbd268so291492366b.0 for ; Tue, 18 Jun 2024 09:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718726704; x=1719331504; 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=MLTZXMk8f7jCos7Oua6eYCL2IKl5sjVIn9SYnGqK2mg=; b=Ed9tuF9arUeqezvHHqsmvy7lUbmTRf8TJ0RwFF6+cVyeXXthAhw9q6vDI0YeQzZnr6 kvWHkV+udskLzAF3qkZ6yuYATtYrZH6O5onmQhZufpex1oFNZplo3c5Rur7Uw3HNZrKE h442zKzOErPSWq6NR/uy/NxWTo6TZR/EU1L9lj4JDtNPo6b2HPb6D1AHSITXI4QpD3Ky nN0dVljXFjztUJPlz9ojOWhigQUgCRxNbTJ7ss+21TZzoi9npTDEr3vxFGi6TNmuFCj5 Rsmi/yysWKMnPYynfgsSd+HQR3ARdyZ/dzTym9aJVywtPpbWcbxlvyI1qssLklqmVSGS nAIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718726704; x=1719331504; 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=MLTZXMk8f7jCos7Oua6eYCL2IKl5sjVIn9SYnGqK2mg=; b=b7oOvn3uDZFFoDEi9wpghCOiAwhv2M5XV2HVvc41lpMk6rw/P+n1vRjcYkwzdD5JI6 4MnGLszgyJMt7j+fUKc7ymbD3qkEvndYcMjFd/WMmwG+akCgYCqBinwh6YzOdawrHHu+ InQAixTwyejCz8XendsU34dIOfMnZiLRYg88wMZgo/Gl0/c9SKF9NVK2BULYivcWyfzm Yr8G0pPXSwrQ+sYdN5eZjdaDN67os5Yd3MHnxwBtl0T77uHJYPRAA2kBOxJfjga1zIN7 hT8QhrMKNznRLZxZHhp1lYkBPx0xdc3AazQR7ca6IqXFZXzD0GPT01q5xhuRAz2/4ju6 WkpQ== X-Gm-Message-State: AOJu0YzIxZ50825UkpOE79XVM4Q/BvurVQO59pTVVj+Kp9M3vu8ko0BK NmYCVTjaxIOaRBKwW4AIsai24HHlzCCQ8OopvTKJaa0j+gsjxlz+ugvVwMqe01G5+JTiQtfM/y6 H X-Received: by 2002:a17:906:99cf:b0:a6f:4ebd:1463 with SMTP id a640c23a62f3a-a6fa430f30amr17930166b.20.1718726703947; Tue, 18 Jun 2024 09:05:03 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.55]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56f41684sm628373866b.153.2024.06.18.09.05.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Jun 2024 09:05:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Manos Pitsidianakis , =?utf-8?q?C=C3=A9dric?= =?utf-8?q?_Le_Goater?= , Harsh Prateek Bora Subject: [PULL 45/76] hw/ppc: Avoid using Monitor in xive2_nvp_pic_print_info() Date: Tue, 18 Jun 2024 18:00:07 +0200 Message-ID: <20240618160039.36108-46-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240618160039.36108-1-philmd@linaro.org> References: <20240618160039.36108-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Replace Monitor API by HumanReadableText one. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Manos Pitsidianakis Reviewed-by: Cédric Le Goater Reviewed-by: Harsh Prateek Bora Message-Id: <20240610062105.49848-22-philmd@linaro.org> --- 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); }