Traditionally, MIPS use 4KB page size, but Loongson prefer 16KB page size in system emulator. So, let's define TARGET_PAGE_BITS_VARY and TARGET_PAGE_BITS_MIN to support variable page size. Cc: Jiaxun Yang <jiaxun.yang at flygoat.com> Signed-off-by: Huacai Chen <chenhc at lemote.com> --- target/mips/cpu-param.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/mips/cpu-param.h b/target/mips/cpu-param.h index 308660d..9c4a6ea 100644 --- a/target/mips/cpu-param.h +++ b/target/mips/cpu-param.h @@ -23,7 +23,12 @@ # define TARGET_VIRT_ADDR_SPACE_BITS 32 #endif #endif +#ifdef CONFIG_USER_ONLY #define TARGET_PAGE_BITS 12 +#else +#define TARGET_PAGE_BITS_VARY +#define TARGET_PAGE_BITS_MIN 12 +#endif #define NB_MMU_MODES 4 #endif -- 2.7.0
Huacai Chen
2020-Apr-08 09:14 UTC
[PATCH 2/3] mips/mips_fulong2e: Set preferred page size to 16KB
Loongson processor prefers 16KB page size in system emulator, so let's define mc->minimum_page_bits to 14. Cc: Jiaxun Yang <jiaxun.yang at flygoat.com> Signed-off-by: Huacai Chen <chenhc at lemote.com> --- hw/mips/mips_fulong2e.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 5040afd..23897d7 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -399,6 +399,7 @@ static void mips_fulong2e_machine_init(MachineClass *mc) mc->default_cpu_type = MIPS_CPU_TYPE_NAME("Loongson-2E"); mc->default_ram_size = 256 * MiB; mc->default_ram_id = "fulong2e.ram"; + mc->minimum_page_bits = 14; } DEFINE_MACHINE("fulong2e", mips_fulong2e_machine_init) -- 2.7.0
Huacai Chen
2020-Apr-08 09:14 UTC
[PATCH 3/3] MAINTAINERS: Add myself as fulong2e co-maintainer
I submitted the MIPS/fulong2e support about ten years ago, and after that I became a MIPS kernel developer. Last year, Philippe Mathieu- Daud? asked me that whether I can be a reviewer of MIPS/fulong2e, and I promised that I will do some QEMU work in the next year (i.e., 2020 and later). I think now (and also in future) I can have some spare time, so I can finally do some real work on QEMU/MIPS. And if possible, I hope I can be a co-maintainer of MIPS/fulong2e. Cc: Jiaxun Yang <jiaxun.yang at flygoat.com> Signed-off-by: Huacai Chen <chenhc at lemote.com> --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 642c8e0..3281ff2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1073,6 +1073,7 @@ F: hw/mips/mips_r4k.c Fulong 2E M: Philippe Mathieu-Daud? <f4bug at amsat.org> M: Aleksandar Markovic <aleksandar.qemu.devel at gmail.com> +M: Huacai Chen <chenhc at lemote.com> S: Odd Fixes F: hw/mips/mips_fulong2e.c F: hw/isa/vt82c686.c -- 2.7.0