From patchwork Tue Jun 18 15:59: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: 805281 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp276539wrx; Tue, 18 Jun 2024 09:12:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXTXoCDA2jSFVk3TLIqhjQOqCEn3GcdQaFnnHxTBq4+M3vXf0tKmOzwu2js5vZg3cUQB6Y4UZC/+JxdlLe4mga4 X-Google-Smtp-Source: AGHT+IFhO/iCskbqvykpNbdhnd4g7EaVQz8gkxCKpTV9bke/xeRIPmEssaZZW+nJCwnf7ofPosO/ X-Received: by 2002:a05:620a:2448:b0:795:5b23:abcf with SMTP id af79cd13be357-79bb3e56b04mr16687085a.43.1718727142474; Tue, 18 Jun 2024 09:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718727142; cv=none; d=google.com; s=arc-20160816; b=ia1CuaJDUrY8w0bozvAmE2W5HoTLv7V0eP57gnAXTbq8rq1oinp6cT97VI/fj5kztm rwb/uZXKEmtvpQAirmV6H4TzGKjlv/2927L4HL7q+AXBjK/IRxoR5wm9r/H4a9b+UiRr zuYxroVVchr8KpZvQ5CttKI3ADjCQNAPX8rMo40dQxZRwMvrcpoPqjwAotkS21xGTL5T z5cfNyFGzQKk98dzeUw/28miicAGQ1txjJ/OnMZdCgmHxeP6qg5tm58UdFYFfzL8qTxT NU859siBl8Vkw7sx41XM3AB5ZhULVddLE91DVEt9Iwb7ViT+0h3m2FmV6UyHXOWteYo4 IcZQ== 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=VFMERdu5BxdLlmHi+3GbOTwf7lyqGeSd5tYPeFoN3L0=; fh=Q+oQ03yQfuoTTxzUPDLJKoTd4xZYvGHM4rKHQJt4bQ4=; b=Wc2kEEkYMIXurnthWgE5jcwDWb50WmlfmRoqwGUnlEGzBkrZAfw6midpJrORcZLd10 fv4iQRnoiPhszIuMR9qzVUTmYxRPZ6DIWkeMfjUYTDF28Yrc81sFLLWw74l/ujbNAasK i8vBHgi096qeKRtDfAkFQZYklQIKa4NDE0lp8Ipq42U05qPk1GaQnKz8zy6NSIrVXSw4 SsmgiYEUgbm2rtSmK7TpKfLjyds2EPX66RTbNH+Wfk39iXpgMfibAZseB/wuXRK0PNR2 ugUXOb3Lrvj0rXmxMGPhy83dMYttasKiJ+CzpXWf3PedUMNvFIfocC8pmh361SO3GMcM 9Jxw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gVGPKBiD; 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-798abd1cce7si1249646285a.448.2024.06.18.09.12.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2024 09:12:22 -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=gVGPKBiD; 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 1sJbJp-0003vD-T3; Tue, 18 Jun 2024 12:04:25 -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 1sJbJn-0003rJ-Ab for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:04:23 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJbJk-0007Ez-DW for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:04:23 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-57c778b5742so6562143a12.2 for ; Tue, 18 Jun 2024 09:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718726658; x=1719331458; 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=VFMERdu5BxdLlmHi+3GbOTwf7lyqGeSd5tYPeFoN3L0=; b=gVGPKBiDqFia8h3/YmO9Qb8WmIf5+YoAIMT/ZTIWNWiSSzfdhhgGMaszTJgbL1ocmD uyUWSEfcvKPrNSLJ6iFOGPy1PcwBKupapzHrB6lQJpdppj+Pf8AUNOrinwJWbYDDNi3S +ILMA3AU22ncZFk+8cWMMwbtnDcl0ssLAMWB0xS41J/l8q859KMAffCaEEsVoLy4SVjB 6GuSdcqWevtN9+BPwi8OQmLMNLlahMRxtvgjJ2Sc3CmNbwgDns12ItBlovrOmx133S1J eDWhXJ6RRcV8oLckRYlA0FReXht3dr2SlzpuYgTA9IX52+46AV1i174hpBn/ZcOmkPta EzWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718726658; x=1719331458; 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=VFMERdu5BxdLlmHi+3GbOTwf7lyqGeSd5tYPeFoN3L0=; b=hu2N9u2aEaQwF50Qvi5gt5EdMdJTGqQ2MyTkX1vgHtWR8E/O7hp0JMg+1btMaRhsy4 6zmDWodyvpz1Lp9JIZmsvQ0qRQNngrsZnmRb+Z7Uj604VGjPqZw/yPSLpnPn2s8MxdX0 JwUWJkFtj+3wIFXjFRF/cc6dAcvbTLjXHwLFVgLndnussdufkHVVC3/Llyo+JNx6kAwD AwINEbRFwzZb/klBSY5TEs5beghhIicyvcQqdZvvtUqzifIjZVmwja6zu+9IIIpfUA0C GPuLT7agC4MVjXFBFtwtkPW0qzDXy3UOoTAK8ch9X4rPD4f3kmcX7gdInnKUiZzNo1PH m12g== X-Gm-Message-State: AOJu0YwcNZ99NkrUTSOOdKmcLH1A7jTQ4q/D0/rWVViErq8s14E7b9SF c5F3hSe1/HXSgkKLH5MVt8vTx6jhv8OV+oH6mJm9XazfSUnaFvQ1Jmt3MnlsH9Wsl9lNHtvYlJE Z X-Received: by 2002:a17:906:9c89:b0:a6f:9f4a:fb11 with SMTP id a640c23a62f3a-a6f9f4afccfmr77583866b.28.1718726658513; Tue, 18 Jun 2024 09:04:18 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.55]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56f43220sm625702166b.185.2024.06.18.09.04.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Jun 2024 09:04:18 -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 37/76] hw/ppc: Avoid using Monitor in xive_end_eas_pic_print_info() Date: Tue, 18 Jun 2024 17:59:59 +0200 Message-ID: <20240618160039.36108-38-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::529; envelope-from=philmd@linaro.org; helo=mail-ed1-x529.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-14-philmd@linaro.org> --- 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)); } /*