From patchwork Tue Jun 18 16:00: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: 805278 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp276392wrx; Tue, 18 Jun 2024 09:12:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVoDJPFt1y3gPRG7z/JPiJEAQN5yZkSOFgTt5PBFK5Rup0iaebcAd0jnSOYar3wemEJ7Mg5J8aUP4o48whzYLWJ X-Google-Smtp-Source: AGHT+IHvY1+4CIDuIkux3BGAZ9ICLU+jBqHAgRupSFcX34LeZ7QLFpYBexWtEve05FtJB29Imwy4 X-Received: by 2002:a05:6122:987:b0:4ec:f52b:e4db with SMTP id 71dfb90a1353d-4ef27833e36mr360245e0c.16.1718727127428; Tue, 18 Jun 2024 09:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718727127; cv=none; d=google.com; s=arc-20160816; b=jh1BJKhutc84qK1AesDnMos4kfix0N30tOE96p2C/bk56CySRqiYYRFKFUNcXO77Ye V3wZMVJYufg99d7ak5zGt+ZtSkEV+ojid2MrfmCfHv1CCfWhxx7qn9lCXsPjpv9+mUKl W/izo0Hu4IZYSgMp6kHW8yRxB4Rm8F/RG/sUwKRVYoMKY/1B6alfT1rML1lRUMlrJkb8 zhrjOp6DVg7wFi/bxZVLOZgKfivn5Uc6CnjOO7/3hoJ+iVuc0V9X7aRywYLSFDUXptSJ oG4fY/Mm3owCKvypeuKSksleZ1Su+IjH8F6/1Vl/4p1bkylZ2zWYYqxIL9fyENzpcIed +ptQ== 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=r0OrXW9b+XN8YsCIUyH/dpkBirMjCPjOco0x9NNBa2Y=; fh=Q+oQ03yQfuoTTxzUPDLJKoTd4xZYvGHM4rKHQJt4bQ4=; b=eDKYDq3syd2OhRvMQXga1QOkUPX4Q1iMRAoGbmfZ0iBNHHHZDqfJNXpLC3zp/x39k8 hArRljraap/3hvetxEVSMwsPS/4Lv2w4R+jzK3GZ+v4swAHPkuihAK4GCTbfhZ93PbGf o/8FbCgFyTjTKVLi6Eb9qb37ON489L1Nc7g+II3qKWZAE2Q7kO5+WnLlMMqmZBUElJWq AmYSNpx9vKlyTkkleMuugMVlooSFNSTkc8GCitRGbDKvP8OCZX/vy/u2d00rgTZtuX3g rXKXSW0Ony5HUCs9p1eKS3sf0YgU0dfY6sfviajlSZ4IXZvkdXUgL48VPK3bAV9/VD+1 hpSA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KCkXwesS; 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 71dfb90a1353d-4ed40f4a54dsi1904818e0c.164.2024.06.18.09.12.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2024 09:12:07 -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=KCkXwesS; 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 1sJbJt-0004FE-SM; Tue, 18 Jun 2024 12:04: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 1sJbJs-00046D-9y for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:04:28 -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 1sJbJq-0007FS-DN for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:04:28 -0400 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-52c9034860dso7113258e87.2 for ; Tue, 18 Jun 2024 09:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718726664; x=1719331464; 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=r0OrXW9b+XN8YsCIUyH/dpkBirMjCPjOco0x9NNBa2Y=; b=KCkXwesSj0HXqEOtm9OX84nlpySUPOvvRpX8SjCP4s9pSZ5yaFnpFymTW+HtzUNKkh 1dHznbgvHIr6splMxTy6E0znGergPFiHfq1UkNa6+fEJbklt+mU1G1GlkPICUyWRsbxZ y+tCL4xLmIf4nGLYLFlpjR4UAHPnjC4dzAx1lW8NtTl6uIfjvsaub4kCQ6s4N72A9Edl lsGKCi7zMBPnyAwzsX9cDxyavGlf6n3+ifjySKsk6Sp858l5PtFGGMEGdtL0RtI1IMr5 kqQGkeNlpsEf07XOu1R65T+Y31vW74JhJvkNfzOqJa+zjT2Aq/4n4O1mNPo5iNYeWrkK ON3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718726664; x=1719331464; 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=r0OrXW9b+XN8YsCIUyH/dpkBirMjCPjOco0x9NNBa2Y=; b=N5Pv6ClMTMhbPU5fFBDVhYg+vBCYjVDFaww6YIEnxSw8RwIr8PQIo1OQYvZbd1zeqG MT4TZBiaExQ/aeyzRHF8wk5+vaq2rN+XKa6v5PwEO97CEWWlYgcg18fuL/j4EL1ibUyO BdpR/4twRUfOk95wdNIUn92DudpdiV8b5P0aM4ZTN6DKp/Pbj6UHZveGtZFFrq0hO1i5 +LR7JHCQ2DFsK2GP7MMIte+hOQbt5deAj3REoDSjK3CodSSABEjllfVA1dDzwrEmaPmS WkhhwgESXPr/GwT2bDVWOp59HESwGhlKvNcIfmlokuX2LKlCTdBRkGFlrfM3Zw5mo1Bi fzcg== X-Gm-Message-State: AOJu0YwiwadCrB25K5J9UOsewYXG/fdTxH6CP1MN2ipfX13E0hc2sf18 FGZZyrB862Va3YNKJUX4a0o6c/WcnVX+IwhPIGG/f8sxnxaD6W25inxNlQuiIsdiIoWXjNY0dS4 i X-Received: by 2002:ac2:5b04:0:b0:52c:9523:f0db with SMTP id 2adb3069b0e04-52ccaa523e4mr44812e87.45.1718726664248; Tue, 18 Jun 2024 09:04:24 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.55]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56da32c3sm638640566b.13.2024.06.18.09.04.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Jun 2024 09:04:23 -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 38/76] hw/ppc: Avoid using Monitor in xive_nvt_pic_print_info() Date: Tue, 18 Jun 2024 18:00:00 +0200 Message-ID: <20240618160039.36108-39-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::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=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-15-philmd@linaro.org> --- 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)