Fix NB_MMU_MODES to 16
cover Fix NB_MMU_MODES to 16
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
PATCH 1/23 include/exec: Set default `NB_MMU_MODES` to 16
--- include/exec/cpu-defs.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
include/exec/cpu-defs.h +8 -3
@@ -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 */
Signature · 1 line
2.39.1
Re: [PATCH 01/23] include/exec: Set default `NB_MMU_MODES` to 16
Quoted 20 lines · Anton Johansson
Signed-off-by Anton Johansson <[email protected]>--- include/exec/cpu-defs.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)include/exec/cpu-defs.h +0
-3@@ -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
include/exec/cpu-defs.h line 57
Quoted 6 lines
include/exec/cpu-defs.h +3
-0@@ -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.
Quoted 8 lines
include/exec/cpu-defs.h +5
-0+*/ +#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 */
PATCH 2/23 target/alpha: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/alpha/cpu-param.h | 2 -- 1 file changed, 2 deletions(-)
target/alpha/cpu-param.h +0 -2
@@ -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
Signature · 1 line
2.39.1
PATCH 3/23 target/arm: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/arm/cpu-param.h | 2 -- 1 file changed, 2 deletions(-)
target/arm/cpu-param.h +0 -2
@@ -45,6 +45,4 @@bool guarded;#endif -#define NB_MMU_MODES 12 -#endif
Signature · 1 line
2.39.1
Re: [PATCH 03/23] target/arm: Remove `NB_MMU_MODES` define
Quoted 10 lines · Anton Johansson
Signed-off-by Anton Johansson <[email protected]>--- target/arm/cpu-param.h | 2 -- 1 file changed, 2 deletions(-)target/arm/cpu-param.h +0
-0
target/arm/cpu-param.h line 49
Quoted 5 lines
target/arm/cpu-param.h +0
-2@@ -45,6 +45,4 @@bool guarded;#endif -#define NB_MMU_MODES 12 -
We need to update the comment previous to ARMMMUIdx typedef.
PATCH 4/23 target/avr: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/avr/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/avr/cpu-param.h +0 -1
@@ -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
Signature · 1 line
2.39.1
PATCH 5/23 target/cris: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/cris/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/cris/cpu-param.h +0 -1
@@ -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
Signature · 1 line
2.39.1
PATCH 6/23 target/hexagon: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/hexagon/cpu-param.h | 2 -- 1 file changed, 2 deletions(-)
target/hexagon/cpu-param.h +0 -2
@@ -24,6 +24,4 @@#define TARGET_PHYS_ADDR_SPACE_BITS 36#define TARGET_VIRT_ADDR_SPACE_BITS 32 -#define NB_MMU_MODES 1 -#endif
Signature · 1 line
2.39.1
PATCH 7/23 target/hppa: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/hppa/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/hppa/cpu-param.h +0 -1
@@ -29,6 +29,5 @@# define TARGET_PHYS_ADDR_SPACE_BITS 32#endif #define TARGET_PAGE_BITS 12 -#define NB_MMU_MODES 5#endif
Signature · 1 line
2.39.1
PATCH 8/23 target/i386: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/i386/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/i386/cpu-param.h +0 -1
@@ -23,6 +23,5 @@# define TARGET_VIRT_ADDR_SPACE_BITS 32#endif #define TARGET_PAGE_BITS 12 -#define NB_MMU_MODES 5#endif
Signature · 1 line
2.39.1
PATCH 9/23 target/loongarch: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/loongarch/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/loongarch/cpu-param.h +0 -1
@@ -13,6 +13,5 @@#define TARGET_VIRT_ADDR_SPACE_BITS 48#define TARGET_PAGE_BITS 14 -#define NB_MMU_MODES 5#endif
Signature · 1 line
2.39.1
PATCH 10/23 target/m68k: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/m68k/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/m68k/cpu-param.h +0 -1
@@ -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
Signature · 1 line
2.39.1
PATCH 11/23 target/microblaze: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/microblaze/cpu-param.h | 1 - target/microblaze/cpu.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
target/microblaze/cpu-param.h +0 -1
@@ -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
target/microblaze/cpu.h +1 -1
@@ -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"
Signature · 1 line
2.39.1
PATCH 12/23 target/mips: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/mips/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/mips/cpu-param.h +0 -1
@@ -29,6 +29,5 @@#define TARGET_PAGE_BITS_VARY #define TARGET_PAGE_BITS_MIN 12#endif -#define NB_MMU_MODES 4#endif
Signature · 1 line
2.39.1
PATCH 13/23 target/nios2: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/nios2/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/nios2/cpu-param.h +0 -1
@@ -16,6 +16,5 @@#else # define TARGET_VIRT_ADDR_SPACE_BITS 32#endif -#define NB_MMU_MODES 2#endif
Signature · 1 line
2.39.1
PATCH 14/23 target/openrisc: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/openrisc/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/openrisc/cpu-param.h +0 -1
@@ -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
Signature · 1 line
2.39.1
PATCH 15/23 target/ppc: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/ppc/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/ppc/cpu-param.h +0 -1
@@ -32,6 +32,5 @@# define TARGET_VIRT_ADDR_SPACE_BITS 32#endif #define TARGET_PAGE_BITS 12 -#define NB_MMU_MODES 10#endif
Signature · 1 line
2.39.1
PATCH 16/23 target/riscv: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/riscv/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/riscv/cpu-param.h +0 -1
@@ -27,6 +27,5 @@* - S mode HLV/HLVX/HSV 0b101 * - M mode HLV/HLVX/HSV 0b111 */ -#define NB_MMU_MODES 8#endif
Signature · 1 line
2.39.1
PATCH 17/23 target/rx: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/rx/cpu-param.h | 2 -- 1 file changed, 2 deletions(-)
target/rx/cpu-param.h +0 -2
@@ -25,6 +25,4 @@#define TARGET_PHYS_ADDR_SPACE_BITS 32#define TARGET_VIRT_ADDR_SPACE_BITS 32 -#define NB_MMU_MODES 1 -#endif
Signature · 1 line
2.39.1
PATCH 18/23 target/s390x: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/s390x/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/s390x/cpu-param.h +0 -1
@@ -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
Signature · 1 line
2.39.1
PATCH 19/23 target/sh4: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/sh4/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/sh4/cpu-param.h +0 -1
@@ -16,6 +16,5 @@#else # define TARGET_VIRT_ADDR_SPACE_BITS 32#endif -#define NB_MMU_MODES 2#endif
Signature · 1 line
2.39.1
PATCH 20/23 target/sparc: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/sparc/cpu-param.h | 2 -- 1 file changed, 2 deletions(-)
target/sparc/cpu-param.h +0 -2
@@ -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
Signature · 1 line
2.39.1
PATCH 21/23 target/tricore: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/tricore/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/tricore/cpu-param.h +0 -1
@@ -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
Signature · 1 line
2.39.1
PATCH 22/23 target/xtensa: Remove `NB_MMU_MODES` define
In reply to Anton Johansson via--- target/xtensa/cpu-param.h | 1 - 1 file changed, 1 deletion(-)
target/xtensa/cpu-param.h +0 -1
@@ -16,6 +16,5 @@#else #define TARGET_VIRT_ADDR_SPACE_BITS 32#endif -#define NB_MMU_MODES 4#endif
Signature · 1 line
2.39.1
PATCH 23/23 include/exec: Remove guards around `NB_MMU_MODES`
In reply to Anton Johansson via--- include/exec/cpu-defs.h | 2 -- 1 file changed, 2 deletions(-)
include/exec/cpu-defs.h +0 -2
@@ -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)
Signature · 1 line
2.39.1
Quoted 9 lines · Anton Johansson via
This patchset fixes
NB_MMU_MODESto 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.
Quoted 5 lines
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:
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro
Quoted 30 lines · Anton Johansson
This patchset fixes
NB_MMU_MODESto 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 defaultNB_MMU_MODESto 16 target/alpha: RemoveNB_MMU_MODESdefine target/arm: RemoveNB_MMU_MODESdefine target/avr: RemoveNB_MMU_MODESdefine target/cris: RemoveNB_MMU_MODESdefine target/hexagon: RemoveNB_MMU_MODESdefine target/hppa: RemoveNB_MMU_MODESdefine target/i386: RemoveNB_MMU_MODESdefine target/loongarch: RemoveNB_MMU_MODESdefine target/m68k: RemoveNB_MMU_MODESdefine target/microblaze: RemoveNB_MMU_MODESdefine target/mips: RemoveNB_MMU_MODESdefine target/nios2: RemoveNB_MMU_MODESdefine target/openrisc: RemoveNB_MMU_MODESdefine target/ppc: RemoveNB_MMU_MODESdefine
Quoted 8 lines
target/riscv: Remove
NB_MMU_MODESdefine target/rx: RemoveNB_MMU_MODESdefine target/s390x: RemoveNB_MMU_MODESdefine target/sh4: RemoveNB_MMU_MODESdefine target/sparc: RemoveNB_MMU_MODESdefine target/tricore: RemoveNB_MMU_MODESdefine target/xtensa: RemoveNB_MMU_MODESdefineinclude/exec: Remove guards aroundNB_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.
Philippe Mathieu-Daudé
Reviewed-byQuoted 40 lines · Philippe Mathieu-Daudé
Quoted 30 lines · Anton Johansson
This patchset fixes
NB_MMU_MODESto 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 defaultNB_MMU_MODESto 16 target/alpha: RemoveNB_MMU_MODESdefine target/arm: RemoveNB_MMU_MODESdefine target/avr: RemoveNB_MMU_MODESdefine target/cris: RemoveNB_MMU_MODESdefine target/hexagon: RemoveNB_MMU_MODESdefine target/hppa: RemoveNB_MMU_MODESdefine target/i386: RemoveNB_MMU_MODESdefine target/loongarch: RemoveNB_MMU_MODESdefine target/m68k: RemoveNB_MMU_MODESdefine target/microblaze: RemoveNB_MMU_MODESdefine target/mips: RemoveNB_MMU_MODESdefine target/nios2: RemoveNB_MMU_MODESdefine target/openrisc: RemoveNB_MMU_MODESdefine target/ppc: RemoveNB_MMU_MODESdefineQuoted 8 lines
target/riscv: Remove
NB_MMU_MODESdefine target/rx: RemoveNB_MMU_MODESdefine target/s390x: RemoveNB_MMU_MODESdefine target/sh4: RemoveNB_MMU_MODESdefine target/sparc: RemoveNB_MMU_MODESdefine target/tricore: RemoveNB_MMU_MODESdefine target/xtensa: RemoveNB_MMU_MODESdefineinclude/exec: Remove guards aroundNB_MMU_MODES
Quoted 4 lines
As 24/23 we can remove the assertion in
qemu_plugin_get_hwaddr().Then
NB_MMU_MODESis only used by CPUTLB in "exec/cpu-defs.h" and inaccel/tcg/cputlb.c.
I forgot, series:
Quoted 30 lines · Anton Johansson
This patchset fixes
NB_MMU_MODESto 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 defaultNB_MMU_MODESto 16 target/alpha: RemoveNB_MMU_MODESdefine target/arm: RemoveNB_MMU_MODESdefine target/avr: RemoveNB_MMU_MODESdefine target/cris: RemoveNB_MMU_MODESdefine target/hexagon: RemoveNB_MMU_MODESdefine target/hppa: RemoveNB_MMU_MODESdefine target/i386: RemoveNB_MMU_MODESdefine target/loongarch: RemoveNB_MMU_MODESdefine target/m68k: RemoveNB_MMU_MODESdefine target/microblaze: RemoveNB_MMU_MODESdefine target/mips: RemoveNB_MMU_MODESdefine target/nios2: RemoveNB_MMU_MODESdefine target/openrisc: RemoveNB_MMU_MODESdefine target/ppc: RemoveNB_MMU_MODESdefine
Quoted 8 lines
target/riscv: Remove
NB_MMU_MODESdefine target/rx: RemoveNB_MMU_MODESdefine target/s390x: RemoveNB_MMU_MODESdefine target/sh4: RemoveNB_MMU_MODESdefine target/sparc: RemoveNB_MMU_MODESdefine target/tricore: RemoveNB_MMU_MODESdefine target/xtensa: RemoveNB_MMU_MODESdefineinclude/exec: Remove guards aroundNB_MMU_MODES
r~
Quoted 30 lines · Anton Johansson
This patchset fixes
NB_MMU_MODESto 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 defaultNB_MMU_MODESto 16 target/alpha: RemoveNB_MMU_MODESdefine target/arm: RemoveNB_MMU_MODESdefine target/avr: RemoveNB_MMU_MODESdefine target/cris: RemoveNB_MMU_MODESdefine target/hexagon: RemoveNB_MMU_MODESdefine target/hppa: RemoveNB_MMU_MODESdefine target/i386: RemoveNB_MMU_MODESdefine target/loongarch: RemoveNB_MMU_MODESdefine target/m68k: RemoveNB_MMU_MODESdefine target/microblaze: RemoveNB_MMU_MODESdefine target/mips: RemoveNB_MMU_MODESdefine target/nios2: RemoveNB_MMU_MODESdefine target/openrisc: RemoveNB_MMU_MODESdefine target/ppc: RemoveNB_MMU_MODESdefine
Quoted 8 lines
target/riscv: Remove
NB_MMU_MODESdefine target/rx: RemoveNB_MMU_MODESdefine target/s390x: RemoveNB_MMU_MODESdefine target/sh4: RemoveNB_MMU_MODESdefine target/sparc: RemoveNB_MMU_MODESdefine target/tricore: RemoveNB_MMU_MODESdefine target/xtensa: RemoveNB_MMU_MODESdefineinclude/exec: Remove guards aroundNB_MMU_MODES
Thanks, queued to tcg-next.
r~