From patchwork Thu Mar 21 15:48:35 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: 1914511 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=x2r+5suX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V0qjG5GqBz23r9 for ; Fri, 22 Mar 2024 02:52:34 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rnKhy-000341-TC; Thu, 21 Mar 2024 11:51:58 -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 1rnKhM-0001XJ-OP for qemu-ppc@nongnu.org; Thu, 21 Mar 2024 11:51:24 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rnKhE-0002D5-Fx for qemu-ppc@nongnu.org; Thu, 21 Mar 2024 11:51:16 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-56845954ffeso1463725a12.2 for ; Thu, 21 Mar 2024 08:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711036264; x=1711641064; 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=Ie3mfp1m/rRKvj+8OELX2ynuCGg82V7qLs9kfFYvM/A=; b=x2r+5suXYj2OJFynwLooTTT/G1/nFqtcu6I19wZwOk6fJjz9M8vEXYlv+fbrMK4jG6 QjudyUBsGu+u8Ycfu4qiAPOB5yL4ndbkg/zj8S3YZ9pVW/WeEFcIJxV2fbqqyCdbo1QO ojOKKvSX/a24RoTMiGY43EDNSynqPsdoJhRB5kuHsXLBb3r04q+HFmuB+P8JuAd/dgqe w5d00MmZW/kA0T2gmuAWU7XOTKXHux2GDkm1JjGyShFTAwv/W42+5S+o6cpUT9AtTg/P rtgdfQyIcnBUKXXFbLBCzB01pNbrx/bJmblJgCPYxTKJ1q7/5eOO3c7EcijqRKJa9Wo7 XztA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711036264; x=1711641064; 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=Ie3mfp1m/rRKvj+8OELX2ynuCGg82V7qLs9kfFYvM/A=; b=Qj45NLIFbdk6sTCjjO/Fvc8a9qnMVH3IVI8k9h3Zm8IyvPipuaDNHjb6lxCr9ZChoT lHzGDRinmcUJSkxNoL8j4Jza3ZbTOpqog1uGZrJG9IuB7JbIGm7SMNWIe/fnyKGJ8O9o aA50OXtjr87GZu6Z3ioxKxW4jkHlDz20zqPbMbglszCEJNEItGEXdd5s+AKL5YFAuQBv Sh97ke9Wop68W5BVFUdbLG03HnA1LdgWQ1/Tk5+qKfgWieEOiMS3j07DoFwwbdewHFBf U8oYEc3taCfZjrw4426/ehhDlIUwSA84Uuhv2TRmtw1SjIWzVZzwz6rNyXKocEaSrqeZ Hy9Q== X-Forwarded-Encrypted: i=1; AJvYcCWUsr+k/BD7OufrUlVeKdvvIks1DXCUovC+RAOJ+UWUtbo0W388f7Pa4voLnLI79vzRfs+RzWCGE0KUhmJZQjAR5Xpv X-Gm-Message-State: AOJu0YxQoHK9nQ3+cIIF7c3xhg7K/PEH+qdkKRHXo58tRiIn3xneujKN KefMR51NwgQ9OMLfJRkyYQYDQBpQnC50DbvaClB6RGiNhqiWqDDVo8LI8VjLe38= X-Google-Smtp-Source: AGHT+IHBIEjNNoQWciGMRReYDUJ+2KBY59lWDsKhCAXVV+pZNY4VmyPe+35g936JWxQSLM+SygqP2g== X-Received: by 2002:a17:906:119b:b0:a46:d776:645a with SMTP id n27-20020a170906119b00b00a46d776645amr6338524eja.52.1711036263951; Thu, 21 Mar 2024 08:51:03 -0700 (PDT) Received: from m1x-phil.lan ([176.187.206.222]) by smtp.gmail.com with ESMTPSA id c5-20020a170906694500b00a4131367204sm55036ejs.80.2024.03.21.08.51.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 21 Mar 2024 08:51:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Artyom Tarasenko , Chris Wulff , "Edgar E. Iglesias" , Marek Vasut , Max Filippov , "Dr . David Alan Gilbert" , Jiaxun Yang , Nicholas Piggin , Paolo Bonzini , Daniel Henrique Barboza , Yoshinori Sato , Markus Armbruster , Richard Henderson , qemu-ppc@nongnu.org, Laurent Vivier , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH-for-9.1 19/21] target/xtensa: Simplify dump_mpu() and dump_tlb() Date: Thu, 21 Mar 2024 16:48:35 +0100 Message-ID: <20240321154838.95771-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240321154838.95771-1-philmd@linaro.org> References: <20240321154838.95771-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-x532.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Remove few qemu_printf() calls in xtensa_dump_mmu() by slightly reworking dump_mpu() and dump_tlb(). Signed-off-by: Philippe Mathieu-Daudé --- target/xtensa/mmu_helper.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/target/xtensa/mmu_helper.c b/target/xtensa/mmu_helper.c index 8be8d79dcd..3b4f53feb0 100644 --- a/target/xtensa/mmu_helper.c +++ b/target/xtensa/mmu_helper.c @@ -203,6 +203,7 @@ static void dump_tlb(CPUXtensaState *env, bool dtlb) xtensa_option_enabled(env->config, XTENSA_OPTION_MMU) ? mmu_attr_to_access : region_attr_to_access; + qemu_printf("%s:\n", dtlb ? "DTLB" : "IBLB"); for (wi = 0; wi < conf->nways; ++wi) { uint32_t sz = ~xtensa_tlb_get_addr_mask(env, dtlb, wi) + 1; const char *sz_text; @@ -252,11 +253,12 @@ static void dump_tlb(CPUXtensaState *env, bool dtlb) } } -static void dump_mpu(CPUXtensaState *env, +static void dump_mpu(CPUXtensaState *env, const char *map_desc, const xtensa_mpu_entry *entry, unsigned n) { unsigned i; + qemu_printf("%s map:\n", map_desc); qemu_printf("\t%s Vaddr Attr Ring0 Ring1 System Type CPU cache\n" "\t%s ---------- ---------- ----- ----- ------------- ---------\n", env ? "En" : " ", @@ -316,15 +318,15 @@ void xtensa_dump_mmu(CPUXtensaState *env) XTENSA_OPTION_BIT(XTENSA_OPTION_REGION_TRANSLATION) | XTENSA_OPTION_BIT(XTENSA_OPTION_MMU))) { - qemu_printf("ITLB:\n"); dump_tlb(env, false); - qemu_printf("\nDTLB:\n"); + qemu_printf("\n"); dump_tlb(env, true); } else if (xtensa_option_enabled(env->config, XTENSA_OPTION_MPU)) { - qemu_printf("Foreground map:\n"); - dump_mpu(env, env->mpu_fg, env->config->n_mpu_fg_segments); - qemu_printf("\nBackground map:\n"); - dump_mpu(NULL, env->config->mpu_bg, env->config->n_mpu_bg_segments); + dump_mpu(env, "Foreground", + env->mpu_fg, env->config->n_mpu_fg_segments); + qemu_printf("\n"); + dump_mpu(NULL, "Background", + env->config->mpu_bg, env->config->n_mpu_bg_segments); } else { qemu_printf("No TLB for this CPU core\n"); }