From: Michael Clark Date: Mon, 5 Mar 2018 21:07:30 +0000 (+1300) Subject: RISC-V: Update address bits to support sv39 and sv48 X-Git-Tag: v3.1.0-rc0~98^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=718a941e19005492015ae7aa5db04d853b5af877;p=thirdparty%2Fqemu.git RISC-V: Update address bits to support sv39 and sv48 Cc: Sagar Karandikar Cc: Bastian Koppelmann Cc: Palmer Dabbelt Cc: Alistair Francis Signed-off-by: Palmer Dabbelt Reviewed-by: Alistair Francis Signed-off-by: Alistair Francis --- diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 34abc383e3d..e0608e6d5f0 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -24,12 +24,12 @@ #define TARGET_PAGE_BITS 12 /* 4 KiB Pages */ #if defined(TARGET_RISCV64) #define TARGET_LONG_BITS 64 -#define TARGET_PHYS_ADDR_SPACE_BITS 50 -#define TARGET_VIRT_ADDR_SPACE_BITS 39 +#define TARGET_PHYS_ADDR_SPACE_BITS 56 /* 44-bit PPN */ +#define TARGET_VIRT_ADDR_SPACE_BITS 48 /* sv48 */ #elif defined(TARGET_RISCV32) #define TARGET_LONG_BITS 32 -#define TARGET_PHYS_ADDR_SPACE_BITS 34 -#define TARGET_VIRT_ADDR_SPACE_BITS 32 +#define TARGET_PHYS_ADDR_SPACE_BITS 34 /* 22-bit PPN */ +#define TARGET_VIRT_ADDR_SPACE_BITS 32 /* sv32 */ #endif #define TCG_GUEST_DEFAULT_MO 0