[PATCH 00/23] Fix NB_MMU_MODES to 16

Anton Johansson via posted 23 patches 1 year, 1 month ago
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(-)
[PATCH 00/23] Fix NB_MMU_MODES to 16
Posted by Anton Johansson via 1 year, 1 month ago
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
Re: [PATCH 00/23] Fix NB_MMU_MODES to 16
Posted by Alex Bennée 1 year, 1 month ago
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
Re: [PATCH 00/23] Fix NB_MMU_MODES to 16
Posted by Richard Henderson 1 year, 1 month ago
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~
Re: [PATCH 00/23] Fix NB_MMU_MODES to 16
Posted by Philippe Mathieu-Daudé 1 year, 1 month ago
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.
Re: [PATCH 00/23] Fix NB_MMU_MODES to 16
Posted by Philippe Mathieu-Daudé 1 year, 1 month ago
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>


Re: [PATCH 00/23] Fix NB_MMU_MODES to 16
Posted by Richard Henderson 1 year, 1 month ago
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~