LoongArch32 have 32 bit vaddr and 36 bit paddr as per architecture specification.
Signed-off-by: Jiaxun Yang <jiaxun.y...@flygoat.com> --- target/loongarch/cpu-param.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target/loongarch/cpu-param.h b/target/loongarch/cpu-param.h index db5ad1c69fafaf368ad7f0c960afecb5a96ddcf2..48512883e550c80570eb2bf02c802f4979151008 100644 --- a/target/loongarch/cpu-param.h +++ b/target/loongarch/cpu-param.h @@ -8,9 +8,15 @@ #ifndef LOONGARCH_CPU_PARAM_H #define LOONGARCH_CPU_PARAM_H -#define TARGET_LONG_BITS 64 -#define TARGET_PHYS_ADDR_SPACE_BITS 48 -#define TARGET_VIRT_ADDR_SPACE_BITS 48 +#if defined(TARGET_LOONGARCH64) +# define TARGET_LONG_BITS 64 +# define TARGET_PHYS_ADDR_SPACE_BITS 48 +# define TARGET_VIRT_ADDR_SPACE_BITS 48 +#elif defined(TARGET_LOONGARCH32) +# define TARGET_LONG_BITS 32 +# define TARGET_PHYS_ADDR_SPACE_BITS 36 +# define TARGET_VIRT_ADDR_SPACE_BITS 32 +#endif #define TARGET_PAGE_BITS 12 -- 2.43.0