All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/23] Fix NB_MMU_MODES to 16
@ 2023-03-06 17:52 Anton Johansson via
  2023-03-06 17:52 ` [PATCH 01/23] include/exec: Set default `NB_MMU_MODES` " Anton Johansson via
                   ` (26 more replies)
  0 siblings, 27 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

This patchset fixes NB_MMU_MODES to 16 for all targets, meaning the
macro is no longer target-specific.  16 mmu modes is large enough to
cover all currently supported targets (12 arm, 10 ppc, ...), and is the
maxiumum supported by the softmmu tlb api.

As mentioned by Richard in response to our RFC, softmmu tlbs are
dynamically resized and so the overhead of an unused mmu index is fairly
low.

The grand goal is to allow for heterogeneous QEMU binaries
consisting of multiple frontends.

RFC: https://lists.nongnu.org/archive/html/qemu-devel/2022-12/msg04518.html

Anton Johansson (23):
  include/exec: Set default `NB_MMU_MODES` to 16
  target/alpha: Remove `NB_MMU_MODES` define
  target/arm: Remove `NB_MMU_MODES` define
  target/avr: Remove `NB_MMU_MODES` define
  target/cris: Remove `NB_MMU_MODES` define
  target/hexagon: Remove `NB_MMU_MODES` define
  target/hppa: Remove `NB_MMU_MODES` define
  target/i386: Remove `NB_MMU_MODES` define
  target/loongarch: Remove `NB_MMU_MODES` define
  target/m68k: Remove `NB_MMU_MODES` define
  target/microblaze: Remove `NB_MMU_MODES` define
  target/mips: Remove `NB_MMU_MODES` define
  target/nios2: Remove `NB_MMU_MODES` define
  target/openrisc: Remove `NB_MMU_MODES` define
  target/ppc: Remove `NB_MMU_MODES` define
  target/riscv: Remove `NB_MMU_MODES` define
  target/rx: Remove `NB_MMU_MODES` define
  target/s390x: Remove `NB_MMU_MODES` define
  target/sh4: Remove `NB_MMU_MODES` define
  target/sparc: Remove `NB_MMU_MODES` define
  target/tricore: Remove `NB_MMU_MODES` define
  target/xtensa: Remove `NB_MMU_MODES` define
  include/exec: Remove guards around `NB_MMU_MODES`

 include/exec/cpu-defs.h       | 9 ++++++---
 target/alpha/cpu-param.h      | 2 --
 target/arm/cpu-param.h        | 2 --
 target/avr/cpu-param.h        | 1 -
 target/cris/cpu-param.h       | 1 -
 target/hexagon/cpu-param.h    | 2 --
 target/hppa/cpu-param.h       | 1 -
 target/i386/cpu-param.h       | 1 -
 target/loongarch/cpu-param.h  | 1 -
 target/m68k/cpu-param.h       | 1 -
 target/microblaze/cpu-param.h | 1 -
 target/microblaze/cpu.h       | 2 +-
 target/mips/cpu-param.h       | 1 -
 target/nios2/cpu-param.h      | 1 -
 target/openrisc/cpu-param.h   | 1 -
 target/ppc/cpu-param.h        | 1 -
 target/riscv/cpu-param.h      | 1 -
 target/rx/cpu-param.h         | 2 --
 target/s390x/cpu-param.h      | 1 -
 target/sh4/cpu-param.h        | 1 -
 target/sparc/cpu-param.h      | 2 --
 target/tricore/cpu-param.h    | 1 -
 target/xtensa/cpu-param.h     | 1 -
 23 files changed, 7 insertions(+), 30 deletions(-)

--
2.39.1


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 01/23] include/exec: Set default `NB_MMU_MODES` to 16
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 18:48   ` Philippe Mathieu-Daudé
  2023-03-06 17:52 ` [PATCH 02/23] target/alpha: Remove `NB_MMU_MODES` define Anton Johansson via
                   ` (25 subsequent siblings)
  26 siblings, 1 reply; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

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



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 02/23] target/alpha: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
  2023-03-06 17:52 ` [PATCH 01/23] include/exec: Set default `NB_MMU_MODES` " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 03/23] target/arm: " Anton Johansson via
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/alpha/cpu-param.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/alpha/cpu-param.h b/target/alpha/cpu-param.h
index 17cd14e590..68c46f7998 100644
--- a/target/alpha/cpu-param.h
+++ b/target/alpha/cpu-param.h
@@ -15,6 +15,4 @@
 #define TARGET_PHYS_ADDR_SPACE_BITS  44
 #define TARGET_VIRT_ADDR_SPACE_BITS  (30 + TARGET_PAGE_BITS)
 
-#define NB_MMU_MODES 3
-
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 03/23] target/arm: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
  2023-03-06 17:52 ` [PATCH 01/23] include/exec: Set default `NB_MMU_MODES` " Anton Johansson via
  2023-03-06 17:52 ` [PATCH 02/23] target/alpha: Remove `NB_MMU_MODES` define Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 18:51   ` Philippe Mathieu-Daudé
  2023-03-06 17:52 ` [PATCH 04/23] target/avr: " Anton Johansson via
                   ` (23 subsequent siblings)
  26 siblings, 1 reply; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/arm/cpu-param.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/arm/cpu-param.h b/target/arm/cpu-param.h
index b7bde18986..b3b35f7aa1 100644
--- a/target/arm/cpu-param.h
+++ b/target/arm/cpu-param.h
@@ -45,6 +45,4 @@
     bool guarded;
 #endif
 
-#define NB_MMU_MODES 12
-
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 04/23] target/avr: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (2 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 03/23] target/arm: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 05/23] target/cris: " Anton Johansson via
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/avr/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/avr/cpu-param.h b/target/avr/cpu-param.h
index 7ef4e7c679..9a92bc74fc 100644
--- a/target/avr/cpu-param.h
+++ b/target/avr/cpu-param.h
@@ -31,6 +31,5 @@
 #define TARGET_PAGE_BITS 8
 #define TARGET_PHYS_ADDR_SPACE_BITS 24
 #define TARGET_VIRT_ADDR_SPACE_BITS 24
-#define NB_MMU_MODES 2
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 05/23] target/cris: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (3 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 04/23] target/avr: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 06/23] target/hexagon: " Anton Johansson via
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/cris/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/cris/cpu-param.h b/target/cris/cpu-param.h
index 12ec22d8df..b31b742c0d 100644
--- a/target/cris/cpu-param.h
+++ b/target/cris/cpu-param.h
@@ -12,6 +12,5 @@
 #define TARGET_PAGE_BITS 13
 #define TARGET_PHYS_ADDR_SPACE_BITS 32
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
-#define NB_MMU_MODES 2
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 06/23] target/hexagon: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (4 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 05/23] target/cris: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 07/23] target/hppa: " Anton Johansson via
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/hexagon/cpu-param.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/hexagon/cpu-param.h b/target/hexagon/cpu-param.h
index e8ed5468d9..71b4a9b83e 100644
--- a/target/hexagon/cpu-param.h
+++ b/target/hexagon/cpu-param.h
@@ -24,6 +24,4 @@
 #define TARGET_PHYS_ADDR_SPACE_BITS 36
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
 
-#define NB_MMU_MODES 1
-
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 07/23] target/hppa: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (5 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 06/23] target/hexagon: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 08/23] target/i386: " Anton Johansson via
                   ` (19 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/hppa/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/hppa/cpu-param.h b/target/hppa/cpu-param.h
index a48a2701ae..c2791ae5f2 100644
--- a/target/hppa/cpu-param.h
+++ b/target/hppa/cpu-param.h
@@ -29,6 +29,5 @@
 # define TARGET_PHYS_ADDR_SPACE_BITS  32
 #endif
 #define TARGET_PAGE_BITS 12
-#define NB_MMU_MODES 5
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 08/23] target/i386: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (6 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 07/23] target/hppa: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 09/23] target/loongarch: " Anton Johansson via
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/i386/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/i386/cpu-param.h b/target/i386/cpu-param.h
index abad52af20..911b4cd51b 100644
--- a/target/i386/cpu-param.h
+++ b/target/i386/cpu-param.h
@@ -23,6 +23,5 @@
 # define TARGET_VIRT_ADDR_SPACE_BITS  32
 #endif
 #define TARGET_PAGE_BITS 12
-#define NB_MMU_MODES 5
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 09/23] target/loongarch: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (7 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 08/23] target/i386: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 10/23] target/m68k: " Anton Johansson via
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/loongarch/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/loongarch/cpu-param.h b/target/loongarch/cpu-param.h
index 414d8fff46..1265dc7cb5 100644
--- a/target/loongarch/cpu-param.h
+++ b/target/loongarch/cpu-param.h
@@ -13,6 +13,5 @@
 #define TARGET_VIRT_ADDR_SPACE_BITS 48
 
 #define TARGET_PAGE_BITS 14
-#define NB_MMU_MODES 5
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 10/23] target/m68k: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (8 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 09/23] target/loongarch: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 11/23] target/microblaze: " Anton Johansson via
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/m68k/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/m68k/cpu-param.h b/target/m68k/cpu-param.h
index 44a8d193f0..39dcbcece8 100644
--- a/target/m68k/cpu-param.h
+++ b/target/m68k/cpu-param.h
@@ -17,6 +17,5 @@
 #define TARGET_PAGE_BITS 12
 #define TARGET_PHYS_ADDR_SPACE_BITS 32
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
-#define NB_MMU_MODES 2
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 11/23] target/microblaze: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (9 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 10/23] target/m68k: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 12/23] target/mips: " Anton Johansson via
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/microblaze/cpu-param.h | 1 -
 target/microblaze/cpu.h       | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/microblaze/cpu-param.h b/target/microblaze/cpu-param.h
index 5e54ea0108..9770b0eb52 100644
--- a/target/microblaze/cpu-param.h
+++ b/target/microblaze/cpu-param.h
@@ -28,6 +28,5 @@
 
 /* FIXME: MB uses variable pages down to 1K but linux only uses 4k.  */
 #define TARGET_PAGE_BITS 12
-#define NB_MMU_MODES 3
 
 #endif
diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h
index f66df02226..88324d0bc1 100644
--- a/target/microblaze/cpu.h
+++ b/target/microblaze/cpu.h
@@ -394,7 +394,7 @@ void mb_tcg_init(void);
 #define MMU_NOMMU_IDX   0
 #define MMU_KERNEL_IDX  1
 #define MMU_USER_IDX    2
-/* See NB_MMU_MODES further up the file.  */
+/* See NB_MMU_MODES in cpu-defs.h. */
 
 #include "exec/cpu-all.h"
 
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 12/23] target/mips: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (10 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 11/23] target/microblaze: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 13/23] target/nios2: " Anton Johansson via
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/mips/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/mips/cpu-param.h b/target/mips/cpu-param.h
index f4c76994ea..594c91a156 100644
--- a/target/mips/cpu-param.h
+++ b/target/mips/cpu-param.h
@@ -29,6 +29,5 @@
 #define TARGET_PAGE_BITS_VARY
 #define TARGET_PAGE_BITS_MIN 12
 #endif
-#define NB_MMU_MODES 4
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 13/23] target/nios2: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (11 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 12/23] target/mips: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 14/23] target/openrisc: " Anton Johansson via
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/nios2/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/nios2/cpu-param.h b/target/nios2/cpu-param.h
index 177d720864..767bba4b7b 100644
--- a/target/nios2/cpu-param.h
+++ b/target/nios2/cpu-param.h
@@ -16,6 +16,5 @@
 #else
 # define TARGET_VIRT_ADDR_SPACE_BITS 32
 #endif
-#define NB_MMU_MODES 2
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 14/23] target/openrisc: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (12 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 13/23] target/nios2: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 15/23] target/ppc: " Anton Johansson via
                   ` (12 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/openrisc/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/openrisc/cpu-param.h b/target/openrisc/cpu-param.h
index 73be699f36..3f08207485 100644
--- a/target/openrisc/cpu-param.h
+++ b/target/openrisc/cpu-param.h
@@ -12,6 +12,5 @@
 #define TARGET_PAGE_BITS 13
 #define TARGET_PHYS_ADDR_SPACE_BITS 32
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
-#define NB_MMU_MODES 3
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 15/23] target/ppc: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (13 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 14/23] target/openrisc: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 16/23] target/riscv: " Anton Johansson via
                   ` (11 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/ppc/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/ppc/cpu-param.h b/target/ppc/cpu-param.h
index ea377b7d06..0a0416e0a8 100644
--- a/target/ppc/cpu-param.h
+++ b/target/ppc/cpu-param.h
@@ -32,6 +32,5 @@
 # define TARGET_VIRT_ADDR_SPACE_BITS 32
 #endif
 #define TARGET_PAGE_BITS 12
-#define NB_MMU_MODES 10
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 16/23] target/riscv: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (14 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 15/23] target/ppc: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 17/23] target/rx: " Anton Johansson via
                   ` (10 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/riscv/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/riscv/cpu-param.h b/target/riscv/cpu-param.h
index ebaf26d26d..b2a9396dec 100644
--- a/target/riscv/cpu-param.h
+++ b/target/riscv/cpu-param.h
@@ -27,6 +27,5 @@
  *  - S mode HLV/HLVX/HSV 0b101
  *  - M mode HLV/HLVX/HSV 0b111
  */
-#define NB_MMU_MODES 8
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 17/23] target/rx: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (15 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 16/23] target/riscv: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 18/23] target/s390x: " Anton Johansson via
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/rx/cpu-param.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/rx/cpu-param.h b/target/rx/cpu-param.h
index b156ad1ca0..521d669bdf 100644
--- a/target/rx/cpu-param.h
+++ b/target/rx/cpu-param.h
@@ -25,6 +25,4 @@
 #define TARGET_PHYS_ADDR_SPACE_BITS 32
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
 
-#define NB_MMU_MODES 1
-
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 18/23] target/s390x: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (16 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 17/23] target/rx: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 19/23] target/sh4: " Anton Johansson via
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/s390x/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/s390x/cpu-param.h b/target/s390x/cpu-param.h
index bf951a002e..84ca08626b 100644
--- a/target/s390x/cpu-param.h
+++ b/target/s390x/cpu-param.h
@@ -12,6 +12,5 @@
 #define TARGET_PAGE_BITS 12
 #define TARGET_PHYS_ADDR_SPACE_BITS 64
 #define TARGET_VIRT_ADDR_SPACE_BITS 64
-#define NB_MMU_MODES 4
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 19/23] target/sh4: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (17 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 18/23] target/s390x: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 20/23] target/sparc: " Anton Johansson via
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/sh4/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/sh4/cpu-param.h b/target/sh4/cpu-param.h
index 98a02509bb..a7cdb7edb6 100644
--- a/target/sh4/cpu-param.h
+++ b/target/sh4/cpu-param.h
@@ -16,6 +16,5 @@
 #else
 # define TARGET_VIRT_ADDR_SPACE_BITS 32
 #endif
-#define NB_MMU_MODES 2
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 20/23] target/sparc: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (18 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 19/23] target/sh4: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 21/23] target/tricore: " Anton Johansson via
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/sparc/cpu-param.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/sparc/cpu-param.h b/target/sparc/cpu-param.h
index 72ddc4a34f..cb11980404 100644
--- a/target/sparc/cpu-param.h
+++ b/target/sparc/cpu-param.h
@@ -16,13 +16,11 @@
 # else
 #  define TARGET_VIRT_ADDR_SPACE_BITS 44
 # endif
-# define NB_MMU_MODES 6
 #else
 # define TARGET_LONG_BITS 32
 # define TARGET_PAGE_BITS 12 /* 4k */
 # define TARGET_PHYS_ADDR_SPACE_BITS 36
 # define TARGET_VIRT_ADDR_SPACE_BITS 32
-# define NB_MMU_MODES 3
 #endif
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 21/23] target/tricore: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (19 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 20/23] target/sparc: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 22/23] target/xtensa: " Anton Johansson via
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/tricore/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/tricore/cpu-param.h b/target/tricore/cpu-param.h
index 2727913047..e29d551dd6 100644
--- a/target/tricore/cpu-param.h
+++ b/target/tricore/cpu-param.h
@@ -12,6 +12,5 @@
 #define TARGET_PAGE_BITS 14
 #define TARGET_PHYS_ADDR_SPACE_BITS 32
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
-#define NB_MMU_MODES 3
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 22/23] target/xtensa: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (20 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 21/23] target/tricore: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 17:52 ` [PATCH 23/23] include/exec: Remove guards around `NB_MMU_MODES` Anton Johansson via
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/xtensa/cpu-param.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/xtensa/cpu-param.h b/target/xtensa/cpu-param.h
index b53e9a3e08..b1da0555de 100644
--- a/target/xtensa/cpu-param.h
+++ b/target/xtensa/cpu-param.h
@@ -16,6 +16,5 @@
 #else
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
 #endif
-#define NB_MMU_MODES 4
 
 #endif
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 23/23] include/exec: Remove guards around `NB_MMU_MODES`
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (21 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 22/23] target/xtensa: " Anton Johansson via
@ 2023-03-06 17:52 ` Anton Johansson via
  2023-03-06 18:54 ` [PATCH 00/23] Fix NB_MMU_MODES to 16 Alex Bennée
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Anton Johansson via @ 2023-03-06 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 include/exec/cpu-defs.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h
index 69cd62c19b..40e72c4f08 100644
--- a/include/exec/cpu-defs.h
+++ b/include/exec/cpu-defs.h
@@ -56,9 +56,7 @@
  * 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)
 
-- 
2.39.1



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH 01/23] include/exec: Set default `NB_MMU_MODES` to 16
  2023-03-06 17:52 ` [PATCH 01/23] include/exec: Set default `NB_MMU_MODES` " Anton Johansson via
@ 2023-03-06 18:48   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 31+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-03-06 18:48 UTC (permalink / raw)
  To: Anton Johansson, qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, shorne,
	palmer, alistair.francis, bin.meng, ysato, mark.cave-ayland,
	atar4qemu, kbastian

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 */



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 03/23] target/arm: Remove `NB_MMU_MODES` define
  2023-03-06 17:52 ` [PATCH 03/23] target/arm: " Anton Johansson via
@ 2023-03-06 18:51   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 31+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-03-06 18:51 UTC (permalink / raw)
  To: Anton Johansson, qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, shorne,
	palmer, alistair.francis, bin.meng, ysato, mark.cave-ayland,
	atar4qemu, kbastian

On 6/3/23 18:52, Anton Johansson wrote:
> Signed-off-by: Anton Johansson <anjo@rev.ng>
> ---
>   target/arm/cpu-param.h | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/target/arm/cpu-param.h b/target/arm/cpu-param.h
> index b7bde18986..b3b35f7aa1 100644
> --- a/target/arm/cpu-param.h
> +++ b/target/arm/cpu-param.h
> @@ -45,6 +45,4 @@
>       bool guarded;
>   #endif
>   
> -#define NB_MMU_MODES 12
> -

We need to update the comment previous to ARMMMUIdx typedef.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/23] Fix NB_MMU_MODES to 16
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (22 preceding siblings ...)
  2023-03-06 17:52 ` [PATCH 23/23] include/exec: Remove guards around `NB_MMU_MODES` Anton Johansson via
@ 2023-03-06 18:54 ` Alex Bennée
  2023-03-06 18:56 ` Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Alex Bennée @ 2023-03-06 18:54 UTC (permalink / raw)
  To: Anton Johansson
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd,
	shorne, palmer, alistair.francis, bin.meng, ysato,
	mark.cave-ayland, atar4qemu, kbastian, qemu-devel


Anton Johansson via <qemu-devel@nongnu.org> writes:

> This patchset fixes NB_MMU_MODES to 16 for all targets, meaning the
> macro is no longer target-specific.  16 mmu modes is large enough to
> cover all currently supported targets (12 arm, 10 ppc, ...), and is the
> maxiumum supported by the softmmu tlb api.
>
> As mentioned by Richard in response to our RFC, softmmu tlbs are
> dynamically resized and so the overhead of an unused mmu index is fairly
> low.
>
> The grand goal is to allow for heterogeneous QEMU binaries
> consisting of multiple frontends.
>
> RFC:
> https://lists.nongnu.org/archive/html/qemu-devel/2022-12/msg04518.html

LGTM:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/23] Fix NB_MMU_MODES to 16
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (23 preceding siblings ...)
  2023-03-06 18:54 ` [PATCH 00/23] Fix NB_MMU_MODES to 16 Alex Bennée
@ 2023-03-06 18:56 ` Philippe Mathieu-Daudé
  2023-03-06 21:30   ` Philippe Mathieu-Daudé
  2023-03-06 18:58 ` Richard Henderson
  2023-03-07  0:58 ` Richard Henderson
  26 siblings, 1 reply; 31+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-03-06 18:56 UTC (permalink / raw)
  To: Anton Johansson, qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, shorne,
	palmer, alistair.francis, bin.meng, ysato, mark.cave-ayland,
	atar4qemu, kbastian

On 6/3/23 18:52, Anton Johansson wrote:
> This patchset fixes NB_MMU_MODES to 16 for all targets, meaning the
> macro is no longer target-specific.  16 mmu modes is large enough to
> cover all currently supported targets (12 arm, 10 ppc, ...), and is the
> maxiumum supported by the softmmu tlb api.
> 
> As mentioned by Richard in response to our RFC, softmmu tlbs are
> dynamically resized and so the overhead of an unused mmu index is fairly
> low.
> 
> The grand goal is to allow for heterogeneous QEMU binaries
> consisting of multiple frontends.
> 
> RFC: https://lists.nongnu.org/archive/html/qemu-devel/2022-12/msg04518.html
> 
> Anton Johansson (23):
>    include/exec: Set default `NB_MMU_MODES` to 16
>    target/alpha: Remove `NB_MMU_MODES` define
>    target/arm: Remove `NB_MMU_MODES` define
>    target/avr: Remove `NB_MMU_MODES` define
>    target/cris: Remove `NB_MMU_MODES` define
>    target/hexagon: Remove `NB_MMU_MODES` define
>    target/hppa: Remove `NB_MMU_MODES` define
>    target/i386: Remove `NB_MMU_MODES` define
>    target/loongarch: Remove `NB_MMU_MODES` define
>    target/m68k: Remove `NB_MMU_MODES` define
>    target/microblaze: Remove `NB_MMU_MODES` define
>    target/mips: Remove `NB_MMU_MODES` define
>    target/nios2: Remove `NB_MMU_MODES` define
>    target/openrisc: Remove `NB_MMU_MODES` define
>    target/ppc: Remove `NB_MMU_MODES` define
>    target/riscv: Remove `NB_MMU_MODES` define
>    target/rx: Remove `NB_MMU_MODES` define
>    target/s390x: Remove `NB_MMU_MODES` define
>    target/sh4: Remove `NB_MMU_MODES` define
>    target/sparc: Remove `NB_MMU_MODES` define
>    target/tricore: Remove `NB_MMU_MODES` define
>    target/xtensa: Remove `NB_MMU_MODES` define
>    include/exec: Remove guards around `NB_MMU_MODES`

As 24/23 we can remove the assertion in qemu_plugin_get_hwaddr().

Then NB_MMU_MODES is only used by CPUTLB in "exec/cpu-defs.h" and
in accel/tcg/cputlb.c.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/23] Fix NB_MMU_MODES to 16
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (24 preceding siblings ...)
  2023-03-06 18:56 ` Philippe Mathieu-Daudé
@ 2023-03-06 18:58 ` Richard Henderson
  2023-03-07  0:58 ` Richard Henderson
  26 siblings, 0 replies; 31+ messages in thread
From: Richard Henderson @ 2023-03-06 18:58 UTC (permalink / raw)
  To: Anton Johansson, qemu-devel
  Cc: ale, pbonzini, eduardo, peter.maydell, mrolnik, tsimpson,
	gaosong, yangxiaojuan, edgar.iglesias, philmd, shorne, palmer,
	alistair.francis, bin.meng, ysato, mark.cave-ayland, atar4qemu,
	kbastian

On 3/6/23 09:52, Anton Johansson wrote:
> This patchset fixes NB_MMU_MODES to 16 for all targets, meaning the
> macro is no longer target-specific.  16 mmu modes is large enough to
> cover all currently supported targets (12 arm, 10 ppc, ...), and is the
> maxiumum supported by the softmmu tlb api.
> 
> As mentioned by Richard in response to our RFC, softmmu tlbs are
> dynamically resized and so the overhead of an unused mmu index is fairly
> low.
> 
> The grand goal is to allow for heterogeneous QEMU binaries
> consisting of multiple frontends.
> 
> RFC: https://lists.nongnu.org/archive/html/qemu-devel/2022-12/msg04518.html
> 
> Anton Johansson (23):
>    include/exec: Set default `NB_MMU_MODES` to 16
>    target/alpha: Remove `NB_MMU_MODES` define
>    target/arm: Remove `NB_MMU_MODES` define
>    target/avr: Remove `NB_MMU_MODES` define
>    target/cris: Remove `NB_MMU_MODES` define
>    target/hexagon: Remove `NB_MMU_MODES` define
>    target/hppa: Remove `NB_MMU_MODES` define
>    target/i386: Remove `NB_MMU_MODES` define
>    target/loongarch: Remove `NB_MMU_MODES` define
>    target/m68k: Remove `NB_MMU_MODES` define
>    target/microblaze: Remove `NB_MMU_MODES` define
>    target/mips: Remove `NB_MMU_MODES` define
>    target/nios2: Remove `NB_MMU_MODES` define
>    target/openrisc: Remove `NB_MMU_MODES` define
>    target/ppc: Remove `NB_MMU_MODES` define
>    target/riscv: Remove `NB_MMU_MODES` define
>    target/rx: Remove `NB_MMU_MODES` define
>    target/s390x: Remove `NB_MMU_MODES` define
>    target/sh4: Remove `NB_MMU_MODES` define
>    target/sparc: Remove `NB_MMU_MODES` define
>    target/tricore: Remove `NB_MMU_MODES` define
>    target/xtensa: Remove `NB_MMU_MODES` define
>    include/exec: Remove guards around `NB_MMU_MODES`

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/23] Fix NB_MMU_MODES to 16
  2023-03-06 18:56 ` Philippe Mathieu-Daudé
@ 2023-03-06 21:30   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 31+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-03-06 21:30 UTC (permalink / raw)
  To: Anton Johansson, qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell,
	mrolnik, tsimpson, gaosong, yangxiaojuan, edgar.iglesias, shorne,
	palmer, alistair.francis, bin.meng, ysato, mark.cave-ayland,
	atar4qemu, kbastian

On 6/3/23 19:56, Philippe Mathieu-Daudé wrote:
> On 6/3/23 18:52, Anton Johansson wrote:
>> This patchset fixes NB_MMU_MODES to 16 for all targets, meaning the
>> macro is no longer target-specific.  16 mmu modes is large enough to
>> cover all currently supported targets (12 arm, 10 ppc, ...), and is the
>> maxiumum supported by the softmmu tlb api.
>>
>> As mentioned by Richard in response to our RFC, softmmu tlbs are
>> dynamically resized and so the overhead of an unused mmu index is fairly
>> low.
>>
>> The grand goal is to allow for heterogeneous QEMU binaries
>> consisting of multiple frontends.
>>
>> RFC: 
>> https://lists.nongnu.org/archive/html/qemu-devel/2022-12/msg04518.html
>>
>> Anton Johansson (23):
>>    include/exec: Set default `NB_MMU_MODES` to 16
>>    target/alpha: Remove `NB_MMU_MODES` define
>>    target/arm: Remove `NB_MMU_MODES` define
>>    target/avr: Remove `NB_MMU_MODES` define
>>    target/cris: Remove `NB_MMU_MODES` define
>>    target/hexagon: Remove `NB_MMU_MODES` define
>>    target/hppa: Remove `NB_MMU_MODES` define
>>    target/i386: Remove `NB_MMU_MODES` define
>>    target/loongarch: Remove `NB_MMU_MODES` define
>>    target/m68k: Remove `NB_MMU_MODES` define
>>    target/microblaze: Remove `NB_MMU_MODES` define
>>    target/mips: Remove `NB_MMU_MODES` define
>>    target/nios2: Remove `NB_MMU_MODES` define
>>    target/openrisc: Remove `NB_MMU_MODES` define
>>    target/ppc: Remove `NB_MMU_MODES` define
>>    target/riscv: Remove `NB_MMU_MODES` define
>>    target/rx: Remove `NB_MMU_MODES` define
>>    target/s390x: Remove `NB_MMU_MODES` define
>>    target/sh4: Remove `NB_MMU_MODES` define
>>    target/sparc: Remove `NB_MMU_MODES` define
>>    target/tricore: Remove `NB_MMU_MODES` define
>>    target/xtensa: Remove `NB_MMU_MODES` define
>>    include/exec: Remove guards around `NB_MMU_MODES`
> 
> As 24/23 we can remove the assertion in qemu_plugin_get_hwaddr().
> 
> Then NB_MMU_MODES is only used by CPUTLB in "exec/cpu-defs.h" and
> in accel/tcg/cputlb.c.

I forgot, series:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/23] Fix NB_MMU_MODES to 16
  2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
                   ` (25 preceding siblings ...)
  2023-03-06 18:58 ` Richard Henderson
@ 2023-03-07  0:58 ` Richard Henderson
  26 siblings, 0 replies; 31+ messages in thread
From: Richard Henderson @ 2023-03-07  0:58 UTC (permalink / raw)
  To: Anton Johansson, qemu-devel
  Cc: ale, pbonzini, eduardo, peter.maydell, mrolnik, tsimpson,
	gaosong, yangxiaojuan, edgar.iglesias, philmd, shorne, palmer,
	alistair.francis, bin.meng, ysato, mark.cave-ayland, atar4qemu,
	kbastian

On 3/6/23 09:52, Anton Johansson wrote:
> This patchset fixes NB_MMU_MODES to 16 for all targets, meaning the
> macro is no longer target-specific.  16 mmu modes is large enough to
> cover all currently supported targets (12 arm, 10 ppc, ...), and is the
> maxiumum supported by the softmmu tlb api.
> 
> As mentioned by Richard in response to our RFC, softmmu tlbs are
> dynamically resized and so the overhead of an unused mmu index is fairly
> low.
> 
> The grand goal is to allow for heterogeneous QEMU binaries
> consisting of multiple frontends.
> 
> RFC: https://lists.nongnu.org/archive/html/qemu-devel/2022-12/msg04518.html
> 
> Anton Johansson (23):
>    include/exec: Set default `NB_MMU_MODES` to 16
>    target/alpha: Remove `NB_MMU_MODES` define
>    target/arm: Remove `NB_MMU_MODES` define
>    target/avr: Remove `NB_MMU_MODES` define
>    target/cris: Remove `NB_MMU_MODES` define
>    target/hexagon: Remove `NB_MMU_MODES` define
>    target/hppa: Remove `NB_MMU_MODES` define
>    target/i386: Remove `NB_MMU_MODES` define
>    target/loongarch: Remove `NB_MMU_MODES` define
>    target/m68k: Remove `NB_MMU_MODES` define
>    target/microblaze: Remove `NB_MMU_MODES` define
>    target/mips: Remove `NB_MMU_MODES` define
>    target/nios2: Remove `NB_MMU_MODES` define
>    target/openrisc: Remove `NB_MMU_MODES` define
>    target/ppc: Remove `NB_MMU_MODES` define
>    target/riscv: Remove `NB_MMU_MODES` define
>    target/rx: Remove `NB_MMU_MODES` define
>    target/s390x: Remove `NB_MMU_MODES` define
>    target/sh4: Remove `NB_MMU_MODES` define
>    target/sparc: Remove `NB_MMU_MODES` define
>    target/tricore: Remove `NB_MMU_MODES` define
>    target/xtensa: Remove `NB_MMU_MODES` define
>    include/exec: Remove guards around `NB_MMU_MODES`

Thanks, queued to tcg-next.


r~


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2023-03-07  0:59 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-06 17:52 [PATCH 00/23] Fix NB_MMU_MODES to 16 Anton Johansson via
2023-03-06 17:52 ` [PATCH 01/23] include/exec: Set default `NB_MMU_MODES` " Anton Johansson via
2023-03-06 18:48   ` Philippe Mathieu-Daudé
2023-03-06 17:52 ` [PATCH 02/23] target/alpha: Remove `NB_MMU_MODES` define Anton Johansson via
2023-03-06 17:52 ` [PATCH 03/23] target/arm: " Anton Johansson via
2023-03-06 18:51   ` Philippe Mathieu-Daudé
2023-03-06 17:52 ` [PATCH 04/23] target/avr: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 05/23] target/cris: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 06/23] target/hexagon: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 07/23] target/hppa: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 08/23] target/i386: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 09/23] target/loongarch: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 10/23] target/m68k: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 11/23] target/microblaze: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 12/23] target/mips: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 13/23] target/nios2: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 14/23] target/openrisc: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 15/23] target/ppc: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 16/23] target/riscv: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 17/23] target/rx: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 18/23] target/s390x: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 19/23] target/sh4: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 20/23] target/sparc: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 21/23] target/tricore: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 22/23] target/xtensa: " Anton Johansson via
2023-03-06 17:52 ` [PATCH 23/23] include/exec: Remove guards around `NB_MMU_MODES` Anton Johansson via
2023-03-06 18:54 ` [PATCH 00/23] Fix NB_MMU_MODES to 16 Alex Bennée
2023-03-06 18:56 ` Philippe Mathieu-Daudé
2023-03-06 21:30   ` Philippe Mathieu-Daudé
2023-03-06 18:58 ` Richard Henderson
2023-03-07  0:58 ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.