[PATCH 01/23] include/exec: Set default `NB_MMU_MODES` to 16

Anton Johansson via posted 23 patches 2 years, 11 months ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Taylor Simpson <tsimpson@quicinc.com>, Song Gao <gaosong@loongson.cn>, Xiaojuan Yang <yangxiaojuan@loongson.cn>, Laurent Vivier <laurent@vivier.eu>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Chris Wulff <crwulff@gmail.com>, Marek Vasut <marex@denx.de>, Stafford Horne <shorne@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bin.meng@windriver.com>, Weiwei Li <liweiwei@iscas.ac.cn>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Max Filippov <jcmvbkbc@gmail.com>
[PATCH 01/23] include/exec: Set default `NB_MMU_MODES` to 16
Posted by Anton Johansson via 2 years, 11 months ago
Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 include/exec/cpu-defs.h | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h
index be920d4208..69cd62c19b 100644
--- a/include/exec/cpu-defs.h
+++ b/include/exec/cpu-defs.h
@@ -36,9 +36,6 @@
 #ifndef TARGET_LONG_BITS
 # error TARGET_LONG_BITS must be defined in cpu-param.h
 #endif
-#ifndef NB_MMU_MODES
-# error NB_MMU_MODES must be defined in cpu-param.h
-#endif
 #ifndef TARGET_PHYS_ADDR_SPACE_BITS
 # error TARGET_PHYS_ADDR_SPACE_BITS must be defined in cpu-param.h
 #endif
@@ -55,6 +52,14 @@
 # endif
 #endif
 
+/*
+ * Fix the maxiumum number of mmu modes to 16.  This is larger than all current
+ * targets, and also the maximum supported by the softmmu tlb api.
+ */
+#ifndef NB_MMU_MODES
+#define NB_MMU_MODES 16
+#endif
+
 #define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8)
 
 /* target_ulong is the type of a virtual address */
-- 
2.39.1
Re: [PATCH 01/23] include/exec: Set default `NB_MMU_MODES` to 16
Posted by Philippe Mathieu-Daudé 2 years, 11 months ago
On 6/3/23 18:52, Anton Johansson wrote:
> Signed-off-by: Anton Johansson <anjo@rev.ng>
> ---
>   include/exec/cpu-defs.h | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h
> index be920d4208..69cd62c19b 100644
> --- a/include/exec/cpu-defs.h
> +++ b/include/exec/cpu-defs.h
> @@ -36,9 +36,6 @@
>   #ifndef TARGET_LONG_BITS
>   # error TARGET_LONG_BITS must be defined in cpu-param.h
>   #endif
> -#ifndef NB_MMU_MODES
> -# error NB_MMU_MODES must be defined in cpu-param.h
> -#endif
>   #ifndef TARGET_PHYS_ADDR_SPACE_BITS
>   # error TARGET_PHYS_ADDR_SPACE_BITS must be defined in cpu-param.h
>   #endif
> @@ -55,6 +52,14 @@
>   # endif
>   #endif
>   
> +/*
> + * Fix the maxiumum number of mmu modes to 16.  This is larger than all current
> + * targets, and also the maximum supported by the softmmu tlb api.

Typo "maximum".

I'd keep "larger than all current targets, and also" for the commit 
description and not commit as comment in the code.

> + */
> +#ifndef NB_MMU_MODES
> +#define NB_MMU_MODES 16
> +#endif
> +
>   #define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8)
>   
>   /* target_ulong is the type of a virtual address */