From patchwork Sun Aug 6 11:59:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342778 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A190C04A94 for ; Sun, 6 Aug 2023 12:02:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQe-0001at-0T; Sun, 06 Aug 2023 08:00:12 -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 1qScQc-0001Zr-8i for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:10 -0400 Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQW-0005Ya-TY for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323202; x=1691928002; i=deller@gmx.de; bh=+zCUxCVvReasse/M3JApczVrlfmNzUS1j4j2/1ouZbE=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=AJakhrrQkNonZyMD10wjp7Di+JSZeEXZ9f5GqBZyICtBWFwlafsybVcztjEfqknPU1DGBm0 OGHiWkT/PEmbsh2C625oCd+2apQCQweo1g+Pg+M+PnxS8VYw3PczRzgMMyxGAU+n4zuTjziOh GuJ2tcEfteZZSKk0yk8Xz+HTD2mcAFPGZFqUhvApCkRoWSQchrMDk/5vh9qNEIp15GUaB9qou xt32Yyll23ZXND2F+u8Ub+qTt1YD6UNVH30MpBmmw5ReyC5S5/qhOrMw7d/47keb2TSGTBtMg L96EYS/E9jxs0x7EUrsg9Y0mDp1yakMpFwvgwbxhhuFeOkjc6vUA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mqs4f-1q6G7H1k8H-00mqra; Sun, 06 Aug 2023 14:00:02 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 01/23] cpu-defs.h; Add MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:39 +0200 Message-ID: <20230806120001.89130-2-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:upPPMKrLlXm8MOZLGoMw6ZtTOfx4anj3Q+Cpx5VJJk+1FJyx1Vh QShijZDsrV0HlmRItVBy/tX/02KK0qcaMwGWUqPC912TYSMASw6+/VehU1PD6e5+AvZU388 H17CSnfrkFfiP24HGJV4hl8/J6iV4ElEsg07Ki47Cyzt4rhVbzfNRFMRkgXQCzItZYMI1ZO un5Y3/IQddu/tfjiTsO5w== UI-OutboundReport: notjunk:1;M01:P0:5/qONVfyZMc=;y3QXNRpqUzuriCBHnVC11VSIysW yS4FpM6dsE19WaD0IDla6jB4gCpMwHqZCr3A5il/P10TPNN9ax8YTFk1jbUggdwu3T+dsEiwY Irlo9v+ALg5T+3C0AQJrjM6bG0ODia6BUOgeno2c4SUrkCaujcn2EnAyB0D4tP+8HSRvtZxhU u+2Y9OPV8suWTxnq+t/iWmOT3SDi1hulB84CJ68Xaa3Y3ORj3TbtsaCo31Qx6SYhLOtBgX1fV pEwtlTboGG3OslNX9Tdz8W3acXgsrBmMbCQjxXyFsn+iQEHftIeQDIBbzZfIO6NN6Ua5+przi 7QkpauJyQiaFqz/7tEYJFNeJOlRyps5yBnFAnQhTbYVRbxR/1UDC5uIsQq5aiMgucpSwgtP9a f9+cIS0DDVML0pFcZXcVly65BqV61QfYm0ADteQGCKHZKTbnno/RcC8rGsW8sSGb6hRH0poqZ MplIeymKaWc/vs0qnXsElNSsxHQchJUUojhtoLEFEV8pIfpAyKJUiOwaZCpD/aYZRU+RdxC0y VtsJM5p8m2SqA8sD4Uf+lI0waUBjaKP8MceX4a3MSNqI6iYKLeLkGrqjL7MWQHYoU4+lxvzOL 84Vv6dxebjzvKGnZMFsT/AN480QkdILuO1nQYV6+tT9AtWPEikMukvwhuvmHM5bVV3b0EtsFO T1JqQug8DJjv3K9BQ80LTbk1lJQwdDpV6hAIOv1DEfGv0yiEKFA+LvQ0jMInatNQENAe5zOs6 pFS64k8OlluR0xPIxFOTXcL0KoNJZTx3cA8VGrZkVbC3696kOADk1FOymk2XAE8yPTx6MG47i ge9PACg5AnBuTKXRjqCGiXzi29/lprDjPruozUMKuQNqiQ+9kT278R1wCpW750hBNX7dJ8kKg HyjUDCh/3q6Vq8Zkpfi2qw9O8w6OpeOaOVUjyP6NE+TeTMJUWgKYwZuy3KEck15TuOUPwbl9w rTIBtgb/bhVtJMacEzTQKL2lr0w= Received-SPF: pass client-ip=212.227.17.22; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Add a MMU_INDEX() helper to specify which MMU entry to use. Currently this is just an 1:1 mapper, but in a follow-up patch it will enable us to generate smaller (and maybe faster) tcg code. Signed-off-by: Helge Deller --- include/exec/cpu-defs.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.41.0 diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index fb4c8d480f..07bcdd38b2 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -60,6 +60,11 @@ */ #define NB_MMU_MODES 16 +/* + * MMU_INDEX() helper to specify MMU index. + */ +#define MMU_INDEX(n) (n) + #if defined(CONFIG_SOFTMMU) && defined(CONFIG_TCG) #include "exec/tlb-common.h" From patchwork Sun Aug 6 11:59:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342786 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58EDDC0015E for ; Sun, 6 Aug 2023 12:04:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQl-0001lb-7P; Sun, 06 Aug 2023 08:00:19 -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 1qScQc-0001Zs-8S for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:10 -0400 Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005YB-7q for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323202; x=1691928002; i=deller@gmx.de; bh=fHh6ths4U489TH2R2+SXZJdWcst+4HBAcj/Wpwd6H8w=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=jlqqE66eJB0v1kftr6g60jtCMh44Y+oDF9R3M4MXLfF7W8ceSUlXYLMo8sEgQ+imWUML/Lc f61gS/XegdHAhMrKIB+epPQqs7SPUCgl+Ur9y0W1vzn6d7ioPr82ShxTeyGIswclbO4uOK0aE dwiAgt9i0NekZPzMJsKA6V2R01jRpLn9NlT9LRkjhr4i816dE6OreS0H7gV3aJQlxqHFCVqeo WjYl+0as7c6vrOg0Fz/BmxmdQd3+hGiX3AQtyrwih//QYL8nmPuX0e4bF2EbRkHcYBn8WLpzx 1+28IEZO0KJaUFS0tLa+Dr/ekYMNmGtc8rysOiA5ntSenUy8j4YQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MQMyf-1qFEHL2MjZ-00MLne; Sun, 06 Aug 2023 14:00:02 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 02/23] target/i386: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:40 +0200 Message-ID: <20230806120001.89130-3-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:lVG28F6K7P7ov0tJxA/6yMHYRbg7V2qPD1Nzoaepi0JFecq8tFE dLZELm7wNJ8qvoZx31ceCbUCDvPQUX9mqmm5vAqlLl251PozzmawQRqpuIGcca+jzPIC6gR +jwXq+1WLs04wb61fvuYoR50yaEg6ughAklLPTI9js0q/WqEMdqRV/6nwBb2pHDjOAYtgO1 Yyawfyu8F3TqsNx8pdFQA== UI-OutboundReport: notjunk:1;M01:P0:OKgUmW+8Qfk=;zjBh0G0JgbqsWVOxjJ44E1hYdh/ OAuw//wNcM88FFInhdtY4wMaD4ZPY8DTFiD5XMoU/8xJUr2ZBah/8uVG1sgEhlMNPuF2kZZDB hKwbDZ8KXmvxSTvLQlQ3IaRhjYhaLJ0AteK/QEKcc5AcZ/helnwT2IbQjwWeoP7qA+EY58LJR Ibfg3j2BKl78Jrrm9WrxZm6YjpLwFufvTo05+Upyas+02WJEq6zxPnSHlEbNkS/q+AKU95lfL hcgA00Mz04668XUXJuynJwuPu5mytE87ylaz+PRxkE+1mhUwbdhb2ynft4Ss8CbwtBAuEOBTX bJFgNT+EX4TMk7rJn2z2fsuW80i/GoHXi+z5JXJPbI7kxpZPQGUtnkczFfzcsJp/F+ja6ht9i 1Phqfwm6KfP/dUJXwftzoqCfPK4VGAukqJAQaLpe0PeiQf9FGy1pZM3RwXBnN1O/CJV2YIti0 jBwD/1Q2KhRKCAOhqcKk6BjS1ZKhmUfwQzgld79ZCGryfXzM7DCHSLyVjRzieVLv+wvX+JZJ6 8er3rVj9CrD5ufE6Zo6KKvPi4Zci08Iyc9yiu4Trv1QYMKopt+Z8bdTtsNv6Tbd/NirLgp/U+ lH9CqyY0VG24DpCAyBAIkNjJw4sl3ohx+8U7cg93LtXCbEHQGwlc0oUAkkUTiFPEhOdykdvLq dkDZpSTVADtQa5U8dWSYpt8U1c/aao1gvalWFZ1tx0O4vj+LhGbHKbgyh0WVPjcZAX0OPUHmG uabhk4MB9L8LWKSuVOO68c/MuDb39Z0fWrhe0i3igdcODW0eJ7lmwGBLwn5qKjNaZVof0cAGq 8h6V2ANq110twj28oaGcy31QQD0y0vh36n6CF7MIzmzcz5dRvj+tBzy5mgHUb0HK6j3Fp2+iy qWBD/DzbDMEMTM092iKJrk8Vk1jD2egljDs8lGg7KK5m2FXqPCUJuMsJvDFU9qJjAIwjVOWlU KKZF2ARn+fl9Ag4vz3y0rc2Dyl4= Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/i386/cpu.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.41.0 diff --git a/target/i386/cpu.h b/target/i386/cpu.h index e0771a1043..8fb1012346 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2251,11 +2251,11 @@ uint64_t cpu_get_tsc(CPUX86State *env); #define cpu_list x86_cpu_list /* MMU modes definitions */ -#define MMU_KSMAP_IDX 0 -#define MMU_USER_IDX 1 -#define MMU_KNOSMAP_IDX 2 -#define MMU_NESTED_IDX 3 -#define MMU_PHYS_IDX 4 +#define MMU_KSMAP_IDX MMU_INDEX(0) +#define MMU_USER_IDX MMU_INDEX(1) +#define MMU_KNOSMAP_IDX MMU_INDEX(2) +#define MMU_NESTED_IDX MMU_INDEX(3) +#define MMU_PHYS_IDX MMU_INDEX(4) static inline int cpu_mmu_index(CPUX86State *env, bool ifetch) { From patchwork Sun Aug 6 11:59:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342780 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 291B0C001DF for ; Sun, 6 Aug 2023 12:02:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQd-0001aZ-H0; Sun, 06 Aug 2023 08:00:11 -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 1qScQc-0001Zt-9Q for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:10 -0400 Received: from mout.gmx.net ([212.227.17.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005ZP-9k for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323202; x=1691928002; i=deller@gmx.de; bh=+FFaZHj41P2ZukVhj09NDP9crnAlhHF9gw0dXa/YzCQ=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=iUiAQwvYnCk7i99/4Kzzx7v+4rY5SS7xTp+xMAuTGodmC4mb36i8Wrg0AbE8ugfGjhRQuLS vwEEgRIN7ZKEZDkeDN6MyetmmLmtU3g9DBNABwGZj1XnkjqsMVw5XT5Ar5eVvXQdAiE0+Jg42 8rvA1qeoGXx0FFIU5pRh/E7iNj5pWR/4MD7k9KkEMCtYAbXBaLlFWv3qoyZw1kGiW+zLbPq/s zUo8iZjl3XdItHDYJbIgI/5fLBdY27cHKQQbvg/ZCNT7kbnVkfQfU3kTKXUhOOteFfRueoIuk XRGzmjukIspadmA34v8N2r9r4jO2WQRXmEgF8SFCNpYkfFF8uD/Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MGhuU-1qfJke2l2A-00DnMP; Sun, 06 Aug 2023 14:00:02 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 03/23] target/hppa: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:41 +0200 Message-ID: <20230806120001.89130-4-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:xCkeYXB4mGhhyZnU0lBpubommubAjOTyKMtGT4O/NponZqNlEHu adYMYsv/5m2orqw4Yu0zG0H3j3++4Xw/HFNgkJzCLfJTmA40Rexz1XXfKyPEIf9mn87llgv zDOR4OmyXOoU6DGyW/6L6k+aqUF1yKa65gLrrfJsamafC5tyFHebYGnCy5sLyN/joNMzZGC o6QRAi1J20DwjVKsNjaHQ== UI-OutboundReport: notjunk:1;M01:P0:22D84i8iI+s=;YHIHKgqbpvzgR0Cif73F1C1ziyK 0icBvi63VCIfs+ONi0pMjPp9RG1AsQjwfXrvPMO3l7Fo9he88GeMVYjc3uNaHBYCQFKlEMxc8 ElYyAW2geQV06mYl5UOqTYwiF2GuTPdqJSgybR1BAs4BmJfM0evum8SQBTYltgwXCxRCx+Npt 3TxMJ1RWbQnNe19BtMGJiNnwfHSgJWutASHd2YWkTnTmCbJje4IX1lBwi58EFQuysGRxuiq0e GAEHBegQgsVeATNuwYJHIKHmnSinf6kJdXAc4TXqU4Di3cVS2BEIpcTmDaWfwtL52pzLLMwXx GfR1OVnkP8wuOFLgLNyGhCixHtTI+prW+ywZVqT+lOw+df4XkIgjlDJcVLHARRhzdxHZpQWTY XnE5kbjTyu3Dc1NI7DjUME5ZFTP8lPmWmy2oHqKS1UURkkQa9LyFNQz+I/GODGajEmI9DoHT/ Vx0+dZqK0Ioj0LQ28AsiNLBe19hlCsnkXa0Io/Ufbus8VaLO7mQEse1llhMWKCl3Bel5Y+1rL i/ubgpb6Z6zuL5r6hbf7uKGKgFjlHwGICSfec1xZDlZKHSWf2fDL51BJuJXxND2WYsJ+w5w7B stpc7IZn3kavv8I2bvsZ5lZw83xmMYPRbCaBXYXl6prS8gNLVSetEkqtyblyOVO0aOMFxB/Vs XifH76oTbEkRZ9gwyB7GKkWjaFDz0+Saw+an7uBs4TUrjjhrVkJRKHg8jpf0cgjJqUGyDY1e4 VmR64g8Im6q89mE6T61Xv2TG3R62yJQ236u3B3+ck34+MOevUxZCwHgApxCK+5S157CETIFmB +vyzVWg8oHe/qlv/7+uHt04eCPViZxjavCO315/DIoBAcqVhF4fWrpKJuxy5prJQPQPYug/5q x/hmZMvx0H0Wv7PAC4de9x2Rz5pZCMpkx3qeBIrwGwfdsu37bU0eT9ExnJXHrxbZSl2XAxg4f ukabTnh4uI2fnFoJvrOxhrCHAbU= Received-SPF: pass client-ip=212.227.17.21; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/hppa/cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.41.0 diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 75c5c0ccf7..f32d328e95 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -30,9 +30,9 @@ basis. It's probably easier to fall back to a strong memory model. */ #define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#define MMU_KERNEL_IDX 0 -#define MMU_USER_IDX 3 -#define MMU_PHYS_IDX 4 +#define MMU_KERNEL_IDX MMU_INDEX(0) +#define MMU_USER_IDX MMU_INDEX(3) +#define MMU_PHYS_IDX MMU_INDEX(4) #define TARGET_INSN_START_EXTRA_WORDS 1 /* Hardware exceptions, interrupts, faults, and traps. */ From patchwork Sun Aug 6 11:59:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342773 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8FC03C04A94 for ; Sun, 6 Aug 2023 12:02:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQd-0001aa-IW; Sun, 06 Aug 2023 08:00:11 -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 1qScQc-0001Zv-C6 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:10 -0400 Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQW-0005cF-Sp for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323202; x=1691928002; i=deller@gmx.de; bh=e7nRBaVId/NKKdFKNPTa2RSz+uD+L1T38x0l/JeC4YY=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=FudQl/RE4r+asurcsxtnh6b4M+wUe1rgfL0HG9A/UIr6NiAkewKHo8zMT7CM6rZNbgRXqHO I3PEfz3lhROcWi/RKkAMZ+PzQqYhewziCvrDGrX6mVTphekAUr+ebRfhi1KxcNpBYQQen8iTB 29l1zyuGF0SjCBmWn2Oiq3E5/l212ML7I1IZp6Xg/Afgz0wg/z1UiXtqm5IfEe1oRIsETAU9Y /26pPCMqoL4EAO3sm/Le7r8JmfZ74Lg1RScHZlVLOS5Df/ztxhJxQodw4y/b8M6OFjc7OQTN6 oxkWRqQikRjlAW0i8buQzJWCi1lMzh7fir5K6SeM+7KOVcun6kQg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MCsQ4-1qbS8A3D4C-008rPv; Sun, 06 Aug 2023 14:00:02 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 04/23] target/alpha: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:42 +0200 Message-ID: <20230806120001.89130-5-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:bBOxNb0jtamCCfrINlD3s1STcvHNvs889pAlcgL8L3Uap63BPgl onQtHOom1XnNHkOeRbgZmNYs9XL2mBPusOm/8ctJpVP7/1A9J8DwnjzIArY+UVa12lcbDvs AKWqfzMz4XQzoBksw2WszEvxfiocq54PDtlAFYwiiXQqGX0ueeqFcwx3xeRxjJEz7iCXK5U wiM0/FDCMDwyVw7lwg1zA== UI-OutboundReport: notjunk:1;M01:P0:oI2PRCNWiZQ=;Ax2/SrbLLe9ddBN2cP/LMFnalHe HRMJAEvpqDiH7m07FaoSHQEcmRuNdjJYrioAdJ4+aWhtq6iFL2RDHaB+CGMmeIyIJHq8LRbAG vV8/MJ4q12OmUaOYqKhr5ZFuSLtaxkHJM9Dz5imhTfAPIl0P8LaMOrOj+4Qk3/mwgXwC08I4a pHhDioL8JVUwj7kl/eRD7HRKW4L7Duef8yQjmlXWeLYQ7Na+vEmWUk8wqU8+acantCnDvs6lS Ws6Oa2Ro24jxaGklKMurNmVkje6+atPKA2k4/FPjZI3GZ4L4xp4xxO7hiFt0035pdzE7xwKj4 d8q9G6VrFwIOw5v5xg/KXz38WlZIRWXhotpGXgJ8Zor6kbwousfH24plCviTe5tSBvNLOu9Vx c44S6mDFx6wevQ9M4hw3KWczHlZXuJjNaHAdwQFMQvW8C2KMm+3xzEw1fuQ+/joId30PO3ZWG 1Ae82KuVaiPrd/Osbd7mSaKmcyNHLE+b8xlSRjbnDaoGtqp9cbbCSRFoSDtH0cGoxXpEBuLHB MmwR4n8+WEKGnsfixTHol2JM1EQM61OQFqxgmeR30lXNxnqNxJXwtPfF9CbyPG0pq6pEROg6C cyFJHF+Cflk6gRHmc01fsEzmvwP0Bk6MdiCyAFNrQxDVHItVJHDDUyNDL20MyAEhcbGdV/PFK OH8m7pV0o6G18xfhCqUFQuNduDAjZGdSXpmVhcVW3Cus3PwTfmLvxabTUoyyKkkBU5hNJWwgE uG3mhQNFyfxJfxTrnJDSgubmBKlCD/VdJALUax5cZ1btmLZOazR/En3p/itR2547xDG5Lj4Xe aI2DYq5KmjM/+0EGAFi8Pw0C1Uuv2Ip7hgQEzi89DqOPvpP8647e8WVmD2NI0ankPVKirRP39 GvolnWjj6PZrXULqihMNAD6wXncdEk//1cZCWpWRpko666WxM8vMdVT+qfHsO3EF06L1Eo+Eu UpnNvA== Received-SPF: pass client-ip=212.227.17.22; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/alpha/cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.41.0 diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index 13306665af..9bf80cdb35 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -194,9 +194,9 @@ enum { PALcode cheats and uses the KSEG mapping for its code+data rather than physical addresses. */ -#define MMU_KERNEL_IDX 0 -#define MMU_USER_IDX 1 -#define MMU_PHYS_IDX 2 +#define MMU_KERNEL_IDX MMU_INDEX(0) +#define MMU_USER_IDX MMU_INDEX(1) +#define MMU_PHYS_IDX MMU_INDEX(2) typedef struct CPUArchState { uint64_t ir[31]; From patchwork Sun Aug 6 11:59:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342783 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15E6BC04A94 for ; Sun, 6 Aug 2023 12:02:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQl-0001lN-6h; Sun, 06 Aug 2023 08:00:19 -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 1qScQf-0001e5-3Z for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:16 -0400 Received: from mout.gmx.net ([212.227.17.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005bT-7e for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323203; x=1691928003; i=deller@gmx.de; bh=h9yd8rngpT0I0RPSFORtYiuKz7zcmMDvTe2DL8IxR4U=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=eeQkR9xIJ4jOy8BF+nAuOCZW+Y7khaP1ovj40ejecw008dPENUKOflxUR/NOMge8604+GoC lD7Err0i7BXu3QYC87m9fIJnuy4eWLxVW9Wjz3zSsEk/vUDSXe3Ul7PS4W+S98Se6tliCq/YD Z9V9Kbdbqzksgc0PHeufOgPpUK9t+xL7dD7aM1/psge5OpjngQZfdNw9XMvGozFBOtZwrGe45 HOzmqw+UT82CPyOwIfUIX3mhJaldM6rlDceUW15q4pvt4PiVUcfP0y7txkcCFEPqAO8tPtFn4 DOCzSCI+EIrhevTZUHyQXulnA3y2LEiTwj1MGdnd1538lgb/S/wQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Md6R1-1psSKP3dGV-00aBh2; Sun, 06 Aug 2023 14:00:02 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 05/23] target/avr: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:43 +0200 Message-ID: <20230806120001.89130-6-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:GPFZTzSIaUmWEzfXsgXPyKqjxBFQ6V25TNOe6h9KocnGHY87A5B TM33tdNDBz2T7rJCWCjgLO2MazKLPINVHZNv1dkEXwD6CkuupQ7K6OBoSDCFB3L0AcER1Eb O31HRG0385XNOJvMNilqTgFgHjuI7QKzdm5i8G9ZeK/O4OSsQiXEzWGu6hnxM8/EsiMd+cI 2rY/+npXpPmRAdTCfkzDg== UI-OutboundReport: notjunk:1;M01:P0:eSKX4sRfDGQ=;pWCOVB4ZruN4pl8nFBJqhrS8xkB zPg/aTfTQrE98CRwQ9YPZXIfubvSYjTwAoVmstqXptPYaq6rPXdqYgVeqFYjPNnoJCLiF9oac T4ykICJvhzjU74NRCmXxUu4WgBo0eoPF0xlg51fEktc92f8lJNJOhaHooB0PqjLZzfyT38eVZ 4ZQ1OUCwgbC9q0IU/loeQPdjUfRClcdeVBrvY+1AKEN1fIahNtDEvgm7Lo8hkHxG87Uql2Zdw Yrap4hmcYOjNwtOzhYfeojiAbj66Maa2H+JcpUxLbK+dvpXKPA/zujAKOhwAs8u7epKxYnOWb FJuMFIuapWoTeLwl9kXO2ZedChe5oC3efeGXnwmCGx6xJrPT3XJQnKKDRzj217pkWP1f4T8N6 fcMoco8zwzZ8UqhslwFaV3tobi+cDuYNhVB8QJ6woYsEDfXpTOm/mQ1KWuSpkA3OFliIdjo59 LK3lbqEJQummGej2EjtuQR26roJP/QYdHZKBZAcswgndlHHo5g1Q+d+UquaBgAcVMZM6+FkPT S/ih22z+e80r8MiGxul1/aq1ytn5kYpvTomuA85Dxv1PCX+D6hwKe3/5kxEAC2rMXHcyOP3Vz CnteIWhLfdMIQRk6wy7CTKoyfaoteRdfpqGKE4+HbqIQmHLnImgzszRmXdqKo4VozhRq6bEBs 5TPD6IIsXc27zAyXPKMlYRsfk5TVQijLn0Wq0oSKdiafxav6bIR868HtziwMR4IDrbTZBU5i6 29faLpbzLhWl+frKiOhPny0ozC5pv4GOuaco7Zn5wBdeWhhGzjDQRfhaUdV90IIeO1ydkogg0 W7c/uMHUBq6I7Y8yoEJk7l6Z1RxhzvlHyCIkPuVdFfvsJJBL0zk/0vV0yn/ckqABazDo/c6b7 84CxXVnANLYXzHWQUKj/SMZsLCIof6034rIvEaes8uCPo3bWt1jhbjHpbvHIBaPGSPUqrbIy3 rmqPNzT5n/wr3mOSxW4lstKwY2w= Received-SPF: pass client-ip=212.227.17.21; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/avr/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.41.0 diff --git a/target/avr/cpu.h b/target/avr/cpu.h index 7225174668..8b5916d243 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -40,8 +40,8 @@ * ST/LD instructions access data space * LPM/SPM and instruction fetching access code memory space */ -#define MMU_CODE_IDX 0 -#define MMU_DATA_IDX 1 +#define MMU_CODE_IDX MMU_INDEX(0) +#define MMU_DATA_IDX MMU_INDEX(1) #define EXCP_RESET 1 #define EXCP_INT(n) (EXCP_RESET + (n) + 1) From patchwork Sun Aug 6 11:59:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342776 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A237CC0015E for ; Sun, 6 Aug 2023 12:02:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQn-0001mI-34; Sun, 06 Aug 2023 08:00:21 -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 1qScQd-0001ab-JM for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:11 -0400 Received: from mout.gmx.net ([212.227.17.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005ct-88 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323203; x=1691928003; i=deller@gmx.de; bh=dvxkSS+9zJe2d6S5F16mDEZxjl4ybNfaIXuGtQs5GGw=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=lqeRZBv2ca/JBcberjH6mxbUKMOo4+UAmoRVt1YMPNhplZ5OfraaUMmDa7F6BMvqudkkOPs TM6Bevqr0UIcSUvCyC6PBkZmiWClpo/bub6ao/NK70Zi3yXzdwivXDMzdf4bMNGWQDZZaVX/Y bqcBesRFURQs9ujUQodanfzHj3vTrggDjxFYLPR7O8FbyCUN2pYX3jlujDBVrBEQ7LTYIubvT vb+ZcB+4hnUNQ4YusDitZnSEhqKwHX5jz5ufHPrXTvjhaBKKI9X6KlVCBqO0IdRs+7bTE4Xm6 iwt974aARJLOcgbZMx6AfFOyaQng7VE50lc/mzljRRRvbS7c/XQg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MrhQC-1q5RIt022m-00ngLP; Sun, 06 Aug 2023 14:00:03 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 06/23] target/hexagon: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:44 +0200 Message-ID: <20230806120001.89130-7-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:OtH6DGDkCQQx7ZsnH/5NSd/dqCjDSz55Ukv7ewz8lqeeUyVV1OX ErhFHf+SskSUAkS9Mg5Tyy41aiYWgxweN8SHQh1ZS5t3TnCY2JL9aFuDaMab/XNeunNmjoW u53F1FpMp7QVy3ZY2d/UrCp7K73Q1UgAdf3NR6q0/9bvwwlYDqxxOBDiNBU1MAJoz4t4Nje HiR9Ft8t+mNSUwvIu5kFg== UI-OutboundReport: notjunk:1;M01:P0:qMo+jKsJMwc=;rCfKfoU10FwduBduQycz+cFLotJ itnX1fCnV75nW8YUutZpryfDXe2ZXfM/1qiNQ7povnJ658I3zKO2Ex9nVaiQEyt7q4QQ1e4Gz V7YkWfrlnnpbg4Gtr0EbyewLSe3qYlH48Ks+SymOUaEdX4GrJ/D2R32mg62Dw50Oejtw2Utgl HMv570WFSk9kV3idBc3cUFENGp8k7ikqvF2PFZqTpcpMxSzksdJDYiGjwGKxfoIYEETuP3zPD N8sj6kJrQQiOOmQ/EY+TmHPP83K51hLSrKLsf5bZtW8XzNizVWLQR+6D2qav8aHPKRvMBIUD7 hDZlyrQ1I+AJ4ZDe2TZyAt3274GfUAzo7Dk353+ZYVa8djmc8PlKm4WT5dIY3LdTEHTVR1hpf 9OoDTbaAGfRbfpbsluK09q20OYrUYtON7BR9hJaUAGWWDqhkcJwRCdFmOn7mujv0ZhWMq4jMI mc0y6TzZmOG2RqTe5XV2wcgP1Jho3NC4fCDEvsY4V8dXIPg+oKRvIcQdTWC+UVaTaLju43X6W G/JJ9C3IokPK171BD2WSYbPa1ryeBw6CtaT8RhdrJoO5SsdAxlGs5IWJh8APqc5R54xGFqDDM ag+Cl7NAkPOa4mJn+DY93xgfcSCvtoqfZTzWUEYrM3PNhWjixnYbKtrUglb8HpfijoCz2wn8x 62JLCT3McfpcdPthF+8nc45pluw+oSIay8N1bPZhFwZvSrapR33ef4hmPs4j3Z7g+oXsrNNSf rWZRac57pdQMEFG7+kHSyQY3kk6QvT1qGYSA714nM6W71i1L9AGmGAfVLW1JRcof2NyeSWvvt BQnnXJTKPCwUuyfNgwg57JTzZ07/HYzBZsF3zqYhzkw90eiynE1Etmvoax5O2c7cqYJnKgDws sQpB95mmOrlH8Dgw4zObLio8aR56/E7NQfl7Zkj33N7KDKgmKxO6thf8cr2fgx5KVLVuchw89 7wMGnHPD9lR2YJRWsivy57ffcpw= Received-SPF: pass client-ip=212.227.17.21; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/hexagon/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.41.0 diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index daef5c3f00..b4cf9f1a7d 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -51,7 +51,7 @@ void hexagon_cpu_list(void); #define cpu_list hexagon_cpu_list -#define MMU_USER_IDX 0 +#define MMU_USER_IDX MMU_INDEX(0) typedef struct { target_ulong va; From patchwork Sun Aug 6 11:59:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342787 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F414EC41513 for ; Sun, 6 Aug 2023 12:04:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQj-0001hZ-7J; Sun, 06 Aug 2023 08:00:17 -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 1qScQd-0001ac-NB for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:11 -0400 Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005d1-B5 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323203; x=1691928003; i=deller@gmx.de; bh=hLqEpcC8Hd79MrgioRBBl6xIy1QwV0TCk6yDDh3U9zU=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=LXiL4z5fbJDnbc5x6klw9T3bL4xe4PNX1kIotgOumyMHu0pqSq69/oNsbvoo06yCXyZdXfg rnuTx1FGPzJhRoYV7JNLhxAI65SQHc1OBCqINCMAa4p6jvHbwUCKA6vvt764MHu68L8WywZcH 8v7YD7Kx0GlvysdK6VBHEl6LxXEyjW0ONtyYCWsTj5cJSnkv+wLpaRom86Ygm0FnN71Q3zihZ 3+spmbgRaqVyY/ndVjdlh5uPlSB2MS0BoA6wC+POBBmcQ65ANin8YmGLqjCIXB4ubKyaJlFy4 Ogs1P2n7ryVE7VYIOz0iN3MAD8kVmyksqEDf2Z/oHvqVteIDAbWw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MVNB1-1qHzyG0dBX-00SST6; Sun, 06 Aug 2023 14:00:03 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 07/23] target/loongarch: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:45 +0200 Message-ID: <20230806120001.89130-8-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:k7nqBYx2IZa9n0J50MleLnYB3B0NAVmapo2EFOYxCbgkI39+3qt qnzqEWVj86b2ZIsWwittVcpX6/ECrV15wk6+NyfAh1aAieuLBKGy0N0JE484vFmiIs/KZsk +ma1Ml/QyEBVCVptu5P/ewvSs9SJJYj70/JogZ7JcIT+mMalJxgoOvrxjbDca2ntE+6keqf Lva4MV9chu4VnRdSDfFxA== UI-OutboundReport: notjunk:1;M01:P0:O0xrt8EYVWg=;kdslLitdnHNaYvkk/107lPAbXWf P9aBxI7prUR7wnLAYqG96S83AAarBKnoA2NJHQBQ8FqtTLO29BrCiFR9Gi+DCaVRk/qrmHa0Y N1QNaQrVhaaGF4+paVylBOdgCgF99b5SwHbgiS7O5R9dNFKLYfzS9yDqo5C6dY7qDwKmgKDSj ljnsGIpvynlHQkE4Wbzjv6YyjpkMDiL9laYnLBHfGZvo8WlUvjqu3h6fSTvZWts8EOYsg8UIx QQwTpXdTnD/bPIBz77HtGA4FYTpCWp0bL0xErpYvFZdfLE3HhymkV4CiTglPij8ATHtOHycEt k9E2DUAhhSK8S74RhvueZe85JuXeQO0Y6gJHiKdjN1LpEDxjKA1foYOl/sy/yUqUqhGfNWb/U Hd+mvzfjU6Onh+Bhy7ce9vBP6Lt5zmJgRVKMX+RppLKVehYNAR19nI63lpDRt8HA7TVb4LM0+ N1hCI965SGwD6gq7zQnexQ0scsIZPNQAeiOIdNOGZXm0BAmZ4RnFykGLtzClQrze/PQhhzvyU UsEp5UJcnCFPHp2/Nq0OFNeb5Ic8QZw+M30iHM1ZCVxLTEmBY3NqYUwsEbCxrgp2AvgOnFbyF GuKesfJ3bn3sEyr3O183xr6SL51gnl7kII5Z6szSrTLRTd3TwFFnnPky8rnPkWtNxpXaJPozJ F+KRbHTaXChxrbqokMgOVC8GiPT8ZNOVxqkr+5gVHhuMrtkqVOquDva06gEHyp6FaY/5U67/w TPqy7e6GzZFpjVavzR8dE8dwKeIOTAdNZdRW+CXxDikF+2l87jKpemX52kZ7/o0HQ1xO7UrDf bvSqTqTMZ5Ure+DnN+1YMYnGvtvUqh30xA2Jsvp9ETY79UK0WBKDvPNRThjlHQgklBzXUcW5z jjemWm8eLr3v+klKTLFqBAX8LmkweiWrfHAxa6i8CUcMgg8ZrHUdWHrN1uL4OIjAuY/wnhGyh 9CCN35S/sAlt+gqMPoJ3jm8hvvA= Received-SPF: pass client-ip=212.227.17.22; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/loongarch/cpu.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.41.0 diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index fa371ca8ba..ab15146d77 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -404,9 +404,9 @@ struct LoongArchCPUClass { */ #define MMU_PLV_KERNEL 0 #define MMU_PLV_USER 3 -#define MMU_IDX_KERNEL MMU_PLV_KERNEL -#define MMU_IDX_USER MMU_PLV_USER -#define MMU_IDX_DA 4 +#define MMU_IDX_KERNEL MMU_INDEX(MMU_PLV_KERNEL) +#define MMU_IDX_USER MMU_INDEX(MMU_PLV_USER) +#define MMU_IDX_DA MMU_INDEX(4) static inline int cpu_mmu_index(CPULoongArchState *env, bool ifetch) { @@ -414,7 +414,7 @@ static inline int cpu_mmu_index(CPULoongArchState *env, bool ifetch) return MMU_IDX_USER; #else if (FIELD_EX64(env->CSR_CRMD, CSR_CRMD, PG)) { - return FIELD_EX64(env->CSR_CRMD, CSR_CRMD, PLV); + return MMU_INDEX(FIELD_EX64(env->CSR_CRMD, CSR_CRMD, PLV)); } return MMU_IDX_DA; #endif From patchwork Sun Aug 6 11:59:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342768 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17F2DC0015E for ; Sun, 6 Aug 2023 12:01:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQk-0001jl-Bf; Sun, 06 Aug 2023 08:00:18 -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 1qScQe-0001dy-T5 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:16 -0400 Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005d0-AC for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323203; x=1691928003; i=deller@gmx.de; bh=vztxPNZg2Ks81IufpA0WxudElm6LqGuL9zpQKXSpcK0=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=i64aboSH1wzDKW3gD9PG+e44eTehdENLgTIRQQLpXpNFuNKVq4KoO5COeQtOpRFvBlyhjPt 0fErNey/IykCVk6aasOIRdYEzPBjOEY1Z/UwmUtNLrxQr1gv0UWit+mJgNlUK8Jp+iRUIkthG HMDlT1UHYJn3G5xc2b58qDFwImcFHH0OKvenCuu3OStoxKuGRvfjXM4ekZ4cxvngI9Dyn8/HN rKQrkuAkGRXC2Ujbl+cCQc+ihPlPFNqlzg/BzgF741CFCI8rWJMeBZvMj3viN20lFIdNbxhAA BPVlp4CsfUWbGB1DQNu3ZYmapi+G0pDlW9O5C8sjUT6h/WP0vhTA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N3bX1-1pjl9E14aZ-010gky; Sun, 06 Aug 2023 14:00:03 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 08/23] target/mips: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:46 +0200 Message-ID: <20230806120001.89130-9-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:/6mt+XHVRLBeA/rnu4hj70MLoVlYqz3Bflr3Th6/+HVRIotxlQH KAq5ZqLSJBPpHjzxeGunlku6bFCaiZTQicCTMILD0/A04tNxDx3n0jakUknLb27xa7/oRhj 0m7d+oWwHzwK3/57ze6Omp681UpV9Zi8d1jPHZrZVKveSCpxd+HKVqw0/Ifwyu8wdm6EgFJ n2p4NsRQee3hnOfE/BR6w== UI-OutboundReport: notjunk:1;M01:P0:hvIUkHbUJE8=;F4vaZa+WCc2sxdfL/izaDSdkGlr 8Llf4sf+SIzSD3ZszRwHxaMdKXgc2+7XrzBMxqXct9NkaO8aD3jfOc7eGCUuBmrA1eVOeDd45 DcLcr6Dvl3Md3pEdPFdoe8czu1pmEMfcpkOEEAw5RA6+6IRVgXG1ggQs5oZcvClt2hZoJVB1j B+zxU1kKCkCsQh275avh/di8smgjA16c59A9L+YwX7v8M2svRzpdtN5ADeP6Iky+JXx3YGqV7 d7cwGQu9a+mgGTr5qPSgGvs8Y5LvvzWOJtrVZOrAw3MTr+4xRSq1H8oAMUQ2hcBG2DBkV1GG5 EYaXP05UEiZFQp0xSB044cXzpBSEn427IgVW6K626KbrxHVp9Ar//Ky79HsXjCN8IErCK2XCF X+fbcSX/0AnJ+fR0sPo+7iudezbV88D6rwuG6a9JCDfnbyG/ngHapZ6J5GUjzCG00Z/NnCEyV gJevp6j7UffSYBmNG2MB7zwJm/57slpP8Fu/min7nwOinSBS2MPcbb5+ZMGCPR6LQBo22WRkt v3RDwJsDuuD0Tiyr1yfk3y+XEDSEeSPAuB0WVQ7FdujExfVafQ1IjmtBSYsemo1JcG6fgwcpw dwz6SiT0hlq0pqCQohILMhOIh9LgQdQHzKkAZJRJMfmrVTqVmisaa/x0Tf/tiFr+Ozg8IJgYR WpwoQ1JHXmfDY+yBHJcZEPSyZFSIFbmv8s/8ud0kD2cixHuqrizrQmUT+ZobIc6LznRvC2spp gdtT9azgZZZ2NUaeBNlZ5uPuq/xS/iI7NXKqAMb+ZM0REoqRv8w1O0lgQLo+FDn4t0bRozhtV v15QmeQkJETPZvVNUcNiAZKfbamdW8PMATRcRvSyn0gR2DSdVZ4GmqoteNaogZidBHNI3nC11 bE6BNGWieryKP1bl3U+gVdEEhaF4zJlNKbh7pJ+pMIkgNcr0Ne+nqW4v5zslyG9PRyjUWHj6j 0HeSADNUxrNAUlAZGjUmCCXS/v0= Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/mips/cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.41.0 diff --git a/target/mips/cpu.h b/target/mips/cpu.h index f81bd06f5e..4039d59f61 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1231,14 +1231,14 @@ extern uint32_t cpu_rddsp(uint32_t mask_num, CPUMIPSState *env); * MMU modes definitions. We carefully match the indices with our * hflags layout. */ -#define MMU_USER_IDX 2 +#define MMU_USER_IDX MMU_INDEX(2) static inline int hflags_mmu_index(uint32_t hflags) { if (hflags & MIPS_HFLAG_ERL) { - return 3; /* ERL */ + return MMU_INDEX(3); /* ERL */ } else { - return hflags & MIPS_HFLAG_KSU; + return MMU_INDEX(hflags & MIPS_HFLAG_KSU); } } From patchwork Sun Aug 6 11:59:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342782 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD28AC0015E for ; Sun, 6 Aug 2023 12:02:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQn-0001md-5u; Sun, 06 Aug 2023 08:00:21 -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 1qScQd-0001ak-SB for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:11 -0400 Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005d6-C2 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323203; x=1691928003; i=deller@gmx.de; bh=KOwVOGLkUNJS93FOFZ3KD/tcWS4SN2K96HANSWFCUjM=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=TduY2SUSGGxchPKoX2FvclUF0a+NtStTJDsveyOFr9LgGm31R0UeMEZLCTqCgymhlubYpHa EMMmDJgDfYt391lCNI0v6mqKPZLe7TQO5mDCdWzaaX2jNajdi6ot+KRcZYlrR7LAqJYs+epsj L783EQk4nnou4z6mWHpqDoNJOp62Cr7qfoZLLsIvQFT5rTyLUzTPzJfasTWUxIQXY5QX9S/FM RTpIk96VJrqz2sBPG/aYp5OB0FXmWDr1o7xcB4wyujPgZZpLczrdu6cKa7fX8PaSATKmWr6cI hK5wJsQykVzrfyVzwN+6goP1wUbCliI9Tc2EYf0ZrqeMjhFom6Kw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MfpSb-1pvDUQ1UTZ-00gD22; Sun, 06 Aug 2023 14:00:03 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 09/23] target/openrisc: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:47 +0200 Message-ID: <20230806120001.89130-10-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:eIo0E6aHCD+BvwKhiwgS9fhiJRcOsu/aLqWcVrfYtoMmquUCNJy YezmbPfgwy/F0WQrfPbqIWDV2vC8RjQy5unuJXAfUDfs/ZoZygqqepNeADN2Bb3ealPmxIx mdX0bZ7SE9bE9s2O8mdcclf3DSmvhIjLx5VJoswaUd+6e9Vp4V022mMNuV1sdhQ+r8oytKE SanKYT3YNQ1N/dSbWxmng== UI-OutboundReport: notjunk:1;M01:P0:WWUrUlkuTQM=;xGxBXe64PY3qkUHqOg04IWH9DoK CHkXaCPHPE87TIDjP6qSjpOzKd5LefAJ4dCL3R1RJ0T128DzEiD1atFfZ6G1kofXguZYu+4Bh PUPfRrx9eDByq1G8c+2pJdf3oi1gQL/WyHOH586fIooz9uJK/6dungLu+VOIETa0dk0s706aS GrTJLQXal0v4KYQ5NXcqxjUxw6bUaWZayOc7pZwcwmO95TNnuqJ5JyNknkiTK7KEvBQrx3n8m Kuno+doh2ThNkdkI1XO4857S3nqaxxGNP6GbPUvsQEc9lcLyFBI4N9X4wkT2JxIb3IyHhwU8o cD6Msg6diUi4tidGPyVzjNkYGzcXSb5OEdOcmf1TTsecJuqfAfJXDTSxWvdzmhXRa3mfrSno0 hqSwq24BBHKQSyWM/Mdb9PhD4JtCERaW8YjXXRml4hYfM81dRC3MH5r33ALTSoqV8FIeGWR1N po8VbebdYHQci7r7ZY7YiLiF8q8uGUBqxeqUHegtZBTU6HrpXI+Whv4p3DjZyvEc/h+aDieOl GFZVdyfgvnO5GESE6z5zB417ka6rnAjP+EGtiCfA3TJwnE5aSzgpRpOxF5ezTkYgwR1tQi/ag fS+iOAVUL0pCaj9lT4I1tVYgc3kj3hf1pUfFaEuy6OuFmk52yfaMWvOdO+q6VF/bh/5BklAwD 52plyfvkd59rcIkQDRVEzTF9+dTDKtPYkK7yirgmGtPqzpBGHMAr45Mu5A4iCGReTrNjf4SzN iEL7uNeTNYN23+Sly1TvV7Im90XeHZ9fUXj+gymQJKc4Gh+YbM9ZrEX/ARkM6u5JkphL5gI54 fSYlr2HoGEEVAOrifXpU5zYw8JhinENwJOQBmUonzcbo8xWJv+Icxy01F0dtPzFgECDWu1duK 4N6HFs3XUybsb8RS1+Br8fiqJ4gLo2Tqt/kdQGV290oED77DpH5Nq0lqSLIeSfckAg+Hf/6xY lfIPxs3IzXM3Bn2TAp9ZYLNmUeY= Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/openrisc/cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.41.0 diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index ce4d605eb7..c216f2fb77 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -50,9 +50,9 @@ struct OpenRISCCPUClass { #define TARGET_INSN_START_EXTRA_WORDS 1 enum { - MMU_NOMMU_IDX = 0, - MMU_SUPERVISOR_IDX = 1, - MMU_USER_IDX = 2, + MMU_NOMMU_IDX = MMU_INDEX(0), + MMU_SUPERVISOR_IDX = MMU_INDEX(1), + MMU_USER_IDX = MMU_INDEX(2), }; #define SET_FP_CAUSE(reg, v) do {\ From patchwork Sun Aug 6 11:59:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342779 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC570C001DF for ; Sun, 6 Aug 2023 12:02:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQl-0001le-Kr; Sun, 06 Aug 2023 08:00:19 -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 1qScQe-0001c8-At for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:16 -0400 Received: from mout.gmx.net ([212.227.17.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005d4-89 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323203; x=1691928003; i=deller@gmx.de; bh=wfGbH/9aMrmCkcIguPrZrqTIG36tr7GpA+9BI5L8PqQ=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=ZH9noynNXpM1upLuztI4NlN1t+GGSfRzsgQWEqQWGZHwys4cM24AUvBSCBQFid2TvdzHd9z OGukyTrnwcD+e5a27WouKErR0lrJrQX2000Tv5m+Tl1aDT6yJU/zNrSqvOPH/HlS2nzMRYuJE DRxmARqQWzuZVcTYdsM8qa+FkskrzcmeqLj8Kr4hbcse9Nd8MoP6lWrtZaB0BP7eCJgPt/UHV KO2Z0HApupTbwfMC6nNIbe6HIV3ijqIXxSTyLD2FmaxSYZI/L/3eU5nNbJUodXHrI4OIvTmJg 8K1k4WUzVttEJFLYTc6PzEbjlNWSVTjw24QaK8Wxir+4ClgoP61g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MJmKX-1q8bVK1tpR-00K9wY; Sun, 06 Aug 2023 14:00:03 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 10/23] target/riscv: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:48 +0200 Message-ID: <20230806120001.89130-11-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:UhwayiyMNk6h1XI8z5lRkJ/o9SfMn+0dMcvMRSVVpTcNDEIsQDj RIYYtBng/Zz4jbqOU9ijcLyJZomzdeXEIJP5AeMAkNBKn5oNdLWCJk5HFS0kZXF017Cqyd3 jSEusGZtzfnj7n1+/11TuTQBKYzPvumXUSNWxPMfUexL+aYdcLl4f6+AwklXkJp9q1Xkk6U zKp7RKXj5CtFeWEtZDuWg== UI-OutboundReport: notjunk:1;M01:P0:4YSeNkiZtz8=;0tcgoTbSIqx2+045DzcijRTJv7w O+2WHBX+DiATMG8jU+pSfxKiTN7E/S9sha6Ko2RQgsc8PSK4eLBX9g0d11DIKoeHF5KcqOxR1 +chMmVYebqftiyILSHEiLBfZ2YBYZ87TsS9O0s3zanGMub/MjA4q4dlu42cTxZiKvDOmqlBB3 VHLsD+RtlGoRZwqN/CEQLsH72ilCT6HhCIUWWTHOmZY5+XHUq5fx/w4fckg0oNpQJ3GLF2EZg GM9Gb0FGU+CYJtksF5TgC8G3eOIyo2Y2PWg58SvKoysMyO1znQOIZmee1raMAJbPHN9jfBZd6 n63H4jpx/7tWHp6a+0q2UPZNgqs38arNVXaxcutgi3M4TQOMzuSsmL74CvUVSS+SOuZsZCRgR /ryznmVDlKi6xZutU6JV8VEJWYw8zo0BBWQxe9If/BU4ryULSZAV6wHcrSv0uPwBgpMcZRPrk qkE/zF2Mh7dkjhPtsTDJ6exfKv456cgfbYzU0B54w4AgGZx09FvX1fiJpTzaeogyL5EhW6qmk J4RaxHHwTxOPwnU7ClQDrN8Cc0MtRLCKQMtid0zYVo9iWO0TrjgINCBnhR3RfyAL/Ww54blE+ CT6wog6v5cTaxIJSWn5+fd4HxLxQ50ucFrFfGxDq3WUztR7C7GpKNMKUmuDn9J3OlZzH7XHFK 5qWyOVGjf1MnbZTgiezc4dNhZhWcQbNTSSUGZCDDY221yL0jn+OcH7ac4XX7a9os1FsjHQw0M oo6bptQbjmqTyTzS4Jpuf5w0Ofo2lKDKh2RdwE6AIFvLKTcsvDzU0LxXOdy7g1Dfo1O8PCH4+ Lu8V6YHYkk0EApDoKOiI7oATssXsIFKYwHk5wCLPf/JVJUKQu7dlgJUyEYmmJTtSGrIdsfBfE L3KDKip4asRuIlsr5iWD1CCA69EOgfT1VJRdi/aI9ITgTLpyuds9/CtkfUsxK+f68NB2fg/6P Nku5bPEyUaPdInwo8OUeRoJyx10= Received-SPF: pass client-ip=212.227.17.21; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/riscv/cpu.h | 4 ++-- target/riscv/cpu_helper.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.41.0 diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 6ea22e0eea..6aba1df64a 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -88,7 +88,7 @@ typedef enum { EXT_STATUS_DIRTY, } RISCVExtStatus; -#define MMU_USER_IDX 3 +#define MMU_USER_IDX MMU_INDEX(3) #define MAX_RISCV_PMPS (16) @@ -446,7 +446,7 @@ void riscv_cpu_list(void); void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, Error **errp); #define cpu_list riscv_cpu_list -#define cpu_mmu_index riscv_cpu_mmu_index +#define cpu_mmu_index(e,i) MMU_INDEX(riscv_cpu_mmu_index(e,i)) #ifndef CONFIG_USER_ONLY void riscv_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 9f611d89bb..a8e6950217 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -107,7 +107,7 @@ void cpu_get_tb_cpu_state(CPURISCVState *env, vaddr *pc, #else flags = FIELD_DP32(flags, TB_FLAGS, PRIV, env->priv); - flags |= cpu_mmu_index(env, 0); + flags |= riscv_cpu_mmu_index(env, 0); fs = get_field(env->mstatus, MSTATUS_FS); vs = get_field(env->mstatus, MSTATUS_VS); From patchwork Sun Aug 6 11:59:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F6F6C0015E for ; Sun, 6 Aug 2023 12:01:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQk-0001k1-G3; Sun, 06 Aug 2023 08:00:18 -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 1qScQf-0001eG-Lj for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:16 -0400 Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005dA-CQ for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323203; x=1691928003; i=deller@gmx.de; bh=eVIz1+2aEWXCJiiL5CrCLKj6aw9XMfrjOXixWdeOVBo=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=h6d7SXteTKBGbXV4f+uqIxcRfDK3v1wxBhU66cy83cec/OWSgo3sqOMMK70hFV0y0TbuA+V q2KLDB3FKmBjEl6vxpa6RhEnqeOFN+Y6hD+lDrzkm81sxfM63Ec/QHFoF4CSk/UF6NuNeKRKm s3lq1BhaExt90lb4quGNRRUCxXkXuVqVRD8XYR1NghIm6PhRjwjpVKjhm71JLzFZgqQ49KTW/ SCo2oJB0OATMZhWmzqKI2CtGHcFdPvD9TD3I770uUDCVAzvV/FJvGkG4xiU0fGk7Cuz0fMdoZ y93VKWN6xItPcDrQIz0/R3z+eudPS3+GjlHllNijjubbt4OOAWfQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MTAFb-1qFn362IXv-00UeKC; Sun, 06 Aug 2023 14:00:03 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 11/23] target/s390x: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:49 +0200 Message-ID: <20230806120001.89130-12-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:/NGfQ8XWaXmM7tqWwcSa79kasB3J451fiJZHGzlMIQ3sm9e33vt 2Q4Js7tOt3ZLYIa3GcyZEfojDEc3rzS2VgTcGgXyjxWWY8kmaL5W1xbBw9so5ePNgTxrJyo GmrOKNJ6/JtlyNp58C5Q/r7l5CTy3EaJ+9PMBhzRi3lwVzIr9KWSU4iIMRbEO4TjGBmCgxR Hh11hnNpt7Rsor7zKUq7Q== UI-OutboundReport: notjunk:1;M01:P0:+ixASq/Uxmg=;8a8EqojkM128YDFE/UITTKNDqRW UheZfpu7+SDFPXcq/oqImnGHNdeX7yqdjf+mPSye1RvkW8FJVd7XY/DSC00X4b2nFnXGUEbyP yDDD6f9N7WJWyb3t2orxbvxWce07m/JlCOqPpDD59Ha4SHnbTf9DB3LnS5Cr2cfSocdLx6wpD U982dBu1Yi8L79zhpPzlKOr+vnSA5hfovoQ56wV/6gwGcoaK3GG0RefoSAJDit5+3ObngspWa HdQ/nkjzm6wZb8ehVi/kxRGYcaE2c7eW6zGzMs2ivdKWfGhQwuB/KHFhS32UCe7feRdFkO5M8 zq6aOWzdjU+uXn2t6l3+//HroaivTEmMD6mVSS6YsnAhr0OpIhY6NWU2dGmLCuH5RWgxUU+6Y 8qHah71Rjl95TI7L0z6x75TA1tM6giuv9HSDvEsqQCuCR9AO6vmbKzAowVqMRiZP33LkbVp8j Ix8Q6/huNEVDJDVIgYUsI7sxxVc8nu9wKB4L2VCOC7AyLnbJavOiLgGezMtvk1TSx0b4CWYT6 muDcGp79TWQXzbsw8y98YiKHtpGX2RV7ZyybA0+NyZEvMgYk4yWYBUBh2j/nJeseA1K+dljfe 7emDZiLaApleKDNMWHwo0r/86J4hu1PdQh0PUDNr65XuxRVozhWNPoYbt7JePgpUm1/Qbz2qJ GEKXMu6xOrJJ+xP/8YuUQQOh9L+rUc6FCUFQsMRnmt35L79V2kg/a6yUFO3VA98of4sTwvvcn Q71q+x7w2xf/0GTPid7MPBWr5Lq9TlwZjKcSQYUvaEjFDOCyqjPXbHqwWc+PJr1TfHlqIysUU KN5Zr59PJBgQmrcMHGNFE1794d+3fabW1s8Sb2+0Ki7M2914LJ7TT3LHy5V1n9XaL9hEj5vzZ G4W63/ppYP4wLkKPN6k3xObhXRNW1hiqk9J0ngsdfcRFj+LvNlxGffUJkHkAPk1V4pXclvQH6 buXDw+Li3GpdA47WJ//rPvMYozk= Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/s390x/cpu.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.41.0 diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index eb5b65b7d3..05a4b7b299 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -38,7 +38,7 @@ #define TARGET_INSN_START_EXTRA_WORDS 2 -#define MMU_USER_IDX 0 +#define MMU_USER_IDX MMU_INDEX(0) #define S390_MAX_CPUS 248 @@ -342,10 +342,10 @@ extern const VMStateDescription vmstate_s390_cpu; #define CR14_CHANNEL_REPORT_SC 0x0000000010000000ULL /* MMU */ -#define MMU_PRIMARY_IDX 0 -#define MMU_SECONDARY_IDX 1 -#define MMU_HOME_IDX 2 -#define MMU_REAL_IDX 3 +#define MMU_PRIMARY_IDX MMU_INDEX(0) +#define MMU_SECONDARY_IDX MMU_INDEX(1) +#define MMU_HOME_IDX MMU_INDEX(2) +#define MMU_REAL_IDX MMU_INDEX(3) static inline int cpu_mmu_index(CPUS390XState *env, bool ifetch) { From patchwork Sun Aug 6 11:59:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342774 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 141FFC04E69 for ; Sun, 6 Aug 2023 12:02:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQo-0001q6-IZ; Sun, 06 Aug 2023 08:00:22 -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 1qScQg-0001eI-DW for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:16 -0400 Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005d8-CC for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323203; x=1691928003; i=deller@gmx.de; bh=wW8jWkcZw5zu6txqL6q+MBM+DZULGnKkQ9in2Fgeebg=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=iXH9rZLHv5HN7oFUVGI2Kp4r7+3CxjitN04mitupgPvPDuOfTXXRVnTxSR9PmTuul9fWaIp 3pYt+6XBDHZocwat/Pw0nV3zW0bAfW65F0FIut3EwuaKUXdr2WP8T/9L0QhiN+qA06O8VSjUR cevB3ejkh8OZWCGMnvdUqBC6oUtfurPHpjb7/ghQM2Eb+T2daFGHWWmnKvvYpDaYwnlPDpU/B yPxcnTjD6HJuKXZzB568ULO3QW1mXbrGXfc7ueCfxymsyBVWo8C4Iz7G+/C3gnjR60IWfSUKU ghId4Ii3kx9vFocZiA/E97w7dTCdm1T14yIScwRqIbiqQTPkbbwg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MNKhm-1qCkEz2h7C-00Oou9; Sun, 06 Aug 2023 14:00:03 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 12/23] target/sparc: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:50 +0200 Message-ID: <20230806120001.89130-13-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:wQ7jLaKEK4xYRLptIveYs9TL803M0bWHr4CPh0ARz14RuRga0AV R+yHBx46vI3H9po7zg/XA63KaSk2BbGpEEZrGoRsvtsa4rJtFQvQjs7htvQzJ8mLZ51DLmK D0q/l3t3bwqaF2wAZ5WQDXHmRDG6pgoNqzZQFTA6x5vt2vOIqtF8Ldcp3wYKZKnNkh0sCg7 +3/hIuccOqM+fMmnWWOcg== UI-OutboundReport: notjunk:1;M01:P0:Tr49OFnZ2+o=;9bK7mApL9UVCZn3b+ou+L33d8yq 9S8jIccV3U+rpOHuSKqShF4/4NUyscT8hDCU20AbVhBpCVf9N4a3BNWOJYguTSQac3/By0GsG 7bJ5G7r2nVoeu51DOALMKhCHv6fIsvM6BoZr7MlF2pgN6VagKdR90BwmcOPt6YPObw2ozMbdE gFKbURq4/NxYzixoRa/OY34y304egls0nOw65tuoBrUEQh6dzgbqli599U1WUqZUp/Znoncwx wlVDVLB5yniBzyhvK7IPQH3evfU9CKKSJpSibsKGMlPLSThMh35GDyq4iX2ZsUbjRdXqHwzXt RhE1GYcVjLqyXQIZqWQ0qnosRsN+shUfBsfP72BY/DLuq/WEMJZZl9BkRrkjdE4mNgnXkO1Uu 5UDwXY2PnhoDEJX+Qm3ZOUNz773MP9UWnkU3SgqG96VIz+zvUMCkScPWlJD62dm+PtU9VHrLL 6Ro8lF3rtPEzNPzhIiuoCYOqondDy+By/gbYMpf9C/5X3+gQjVwQiFOj3mHtyEJ6T0nTV+xAu 0c7y3YlI1/6HtxUp1da5iFIxc99A2zdJWCBDz+7IEQ62orATBf7cLUk6NpSH1m97ZLnIGzKIL 5HQPbfgpvDLxk4/z6MphjTRQnzLq5/o/prr0Ach0C05kjoHg7VnU1gvAWSk4XyhaejAZF4Tub 90BI2H8O42RonJpvONRqxzac5PhDayBFX6Q2fIZTfTDZRIN9G8X46N9FKKkohLxp0axwnCo// /TiSuXEbCKNDqURUWPwZ8m+B6naZ/RF7pnzkhfa4b2elXym/QyLDCUugUV2aTy/NBXEsgGodv KBqZDcIYJrIzISR/pCak2OvtKb40JMpkO5iQu8wplJ1oR7IoBiRLqWf7STQKYycKTAM0U4mii +vIeTQnAwjzo/NVbBNQwS+U7gk+TdfLHu1nYOB9M72eZ2jby4NNnUWIKuaEDldARLLKVoUgQQ dp04JbbZrm9F/xM5CKAQWJMyYaE= Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/sparc/cpu.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -- 2.41.0 diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 98044572f2..0c84033326 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -659,16 +659,16 @@ hwaddr cpu_get_phys_page_nofault(CPUSPARCState *env, target_ulong addr, /* MMU modes definitions */ #if defined (TARGET_SPARC64) -#define MMU_USER_IDX 0 -#define MMU_USER_SECONDARY_IDX 1 -#define MMU_KERNEL_IDX 2 -#define MMU_KERNEL_SECONDARY_IDX 3 -#define MMU_NUCLEUS_IDX 4 -#define MMU_PHYS_IDX 5 +#define MMU_USER_IDX MMU_INDEX(0) +#define MMU_USER_SECONDARY_IDX MMU_INDEX(1) +#define MMU_KERNEL_IDX MMU_INDEX(2) +#define MMU_KERNEL_SECONDARY_IDX MMU_INDEX(3) +#define MMU_NUCLEUS_IDX MMU_INDEX(4) +#define MMU_PHYS_IDX MMU_INDEX(5) #else -#define MMU_USER_IDX 0 -#define MMU_KERNEL_IDX 1 -#define MMU_PHYS_IDX 2 +#define MMU_USER_IDX MMU_INDEX(0) +#define MMU_KERNEL_IDX MMU_INDEX(1) +#define MMU_PHYS_IDX MMU_INDEX(2) #endif #if defined (TARGET_SPARC64) @@ -701,7 +701,7 @@ static inline int cpu_mmu_index(CPUSPARCState *env, bool ifetch) if ((env->mmuregs[0] & MMU_E) == 0) { /* MMU disabled */ return MMU_PHYS_IDX; } else { - return env->psrs; + return MMU_INDEX(env->psrs); } #else /* IMMU or DMMU disabled. */ From patchwork Sun Aug 6 11:59:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342781 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A01A0C001DF for ; Sun, 6 Aug 2023 12:02:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQj-0001j9-GZ; Sun, 06 Aug 2023 08:00:17 -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 1qScQc-0001aN-Q8 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:10 -0400 Received: from mout.gmx.net ([212.227.17.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005dF-9i for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323203; x=1691928003; i=deller@gmx.de; bh=QJYh3cUm2UBmMLn1LmBThaRIWm8idLzbefeI9YOYT5w=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=jQUmlLa9BEIqmdrtuelVrXaTQ8v29TC3iA4hv6lPOPdlBzMbMOeXK6caFmJDDmUh7wi1xBV 9qAGpsVbxHLiDlmLRHJIobAJWjPNl3jU6EP5tVG5fvPKrtBSk1rAGLsyOoZKkP/3KVYNEJ20e N/F1GWx3ZPbxo3Z8t/daEte5kauWA8necCRDqlLrT2DiR1rN2ei9TQ09i5q7TXzDUhW7r1BG8 hcm36KREUp0WkFLgIEB5KHaiZTtnkXx54/AVHzLYmDOGUoe6f+qCdyX4eV01qYE/5/VjtHJxu ivq9bwcmPXEoOG1VUtVzoGYK+zfAl6AuMjz2w2uqgT8UeHuAUdmA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Msq24-1pZXrv38a8-00tDiF; Sun, 06 Aug 2023 14:00:03 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 13/23] target/xtensa: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:51 +0200 Message-ID: <20230806120001.89130-14-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:BzCdwywk91Q5Y62CtEqaHYBWanWweenkIZz+0FiKrb7eXzFcCCj TCl4S6BCeTHPGBp9i0FGpdTLgOJiJzQTzsy3tk45gN2xXHDcJ38UZ4Hyi4qEkIYrBRr6qVH pVdOARkuBKOHL/TDZkzSQ/fHTKTJeNuz/ck7XNgQLGXgk5TicTEdYJq5Z6aHhELmvvNm5/8 DZsws6zWuQHe6XjYupHNA== UI-OutboundReport: notjunk:1;M01:P0:Jii9YYQ1buY=;JD3zC7VLG4qRgHRwuP7vEiu4k8R 7UcLuNwqSHQZ889xZNj4MNT5hR1gNIjwTBHILdwRUPS7fAlU7geiJc6aiS1bRbuPN3Je+gwjG z8YxmO9cnBwVYRkF0gQDtrruqQ9qw2+FggvLCngushXKHFvmRkdTcKu+BwWCVh3eSo773aWMc t8nhI+9SJ8tR+sK1shCwglhX7z3xswEMkmoV8mom6qKnrHKSokenWXqpsitp1i2jOgnWGpAea QRFpnp0KoSkzK82oOokUum7j+NAS8rywBQPJwrGBv55D8Dr+DuUOsZSiyoN+33p+tvIg4HUqz XE3Wh80Me2l0HojxQ0z/sPH9seCX1Ccq6WyOvSvG+HvcbAi34qaLFqHAejnX6snMbwa6w2qP7 Q3UjtR0l26aFaQhEDxvxVhlcqSf1IufGqwRITHJYEWJ7Whgwzj/mWnCszZoBwxOAWr4pICC0V +JWFBdbrGRudYB15T18lBrAgP94ScXuXEgeRM0A5lDC9MnqA4PrscNUmPdQUcicHQDcDztNHj 6jT19OHvzaFrO9OXzeJQduQKfKTMEuaFbOC1c3KRekZjVkYEYonMtXqDzUz05LPXsL3w9vA3S qO7tNmA+dTiUznYhaXdFXGX9sD/75mqoSjR2BfrHcptGnvO0aM/Qs5Gf2XTkjF8/W8qV5ZS+I rEw+n2qEXglgtPcYMRQX2gwylO6ETaFB+fvxrD5Gg5ymYJGKkhDC0ZfbW66FENHQOKL+hib1K yWwsMcrqZ7zzSpj33clw9cmH9ZV3OLWgoPH4a44W7lcYi0DrZQYd1mzmDXN25FComtWXcbeNH Z9NfQhcK9VMvVZ5UoRMeJgfFpxiHih7CAOkoUcY9ZGdm9SufK0nntwNQRPs/+59uhe4HeidO2 zrGnkXOxJsBAQ/rJxW0pLqkFr1hKRKkQBeIlD/iq6rOrir4q/tw7aS5wKijdJF0czTjIq2zA9 HGUDhlLFXVqzHd6vE3qRLktVVak= Received-SPF: pass client-ip=212.227.17.21; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/xtensa/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.41.0 diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 87fe992ba6..2f1349b13d 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -699,11 +699,11 @@ static inline uint32_t xtensa_replicate_windowstart(CPUXtensaState *env) } /* MMU modes definitions */ -#define MMU_USER_IDX 3 +#define MMU_USER_IDX MMU_INDEX(3) static inline int cpu_mmu_index(CPUXtensaState *env, bool ifetch) { - return xtensa_get_cring(env); + return MMU_INDEX(xtensa_get_cring(env)); } #define XTENSA_TBFLAG_RING_MASK 0x3 From patchwork Sun Aug 6 11:59:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342772 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ABF52C0015E for ; Sun, 6 Aug 2023 12:02:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQm-0001lj-70; Sun, 06 Aug 2023 08:00:20 -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 1qScQd-0001as-T4 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:11 -0400 Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005dJ-CT for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323204; x=1691928004; i=deller@gmx.de; bh=dY+5pD/7yMidI4e6vPgNceRyHJY15FbDamoy1ip1+Fo=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=g5IeORZVvc0NwS+cjX+FPZieftlO633vzsdwCevigu5jv0dN/SowQXj+7AVZR190KzuR3g7 CNLVVQdSDNkYDsOsz1dJTvq/a3taquDcP+NLXX2awrdmB+4UcNLE+A+5PqGVqJ77Nr+Om+N5m s4D8Sylcl0yLY19Z4pTdh0D2QJdIgvGJX8J0IBJWKXFjZi5EhTFYzusyLA4vkX4dRWeNu0fXH 6/h2m8X0LMgAFdGBkQwX1AvSDZQGTcHzdnnu3duHw/bD5hdhGxzEYGSVF2/pvXWPCe7zthkov cRUdNO8jv93JKYa6PrpUOvQTu5Jk7eerselrc+B1EkUDDSJlwVeQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MvbBu-1pa6dB3Xgk-00sgY9; Sun, 06 Aug 2023 14:00:03 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 14/23] target/arm: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:52 +0200 Message-ID: <20230806120001.89130-15-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:hfwSN9aXPfGJCMMATesmwWupFT/hDjzris0yWPoggr2NzV13swc oT5Nf5sLML3fGhyJvWwDY4/PBOpIuN/RgkW2WXZFkskJY25KnRrTOQvpXPpQAcEuf5Jb0jA STbPJoJZZjmB+I+6eZKO3ih3EbQxgi/RYHEc4Hfz/fsOXwbgkyWjtQrY7TuK5gfzAFjgaOo 7/D73YWCaUhlYOgZmqlRg== UI-OutboundReport: notjunk:1;M01:P0:Df0Y5LGg0iU=;D5guD7iv56YoHnSeCH18aYn4bSJ 1zDMoEH780lxaUp4376l4b/PV8ec4H0PV+P9S3apaCrXPKp9QBLb5KZ8UsQvY1Ol59vTPZkPF zXHx/GNQfECo/CjpjnD0T/U+h31m6iNSVksHnftxmCRdDenjghlanuzukDhNZAQXwpiuVkVxP IHpJiduz2/5Shm8MGNIVQkRMNEswf513hNr5cn6x6HSR6IzyUXd2TcucPzX9Ez8lnNX8iFvs7 uxFhtqGxiDiyidKo0At/1uYvN73Fk80vV9Sc3TFLZzxlhvjK8GaahlfKSAL25xTpYmcbvfxuj wmwfb6G520YQYELR2Nl7gFlVjm0aG+SRa38C3hfCg1YBW1e2CoWa6iPT0F6EuZaozeXhJzATh 8TN+he2KPFGGixZjKWKgfP4tONHhab3T869Fk93bAVmp1vqf5CecyzEyjAqup5REUPzr41JuO 6BpurkCwUHgr8gj8UHzuIry9w0uoTGfRXRST1ZUiZywSxwFYkj0fXyz51PMjwinu82WAsp0gL ZIS1UVfPjXLS30dVQaP3A+p5eGhQfqgHaukxE5sGJ5Xlx2JlHY7UVAUb2OkhzGfcpM623UteU 5lwBDaMpBFaGphVE6nmDxzUoCFFh/JU1NKRxPquQdF4gdJsW8TrHBM/wsQIVPfe9WCxUFiz05 wU2ZSvE5UMXd8PZk28amI5bzwQZ0+ObpaOUxWG/d4ex5D2MWWBTArNEAAyadsXOaILR+8iDcV uIpwTa0WuOSHrUJ6aip3vNDkbebNfZSgxoA2hFf60TU1bPlIaC0uTcNTeXDEIYmIwch2FZgZb wLXA6mZdl0eU08o3UHLd6uOOK5zIPAzfteo1aiOj7QP8++oz4r35KuZRx+fLg2mW7XoUJyX3P +HdRl5FqbtMGBT7xq7P/PYzlbVyFoCA32f5zUlQ6oVo8ymAtPq29Yb1BfE7g/aA12QCxmqKkA TFhBwNl0QhJ7VD8CY2n57hA0TNM= Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/arm/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.41.0 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 88e5accda6..16e18fb22a 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2930,7 +2930,7 @@ typedef enum ARMMMUIdxBit { #undef TO_CORE_BIT -#define MMU_USER_IDX 0 +#define MMU_USER_IDX MMU_INDEX(0) /* Indexes used when registering address spaces with cpu_address_space_init */ typedef enum ARMASIdx { @@ -3166,7 +3166,7 @@ FIELD(TBFLAG_A64, NAA, 30, 1) */ static inline int cpu_mmu_index(CPUARMState *env, bool ifetch) { - return EX_TBFLAG_ANY(env->hflags, MMUIDX); + return MMU_INDEX(EX_TBFLAG_ANY(env->hflags, MMUIDX)); } /** From patchwork Sun Aug 6 11:59:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB69DC0015E for ; Sun, 6 Aug 2023 12:01:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQo-0001pR-20; Sun, 06 Aug 2023 08:00:22 -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 1qScQf-0001eF-LS for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:16 -0400 Received: from mout.gmx.net ([212.227.17.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005dM-CU for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323204; x=1691928004; i=deller@gmx.de; bh=ssg8jQPKMpMEyj4XWfdcML4VNlGF+SIF4/0Fv2zswF4=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=B6MQyZ0tGx09DgUY/tgX5zN6FRKgqRr++4B5LvzMTpXdjxfrLDtBXwbSyLYjDA5aHGptzAv rHQt4A1D7kWp9181YBNO8uWorHFT+DSWx1R3lhwbJCWhvNT3theDnTKxmkZKF/+S/KgaCg8Rc 2ICsXZE2ZbxErwZTySnXCdoE3LQPIwZWiAHB4nDWg2YwhBExGDGf7k3VRKokwyTFUKd6Vphcs XH+WwwedY9idu2+udIvudVPZAu1XzJcBVK97mpSYusLsO2FARdjaqX3HEoA8k0ebXzTDyBU3i jT3orjiiG3MLkOH0mFQzYJp7UZZ7squr97qS8uOTTOPkFfzEMPnQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MgvvJ-1pu7Ys3vJt-00hJUk; Sun, 06 Aug 2023 14:00:03 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 15/23] target/cris: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:53 +0200 Message-ID: <20230806120001.89130-16-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:8q1YF7nWrwaGms2ttrklD1E/uamDN8KeF+w5LCeKpj2Qo0Zs4iG Xzp+nV9zjzuWyaeiwKfDdEYYB6zsez0NwgNRBGLIuHJvJLr76hcXKv/dbxrI40fRP57R/+8 L59ymf0ZXJ9IiVu/Uceb125t5L3zP02x0fQYzO45RyK5+ZfogNDTvf4SgiYJEfokCNZWVi1 U/evUlUg1f8T4Kay9MNmQ== UI-OutboundReport: notjunk:1;M01:P0:6uLFHju5jSA=;J6216/BIUYTbrUy11UFx2Qaw5Fv 64VSXCPXRDiFaOQoJcT/rlOrctGZ6idPfInQYVyFg1Hg1hEwyZRmWvWbftmQaAwAI0Cfbq8Mo 41OT8ZUEDhf9t2cNSv5dDnoiNyC2uO3htAovAeeu6wPqzzCoSsF/JDhoNirdwEn91sRYh21ot 8eYRWBqmygPmN0MiejKFQvw6XCmmYwV/G1yq4nHcb4MplUM8m4synmgWO831YwA17vk6a6drx 3Km7OPfS5qNhBHIHn50dTrPF4rJ1ZmfR6Pl/xcefIMIKWL2j0uAarKdgSNYhTrNp1O+bZpDQg LZbkf7egdD+/YrRO1Kqbpka5wwsJM22l8w2aE72g2BP1ZCERA4He666jxd0uFqzjQxXwsgr2+ sSl/OMa6LDzThLMieUCFJ9vNwVP506genymmDCdhJr12WkIosFwhXeAEKDMdnon/7D//gojT3 ANLKBidbWOz+r9NskQ2HrZCbzYhdgXRmOk5DKj7kATly9CcaHiqA/epef9++52JX95NC+82AM jZSsHdbr+sZELU+v1PK7Oubw4rtwHubTpEzZCXKsa89TygX3wS5Ea3RYUjBtoaLa4pk9YeqiE bBZiEqufSPuT2UTrOEQv/X7Gld7y4qYjXnuH+EDj5bsKUy0aFpaxg2BNAjD3io+SE08iTBV02 GFy3PqNQwilOJIZ0TzQdgOOlEtRNewh+zwXF7G1BGZYwcPj0IBAJmt3sLwMxWGilkGGdQQ67M xk0M/aJF4evfS/ZKc/l30gTRaKu/pvcPQuOTf6OEmZDSzSgaU5090rzmUZM4fdxoTAbP8DR7M vRYjg63hPz7dFUEo1ku50F9G5P9s7sNs+y2sUgJf5gdjyMRyWomta+RYQGPdATaA2NkPwOTMm rUsGQru25xpXiSjVxHziSpNfhd+Cq0d7opGjU9FSFGbolKPV8evwSzLmu0TMRzBOsWPpj/WbB 6aCduA4+kixYQ3FC1IX2BXFqaBE= Received-SPF: pass client-ip=212.227.17.21; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/cris/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.41.0 diff --git a/target/cris/cpu.h b/target/cris/cpu.h index 8e37c6e50d..4064a16564 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -248,10 +248,10 @@ enum { #define CPU_RESOLVING_TYPE TYPE_CRIS_CPU /* MMU modes definitions */ -#define MMU_USER_IDX 1 +#define MMU_USER_IDX MMU_INDEX(1) static inline int cpu_mmu_index (CPUCRISState *env, bool ifetch) { - return !!(env->pregs[PR_CCS] & U_FLAG); + return MMU_INDEX(!!(env->pregs[PR_CCS] & U_FLAG)); } /* Support function regs. */ From patchwork Sun Aug 6 11:59:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C26F6C41513 for ; Sun, 6 Aug 2023 12:02:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQo-0001qb-UY; Sun, 06 Aug 2023 08:00:22 -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 1qScQg-0001eK-EN for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:16 -0400 Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQZ-0005de-37 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323204; x=1691928004; i=deller@gmx.de; bh=3j4/JtDPN66a0Jgkn0LY3i4AonLjxhCnzA3yeQjEfvM=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=mUQiaCQHqFzcp4gQJzpKKD63gpFpAworEhazTF5/lwkhaUOXaSijIJdxJQGKemWHu7DAaV4 yNsCAQQDkSnC8wr7ThUym1lvsZCyzzKsNOg/hUhlGNxVM67+9z5BCa0/G9Bd7Cd1NM47cSPTy Tq9zLp0LMbteVXahQULwZdaJWRDtDqwNzn82lZ6bmtYvT+ijxJqsPFMso6+erjMWkXG2uYH4m G9G30NsBbtRavgxDsiC/YRIAJx2IrKsBoESH868a/kP4nv+w7vp3oezMlD5W7BeNQ0iuhjGBv B+1Itii6xG91itpoK9RbrZKdwx2FUp6KgWitQCOiMWhiZyHHasRw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N1Obb-1phYEB06Jv-012sc4; Sun, 06 Aug 2023 14:00:04 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 16/23] target/m68k: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:54 +0200 Message-ID: <20230806120001.89130-17-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:ure0po7oEoivTpbyorsAU3uXPs7qQ+wips6/T9Vk4nHU1eCNunS T481lqF5G5LZi2UUkjfF2385FDqEUJwwDv9fMsdZhEQqjdYelcLfSqrThMQVVubu/uSnqce 6up5HWKfYH5Cu9wFi/akKRSNMkl+kk9Zoq3FoxrJRvT6sTHbDIyUp9JtF6epcg/JDuMh724 KanYmqPxdgchIR5KGM2WQ== UI-OutboundReport: notjunk:1;M01:P0:9fEa5cKdTzI=;uULf3MJ0QKyIxm61mSIushwyBAJ Uf9eQqX+x18bqzuAnONkZu//0JyBUjGyu2yE9Gzo2GjM0CGWgBFO4O9RFpMPR0r/n3hasXTqe l2UYLTls5sRetnB9ABppb3rR9t+eqDv23IR7KuKp2IiyKhBO1L/a/Zqa8eR9tw4lRDK2dQa+R ccxhLUk6P7+njsyTIaHgi+UStYna+t+o7+zyXXTGmNPh2qC2nLhGIpPZab6mqhnslRTflxaSF pr2sw6BbWND6jb+w7e711vRjVKNTNAa1kagqqbrrsLFMc1n5sJrFcsHffBJ2jn0623JTouz3q VjZKForWN/oiltt+H7E3Pj2In7JOdnlj6OZbMBf7WmKYGxiLbqrcV/YzGVyy0jwsUQRVhX3lf 5yhvAcjoneO/X4/OktEVFqiaB6pF48T9wyVWbL3SbxtoE8vQw8AOIvJFt1L81Jj7mUFv/r6ZW KvkY5hPluwhTNrkIw9nPnVY5Tpj/GoASGWcAU/jGgE3AJrz1aR4Xt44QHESN5r2GAgx5nkknA dwm6LuKbrXhbuqhc4wZ9g4WcQofmywubrZfqI4O/lZOvKIVv+mSyNluvAVgzcB0Jnm5yug4RN tFKWmcXZtuncwA7SDFYa7e0ylg4WgLGtCUdg+pHbX3iGyaUxs5kRmJH1eieuOq8mzGcGVGGAD 9PJ28ltR4YE5kNeHLChe72N0u4qA/zf9hwXr8H2x5+wSRWoTAKLN8lkoiMR2t4AiDNyZkF54J oPpgXq2QQd07rSvtLlMy8TyjdfZ7PSbHn1SvB5VrzIFEYqo9yUSPLztVYKw4bscZpwn/Hv9vb ka2skN3E3CR83AR0Dky2J9h1X4b7p9uuYoXhBIBmABuZ3SHubMeOtOzaEL1pR0Iz7zBDo1mSx 9WL3E4Dv8ENOp8g2GGrJv079Wk8Cd/kPr5E1p3fjalvkfukT1bM7NnMqj3kWtWZME+DZ2WpuN 67fD8du7zQkmWpQ9xyOprqTGb7A= Received-SPF: pass client-ip=212.227.17.22; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/m68k/cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.41.0 diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index cf70282717..8321868506 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -571,11 +571,11 @@ enum { #define cpu_list m68k_cpu_list /* MMU modes definitions */ -#define MMU_KERNEL_IDX 0 -#define MMU_USER_IDX 1 +#define MMU_KERNEL_IDX MMU_INDEX(0) +#define MMU_USER_IDX MMU_INDEX(1) static inline int cpu_mmu_index (CPUM68KState *env, bool ifetch) { - return (env->sr & SR_S) == 0 ? 1 : 0; + return (env->sr & SR_S) == 0 ? MMU_USER_IDX : MMU_KERNEL_IDX; } bool m68k_cpu_tlb_fill(CPUState *cs, vaddr address, int size, From patchwork Sun Aug 6 11:59:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342770 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D4DA1C0015E for ; Sun, 6 Aug 2023 12:01:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQq-0001vf-9v; Sun, 06 Aug 2023 08:00:24 -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 1qScQg-0001eJ-E7 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:16 -0400 Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQY-0005db-Ut for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323204; x=1691928004; i=deller@gmx.de; bh=wH2Q5j3lm9FpTw8t3B3OJcOs4tm1iK2Y28uQcRF84Mw=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=Z2jFeqmrIHRW49lJfLAq2aO9Dvu/8OCsftRwE44jZw0A54KhkSHm/2mG4Pqc69aCADe00R9 9dPREj8X12SXNjKP3Asg/L0cSWBnoBLhk7XYk7W9/w1tS3s5UuWzhYhyPSUFcmZw9I9qUXIjN MT39yzpmb3C+wG/F3nE3zxViqKRFRocX2vWs4c56K4vtUFIsqv1rMYIWTvq9cg+ZSB6i0lv3k lYXkUXZqRRXjKm0KXAhJ/ETFDqDhMJakU9EqLe/1wrWNRuvx8Cu/DyBIxFNL0r8B5jutDhHEU YJSxHYAtC1shmH1DvBfynlEnFT0ekJCIUH+j7InuQFV9/O6gU8Zg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M9o21-1qVfEX0VVN-005mt4; Sun, 06 Aug 2023 14:00:04 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 17/23] target/microblaze: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:55 +0200 Message-ID: <20230806120001.89130-18-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:yF1nDvDINr+/oRmPhvXKx+MbOD6OR8K01/wWLt0sw/aVPADBU0v GzHGQ+DqtsshVJ9uxwQwj0foYYT30TKzzzwtCai0W7XOj0NXkG7BokmEyKtMk7ixrgETUTA OVIqNO6cB54U0SQv/GOR049nDfd+E/Ig+lxDL8IrzMVSlFhHyjMbOMqSK+2Y4dgaxsce0Ao 6p1scHRn9oFU3Coeb1cVA== UI-OutboundReport: notjunk:1;M01:P0:1WdmIPtJ2PM=;9r+w0VCuXKG/djTAGMLdvr1Kf1S KHr46frD3FIFOjY+rn2NivJoEMQkWhfgrSJXk+/3B/eWAYQWelNJdwowqAeIOnXwdAhUJD5QL gBkfMUOg9r1INuWAFre9SLZa2TQpQIJxKpR2HzQhwnzvSCcDKaFyw4XLQ3M9btSgi3NsMc7bT PRFVjW0N4k8yGuEIGPSQ+bxEw2VegW31OGLtIYkQNKsAivsjnJhpQMmPblUhOH/YipsJki5qw 55/046UDi73cSOz+Waw7JE+SVCuv0RsXz+zSDI894bil+g8OXCVgSiiBHe5QdF5ISc9EvHQhx 2go8sJTsUGyMSzhBVk525ZH+ACngPZkWjCWxryvre2mS3v8ykGX7HVkrmzt29iP5Witx+r3O1 08qH8RkXIZf+kt7py+j4pb4eNBBSqvSxUORYkahN8+3fJfHmHTRDjO54uagHECCo9R0FiNT3A xWB8lOZxj+797DifNd6z9xq1W5WplMNJa0XnpFMC5Zq1D1AH2nemG4YRiDLrfSckqdRkhJ2Gn ngLj7lz9D8J1TPNVJYLyrJxxXorNYBrGUeezXY1kDCtbf8QFsxzEkW4xoEdz++WqlN9j8GXfo iMqLVwo/5TKBcAeUc91hJu5YkBuCUoPXsw3jLOfBuWL8xGlwdEJhI++SdAIdvouIwZzIfmObz M+4TO0vJ1idtaWQ7L8gRv/ucPTunQ2g2M78dCLKl5VroNTGvOABR/AMjR2MJm7bSaM2HlwIfu dCZV9rOsfK1sdArM9ff+YoP6KHo9zYPjM3UnFAzz7MqQW5rK5MYjkDcfZQgUUbpLjxkiF1nS9 iZDJ9jxHFMPpSQf/Pgy7mplc1eTN69MdOJwdTI2+zPZOfQslz18tKqhfCi0G/C1PytaLVn6Bj ezsmvMU7OUwyTZJPHBmUxZbrN9D9ge8MSjy/Ol0GvPR8eIZst8YT+OhcDj/WcTI6jcZCYcv0W J8fwqJ6BnmsOvOR0te9H8Ay/+0s= Received-SPF: pass client-ip=212.227.17.20; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/microblaze/cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.41.0 diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index f6cab6ce19..eed0d1d8ad 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -394,9 +394,9 @@ void mb_tcg_init(void); #define CPU_RESOLVING_TYPE TYPE_MICROBLAZE_CPU /* MMU modes definitions */ -#define MMU_NOMMU_IDX 0 -#define MMU_KERNEL_IDX 1 -#define MMU_USER_IDX 2 +#define MMU_NOMMU_IDX MMU_INDEX(0) +#define MMU_KERNEL_IDX MMU_INDEX(1) +#define MMU_USER_IDX MMU_INDEX(2) /* See NB_MMU_MODES in cpu-defs.h. */ #include "exec/cpu-all.h" From patchwork Sun Aug 6 11:59:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64138C0015E for ; Sun, 6 Aug 2023 12:02:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQm-0001lh-6O; Sun, 06 Aug 2023 08:00:20 -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 1qScQg-0001eM-R3 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:16 -0400 Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQZ-0005dm-9f for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323204; x=1691928004; i=deller@gmx.de; bh=AAhlFKdhCBg0rP4mi0eaKNbjFV2RubxTJe69zIRETsY=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=TBl9TO+aNjsa6htxDzlOSLeoHKgxmuzvt2GLYClistcfhwHvJ1g5XisJlM2bsa8MXGYKUtX G2Q8npeDEzz4HeTdieHxzlLJMvu3JFQ+gl8tieLX8RDGI14tmGl2rYBJzTXSWpeD30kweGXm0 oVDtzLAb4Bd4PQaGeL/kvcnYiK8FXQ32GDpk7LsJm9P/7CzapXLcEz63q2BxqD9GMRO7w/dI3 05U/Uc6sOFIa5IksM9uAqeKnPb+qtHS/eSKZ+dGhZPoM6P5oWz5fI8ZRxHbBpU4m0Nvk8RQg0 swWO9OemtXXDUjHea5v7DAptT3G5xn21+nxEbTO1WATBcDRYieOQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MsYux-1pYiWV0val-00u2vQ; Sun, 06 Aug 2023 14:00:04 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 18/23] target/m68k: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:56 +0200 Message-ID: <20230806120001.89130-19-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:IaRb577QcAhFb1FCi1kCy/K8OVeUGIPObwR4Cn3lWMn/M8XzHeU 3PbGvjfbJEErTJlSkz29wQrmz6Hng9zp97hNYGMRn3ANpJqFbwGdz4hXnY2ONQ8VTqdoGVo lV3kVVvvgEWRITqWT4oHEsoXVfEZLo8dtKJC+72TfdthUKnpz16Bvblt6AG5LtpSCR8Ozqs psoxRCxYTGL6gXj3lJrZg== UI-OutboundReport: notjunk:1;M01:P0:kvjfawt7yvE=;XHX9ly1NNUqO7eoeltL1lyWkppb JP5Z3nI9gDl0GE2VATqeEOYL0qt+uGzYTMv61ACujwWG3BMHqKTs9KFckeGBDgAJ9AutXSs3K d+9T4Olz4qSJbiKSwAUw70tMgBZeUE5Nm8oXBcOXtytLLMFDBL77BpSwUJjsy6IRJMld7IW3P YE0rmZuSIq/OodRV3+/L/wOQRMQjPn6n0kTOsNOEruAWBl2ht5kCDXhSLaBRCJ9C1bu9y424I OSGu44Rsrif5aKOaD7YyW5+xM+mkfu7aN5TgidFS8tIj0ki91tA8ONPVWyw546TLr/yo/KjYb WQLFqB1vrC7fYR+i4f2gS8m9k4RsyRQphFkg2h8eHD8aCzU04Q0KVbKZyMQVNEIcWSsSyvV2P gvPYQiOlyZqtRrSAeLL+WLdJiaG1waAUZSWTcR1hgIsUhPZJXRFzZ/+HCaK2QoLD9uCxiUDzR p3x5D1ihVFpo3WWinkHnx9RB6X0gCQdxMvwdRgCpcimyazjoF9a0Iv5YvAlJub9PB7EQAb+uS KxfGU56OxlJzmN21ziWl0G45qtScFDe0gKuXvXNyPozsaMknrGunFkkFT6R3Q7LZ0MFY4LdXx kiTvFNMc7+ytlsc+hVRZR7F2Mj448CBEmtobuk0e+oe8a2c6NXspLnwu+dKw0rcWg+mSjdCN7 e6Mg7nmbbUKmWm7f5nVZtXWgYmxQDgB5RP2awuy3U064phpVONZQTBAe6Oc+v8ScUt5D2u+G0 TgFfe/ko31MOF+Ub7P3zaP6VZUQHzaKv6+jYm7G/l6jnXXCT+3rJYX6PFyL/+7RdlQIKd7RUq SAcIeoQYcy+3dkl3dwPVH+7ZzRrPwiMAVwIxnh0IHi+tFWKZoJj+HVwNtYWaj0kD2e2cAMXvr 9p8GscdUuZ6Xep70ksLB7isxg0IS9HZZEwb2LcV3Xr+PIsRFohEa3TTPFVLxCF06uTFr8tuTd RjLPJUsBz3WTv0eWB9+4W4YuRTE= Received-SPF: pass client-ip=212.227.17.22; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/nios2/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.41.0 diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 477a3161fd..77f9e3803e 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -277,8 +277,8 @@ void do_nios2_semihosting(CPUNios2State *env); #define CPU_SAVE_VERSION 1 /* MMU modes definitions */ -#define MMU_SUPERVISOR_IDX 0 -#define MMU_USER_IDX 1 +#define MMU_SUPERVISOR_IDX MMU_INDEX(0) +#define MMU_USER_IDX MMU_INDEX(1) static inline int cpu_mmu_index(CPUNios2State *env, bool ifetch) { From patchwork Sun Aug 6 11:59:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342785 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1F936C001DF for ; Sun, 6 Aug 2023 12:04:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScQl-0001kR-0T; Sun, 06 Aug 2023 08:00:19 -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 1qScQg-0001eL-HI for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:16 -0400 Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScQZ-0005dq-B8 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:00:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691323204; x=1691928004; i=deller@gmx.de; bh=Oh0k3yvvWbtkEZ2WV4849UsfR6Tag1RdVubVNLc9CMY=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=mngojv5m9Nkv2Uv3waKumXEOBnPU0SS3k4+XwLt0TqaVRT51bfRjNz5xAp8Q5EA7xRIO82o YdtmAxH+fKlZruvS4azRv9WJPkTcE9IS/EDEQk90rzO02emfzctUQJ5Nq4QU9T2+c3zOSQdO1 cb0cbTfdClw0d5/shbwS907qgcRua2s/tMmsvFK7dpsZDXqjnQI/lJQOzuMQosH91v0fIgKBi 0lgVMSq57OKocRfIwDS2kemfaXKuyFKQIjxLPjVCyhDLqJmTEt4/BLuttWWd+WtQMKYIw06FQ 9kjCw80xDy0TFUOD8by+ZyXT0TXP41ysa5Jc7Y+eEIyu1Qbi/ecQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MC34X-1qXsAD1Jev-00CQic; Sun, 06 Aug 2023 14:00:04 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH 19/23] target/ppc: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 13:59:57 +0200 Message-ID: <20230806120001.89130-20-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806120001.89130-1-deller@gmx.de> References: <20230806120001.89130-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:WGlDk8V2Vl+GK3F9ymgQhMv7+T0+qT2ei4ZNiughiez+BCcAJdz 2hpt24bQ488YbbI/zIRPflPlfr6yfOvWPbU+TDv3KqApFj1Z0kfc9S2/hA//eFYiXk/njF+ 5wIvHGVS/YLr8R3p9ksQDgtkHAUwfCP1o1Dbgh7CvTqCWQaS+ZemJTy0wuI2cKYlVqhk1Ph gQGEEOoIoO7i82BMsJ7oA== UI-OutboundReport: notjunk:1;M01:P0:APCimso2qnU=;8YpGPdMe95HKUkogpC6kN4DEwqi Dqo6+fajRS43BBMu/kB/fUkpYdY2eC3D4KQ/aykFyZj7em4uzm9YjVW9GTA+RvuwZf0DinVDn SuKsF83IPg+OKazPn2FueBkUeHizy/ssb9THZeFoFx9jjD4PAAUEUNmMpqbBQfk6u3+b2NeVf dlEl4uzG6icKHCufn+vjhryteLQUuFyBFyPlp/h+Qd4sMXSJfU27dxnDjqOgqjlXwcJYHxESG b69yvUrfrrxROdy6rsoiVI2VIFUC9RS1Tn+1o8PwTqKgr79bZ5aUMXZuc6JS8jUkchD6MVc86 4ninMbpKpDSf9tkJerdVkeiqsBbsHa4XD1HCrwiB0hqx9W3h1z1bCpLGsHVwWzNPS/PgCTsKG Vmd/mOrryBk2h2tLbKLBBhaILC6gXkPSz2Yt0skdU3FSe/OVLhGXK/S9WA7MDUx6ocmbPXGFu +8Sm41b1ygwS41ZfvzAlR2J8Q2o/zvwJvNX0wkwOWuWjHDDR6d976creQAx2QazEQLUeFsejQ OGB2mlzVk0+cQ7EDW6n3jAhKshidMI/VaONWnEUxvj+wktXWfXmy/Vns4KRE8TQOh7RgH8utJ yrnQ1NRqrxLZIU5W9aqDAV+fXGfB+47NCn/4uiVnRJ1W8+vhWC/chpZOF9fNS8ftNZ8stHjOu PmQCjLJ2EhUfYQsb3jO9q0MkHOOdhILW8OX6yFQtL7eTA4XVdGFyS+950JISzetJAIpQHZHa9 vmfhwezhCA9GK/o4XAH7qtNe18ex3hDnGy+d+PH/H04C/CHPShEyMxODLyHY3UyBFd6t3qqMz fMiOxN3QTDOjRy0o9W8+4BiHWXPoes/EUceKPFnh0K5bpGGB4vjt4x/npoDfDTxOb7b5MfdSo p9WM2wvJEatcS95h7ca/+Bk+KFs01JXjiwmy2mHAmLksXUytLwsFCfMdn3uuciksr+m6zN6X0 RXwaTw== Received-SPF: pass client-ip=212.227.17.22; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Use the new MMU_INDEX() helper to specify the index of the CPUTLB which should be used. Additionally, in a follow-up patch this helper allows then to optimize the tcg code generation. Signed-off-by: Helge Deller --- target/ppc/cpu.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.41.0 diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 25fac9577a..dfd9ba2518 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1474,13 +1474,14 @@ int ppc_dcr_write(ppc_dcr_t *dcr_env, int dcrn, uint32_t val); #define cpu_list ppc_cpu_list /* MMU modes definitions */ -#define MMU_USER_IDX 0 +#define MMU_USER_IDX MMU_INDEX(0) static inline int cpu_mmu_index(CPUPPCState *env, bool ifetch) { #ifdef CONFIG_USER_ONLY return MMU_USER_IDX; #else - return (env->hflags >> (ifetch ? HFLAGS_IMMU_IDX : HFLAGS_DMMU_IDX)) & 7; + int idx = (env->hflags >> (ifetch ? HFLAGS_IMMU_IDX : HFLAGS_DMMU_IDX)) & 7; + return MMU_INDEX(idx); #endif }