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)