target/riscv: Fix incorrect MMU_USER_IDX value
PATCH v3 1/1 target/riscv: Fix incorrect MMU_USER_IDX value
MMU_USER_IDX is defined as 3, but the RISC-V user-mode MMU index is MMUIdx_U, which is 0. This macro is used by the generic cpu_mmu_index() for CONFIG_USER_ONLY builds and must match riscv_env_mmu_index(), so fix the value to 0.
---
Changes in v3:
- Keep the MMU_USER_IDX macro because cpu_mmu_index() needs it.
- Link to v2: https://lore.kernel.org/qemu-devel/[email protected]/
Changes in v2:
- Adjust the patch descriptions and rebased on riscv-to-apply.next.
- Link to v1: https://lore.kernel.org/qemu-devel/[email protected]/
target/riscv/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/riscv/cpu.h +1 -1
@@ -180,7 +180,7 @@ extern RISCVCPUImpliedExtsRule *riscv_multi_ext_implied_rules[];#define RISCV_IMPLIED_EXTS_RULE_END -1 -#define MMU_USER_IDX 3 +#define MMU_USER_IDX 0/* MMUIdx_U */ #if !defined(CONFIG_USER_ONLY )#include "tcg/pmp.h"
Signature · 1 line
2.27.0
Quoted 7 lines · Wang Yechao
MMU_USER_IDXis defined as 3, but the RISC-V user-mode MMU index isMMUIdx_U, which is 0. This macro is used by the genericcpu_mmu_index()forCONFIG_USER_ONLYbuilds and must matchriscv_env_mmu_index(), so fix the value to 0.Fixes dc5bd18fa572 ("RISC-V CPU Core Definition")Signed-off-by Wang Yechao <[email protected]>
Thanks,
Nutty
Quoted 25 lines
---
Changes in v3:
- Keep theMMU_USER_IDXmacro becausecpu_mmu_index()needs it.
- Link to v2: https://lore.kernel.org/qemu-devel/[email protected]/Changes in v2:
- Adjust the patch descriptions and rebased on riscv-to-apply.next.
- Link to v1: https://lore.kernel.org/qemu-devel/[email protected]/target/riscv/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/riscv/cpu.h +1
-1@@ -180,7 +180,7 @@ extern RISCVCPUImpliedExtsRule *riscv_multi_ext_implied_rules[];#define RISCV_IMPLIED_EXTS_RULE_END -1 -#define MMU_USER_IDX 3 +#define MMU_USER_IDX 0/* MMUIdx_U */ #if !defined(CONFIG_USER_ONLY )#include "tcg/pmp.h"
Quoted 7 lines · Wang Yechao
MMU_USER_IDXis defined as 3, but the RISC-V user-mode MMU index isMMUIdx_U, which is 0. This macro is used by the genericcpu_mmu_index()forCONFIG_USER_ONLYbuilds and must matchriscv_env_mmu_index(), so fix the value to 0.Fixes dc5bd18fa572 ("RISC-V CPU Core Definition")Signed-off-by Wang Yechao <[email protected]>
Alistair
Quoted 28 lines
---
Changes in v3:
- Keep theMMU_USER_IDXmacro becausecpu_mmu_index()needs it.
- Link to v2:
https://lore.kernel.org/qemu-devel/[email protected]/Changes in v2:
- Adjust the patch descriptions and rebased on riscv-to-apply.next.
- Link to v1:
https://lore.kernel.org/qemu-devel/[email protected]/target/riscv/cpu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)target/riscv/cpu.h +0
-0@@ -180,7 +180,7 @@ extern RISCVCPUImpliedExtsRule *riscv_multi_ext_implied_rules[];
#defineRISCV_IMPLIED_EXTS_RULE_END-1target/riscv/cpu.h +1
-1-#define MMU_USER_IDX 3 +#define MMU_USER_IDX 0/* MMUIdx_U */
#if !defined(CONFIG_USER_ONLY)
#include "tcg/pmp.h"
Alistair Francis
AppliedQuoted 7 lines · Wang Yechao
MMU_USER_IDXis defined as 3, but the RISC-V user-mode MMU index isMMUIdx_U, which is 0. This macro is used by the genericcpu_mmu_index()forCONFIG_USER_ONLYbuilds and must matchriscv_env_mmu_index(), so fix the value to 0.Fixes dc5bd18fa572 ("RISC-V CPU Core Definition")Signed-off-by Wang Yechao <[email protected]>
Thanks!
Applied to riscv-to-apply.next
Alistair
Quoted 28 lines
---
Changes in v3:
- Keep theMMU_USER_IDXmacro becausecpu_mmu_index()needs it.
- Link to v2:
https://lore.kernel.org/qemu-devel/[email protected]/Changes in v2:
- Adjust the patch descriptions and rebased on riscv-to-apply.next.
- Link to v1:
https://lore.kernel.org/qemu-devel/[email protected]/target/riscv/cpu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)target/riscv/cpu.h +0
-0@@ -180,7 +180,7 @@ extern RISCVCPUImpliedExtsRule *riscv_multi_ext_implied_rules[];
#defineRISCV_IMPLIED_EXTS_RULE_END-1target/riscv/cpu.h +1
-1-#define MMU_USER_IDX 3 +#define MMU_USER_IDX 0/* MMUIdx_U */
#if !defined(CONFIG_USER_ONLY)
#include "tcg/pmp.h"