From patchwork Thu Mar 21 15:48:30 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: 781572 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp901059wrj; Thu, 21 Mar 2024 08:51:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU+Si0aZSPlG+3Eq5nuud/s6x9M41bOo7XGMTc5YVOQChX+iuy0Q82qsqaS1QhyX2gsxtgOTj+mujLvgZlBT4SV X-Google-Smtp-Source: AGHT+IHdU0EdIOBpjtrBrO0sPdLiyPnyTiIUKL6Z2j25D/x4Exw+GXrXivWfRXGVGa2z2RliWfiB X-Received: by 2002:a05:6000:1946:b0:33e:7c3f:ee0f with SMTP id e6-20020a056000194600b0033e7c3fee0fmr2072105wry.28.1711036302620; Thu, 21 Mar 2024 08:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711036302; cv=none; d=google.com; s=arc-20160816; b=wj2DVeIjAtDgNreUZszZlRzazVTXjB1mkOh0Vowa8Sqy10p9onD4rGKMO1JK2OUk0d ES6mJGybmomDAJ/pIWIinkS+Nn6NB1KAoSVFgPDhyN7eLPu59dyCSc04JQ6yfphaXmFc o0bppGU6Z67faDTuSNKRwwJOfCGeJqAC7ZALN+qplaYt8lGSxxEyucXV3jb2ySRUZKcd qMeU4AKrY5+DiOgXsacGAPX5LWwFaPUnlZJT5b0q+96A3GcsURMfP1C3SAuu50vWwJI/ t2Cwz6fWKv56OU/+4TvicWXz4vUZoMnTM9iFWLv2HOGTrf65tfJHPrWmO7Dxb6Y8y3a+ UFiw== 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=2zDd1vJ1m0kg+6reKiJJAv3Gd7RU3RjeGbW9KAoTqqc=; fh=T6rKnw5qbXdIf08MbaczezOCfCSVJgQaY05KIUhs/sE=; b=usYqAjZ5pTOzPHw8BV8Ba9cOgE9jtwJ9EQxTF3dR/wNSdHRAJtvhH6XJsFtoucnjYE YXNgK/GMIirbLfom65CqGrlI9uSpJ19drbXnOfRNWaqSEulBasSgg46ChcLQbQgWSGJO EXnPOYhLFP1hR3UHZ+NQWJWqFOPWar+Q3PloPL9kjGs/JAE/1Ovsa4JFg313KzHZegRh 2yHkBaYQZs/NbgK2uSTbz9OJ5Dq+yHBa6SSupuSFuH4NCb1YbYHYOwvqrLZX1lsaKiY9 Z3jsYBoyySgg9Xs/KiLkyti0iHMXgnJEC1O66gfjeGO96ecUbRcpW/eL+kr//NkWJ092 rlyQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u2rQNocd; 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 m16-20020a5d6a10000000b0033ec3f42bcasi8638366wru.823.2024.03.21.08.51.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Mar 2024 08:51:42 -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=u2rQNocd; 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 1rnKgg-0008Eb-00; Thu, 21 Mar 2024 11:50:38 -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 1rnKgc-0007sa-NG for qemu-devel@nongnu.org; Thu, 21 Mar 2024 11:50:35 -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 1rnKgY-000201-RX for qemu-devel@nongnu.org; Thu, 21 Mar 2024 11:50:34 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-568a53d2ce0so1551729a12.0 for ; Thu, 21 Mar 2024 08:50:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711036229; x=1711641029; 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=2zDd1vJ1m0kg+6reKiJJAv3Gd7RU3RjeGbW9KAoTqqc=; b=u2rQNocduOI+t1ABSpdjW3mvJpfffGYmGgPrJVlFVeDA3vtsDLVcP5Cxx93Tr7L9qz hTNbCMpaZ8cvsb/UbkofxlsdwT3hdM+rwC4+61rTStbUCPyniEOZIPeqTStEzlN6OM5T vTrY7zF8tGoLmWPFpo67vXHHMTQOCBgE7bfWVwyeJ05NDA4370uH+HAdvNwi0FqlVP3/ okWJcwPgn5lEC3tu/ADITvHQtCkkL7sx58fnHs5rVQth2bBcDzFur8DtMqyMvUljBu8+ aZbFK/ew7Z8NBibcoevMEh5Cm4gDB4qwCNH1Ty6GXCe3FDrVHaNEpoLhs52dFqFttGyd bZSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711036229; x=1711641029; 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=2zDd1vJ1m0kg+6reKiJJAv3Gd7RU3RjeGbW9KAoTqqc=; b=Ku5ToJc+3RH/nEmi4KPjO1DX4PjhO6joE6GvCrCFq9jeTjaKq5ZhhRxMk4wVbXNqgF TG5dfBO7M3MVMog6hbKMMalqpN87AfMld7yQxk9JrkANfq3rjtFEKyIdt0AfQBxzkqb4 ivxOfnZn3AloBsRxBF96C3o5kOnpyPtrnpQFhzASXRL4BTqA50m3STQX1mAlrIvG3cgW yexsqRxv+AVJW6k+UMByxRvZG+LVYDGSS0qF6Px2H/beQ4tOz9SAhu5619uGGIkwBE5t BCDsELUuACPQX5WprHsghYIGnrzxsdXDsA3wVGqNbelOmTVgzSiopFGP6atKWL7IfS9Q yjUw== X-Gm-Message-State: AOJu0YwefEHyTM4H5oQO4DI0PgTkoizOBsKTnM34o0GYM301Ldwq7QIU vS1QjvkqbhL/DtTztTSkycLkxHrxLMuDWAQPeUxWbKOXYi7KsRXVF4dKppPigTG4jgQYw/6MQ01 6/RA= X-Received: by 2002:a17:906:a44c:b0:a47:e19:81c7 with SMTP id cb12-20020a170906a44c00b00a470e1981c7mr1678931ejb.21.1711036228996; Thu, 21 Mar 2024 08:50:28 -0700 (PDT) Received: from m1x-phil.lan ([176.187.206.222]) by smtp.gmail.com with ESMTPSA id o26-20020a17090637da00b00a46e68a1fa0sm54362ejc.53.2024.03.21.08.50.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 21 Mar 2024 08:50:28 -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 14/21] target/sh4: Extract sh4_dump_mmu() from hmp_info_tlb() Date: Thu, 21 Mar 2024 16:48:30 +0100 Message-ID: <20240321154838.95771-15-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::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 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 Extract sh4_dump_mmu() from hmp_info_tlb(), replacing monitor_printf(FIXED_STRING_WITHOUT_FORMAT) by monitor_puts(). Signed-off-by: Philippe Mathieu-Daudé --- target/sh4/cpu.h | 2 ++ target/sh4/monitor.c | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 9211da6bde..4e2e9ffd66 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -385,4 +385,6 @@ static inline void cpu_get_tb_cpu_state(CPUSH4State *env, vaddr *pc, #endif } +void sh4_dump_mmu(Monitor *mon, CPUSH4State *env); + #endif /* SH4_CPU_H */ diff --git a/target/sh4/monitor.c b/target/sh4/monitor.c index 2da6a5426e..1befb42b07 100644 --- a/target/sh4/monitor.c +++ b/target/sh4/monitor.c @@ -39,20 +39,28 @@ static void print_tlb(Monitor *mon, int idx, tlb_t *tlb) tlb->d, tlb->wt); } +void sh4_dump_mmu(Monitor *mon, CPUSH4State *env) +{ + int i; + + monitor_puts(mon, "ITLB:\n"); + for (i = 0 ; i < ITLB_SIZE ; i++) { + print_tlb (mon, i, &env->itlb[i]); + } + monitor_puts(mon, "UTLB:\n"); + for (i = 0 ; i < UTLB_SIZE ; i++) { + print_tlb (mon, i, &env->utlb[i]); + } +} + void hmp_info_tlb(Monitor *mon, const QDict *qdict) { CPUArchState *env = mon_get_cpu_env(mon); - int i; if (!env) { monitor_printf(mon, "No CPU available\n"); return; } - monitor_printf (mon, "ITLB:\n"); - for (i = 0 ; i < ITLB_SIZE ; i++) - print_tlb (mon, i, &env->itlb[i]); - monitor_printf (mon, "UTLB:\n"); - for (i = 0 ; i < UTLB_SIZE ; i++) - print_tlb (mon, i, &env->utlb[i]); + sh4_dump_mmu(mon, env); }