From patchwork Sun Aug 6 12:17:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342834 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 1C304C04A94 for ; Sun, 6 Aug 2023 12:20:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchZ-0000Ex-2L; Sun, 06 Aug 2023 08:17:41 -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 1qSchX-0000CY-1Q for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:39 -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 1qSchT-0001ma-Bj for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324253; x=1691929053; i=deller@gmx.de; bh=+zCUxCVvReasse/M3JApczVrlfmNzUS1j4j2/1ouZbE=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=hAtyWiO6c7ri0b/Qk0lZFTffiHk7LbO3asY1OPtUKK5P4E+/BGLQ/QmTr27NedTfjB+0Wbl VgAQvojDI35B1nel88YFvVzDjv+hFU2fDTCtdgKAh/4Ssw4T8PK1rG3czVsOogoZbZ33QxrOs WsVuZ90UmtkoFp77751tFgMRsYUuM4eMBb/90jAPQNm//XQED/1aUiyuRvJinuYsYmFqWaSHi lUH7dxKDLD/RW1Zn+wsSj0XhvcBxywEqrP0JnjtXcL0yGd6UDWF4vgP6LwJzhET4ccmkNHycd 6RA4x4AWxv1Jy1sry/WzBsL6iLmq8D0xWiGUpJ2zNULMK4wd8zjw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MTRQq-1qGc890KPE-00TkI0; Sun, 06 Aug 2023 14:17:33 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 01/23] cpu-defs.h; Add MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:10 +0200 Message-ID: <20230806121732.91853-2-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:ZP7Wo22Y7+w4FTEOpdh8gUOQ3J5E0HBv+B4tCOQcAS8UVBVBMbF nX2am371lii08ZsZDOLpyCuTBgA1lOtNGepWli5Ann7DaRPhcynCVnsID4bPJVVRBNDHj6/ /3eweDkTxZqkwnNi7UK0cLTwAMlpcQk0hyZi1YDatM6IZ+wpLXJarP9XLftIb+nJGg5K1lU GVVO0ywg7XQUpERYbc0Dg== UI-OutboundReport: notjunk:1;M01:P0:Cx8N4jL2CTY=;h+LpxDcfN8+DCQvLcYeyx0EwwuJ exNCstxeUBec9Ov4Yije2zC1UPUVBIJP0TM0K8edmcaXAT3HAFOtx6Uehp4+2ZWkVOoRJN8Yy dv79LH3bkJSYc+ky6KAqeX8rgym/+//C/cZ2+Xx5dYG3Uw47ntht3D9IN4jV7P+szKYNqAuQx MBPm/388s3NB3uTHGw2pbsjBXMs0rYutxW1JOvMNmgbuxcC99khYnhUnv3rGy8iZ5Vc8iP1BN FiaGF7JxwWY4SXSojJpgSi9M9GWV6OP2cC7XqSpgJWUv3y1ljvYqAEsSp3Y3eZk5VkIXao8z9 4Ka52fsCf06OaGxK+TT0uxqeZT1NlnmmQSqhq/+bZ/xK1pEmJ8FWygNyTOeRD+bNzDck4fvIE NpjArK0oRcsS7lhhpOhW6Z2gFK4F/rOrKlTI9+8W3dv1i/pSqIgVX28EFqe7s1/gU4MHN+8/r 7oA39wrqtJgdSreZYAv4Ng2sgCK1EyuUoXdML8uFp7czO2M+iPtdBueraQkxNF5N0CH0a8i16 Ifc29eMgROQQ2C+inItqGckPhZgweS01362WXa7EFLfCGK5OmHh0QatWt08a75IG0IM/hxz7F 79eeecyOus64HtC5iFfDT9FnhWAfEQWZAKrVaeujAGZSC+IMbc0ZG3/IBUa3szLtmU/qHJ8oU KYipQeS0/BmsD/O29CFIoG7U4BfNuspafWNSYKlefde0viuOe2xmjcSZZiPQW+c6LFJjV+U39 FSqyH1CPD6dVpwuy5RHE1spvvGNuMVWmqZtQjqmHrbLtIXZvKXm5y3n6iot0EP23/ueN4WaSV pqeomMS/pHmpoyGiGjl3q9xMEGD8jjH//hpOWFCdFLXZ7j2ZBE2FthUy9VOa0ixhntKpaNut1 sQ2cyVq7ExaftE/qa+JjZY73YmplknZ9TqZEZTlNoWoJ15pC/y4k3T8lFMacCKYNzIAmLtKlD bIVrjg== 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 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 12:17:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342824 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 F20A9C0015E for ; Sun, 6 Aug 2023 12:19:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchY-0000ED-8P; Sun, 06 Aug 2023 08:17:40 -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 1qSchW-0000C5-LW for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:38 -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 1qSchT-0001mc-Dx for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324253; x=1691929053; i=deller@gmx.de; bh=fHh6ths4U489TH2R2+SXZJdWcst+4HBAcj/Wpwd6H8w=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=Q/y/38X4ITl+kP+AC4gw1e4SDz3u3m18VnSvUda2Cm391UKAur62gALzNRIRjueyg0vsVau MH92I+gfw0+JOXsTtluMxFghqnjBpWpZ+8FfIUhyg3VF4i/B0j3/COVT2l7R+YwpS0K1VKIW0 KsE9C7NMnJTTI+Mlpc3bX0bIZIH2uHA8KZUD0mYiAMq3gTe1lCflZfBpvbkvO78w3dqca9rJ6 HV+VNLRwmgf86+ru3TCqGsTA1ghdt7bnfwcNfkE6YtbIJ/6A429w0Zbmgm4lkv5KhDXlfmaFx JpmNEwwxVpy0c0OR6nazuBQfM7FX3D/8ov/y2f4h+Cakpxsvkfnw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MAOJP-1qYQ8E0sYN-00BwBn; Sun, 06 Aug 2023 14:17:33 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 02/23] target/i386: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:11 +0200 Message-ID: <20230806121732.91853-3-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: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5XWqbIq6JEyfcCfmT8l5a8LqPpDPCawjjYL+V6fnq6kQ2NuXTvRR1rgmM NZqg50X8jeTuqe4ZLLaw7a3MlAzQjPVblUGcR/h7ka5BKzXV04/RpRYnJMLUNg+pnbDAjOPNY WsKLvnoEh7E7r/IsmACWjc6FbcTZ+F0532trXEcPj1H8pFvN4GukGaiAuomyJW4GwE5dfcuss 0gN7hfbCQM1jR5go2iUQDTQc8n0= 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 12:17:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342822 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 39D2CC001DF for ; Sun, 6 Aug 2023 12:19:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchj-0000Hy-Mu; Sun, 06 Aug 2023 08:17:51 -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 1qSchW-0000CL-T0 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:38 -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 1qSchT-0001mZ-DL for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324253; x=1691929053; i=deller@gmx.de; bh=+FFaZHj41P2ZukVhj09NDP9crnAlhHF9gw0dXa/YzCQ=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=WkpfATQMyDVsfLpmFh00N7U0Hytx8vb3C1dIqyA4c+wsiOmY2F+rVhqRubgdOCgy+3QOMOb 0b49Fr+e/PvKWLv0SkpdFHPwf/sTWf++7bEJCvhGaxfmB/rdqZ8Jh5nvietT9qEsO0/ACvpSk 8U7tlQePMW6TxTvanG58XBhTEktZqSYCQeuKYG+4/13jX9vl0PNY0fi13/0UPKDkBqUyNkCRL IRWVUijRl3/PSjO2wfajCR17TNBxt9Yi5K13E1jnpu9v1262wp1FWJa1Duk64+dqTGCaRgk7M Y9D+M8RKeBmGk8tYZP2jvzjhAkl9ukoV5nq1bT8jeyi3ulDUxXJg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MQMuX-1qFEXk1EsD-00MI1x; Sun, 06 Aug 2023 14:17:33 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 03/23] target/hppa: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:12 +0200 Message-ID: <20230806121732.91853-4-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:wh4MSDm0sLQXfA+QLQ3K+V17V7afNdBZV6FcXCdTeUVYGcpHSzE W1uDPk1uyyctiESnFvnLvKeFeIBWwhWZ0+95CTHAiNXXGcu1Q38bQaOB0uCyJnCvCiV5RvT N8YbjkgZeuoX3UXc7lmk3GhtnqQkO8/JhW33WKroIfY8ghMPnIyNlLaQASIfpdrVq5Uu88H KgXHnK/koHBvnOla60Q4A== UI-OutboundReport: notjunk:1;M01:P0:fxJLcJ3jyxs=;RnepeVM6p3N0EQKhsloWNnXGeOb WdhuZiil3RmRn5LOXQAEfLN6IYMaS95ryebDyrwcuVnFy/bJFxAWQ5oUsloxlP7Hg5VuJRL3O tgadhv7IH1T4qHMuKI3tgIBlTS9Ra+AIqJ+D9Hsv7kJx3aQG1u/L0FK1FnbqBr1lsQE3YLajb Hh1V1m/ID590U4y86NF7NeZPQE86aoY+rJ1XkJYVNBhUzYxiUjp83YX/2lqEkB0j9dnPL0ZZd 707TWuOHpCw+m+3CfWBEMreQOXpGo58eWmZz3zoVBQ7qYKXNLSxjf2XVUqn9eFYwKEEbo9Sin 8KBq12Gyrf4+JO082M6C7YCM6qXIC304gE8S2OoSrowx8GqS5C9dbM0fVHK2oGzVa20qSUozQ YCQ23GXyDjySZKMv6kvM7dWMfpvlyfQYdYplZmSOuXy01AJX/WkDtcyuzBRfMxmSCFsU0bXW1 4ix8tYnDaVxOW83eQd9/4cASHWGjjPW5TLEYJjTcTrP5HNJB5wibVre1Fntw9hLl664BkJI2V LxYCOExFQf27/odPedAKVHDhww1cTNxehRJQ839EXTZn9ZTkVvyl+0jT2n9sQkEE5G6RDCBYU W2uzwRJgBb7jNqKp4ahGbBYvh+L26SyhEa7tZOydCEQvHPQRev3rweDlxHxrJgrO45voimi+d AHLHZSDxcV3SriaFCIq+NYYuhQpqlL5Gle2TOD7r+EFjzlb+lh5K3rVO45fmES4FajNpf5tFz dwD8M7CuYoVaTg5o/kpMQevg3lo7qv9u6TbLiyzAFRIakpr9cA646alaUbyT7hhCDwYFX+hZV fFNE76SqUw71VhsntFNv5nI2cAigF5B37LZs7AEr0ouRKGY17uari9gFsYUOXdL0lewgLYsle AopRKYcZLgZ/7KhxwwwlTx2/6oXR/oCMm9g3huy+yKEzRhEOgvebmkLN6mzhfF/HaaxiwNRAh anh7S96QU4Kt/XY2fcXa1Qoy+0Q= 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/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 12:17:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342816 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 05DF3C0015E for ; Sun, 6 Aug 2023 12:18:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchX-0000CZ-6B; Sun, 06 Aug 2023 08:17:39 -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 1qSchV-0000Bp-FF for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:37 -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 1qSchT-0001me-DK for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324253; x=1691929053; i=deller@gmx.de; bh=e7nRBaVId/NKKdFKNPTa2RSz+uD+L1T38x0l/JeC4YY=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=P7I7NCTwMzsKibyN2BceE4byryd2wcWXQ88hzDDkxyIktXA+9f4/sIHXweWOKX9hLUNYQPs wiJUdYray1VGmgXpDQEE2lLq7q4Kb6CaDb0qcl76rexPeN01QSU26S+Pqpm3XHrYvnXdn+P+h b7mfrzyL+ue0s51tXXNb2SMcBHbgQfP5H0kh/YsQHVV3f1u9C1WvLFdpZNS3UFOZa5Rpu0GU6 ducnhS9rjVd9b1+Sy0SCZGGM7zxFDbOrDZPmq+tPcIgZ0NG5w9nEV4in5thA1N7dD7DoFnQgr 8o7bmLJySMszgYqJGUitWNmHADS5UIh5J0TmcDel+qWnnVwuR9tA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mwfac-1pdPkd1bcQ-00y71W; Sun, 06 Aug 2023 14:17:33 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 04/23] target/alpha: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:13 +0200 Message-ID: <20230806121732.91853-5-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Mg5amwIhV9g1wdDRzjUqt5Xn+2oxmxun5GQOyMIEQLyllVcwMXU bhj4QK71YjzItTN7I8fOkkdoOJjID2CVGUCSpEzaVltH8RoFH+awAeLKyKZk9fRn9iq8Rla PHPaSQRbLhTQtcgE0DWrJ6HlslkxYBnrE4WxoMImcmAvu+K5tOzCXGrN3H9fw8jbXE+MQbg yI+vU8etlRHNA4UWMPPzQ== UI-OutboundReport: notjunk:1;M01:P0:9tXbL2/hUmM=;fcQxq16dFmk7RmNCJMtX0TtVcKY b3EAWiS/DYS0qXC+AbnkpYWJYQuhvMBTqKV0uF92dEhP75tGH4s1jM45XexjtPKR6XnZrDnTP Ckz1qrEwLKOf0Bcas2zpa92ajK84IklKgQPYgH+Jdyr8BH1E22HWTFE/VoFn1WwDrqj+jfMKM SRQk+1rDlzMucXK7QVaUreTmz6uhG88Z2N6rFYSyDNPYvxOSBlgEdYIKgeA/ZrAAMKJTko8y4 9/xdvABC6+LqSjQcJgVJ4erFJTc4ewRVSv2yUKsfyKQVTQs2lcuScKTq3uTPt7lQdZj7D4L8Y hv7xiOvEt2dKY/qQldFp+j4y8uqUNrRoOR8JTfeZl0yS8Xj/AR9h7JMj+PndqjothN2HEjqym 62J5+V+/rwkT9jx1NwdY5kN5XV2W5DiBoZMprPVU8pjEDbn84RNdEaBjjj3OWS2kJR2h6PDtZ y4z3AYpkidN4nyJeXLvJdjwjYG+CINyn7vMHrxjLgj6WD5V6OZveYM3EkihrZQ32tZsa8MSFa dcPbcURAAEqP8/Vgit7OvPke5mV9B8jswogGtD9iEc7zxn/oeUOd2PCgbQL7qVA8KmPw1P3OX /geC31vJyNvwLjRkf4ne2UeBkl6dZJez4ACYnoWt0zcnodurapDyO0NJ7LE0nqCNRw7Xwwxw4 eW5Ei8tP5AFMg+phFF6UQDoP6oH4eWZBLoUhe7fzmYzRMiWf/8AGTjCQbqtzcdGEZwuP2EPf9 jHdDLuEEW9RTeTyzMGi6MvTee7MGoYV0mR5ywwiX/Af9VqPleOnjuCsl5hS49TcM30txYFvKA FIX0teDZFcJ5IQNz467rH/SCbbFHOV3sXyCJK8cLFiQaPsiD+RRLUKfcYtLb2uMZJ332n3inl 1q6tmR3jo4vblfyVd509jKu+elGlbeauL8vxUiXuCIA95TVjY1SP6lIPkU30lazGL3h8QVDGK 1gNdmrH5J5hJ9s0roRxNcQgTmiE= 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/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 12:17:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342835 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 A0225C0015E for ; Sun, 6 Aug 2023 12:20:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchZ-0000F0-2w; Sun, 06 Aug 2023 08:17:41 -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 1qSchW-0000C4-JP for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:38 -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 1qSchT-0001mi-I9 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324253; x=1691929053; i=deller@gmx.de; bh=h9yd8rngpT0I0RPSFORtYiuKz7zcmMDvTe2DL8IxR4U=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=MFj5sNo49M4zGW1gU4V5kryeFgQbyBGIsArK3cnyWJSBf1QkvTlv6dESM/jwLNj056NJrmt DgcySDMS3CuqWPXSCI6Yjc3vrsBY08OPgbKbpaFd1kzPlkgoPXa8nStTHE8QdapNZoDHnICQl AemVkrLGwr2DN8OLrh8b7XuQUg+lldy6DHorpJ+2/e3Cvtpwh+gdobvuNKCWJ/HRgQ0HyL8F5 NmvraTxMRrlf5G+1zlpnhNr7UDR9/PIWw5YRMXqGSHUAwZf1bMD6iW1ppg8AnlVMFDsRCguZX tAL7IcZk6jiwJKsNpsRaG56ArrnLqqaYsXGwpwQ7BJZfvLIZPIEg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M1Ycl-1qPaQY1y0Z-0036U7; Sun, 06 Aug 2023 14:17:33 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 05/23] target/avr: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:14 +0200 Message-ID: <20230806121732.91853-6-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:ZLKyKbiBj2L3fUQM744R9tzkIa0EZj0fcs/FZWO7MfN+/bmMM0A QGiacvRb0BjMie77BTL7iXYmkzZd6luTA2YBRKppQnQOWphvoDeMFsSpLU6qxS6RI2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Keap50V2uAOlxn4fh/YQ9VTi20hfk4m 98G0XEB9YLtsj8VG5Gu+4GgZZb4= 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/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 12:17:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342812 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 0ADADC0015E for ; Sun, 6 Aug 2023 12:18:25 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchX-0000DK-LV; Sun, 06 Aug 2023 08:17:39 -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 1qSchV-0000Bn-AJ for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:37 -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 1qSchT-0001mo-F6 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324253; x=1691929053; i=deller@gmx.de; bh=dvxkSS+9zJe2d6S5F16mDEZxjl4ybNfaIXuGtQs5GGw=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=tEuSi+o8v3+RY21JA9nfwacp4LxBHJ0QLpnuAy9SGnMzc1wmIeJIWqCQSTTS2Bn7tAyC7MU PsU3GZ+51Kjz2vjj8LAvi18tL4RC5KuzvZq7iVIdjgzR1ptUXTwgIsJriHVozu4FrHosHqItR VaTcsMuHdXkzSsYIOgiYGZAbVVZ6Sz/snDI+hHUVKSn9RnGbwOFTUfMjNU6zsVKfFpgJGaUaR 1DMz3RdXFIO1yXxNrvAqlyh/i0ZA5Z/qVWTm0cln78VdesYvW6lTIvOcNKkDwi0rZckAgUrY3 6K3k8SZ8HRiN7fnRvaOGmJKiC4ln/DKOAm5EMMDuesOCe5JWuaog== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MxDou-1pdxyv2Ucy-00xYnA; Sun, 06 Aug 2023 14:17:33 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 06/23] target/hexagon: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:15 +0200 Message-ID: <20230806121732.91853-7-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:zp6JnqrMUfV/5wQoLa24KCo6vzZfqH46o/Ets0FyzpYgpuV36j1 Exf16DjQ7Tgnp+FeYY2If6b4UFkZ0tYMTn/DUQJmkrgizUfk853xrqwO7HhFEjWvF0j15h7 vz4aU+zapcoO+OaqLvuh3iuPmuymQru7TUe+Ro0CH6Zh/VZNYXT/TZ7ZsKZeSarB7UVCr3k +6QxdI5iFi+UgaQ8eEyNQ== UI-OutboundReport: notjunk:1;M01:P0:di1tIVIDR9Q=;TPJL3BxqaMq7OnloIdZHRYItp4R xOi9ccUdMahJunxp5E1duLC6Z0VyPgkl8k2MO+cCg7HQ8wHbbWDy8FLp8lHvgSEsFg9nLBYGL 5QicRSR9WPpHY3YWQt0/aEjLajrssTRra0npoQZ+MVH0LnLClZWTEEIRFlCPuPKfDa/md6ODh K8RmNSFznCTEtJf7mmI0T9M2+5d4fxQH5PaPpjx6u8qDYW+iCSRkTrTSLwvZmf1pRw7u8drI0 QNjaCzHVxKubpbkXvN1g+oyxsfkD2oEDcuf+wO18DRhznMFvFZVbsqSZ2uQ1G/xWaf6g36ESg JJO71vg2xZvZ9UZyvXBHGizImq5vc1mtRzI42TrQ4+xxvRCB2ONTNJApm9V8M4KY90ssCAzHH s0o6LF2Nf+IIJQeHd6G95sqOE4GKmfGa2dcEjYhGd4t2hrcVXmodH+z1W5ICzVZJ/4kKgjFvX GVaRsLWespe7eTo9g1NUHa09wQABGekWvdMzvNTv8Bmok64JyH1BY1VZaoJ9brXUY/HmVqU6Z 04CY2VaYc2dib2Jz9BTtYYNwVWXkAtILXdgv9Kl2PBcmBSgud1is7F2hWjWRrHUBJNEap7411 0oggv2G25C3kvksJBxBovVzj4I7qz1jjb9dKiadE37cwadWWb0iLg8u3rHNYORn65a5iRkR4H BuNdyi/0es67JVGnMDWBbUBqeYjxnZB7tFVaUvr/dQWhQNzvlHM3qHleewcBffJXvApdd2usF xAeIKxHszSL8KeR+JsVMQmnZ6lQIS2C8kTqJwUBJ5Xgu7FaxrnekwvasuvtMMQ7pOap9eEtg9 PzH+dBEZSLMLKX+cuOf+mcnMxTGvNz0glQ35+YtCUQ3w1IYgECAU9+EVjIaSsqGT71I1jS26m R/OX1uPs4uyOXTeTUYDE1fnS098z4NK0PXNKdKQ5D4lwz36vYjSBaz76bs3x1EO7LjB9VUTl3 giYHK/boTG0UX5qRuX9fDfw9VhU= 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/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 12:17:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342819 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 23F48C0015E for ; Sun, 6 Aug 2023 12:19:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScha-0000GQ-Ua; Sun, 06 Aug 2023 08:17:43 -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 1qSchX-0000Dk-Ph for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:39 -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 1qSchT-0001mr-JR for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324253; x=1691929053; i=deller@gmx.de; bh=hLqEpcC8Hd79MrgioRBBl6xIy1QwV0TCk6yDDh3U9zU=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=Pdw6Ce/qIB6O+KpaUHnYMJ4zk8m20BF9UJ/CB1bYgfc3Pq8DL40PocCODQMg0eg33w8BXa2 n/M9HCCCekgVaFCTK80tSHKoGKPNfKAStnPIhHo4OfPsdjP+Tdc2RNNjztHsjmlz1SlyQIFL/ 1xJwpSOOEt/6P3R5gcbg8ofkHNtmDZUrnxus+Cknq1jZ/gFPOVJr2+8N94C5IL7KSzDuapUuM bMIXDcAvB/OIhkAqrYgfj1v0rPTSFNy2Tgq3c9fJ7tB7oJUba7hLyYoeIvvB8c3Kag0I29Lpx wsc+dMt8eh5LQOguCVflw/gTvYafekNQOVXXjNaFx2WLAkbTjl4w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MOzSu-1qCCGn32cu-00PKRA; Sun, 06 Aug 2023 14:17:33 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 07/23] target/loongarch: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:16 +0200 Message-ID: <20230806121732.91853-8-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:HK1s8NwL4fcqchpAumkek6Ph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crt9l7kPBzknepWCc1sdeC8uHnOrsu20hj/w7FJLtpQJv2GvRTqV4upZZXQsf9mZ fTKJMGGXvp/vL285+CM1mdGp+fJQ514TYrNud4isc47XQQyiF9j2lvPRI0fZ2742RMun9OIIP E+6Y8CJJwZi1ALH8LjiClKa+iWs= 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/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 12:17:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342813 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 290F5C04A94 for ; Sun, 6 Aug 2023 12:18:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchb-0000H4-Rl; Sun, 06 Aug 2023 08:17:43 -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 1qSchX-0000Dn-QI for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:39 -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 1qSchT-0001mv-MD for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324253; x=1691929053; i=deller@gmx.de; bh=vztxPNZg2Ks81IufpA0WxudElm6LqGuL9zpQKXSpcK0=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=OwFHjgySUB6x6BeOw/lSOGf7RIe7xMOy/mBgPnSXPF59Hy0xW6wrx2hhZ8m+ls8trDlq30t q09zvDSi3LQnvadwcqPeOy6GuwM6GheekJ3EnwRNlj3la7ET+r6M6iokYG+yMuqgdIaE4UD9P 776vVEUpjOOgkA4t1VOM29f5a3FVdXrZliR63HeR6m7A/yeqafw1yN0vuvcQD4x/zCXOrBwwW FGGXn1hzLg6q2IrXylOlkEiu5xRu7XUET1iZ+tlWXIaFzCJsPaBfswYNtsUbfUaRr6GWHGyi7 /UhAG95R10+tNzEUKA7SqowcqSdjR9WxGMsJo6FUoUlvRySyDaLQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MXp9Y-1qL1yT3Q0i-00YA8q; Sun, 06 Aug 2023 14:17:33 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 08/23] target/mips: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:17 +0200 Message-ID: <20230806121732.91853-9-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:lPjaWoH+jAMgQM9yut+T6+n3X0tXtcezWZ1E5ajh9mkfUCFIfdL KN2g+yCfy+DGrl9Q+L/urwvHhvqDooec7AMjHP6zpevGr3FShy4OnJB6isRvME9xj7Kyy5X KG7i5mQCl9KGxZyFYBuJlq1cVyOpqYVOMWELAo4e165vqiCATCW56Pi+1gT4CuQ35LxzSTX ouH7yQzsO3MKsKoBjcIg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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/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 12:17:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342814 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 0F9DBC001DF for ; Sun, 6 Aug 2023 12:18:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchb-0000Gg-G2; Sun, 06 Aug 2023 08:17:43 -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 1qSchY-0000E0-20 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:40 -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 1qSchT-0001mx-NM for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324254; x=1691929054; i=deller@gmx.de; bh=KOwVOGLkUNJS93FOFZ3KD/tcWS4SN2K96HANSWFCUjM=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=Sy6fr1CGPH1DY6vBHzzSZfaeBxXVA0d6d3tcGWq7NsT/7Mpgnns2vTAIT8FY3iAV230zkMg j4JB6NziNbxti/B0T7DXK6rmOwE1SJJWv/8zXLAq3Ax3IxjirEbEoCzC9JCAJkd5nhzE1IoNf WQXlEVSmWPXJupCOcpDZpwpsLbz3y/CjPgXKBb7UMupOq1ljf6oR2dqIrUUjYHhOQ0NKLOI6k 8H1TD5ZKikTqzvjBcL5Tr1QhMaEIskoyOzIApAZRRZ3ei98cOAQjWTid06i0rUJ/N4pIQOWjq qHH0EHlxugimEuzBY/LmdJFuOQBmmbzRZ6m4wRCgkLm2r6YW2PMQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MtOKc-1pXtRb3ofm-00undO; Sun, 06 Aug 2023 14:17:33 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 09/23] target/openrisc: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:18 +0200 Message-ID: <20230806121732.91853-10-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:bMo8RRIM82HgHsy16zfnuiLcZqG52uLYaVbxBOr3CbjVzubpo4s VGh8+CJ5vreTeLRIIgtDBuvBU+Cy8t8wVYeUtHwb3OWsj8KMCf3Fpf/OqKi9vPklwP41+Q4 76m5Qv5UDQAbEjZa1qn2VBoojHLnh3LC3MpVBmjVM8IfiOLmzaN+lRvrF8gLs4pTfCQdNWR KqU9Q0bBfIBj95HQ3LncA== UI-OutboundReport: notjunk:1;M01:P0:G5RRCh346dg=;ht9KnBHKd+NrZYSxsK3qepmxjrj m1g/ZT/ib25XGpVYpm8v61cl//DN9ljhCieNkXYSYuVxkShkp5Ly+xZNjiK+1cgd+tFn19wEM fu+JzfLfngr+UWzHFYbrU7EHRt1+qOu/j18BZrBG+zREWTW64vixou2VPwCfB2TJuaQWx8kfh C9SO34IkY+GizQj/16ASTEZ0V37yi1mbEPYKYdyGyO9quwbNWrAI7hbDexJFawihVn9ynf6mP XhWc8+g/kMCLGHCJFX+upS+fX2xS2THbe8wUTT9/CCCiNLST7Adkc/pu5GJyASsGXH5m12lLo uEr98aEPG3AgZ4HIeYIEiCMpe0HvreTwZQtMzlVdugd/Zben7S/6tOA2giIM2c7qkyN0CpqB6 NTGo7q8TK9SQpLOnsSH9JbTtFzvLVkARqTyMuCq7q6PfXBuvOzMe/pTIX53G/GfpBJX2Lmvus JEezNlJcXNijWtp9DG+sTyC+hLI0mIc7tSRtn3FvWNNK1/Yb19NlQ5jDeualEjT120I+i460m F0daRNR4UGs3igl9D59XrxS0ZVWj1rmkjeGgNapJm+JgeJecNWmDhVFAy18Slr042AMi5DOD/ 49gsWRX1aKYQQ27pTA68eEld95f/aOPgEZNNHf96EAjY4x/O4MOqFCOX33VmfL5UUeLUmnHGf yAFsFf0Y88pxK7MVlo4aeg3z32Jkp6awCLu4dixYWAe1wcKp0NrMV2nSuMKGpL6qkxoHCOq6+ QbZmebd5iNTfj7XyoB2BrBa1R9s6E11fC0Cf+qON5JY/mmmCXwFPr2uy2s2r2Z/Q1vuAPpzq1 Rzz5m/oe+Tk+TeprnL82YQOrIPEP1Aux7idCA1DEQa4Oh+Zw2W/ci+qLLkOJVD+IWmnFimZHS Ghoh7FytUDzQ+IAMR9izt9uoy+NPhAEp+vp+wgRaC9bQQpBlFU7My0Qs9KQF0QnN6U37nUavW pu9bMxxDZNQNL0PTce22CXEKPec= 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 12:17:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342825 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 BC8F7C001DF for ; Sun, 6 Aug 2023 12:19:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchj-0000IG-TW; Sun, 06 Aug 2023 08:17:51 -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 1qSchY-0000EL-7n for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:40 -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 1qSchT-0001n0-Pp for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324254; x=1691929054; i=deller@gmx.de; bh=wfGbH/9aMrmCkcIguPrZrqTIG36tr7GpA+9BI5L8PqQ=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=VsvG5AJi72BJueKhQv5u8aukQSJhsA2uVYmbdli8n/n6GZeP9LdcOnadJORf6z9mz5SOaSl jm6ucemraw8R4yVpJc5hkg/O3AlcUH62RqhTnpUqAWejFsoHHVAEzF0MJhXvyWV+3S8IKSwz1 tUMjL2ma0AVIKK5pKbiP7CWB6QVcCPh6eCmJUWxFAOXNFmpuqBW1y+Ug+fQ+5pG5RM2uMPVY9 R8qZH/CzNQvD8cpyhUnpmpRSB0K7+4TWqw1gqW5C1RrgTyjNi8GvbXVugbGPHhKNsvkV1V2ey JwuvinRbsVcnU0cYPVohZvKDukyxj/d9UxeAQKDGJtYQFA+YPn6A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MYvcG-1qOLMc02gy-00Uqki; Sun, 06 Aug 2023 14:17:34 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 10/23] target/riscv: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:19 +0200 Message-ID: <20230806121732.91853-11-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.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s0XccYRs1zKLDxYDYMscrVn2GpMXIW+OWZyAUy7nav1JBJayjVNIdcmaUOi7 JyKI2OHOR9ydA5KFo1eKid1dC/Ja1zvg6dA33ckJPzcoymICIU2zY6qxPZX1MKQhsMh9WstpD 0oclkRoTc1qc4z9w/v3Jlpb5z7HlIDcTG7XTmzqFEHbchSow/bdtwza+0/CZJ00cEZ4MGUYBp tLvuR4/dL+xfA5CmZq2t1jkoNo4= 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/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 12:17:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342832 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 050F6C0015E for ; Sun, 6 Aug 2023 12:20:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchr-0000LE-9r; Sun, 06 Aug 2023 08:17:59 -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 1qSchY-0000EF-6C for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:40 -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 1qSchU-0001n2-14 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324254; x=1691929054; i=deller@gmx.de; bh=eVIz1+2aEWXCJiiL5CrCLKj6aw9XMfrjOXixWdeOVBo=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=EqxU1da0q+YTCjMVngOWFZs3EKMahuCUITe220fIJfFEz4nygME+XrNpfAgUo5AJHKWR6cb rhcuH8JN+ssp9DScVKhjlwFKX7lioYjBjJnTNnPle1yU9mMmqYOlTkrtSq3cI9OO4GfjJOUM7 C2c9jobBMgiKpliLmebM3d1nMlc+/OzIFiJv/YNRoZWoZVjbAo11WDJkRTKfh8/ScXFX6uFlH tI27387lso3qUx+wpy5HoZLMF+A77i4GmtFMnLV5tJrqX4htfJin07G3qu9WJ6FRZHcDEBsF+ YL2Rw6DSv5d1+DUFQ72yHu9pMP/xsumteWBDfyUaON94hth3CZtw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M7K3Y-1qTj9e0QVo-007naO; Sun, 06 Aug 2023 14:17:34 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 11/23] target/s390x: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:20 +0200 Message-ID: <20230806121732.91853-12-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:S+SRRbg+M3fPCYOB5lyoL86rs8JxtofsmXcsZm8zKhCZlDZIaMD 9WqG63C8fj6NG9WZSs++jKe1LuefNH8xe/wausNgd74x0Av40qMtJf6nUW/479MNu6/QvLI 0JrueShYMxU5xPID2MJy+0ZTr3bQ0E03ZJMB49XnYg0oVsC6UCoya8GAJR6YnVt1Z1z+TsN aKR8uAGSlElVn+rfc8Gxw== UI-OutboundReport: notjunk:1;M01:P0:aJ8WKztcYIs=;6N+f4rBN6uiUowOPyyrmeTgaudl WrlvPZgU19WPSnIVRzMC79A/vFMYPWMJ6qvzsU7HOZIqbJIa0SeVErObp5ibTIC7BymNNi5Ll ZB2lmvfWBBhdgGrQW+r891cyaUlv0iLxpRgnBJ3YwiXiYGIaRgQTAgbpW0a9/pzqboRk44RRj rPXMkLQmQZsCJuUltg3og7/Uw3QZ12wXLue2OHeXr/2BQCYOJnnudgSoH0/hOlECIdYaXtODA b7HW55/WU46Io204rV4N2EiPnsXMJpIZN/T07GHdLIJaDIiDP5uaoF7YDdi6UFMCsOGGYKcfj kCaHMv6D692xP7yuyjv8pS4lHf9eYKjmVC7B/m62ZVwyUL2hrSHSoEo733VSCcd8ZOd1V2A28 q1iuazIXCpgS84v4akD5JsniTLdZxGuacvM8mlFmNjb0Jy29gIQc95VwRydrwRN9Tf7M72XMb hWjzaYG1QiIWyUBf83VQQRijppQLcs2hxuip2gBP9IWjHJEwBoCO9C8t2xGHo5i3LhcGqCSw3 IW/hCkdUlvP1oxJbBI2banirc9dnRksVPjMYQQDqdRxWYbAY18svPJxnM66xhB3G9kb7tEuHA LMyHKgc10WQvN8zhYeMz5/rk45loy5iMONdaLmt4+yhOwHXTwCkEpLMULkLvDnpNhPcUkL8CK oLK8YinuprDfUV3cmDRfNdPJW9LFmVEIIEHfqYn/N4A5hbuijoiKbdh7J1T74CvpSMVX9eryf iPECIehOOb5no03ErpsmT8Ae6wguudB4dmz3Cob60S+y3TEkx6uQV2fVcR9lNjdxA5F2rPpxK Il2iQ8dfWxDOEsuiOsAXg6ujkbkKK/IOOP6k06hZ9KQTXnmh1APHzUlVNfcAenucMdWaOoZh2 fuZwDh1uz9XFIv93UQe9qfPaHXWZ34iFi71kMbPT4Gz/wnWMTfOcsCcWtkSENlI/1qAVW+5tc g+IcqFfqd6a2NLRmioIo+XClpVg= 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/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 12:17:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342830 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 AFC5BC0015E for ; Sun, 6 Aug 2023 12:20:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchr-0000LD-9D; Sun, 06 Aug 2023 08:17:59 -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 1qSchY-0000Eu-Sc for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:40 -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 1qSchU-0001n7-1F for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324254; x=1691929054; i=deller@gmx.de; bh=wW8jWkcZw5zu6txqL6q+MBM+DZULGnKkQ9in2Fgeebg=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=EfTANcGyxaLg2VvXcwGqkjxYORfSykAgV3Trp3YR76T21TjzVA6fO/rbDA+lgKS4VGnd0V4 YkcfU5HInPooBmMIkjRnvdLEJRe9jXhAAPzETsYMSZkVH3RSCHexlnKmLFevxMKneFyUTm+yS R9XRB6ZsSyQeq7I2J5goUoAdB+YEKxXwKRdiLp5jv+1REOXA1bdOzXPuLPnoDrln8jl7Uy4vl nGWVzMK2rWiZLbln3IVOQicsoUqa4Lrvi2y/Zf3mHkN/jwblwRES+jQcukgqMmlkP/NJOS3tH 5EiOIY2AFGxB9DnQvwjH6vLhhEUPWccOifMLuVw4zDfsIF4wrpZg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M6lpG-1qTAvI0s5G-008Lok; Sun, 06 Aug 2023 14:17:34 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 12/23] target/sparc: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:21 +0200 Message-ID: <20230806121732.91853-13-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:NLSpTp1PLmXKyeE4hNkYfbi4NlAFXEQt3vSTrgGwWwitIgMqW5x rO1nWHKO/rocetXd8odx3jMVNf6SsoPKk+h6jIP5ikEO8tymMRgtVC07fIZ28sb0qJsazGf bKwrqehF9HxuTznpcmAdvTNG6XQpPjuZAfdT5NDwAOV7127f461hNuUXFTaQDLCdzKbLSqG iB4UKISXXOkDhIvUHwLpA== UI-OutboundReport: notjunk:1;M01:P0:QKafihooABQ=;+cHLYl4wq+VOecJEjnQD8UK6DuT bQsR81JU6TCAkoo6vaAHzoLL2HYqHjiYTdLOqTRSP+Y3VBOeumojgTI3NZcdtu9tBumR8w0vb RwK+lcnI2kjBRQ8qrtZh2ThomH0R2mE7qqosZcnMU+0oVqzd8adhM4OlKT8tw33rXEq8+bBH8 hatbdgJpiBJfILazHCN+b5mg4WtI3k8L73nJvpOz2K7TSqw+ucjV23e4m6DfA6CTrWdfZG3Xe vMqnNlgKar5GoZ6nYtZXK6FsandyYjdGsM1njr8YPR6H01NO09u6aBAS+GkYAVdhHhkuw1ZsE R4qiCqljjnSz/0RNDwVyVudtUhiFDuG02ywTIYmO7cag61GQqcF0xlwPLPCyHN68vHs4Es5vh 8c/AoHY9yTB2w164Kt0ZNp569DQG6/ar0nminaZl5m4fTwusq8rDfCuxi69hLiNoFG3/qyS4D /uMLwz9anUiV2Sy6e/4CyKbH+reDkCFD02rKr/8boRwjTPMmwnt//EX8Ce9zD/gVzmqDy3EBe gLdHYeYsMagAH6naNJh13BrqKNKoJuHeMn3AegCKJig9q7gWyc69Yph355hBp0DpnDvNN6jro 5JEmOM1nTYhobuGWNrHmxMc3hruNoNcGy/MI5wHrdCy3NKSffdReZY8d7MHCUX2xY/ZLt4Lf9 fXgVgIPCwu3Q0iZavWzLU0dBpbFm7OEGxJJYSRogP9iZM/H5E3tarE4a9kEUEtaPs3agTTxXa nkbC+WE5dow5UQPd+5L8FYMX+B6UF8UOqq2u+aq7QMKlgQmhtcnkcjFEEkCoLfKGBLIZEEO0Y oRurKF05m0mV7yHOFHjoC48noS/X7A2zz1i+zEXFbdL2hNdN1wQGjbWK7Q28JSdBoToFDPyJi Zb4NQaWFDGZX3tj4XXE1c+nuDvJ79+7826G5nsNv4xHnn16Ne37YKINOCOXI1Noj0en/y1sOW qZe9mTwEPeXpZg3YRjk9/Z9njM8= 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/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 12:17:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342818 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 33E67C0015E for ; Sun, 6 Aug 2023 12:19:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchm-0000JK-MF; Sun, 06 Aug 2023 08:17:54 -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 1qSchZ-0000F1-1H for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:41 -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 1qSchU-0001nE-4A for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324254; x=1691929054; i=deller@gmx.de; bh=QJYh3cUm2UBmMLn1LmBThaRIWm8idLzbefeI9YOYT5w=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=i55H1WGoU0JcbK9Z2s49z80b/sb6vYbS/cufCiI31GFLm2p5RYW+GjehsSQ4T5+cLUF0lYU OTX4IlxI9sTFTVoISb6YERsiEHkDRuS0BetApHVRmO+R6IkrPW2Yji88ORMwCTdBJLQmZk8v4 F8YPDo7UepZvbLRiVPG7mUwequZ2wR94mLh8fbbjRbjqmun2F9mUFCetpLAFK5dp/cLhkF6HE mntEzzs0QJoGGeIRAMdmxqCfuu/3DogD+EIX1PdeBooabyM14F9Oj9c6Tk3etscGAWog2mYpr L1Mwuep4LCJ+j906m5Cnz7ReHvsNt/nW7+lIK6Tr3N9AVhpD9lyA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Md6Mt-1psSbN1H5H-00aENP; Sun, 06 Aug 2023 14:17:34 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 13/23] target/xtensa: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:22 +0200 Message-ID: <20230806121732.91853-14-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:C0WZdAEwNAas7AHHV9LBIewK1nZRK41G3RKBb7P7sMe8U8IsGmp wNk7YqzKnOIMfxWcl6U+qChQ+PW31P10YpxnaMq/n3aWoQG7GCNCCbt5e3MIBbzPCf613vR JI7Lvn4fygTDecLC8Xv8PzNPxOH92CxjYFa5hNhYfXsPZDMfAhqeQK2DSo0wiv00cDmbHd8 wQ4aY1jRVGZLKh/mZO37Q== UI-OutboundReport: notjunk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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/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 12:17:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342827 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 53CF8C41513 for ; Sun, 6 Aug 2023 12:20:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScho-0000KU-M7; Sun, 06 Aug 2023 08:17:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSchZ-0000FL-79 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:41 -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 1qSchU-0001nJ-6D for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324254; x=1691929054; i=deller@gmx.de; bh=dY+5pD/7yMidI4e6vPgNceRyHJY15FbDamoy1ip1+Fo=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=DsCObQwPkWnZGrKQ9z1GGA/p/IQ2Z4LIsG5vavvIMz/4LJ1+vTdIetwNb3fc858kKJVAqZy YyYU142vTQFNEZf+w9fouhAJe09Y4BZsZnO6Y2lTLMkQdOvOxQKssrOkJ3QyI087fr5hcPGd7 +r4M92KCJsXy+dHGfmxqEM98xrCfJ9jj406RHraGVjEKYcy0P+mpyFE9ARx7uP83EsgoGZPND CLkcTRcNtnlh4XH59pDPMrslWnY7Kj91Y2xojL+tZ/LKw+N5KSLcT6BaG9GultzdYNftvGDn9 BK/vIIK27fHCuIB/z79HYJoWHNzhmnCyp48TLxpYC/urs46hIRpA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MFKGP-1qdOCt1ghl-00FnoH; Sun, 06 Aug 2023 14:17:34 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 14/23] target/arm: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:23 +0200 Message-ID: <20230806121732.91853-15-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:agufvB/f0aZvyiRihcTMXaxsyqRP5Y5BefXVZAB06VPNed4fGlr q5ta6/9cVzl86fC845SZTWJVJpxhXB/WBlMXcBv0j+CqgC02gicbkazgkg+vOLc+0bwunAd 2HWOyyIKhw/9TFGcc0cRdFuHwqPBNlk57PCh04gQMLhdIQueXQbWbb1IC+zh3y6rGDM36N+ USWcds1SvsW8ttZ3DumTQ== UI-OutboundReport: notjunk:1;M01:P0:G0iP7dt+ezU=;ofdrzOXql+cy3Tj2wt+USV1jsAM 1CTcHyaBPC9P4Gu+c34q4e7aVj0l3H/1hD7+SwZpiU91FAiKhJt7wPMMduI//2OI97jtB7Cot I2KT7OkWLE09Qlh8T8U0kiXgsWblZpZNImfMUNITDHl+LTZgSwBbkr1dRRFe0Dg5c7pP8f1bY HVrxevYTxlYx0f0nkUrAg6cmllXw1HbXHKSKJSf/D2bDj5YjEsV5WDBTYWWGXrwGI3+ljVo81 Ek4BT9/zfEMTTi5T1LHTItal5VXD68bVh9JOYkC3q7vAZJxTmyiOdSwgX+4ZEILHYtQEByeh5 KQa0Iy9/0+nrQiTSPNfcW0A4zLf5fsGacjZtfLYsmvdwc9oL6/Ob5zrDg0M78HLnHfwgiLC3l gpctsAoxP3VUFU0AmLTJCh8bYzOx8DLWhAQcSexzAfcNSN9ZnktpLCWQzQHL0jexMbVKhAjh6 dMnvnYKPLRV15ohrstEXXCeBcWCxtxHwotKvbjZMKswGiwT6mLnjb4Rftc26bJo2uR0jpfanA EsIqBc3V3WV6x3x/r5sPqsq813k4ry9oAfx0uTQbq8boRPJpa2r9I79DUHqV4dnB8uJuu7fwC 2uXPxt0UdKNgwirV5xjh7eetSK8atfOewKZug6HXFnsit08z8sQ0PM0bRbnHW4F78m06Zk0tS 69MlIFwyVNkfJkaBniWpF3ZAazln7FP4Y1hkdv8n1mYt56L/s++XjU1vE9nheSLJc4EysulzY re4kC1e6qXv/zYs71t5PcgSGLqVmgGUGM7ZFeUAyDFe3C+lqGFcV4CglShLeCxe4pluwB7sgp s90DNOjGBaBfURUUz5IvevW2aAlY7H4lf6E+6tTriJdAir/jO+XubTvK66T+XCRBxLmF6R2Jp Fo56KCjJnOrD4iQPz1jrRpt+Bfh3RYVvkPPl4Vgna+ynFwC4cexi+SIMWR1NlQu8sHGD7AQ/h N5GnOw== 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/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 12:17:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342820 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 2890CC0015E for ; Sun, 6 Aug 2023 12:19:10 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchs-0000Lq-2H; Sun, 06 Aug 2023 08:18:00 -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 1qSchZ-0000Fl-DX for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:41 -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 1qSchU-0001nO-7m for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324254; x=1691929054; i=deller@gmx.de; bh=ssg8jQPKMpMEyj4XWfdcML4VNlGF+SIF4/0Fv2zswF4=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=NkmVIN0j1vZ3pODkOBrdWQHLWGoRRWzprEjjBrC1XPpfo5hIVIiob21J5/OTTvOYH1GT5x4 zP70QBcMS3wFZDEJLZS+GM9sfgGvuQqrzeQaKI2u4inRYVjLnIALTSV0P8xaYJvm/KUAE0Yyv t0hDucD6hB9HsZNPITY6hHqT4J2vy7WuFxPAEsXfErBkA6em+qeyUxxWqyfy5aQ3R76Dtwv8c 4L+LK2Bb+LKq6rffqTGdALfX4wZzoPqQL7wn5xv4HaKXkZEG1kdFpIXsoADpr463dYiP9N68e 9EWvRrU8kT0pudyzYhC7e2SKu913oa3jGNASAaDtHSN2OnDlgPGg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MJE27-1q83Xh23Lv-00KdKt; Sun, 06 Aug 2023 14:17:34 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 15/23] target/cris: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:24 +0200 Message-ID: <20230806121732.91853-16-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:UPG9aiW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/oTAVLxNWq12i1eRePCt0qf hPIGcEQyvNqZwLVobtR4GO4m3L+ni8bHVvnbZc+xDzMLCFvh44gAit9WPYn21U/aEM7DeurcT zK4XX5sWDKX9yuaQeRz1h/vcpcb+hhEQvEkj+G6rzf8+G/rHPxmv52/rWpGnATVQqWF9YkMI9 Rhy9vtsuXlXRH0DObPbk+m1FC7U= 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/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 12:17:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342823 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 D2802C0015E for ; Sun, 6 Aug 2023 12:19:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchp-0000Ke-7X; Sun, 06 Aug 2023 08:17:57 -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 1qSchZ-0000Fn-Dx for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:41 -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 1qSchU-0001nV-E6 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324254; x=1691929054; i=deller@gmx.de; bh=3j4/JtDPN66a0Jgkn0LY3i4AonLjxhCnzA3yeQjEfvM=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=eA24+V9tM7rLhnke451yRKIQT8THbLDrFqFay7luBBBr5aQ3twqifgzohCSujHsNZISe3Hz EjGMxFdPqQBSq3C2Ti2APMC3Pbhrgf4TIRDF31Gv32QpPQfJzOIpdouNyXzhXzYiqQcP02ZC5 emAbkCtZciqjvAFKW+Vhvx1PvXTmLABRtvuPKHuHEgma8qsuVnOOz82vFla9adclfst78Tksb R+Nn/Dp3ztFjqMMPmZhaUIiMI1OIkrRtHiFU52DEYD62zAuLuddRI9D1qxjdvFEa+Ic8Rkn3P fOR4T2ttIL2Fqh0SUMCC0UMwZpWlpRZxr+kKFRHkApgXabUdf5RA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MpDJX-1q2OlF2RUV-00qnK3; Sun, 06 Aug 2023 14:17:34 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 16/23] target/m68k: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:25 +0200 Message-ID: <20230806121732.91853-17-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:1lcPhFBfFcn6u12wPXhYgfMU617FLOfBH750OiCttfPYl49JgDq QwmiZxIm40oYpDwgMhUueFGDY4Xesf7RCBfeyEDInl1r33iFCVDW+d7rsyBhO+Tg11/y8YQ mn1gxi7peCn8Ar6gL3OSrdJzdcGE9aprhfWmAwjXjQxqA/uey8ShnlGsM647Rn5xzBjC9ef 0w6BoS4Fkv3fIPEelrRbw== UI-OutboundReport: notjunk:1;M01:P0:b39vaxdU/VM=;yqh7UYkqasnl8/gAqjToqcg4cq2 MDZBnJsc06iD6tr9UABVATjJRzdGQdPJSCtAucMppYDR/sShCgNZ85N8iydePeCpxHIMcLW8Z dECyLPKM1Y62vEXqK6Pdongu1JyZbyZDw4e2APCWBItKtnqcwDxEpMX6x9A+pMCXOZuaTI8BP OF24RDSokk8TBsBk2nvMkuIrrjEbppfRg1SIcf4vF2MhRObQFzicjESGL4i6nqYz/KQwDCeDt ngOBk3qAVXuUZwZ4llomYQe8TyGzFQDjbLyfqwHlc+bd5g/uOYdIqb7RzEGMyWYDreadicW5B W8uUze5DKgiFGKTzbIuI428sC/XEv95zNac2VxwW+QXZtnnBvAaCvwahm9hvH0EcSekGrRbo5 +WQLgmTVQLto5zUoTz1VL+x++5dBL9b7tPw8YwbfNbM6a4h8b4TEuNq97Mlwnpg5+BYBC2pIE +xDdFCBwQrCKmC/l7kjbdFnv4vNmVz8vwX/+aVsz4jJLwNzTJotH1O6GozugrfOS9czluSFU2 1YkRZYnZZB9bguKsVNbT0MwKn9bKGVSPeA+MOY+n5dZIi0YpcJl8+G4Ohm3vorbcqbe2JVuz/ yAcFGpZwFBm1PgirI2fPLcjGpc7FftGH4IQtr5739HVr2tO0AXZy2ZIhl+lKuLbiliNMwN6L2 4xrsR5viMLYQQVQd56LbEFn4QKDRd4ImJIl5KhIG0jK8VmjhyFAplI7nb2Lno/lrhHGllbW+g 4lGautuCq4lKxpiPIY8umU0JWeEN7JnXcgkm8n2/dn05gTry29dOs8F6Ybj+77a1hufxvIgci kNAgeX9tznaenq9/d02a/gY4hbDSdcpRbiXW1wBFNw44D3vN3mvV5Iutk+TRlNBEu2oO6JMtD ZdrFUx0dNg/MV10kQaqHRAgUS93UaajpKn+eC543KZEpaeRAnvOHjvakNySbNnFz3/IrlT40g wnO37hz0nq2XsiGXws9p8oMnI1s= 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 12:17:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342817 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 B4A28C001DF for ; Sun, 6 Aug 2023 12:18:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchq-0000L7-AG; Sun, 06 Aug 2023 08:17:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qScha-0000GM-4M for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:42 -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 1qSchU-0001nZ-ES for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324254; x=1691929054; i=deller@gmx.de; bh=wH2Q5j3lm9FpTw8t3B3OJcOs4tm1iK2Y28uQcRF84Mw=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=Q6z7v1NcQOXy38z8QBdySH3294TzvQfk2hZwhEpe0TEMNN+2YfogH7Zm6Hc3rwqveAZ4t5n neYZp8WNVzG8TxImzWWV/MGSkHWo4m76IcAW+neE+xi42OVuptH8g3UPxpyioG1HFsK1zEIqX QJyqZCOYUt8ZLx12T7xu4kHsOtY7TFxEG3jRpgs3Sqx9IOa8khBwNg3WnL1ctRNtqVrZUSOwt na/eI3ryThuQc9n/DxIabcThP9z2s2eVFZKUarSamU1Iog5hhSa3DJa6O98qOhNxjOBRwtYgC ENboliczfdnMijlYUhjy6clGBBlB8KUv0xLrJXh2aVUtCkkmkINA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MIx3C-1q8Keq2pMw-00KMLy; Sun, 06 Aug 2023 14:17:34 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 17/23] target/microblaze: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:26 +0200 Message-ID: <20230806121732.91853-18-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:yvHH+2XIloMrCAQZFE+BMeVBmkJBuzHVPZnnEsxiIKa/LjYjczf 6NvPgLsgXzru6GEAfSv+VBfvYkbv1t/efI2wefrRw3jc/NALcm49oUbCSyF2exEk+Dsk10w zPEmkHzj85kGb5QRNKIw2yvk4NwcttpPj1MPByM9hrA2ydJ2WwmBXBwCKfQVO+XfQI+oilU hIpmrKYGHwRydBHXQpyrA== UI-OutboundReport: notjunk:1;M01:P0:ZnMi8V1gS6w=;3IHzXl8Ya1NUFys7zIes7/arcBh VDKV4kJ9o60YWl1A72SNxPzOm8S1gNg0qynCWZU/Ib34tlMXiVSbgjluFVDszxPcD1RzhtHnt KwpTfK7/1927G9qB1CWg/5zd7ldetMzEBunoQHCrvFaRa96ppcqXvZavNqZYbRGG0dgZ/FTjL iD9BbmFGrKenWI62I9+oknLDwZVLkfi+PrizUwB4HF62k3x5FNOgFgaMrk9+alpigMTZaGiGS zx668+2oqoT5YPS3+rL3JuoYnnStYzt83BXfnp3bWw3NvuLgFe7+FTcgqS7SQDsz7/f9smWU8 0wncTCvYeWdnFkPF/XvBM2N4BEFZR2VBtEXoDEZAEnv7i2BLAFuDS7GMoLEaVjhH3oQBiGzY7 sMwefTvliOoKbw7jhCatmBGVf0kjPrhWPMA9+i2vuiUipYGIz6NnjyxeY+ISjJlZrVRUWGGsH P+VZCEhZT7FkUeFpWkhzOP8r9xZv3pWzvmZHyQZDugGUUJMZexHGU2s4Do8K2WqKF7OiKMJ8v Cs9M9V6CRhEa960quDFgxmR/eu0JUJhjV9zP9iiKlgS3aS9GFsa9Qmrj2n39i8+ECdlS1dXi6 QciCoOXVD0vdgV4bKARjCsktFgpxCx15+LXaUQ+3IioUa2Nu6e3Ov8JrkrqDxqEGOznmKsAvZ W+GGLGmPWuvS7n/IKbnXgOWT+YmQlmLqSBfrSP3Oj8z4HCRRk7Tt6IavRlUpBc2nzjhjXilDS QxCD6twXsXd+i292SREI7sUcMA8FvGJbfjfIj6b3cHKQGkJCAkzfBOz1yJUFw+/KWBHnG28eu 28K6+ajr33YUe605+oNowCjfYApTAhsyi3jWuqWpj4tR42zLS1OX5G7L9q5wHvSoOsjGVBQVd pQFnej7Uv165cOHoJhkaVUm7s0tpZRsIipdk8aNSpKoX+bdVey3mWMfR7Vhpb8sJDlCZzavrE MQeGUPnNTk8bJ0FOEkhdt+hWIrI= 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 12:17:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342826 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 15D4BC0015E for ; Sun, 6 Aug 2023 12:19:58 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchp-0000Kf-Aq; Sun, 06 Aug 2023 08:17:57 -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 1qScha-0000GP-Cy for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:42 -0400 Received: from mout.gmx.net ([212.227.15.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSchV-0001np-0j for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324255; x=1691929055; i=deller@gmx.de; bh=AAhlFKdhCBg0rP4mi0eaKNbjFV2RubxTJe69zIRETsY=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=Y60zsxV/eYXX1nZSe4YLNRcM3ps/Re+rKdxgkBpRM6q5GF0LghnTdPvqeGa3MGBCE2exaTg 6cyk1e0QE1W8TH+9clpoh/goPLoPKebl3LKFveXqjFWYwvlWd5dq1ZqnTrd7Kh30ClVUOLFAH CvWBDqreFJt063ONSaVQEgJxl88hD8y8x+3Z3GcxKgW42YpbfDDwTy2HAFSlBO4DDSSiwTzx0 HAr31+/OBUktrMyCe81/n2C+9NcB2rsBesCpXW9Gidz/zFQw08PDJ2W2o8gJF7wfqJN5laqmr vYXAszSJeOoxbsO1QSU7vZ0xjQoiAos8RUBoPbB/y/+fW56KxUhg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M2wGs-1qPJJL0K7A-003ON4; Sun, 06 Aug 2023 14:17:35 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 18/23] target/m68k: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:27 +0200 Message-ID: <20230806121732.91853-19-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:UYtI86l/OKWY+VJvOdSExYClxOIAYfpE9h/9ZODyjFQcxKLejT/ DNHJrOCtkS+LkXe5wzZU+7sgK4mz6iGQGroeys9zuzL7P6TFaLG1ucJo9JseGusgizlne/x 6tfWpdHfAGuuZZk46R8lSFxRBl0vu66YgzYIf9Qc/oXgnpicoQ5W584sSS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kLVaWPscosX/fAp4FBQwe2i0= Received-SPF: pass client-ip=212.227.15.19; 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/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 12:17:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342821 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 36653C0015E for ; Sun, 6 Aug 2023 12:19:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchm-0000JW-Mg; Sun, 06 Aug 2023 08:17:55 -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 1qScha-0000GN-6U for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:42 -0400 Received: from mout.gmx.net ([212.227.15.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSchU-0001nr-WC for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324255; x=1691929055; i=deller@gmx.de; bh=Oh0k3yvvWbtkEZ2WV4849UsfR6Tag1RdVubVNLc9CMY=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=Z46YSmdTBe5Vv1ziQrgoww/rKXZ1YoocZtzIeyYBtb+TnXoW40LtOncbf/1MpKGdl7DuLRs zgWRnvvyyX0OBJ+ZgwH0xP7wpYmr6X9DodzFoqmHru8mDTi/9cj4mwbvFyU206QCMFacDjNmu f+CiJH9tUWA2BRcU588LPp29FDwJrC18GaGphDC1ena7D8WyyMlqWEw31N2iXACefjB2B9+Dm Xx60zYGklCKBeDFg2+fhd4EE9MN9fWNE+oVNH626mq7CUSQ2OCukcaG3NwnmTcxQScqBPaDG6 q7B7rsfwQgt/TMlFeY/ZPgZPrUlXIu1ArH7zDTpoI0Wf0rCbZNzQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N3bWr-1pjlQC0d19-010cQz; Sun, 06 Aug 2023 14:17:35 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 19/23] target/ppc: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:28 +0200 Message-ID: <20230806121732.91853-20-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:yBkRo7b4hEndZRVxZjba0OR6sJpbV8lUPKkoowcnTz1oPcz9k+L GxksinvoYASIw1I9Q/ot5/BKx3zfbKHWlxc/BaYHv6PCDqjllETPxXUrFB/fg7Rdl00ztao lJFCQhPQtwOW/6BGUHlGrb9RJTEbwwdotbYx3uqEVaUE/RWZn67shFbVU/JtJMOqASw/kYN JP9lAeuQoS/3nTAGmzDgw== UI-OutboundReport: notjunk:1;M01:P0:QgIHoUFHE1Y=;BpWn7kuXeaZCjCyDU0Reb1f6zj9 ojX7agi7A/OkeM3ddGCY+sGEVgyKGViyERl6Eo9mkTejJ0+kNd6rR+R3nFMcTl27qvsRK67Eg 2hh/mLf7lyReFXYJExMuf56uEGTSkuDu/P+wznPvIQigeRb2eiPTdkJPdsYZ98lKYNm82oXJz pcgmvHVz9up9vI+TI3zf14urwLiEfaZPp3YTJ3bbCK6sQ5wYtumnr+jpbKRSkl6MWxx8xlHrB qRIGHqgAbJ7f63qWOzgAh+2fJ+s0MMxfw2lsszuhyiqYHd11Fs5MyK+n+wQJt5kOxzW3SRpSx gO/fxgn5TnG5ePubd598zcjFe5BtfXD9jcW6ELqb9RC/IJHNisrBu55lSgaA14ClFGOVKc5gR /bPo75+ElkqM6OelD2GB88rUJGkuEUDQotcMFoOaFnGNN7NojZokhi2Y8QiPCoTQTS9JQPOxr VB3/qqgSrarKyyob0UBKplZWTk9fpS5/xrMU+RU5CLeKLkWexTmMK4v3SAoYiUBxQ3dER21oP kw+BahwOeXGvDFKC+9gluGjbQz3ZYRExWHqUpjGeaIx05fCG40pmBSRQDe4U5oCGhnxoPr4dZ a/CDK17uH2FWVqadsjvhVmmJ1l22Q6mG5YE7ecaPGEq0b6Kjx3E8LKUtndtNZ2L6WGmc3oq1R 99arE7/6GY6QPkyBYGM9TM85sJETkurMYzZ2blSbXFizqEwacRIf+LTqNdQ/JRXhCHtcr3b/f FIGhClaTgL9TFVNnhfAfQ8adHcdMeaIPkMEHFf2u6eGsjgptzZ9XLxATo38uQoyDfcthLuOTK CZjEgLxT8ctKH8dGSWyL1QWlnw687ubIVz9Mq51gezjQrM0b2d6KXEBQDXNUQUe+LJk2uyQSg tj74OB0WJYjZhiDAQYtxzCiZnWHOf+Mh/Y5bSgPG8VsF5wH8eaOvSCbYRPjxZkFwRFIeecC1Q lkP+WeMXANCyKQKP1h3+PlHjwDs= Received-SPF: pass client-ip=212.227.15.19; 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/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 } From patchwork Sun Aug 6 12:17:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342815 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 EE6EDC001DF for ; Sun, 6 Aug 2023 12:18:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchs-0000N1-PS; Sun, 06 Aug 2023 08:18:01 -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 1qScha-0000GT-FK for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:42 -0400 Received: from mout.gmx.net ([212.227.15.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSchV-0001o0-33 for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324255; x=1691929055; i=deller@gmx.de; bh=n/huR/PDfIZmE2vJlsMRDdZqS2ZoTWD5gTvGV/Fer4Q=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=qIxPTp3dnhmLzq81U7I2/VoLAB0DjL/zQDBlONyx0oWYER/QrwRTd+VteY5J0dwm0Y0sjQK VVM8u1DQ0Q+s/YlyBJ3phspsd89viKs4hgzY99FF+YAU9k/0TRi0tdLgN/IeJ6zWeNYSte6bz eRQjRqVwfs8qD/OH2cWmE3oXsXeZaPUFDwXKnGJjBZ5NPcqPqaVT/6FUkmqyaaTwcIS5htD50 WN0Dwgsjbjqf5YY6lalMSP0oJs8i/n/s0WkfTUn3wg3IYSDZ3vNplqlFfrcz79UTlh7M3Oa+u AOR+Aukt7MRY1x88yKSxje6dMgHwrryZnUysaL9a95EZTlnfFf0w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N4hzZ-1piexU0yOd-011ith; Sun, 06 Aug 2023 14:17:35 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 20/23] target/rx: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:29 +0200 Message-ID: <20230806121732.91853-21-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:COSfa20NP1dtSuIOAPxncWi+KEEmauA6Gabq63z2eiwZGeskQhW uwQGGs3Nc6ssIB130zxb3rC6FIvTqT2XZDvvyMLRRv0lktI5nOjuvBDgdPjDXx2dcDtaITY BUWdSvONkth5kQWm929/xNixTBHFNlBNVG/hFzYtSVtihEfm7H7tlrbWVA7F3SAAMr/URIi o86RFwfSvvQmWM+dA11gA== UI-OutboundReport: notjunk:1;M01:P0:8s6YZDn5zo0=;6kHfIY8QPaRaSjUV5Sc1BG3Lnay bm9OvnEf2ZLiEwkft2nTu6TbBr+ylvVi9X8MvmldDbERTNnPWCTkyCfR8Hv3BMR79d2rN2u7+ Mv7lL5hRjMNAlbc3c7ZplV4UVJCt1wD+WZaG/UhHj6cRrAPiEF3AqCc0EgVI5t0UQMq/lo5Ar FJJNOVdVV72dlXWGkw3HcVQlV8Vko05pJV7g6EMu8Z5zfWRsTjSUs05RR8R20x2bvxaeuUuHK Or8sRcn0tw2oWWwZOQCLF+8dI4AKHoG4ywOHcA9AXSIxvlV4XGBlGksFBvN1geCLSUoOmRP9S C4zBeTzT0dPhwlI5sK4xI+70lHnX0QMtgGy9pcqSoZUkL072FUPRj8xLbfzaVLfgRiW4JbCFV iiyxYyZXGj8cbUKnJwnNNhcol6oQ7IxpSzhS6JqOOcVOAZL/ZNXzp1tXiA0kv7FjzUsxfLrx5 qJyjwedBTeHQMbKQK5pmEJK2I4xSK/0ZGTjsRukVuY1KhN7levFsEbQlW5cxXSc0cnK8pAQF6 c1fUP/M+ziylYrkOSzLrbEn9UzllZrw5NsB9/SbParLBKcs25zcLwyRNMEq6RZYuVwV5ONNrq IW9Yo3rXikHW/95qUKl9ncsU3RPKelNhiEaugnKrJeZ3CABCMIp0/oKdpq31oD/IWhrONALes ycWRUVf085AJV1EyQE5UExV+R/vy48rstwW2k5Lw20C3SWy1JyTQHMUL5akNQnOa0bHC+6u+b DkFuwHkw0tOn4A0OH7/IT6hiu+o8Wpzg8+j8nZpKZLKBbMov6jv0CI0mlcCGrLM30vM5I0fJN 28i9IAUhs5Xkc0hFK0VACeI6b+9ulsN2eJxHNLDv4r+afoR6kiahghuiVVquE4AzfdszKr2c9 yVS6dsjGF6auodFrdSLaQAuNVJDdt//oPGAc8f2RtBlz3+70W+gLzTeO4u+miVqV4UKL68qqW XHidsG67h/SRSqRuHuLkmewlkv8= Received-SPF: pass client-ip=212.227.15.19; 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/rx/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.41.0 diff --git a/target/rx/cpu.h b/target/rx/cpu.h index 7f03ffcfed..bb19a456d3 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -154,7 +154,7 @@ static inline void cpu_get_tb_cpu_state(CPURXState *env, vaddr *pc, static inline int cpu_mmu_index(CPURXState *env, bool ifetch) { - return 0; + return MMU_INDEX(0); } static inline uint32_t rx_cpu_pack_psw(CPURXState *env) From patchwork Sun Aug 6 12:17:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342829 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 4919BC04A94 for ; Sun, 6 Aug 2023 12:20:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchs-0000Lz-20; Sun, 06 Aug 2023 08:18:00 -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 1qScha-0000GZ-Jk for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:42 -0400 Received: from mout.gmx.net ([212.227.15.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSchV-0001o5-5F for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324255; x=1691929055; i=deller@gmx.de; bh=DYKNn38KjnEDUEwlcK6bqWAeJvviAzR2xTLFiKiKkMg=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=OwsZFdmO1bYz9+m5ckTHCUBN+ZlMmbpk+l8xq1JBUUdrHefH7rdh2tueIHXK/QH1+LC6WK0 rlBcD0xQOivvDO/1aEMOKrvlSrfixKk+9E3IP8qr3zccsUHrl8RykJ58nui4SE4VBiMvKyZuw 3CytNOFt2fq6HbQdDuNQwFcJqVojxJJ5umNaOgLmdmwTYQPmGYlGkRozB1xxdIM1MO+8im4eS 8cQ8q/iBLUUuujS4sXj3wpRklBjt8OM7Vqvo9bDttvuizFZSwOpFvZlcieHc9S/XASMY8Pf3z XmJdXD1gOZ7eGbj6urV1aweEvRA7019X6/u0zfKrpk7aOrk22jMQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MKsnP-1q7VJK1XzB-00LCL1; Sun, 06 Aug 2023 14:17:35 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 21/23] target/sh4: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:30 +0200 Message-ID: <20230806121732.91853-22-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:I1wJECXjR5x2Uj/l2S12HrbaOfyIwawyBIYvPpvnRhDqpnEyq17 la02nkH6NKhAsuWFYt1oyLcAmCtT9OpGpUWcAK6Ei7je9OyacC+uUtil7ZYH6/884PV20UG bkpHeyfjVmPa9KpYLIgTVf4ZdlxAkVYjyLboQjPJji+mxuV715/Ki59nSPjFPkScBD2hCSr 6XWJjF5i4axWItDvHJG5Q== UI-OutboundReport: notjunk:1;M01:P0:2hleSz/vmas=;IQHtd2JG/YscWlAFxCqrKNoAWMI 2ypTAiAokIavNzKgBcqwWf8oLWB6UnaSWQulK1HwED/cBUMtoGHR0k82uzINiK9NGNMcDRPX0 zzkEXJGOYpMaWwgF+8SkjkymCirUTDibJRJzwVNvYrv7QWx834g2lcr7DsXkRmYNelSue40qp lSVgz+FpuaHOWtslhdy96avZhP6sFyds5+EStZxIc1YxSOChaMPXbpljx5ebGq0cEFrNIo6MA lPXsB/Oizck8mSH6H88RxD2HAAo7mQV/tlwc85WGJu7LAoGXBrFkm1TsTwtHXch+dM61alM6R BLtA/X7btc/1OWRiUPglVf55edUKfvvgT1R/vy9BMsygs3CA1wMH9RPXwmZ3RZADI6Inur+kq 1X858gCETjoqyeBW54McX1LmDVytMobRb3stZKAsfjO91al+bMUGijuWLNjt3pqWtPHePft7q Km4WQjA/fWYPAL/YmSMTbgtlRsdwgJjVmviHz3E0QUGH4iNmFgpkMLwVzqghAkKEeAPJte9cj lD8B84/Zqb9PzEW3578mZhPsJZtux/2y5TXJL05vvHfGfrkTQBaqgACXwoGFY6yn7aXeUwbZO sPTjQcVEU3dndYx2LbAHIh3E+AxVJbgnIASsqvlV/eTM85Z3x7WswZJrueAX8IFg7vCAeRNtY DDFpEN/GqCkDMwBIP9/pZw2PxCMMb/mHIB1r73ALB52XsoBii03NlEbTYXE7g411+G7P3wmeZ FjhqdhlT1iX5zKgBn5yuHcdHsUdWUKoY/UGN/fDVfnvwjNRSxaBXPcBU+S4nKfglM95j1AbLg naEW7yCSPG8bQp2LYrO0XC4BhOWJtC/dUexExvn//SR5JESC3AjG3SZPuY1jn6a93tWr+CWME XSg+WjjiosE2BTvqQdtwKc2Z6MQGjCZoOdvgYHXlIPLD9JPzPDm3Iw9TN9eiHas7DReoQm6Y8 gGbJRQ== Received-SPF: pass client-ip=212.227.15.19; 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/sh4/cpu.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.41.0 diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 1399d3840f..9adb1bb893 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -260,15 +260,16 @@ void cpu_load_tlb(CPUSH4State * env); #define cpu_list sh4_cpu_list /* MMU modes definitions */ -#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 (CPUSH4State *env, bool ifetch) { /* The instruction in a RTE delay slot is fetched in privileged mode, but executed in user mode. */ if (ifetch && (env->flags & TB_FLAG_DELAY_SLOT_RTE)) { - return 0; + return MMU_KERNEL_IDX; } else { - return (env->sr & (1u << SR_MD)) == 0 ? 1 : 0; + return (env->sr & (1u << SR_MD)) == 0 ? MMU_USER_IDX : MMU_KERNEL_IDX; } } From patchwork Sun Aug 6 12:17:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342833 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 3D4C4C001DF for ; Sun, 6 Aug 2023 12:20:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSchr-0000LV-O0; Sun, 06 Aug 2023 08:17:59 -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 1qSchb-0000H1-8y for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:43 -0400 Received: from mout.gmx.net ([212.227.15.19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSchV-0001o8-8q for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324255; x=1691929055; i=deller@gmx.de; bh=woNxUkQ9IJtCMZI7LjFWB0Pz+7giVXBRlYTwrlmAgvI=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=OGOafRbrbqoiOdYdgJwvTLxvYpNyJYmChUlXLzmU2lqUurveraVTBWmgyfGfvLJpWQ1Od58 m8usdjFptnzRijOxa2uj/Yk6psDOsm1qUM1ULS3y71G+x+HCuxQanE93hspn2qfdS6G6ODaP3 8yhq7iEVbKLABkqsFDO+GDxPkkhI+PMbvsoVIsWRxHQ/RwQkYeWQyrSKM3zRCFXxBM3+zCWtQ NwyicuivV9DM7CAt9IEc5q2VCpH+aBQP3/viTIr9eUCHUHAIp87sUum714NPoWt+V4m0KrtQo q0AthFQgjk12sWmWzXGVrRAtl9KH0LO4EqZSWdvkPFWnGcISCt6g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MNKhs-1qCkVB1tQw-00OkR6; Sun, 06 Aug 2023 14:17:35 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 22/23] target/tricore: Use MMU_INDEX() helper Date: Sun, 6 Aug 2023 14:17:31 +0200 Message-ID: <20230806121732.91853-23-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Qmua3fd5SjSlSaUe8qQmkAonWj2AT/+oDI3jy3OVM+VTMUnWwIs ZxS1KF8mqnYSQmbk/r5Ad9vEqZcB+1OxqdvgeWOf+Iu6N09rfgWW0vB4kwjJGg1gajWI3/z S/Rb7+wlOwqd74BX48UvPTAMIcTcKvRlE+FyDpwT/NqmoeRuQJxjyanxAxBkn55g+hUN0ZR IqCT//97Vg4e8BjIn9HCQ== UI-OutboundReport: notjunk:1;M01:P0:30qOVr4YxkQ=;iX3VuXpsYKQ6On21dZUERGly3fz I45YUEBWJUudTtE1LtiaiaDKi5hH6DhBaPbbVPAf10gszroCEqhQW6s204h+Hs+K+1AVeKT1g lbaZ4WDxji9OQ3rekmm9ibZHafFQPpvKodGw3zAZpHHyGhzeRQRJs7i3fbVaNmO/0Nwsdb/Q5 k99FUlDzl1CK2W2zV7WCzScuJz3Fq13yRSifrU1DbghaVF2oii1bIBFwEuPPvIte9Tg38fuax 3/0I3g2+MBCNu4f6+U9u99mMDzza/ka75q23J35yucHXycGUs9eBW4p3YJR8ghuFUqe28pzFi sbbNGk7RX2cL9nxSCXDGdbVy7VjwUmV7Gf1Qb87OrXbKmey6ynqtquhH6Oq8Ej84NfDWPCLir 0IQa5vXn3txm56+cEwVJo12p4tIHd+3XkCEmnMP4HhCm5jIf1eszfXwQ+Sd6Vmg79oe3WfH2E uMkwtU0mLuUO23hspIPpJGh9bGC9WS55bop8qKlXEIfQM0dEgmguYjpz8EldJQ7oPtxPsB+gs +64lPm/2+tYk3JOHPabqm6n1ukYJqNhc0EQ2OPfWEfjYxswSNWmszWM9Br3ysdAd+2+fILo3o OLRh352QgagzZd2X4UAAJJMHn9b0ORv7wpmj9Sh1jwEfwAOGXUWmnWoPnfXZ+Bqxhzbr/5aPe Men+SNigQOH30HwtbgrPQ44vf4gfWxiR6oWz6SGPxHvuB8BJiBp19KY5LYfd8anKTNHbnNdUp bFN9udxb8UCcpNl2WlD+Z5J0hZw2VU4C14FJL+VjkaCyGQmYzRUbuawh1P8MNW26XYf84h5WS XvEhz20/h8WKsQZ8tz2reUAp6c2w4NvIJ1nivblB+0vvo+kn0gPJ+GeAVoQNTYxXlCjf0i8b0 fcKaw0nic7B2JZgHh3/bx50cuzDGySB2xNAlDf0FShwveaIzVJKBY6wUZyzp+Aa7kp1wHi/LT f/4JLwnHhm8z69YylJp/yLDhfXU= Received-SPF: pass client-ip=212.227.15.19; 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/tricore/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.41.0 diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index 3708405be8..6c8ba27737 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -366,7 +366,7 @@ int tricore_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n); void fpu_set_state(CPUTriCoreState *env); -#define MMU_USER_IDX 2 +#define MMU_USER_IDX MMU_INDEX(2) void tricore_cpu_list(void); @@ -374,7 +374,7 @@ void tricore_cpu_list(void); static inline int cpu_mmu_index(CPUTriCoreState *env, bool ifetch) { - return 0; + return MMU_INDEX(0); } #include "exec/cpu-all.h" From patchwork Sun Aug 6 12:17:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13342828 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 40800C001DF for ; Sun, 6 Aug 2023 12:20:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qScht-0000N2-8e; Sun, 06 Aug 2023 08:18:01 -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 1qSchb-0000H3-FG for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:43 -0400 Received: from mout.gmx.net ([212.227.15.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSchV-0001oC-ET for qemu-devel@nongnu.org; Sun, 06 Aug 2023 08:17:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1691324255; x=1691929055; i=deller@gmx.de; bh=fLd9qhuZ16Xfpz7XDgXc4X9dd5C7qDtNCbmyF5+3VJ0=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=k7xXN+5t692GB70s/soLNU3vwBQv620GCgY5rOfBWmFbfJgI+ws1Dy7kV7D+B58b1/hC+Zi RkBu8gtKU3DjQ9G8vLYQa1bs2pRHSY6eaIWGU7wqyx4fs2Yzq1w1UYm8ZLR+Ell7I/XgAI/GD szf5W3ITeho6mCOWqtS1htRGks7OB8Ufm1WOCRmDNOhbn8D7XxRkuSeMgZQWteRE6XN07DWTv zPWrVNjMONv8uJVcJyHRzqh+CBa4+Dw5HVko0lORGMIdaXYtaxI0kIaD6uAkpxFzq4ISwHRQV fUvERYaAk8A1SHL3JNd2Lh/n7dflYw/xV40zGfK4nAJqh3pxiThQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([94.134.152.250]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MnaoZ-1q0k4g2Ctp-00je59; Sun, 06 Aug 2023 14:17:35 +0200 From: Helge Deller To: Richard Henderson , qemu-devel@nongnu.org Subject: [PATCH v2 23/23] cpu-defs.h: Reduce generated code size by inverting MMU_INDEX() Date: Sun, 6 Aug 2023 14:17:32 +0200 Message-ID: <20230806121732.91853-24-deller@gmx.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230806121732.91853-1-deller@gmx.de> References: <20230806121732.91853-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Wylww5uZ2DkhLu7o42ZpBE48eepwyxOApgwgs54YI+HZZ50LAjZ DbiTGl0FrhPgzJGst16gZOp78OqdAhGQmjT2d9MLyFRW23gptXvj2HFcwLRXKCqO6reYI5U fdwH8luNTgZkMP94L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vkntMRv uGnO/4XWN/YGQGi+MemhvRtsvw4= Received-SPF: pass client-ip=212.227.15.15; 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 The MMU is placed within CPUNegativeOffsetState, which means the smallest negative offsets are at the end of the struct (see comment for struct CPUTLB). But in target/cpu.h usually MMU indexes in the range 0-8 are used, which means that the negative offsets are bigger than if MMU indexes 9-15 would have been used. This patch inverts the given MMU index, so that the MMU indices now count down from (MMU_USER_IDX-1) to 0 and thus the tcg will see smaller negative offsets. When looking at the generated code, for every memory-access in the guest the x86-64 tcg generated up to now: IN: 0x000ebdf5: 8b 04 24 movl (%esp), %eax OUT: ... 0x003619: 48 23 bd 10 ff ff ff andq -0xf0(%rbp), %rdi 0x003620: 48 03 bd 18 ff ff ff addq -0xe8(%rbp), %rdi ... With the smaller negative offset it will now instead generate: OUT: ... 0x003499: 48 23 7d c0 andq -0x40(%rbp), %rdi 0x00349d: 48 03 7d c8 addq -0x38(%rbp), %rdi So, every memory acces in the guest now saves 6 bytes (=2 * 3) of instruction code in the fast path. Overall, this patch reduces the generated instruction size by ~3% and may improve overall performance. Signed-off-by: Helge Deller --- include/exec/cpu-defs.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.41.0 diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index 07bcdd38b2..7ba0481bc4 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -62,8 +62,13 @@ /* * MMU_INDEX() helper to specify MMU index. + * + * Inverse the number here to count downwards from NB_MMU_MODES-1 to 0. Since + * the MMU is placed within CPUNegativeOffsetState, this makes the negative + * offsets smaller for which the tcg backend will generate shorter instruction + * sequencies to access the MMU. */ -#define MMU_INDEX(n) (n) +#define MMU_INDEX(n) (NB_MMU_MODES - 1 - (n)) #if defined(CONFIG_SOFTMMU) && defined(CONFIG_TCG) #include "exec/tlb-common.h"