diff --git a/riscv/encoding.h b/riscv/encoding.h index 1fb0e51d..776a2aed 100644 --- a/riscv/encoding.h +++ b/riscv/encoding.h @@ -4,7 +4,7 @@ /* * This file is auto-generated by running 'make' in - * https://github.com/riscv/riscv-opcodes (56f9011) + * https://github.com/riscv/riscv-opcodes (3deaa8c) */ #ifndef RISCV_CSR_ENCODING_H @@ -383,6 +383,9 @@ #define PMP_NA4 0x10 #define PMP_NAPOT 0x18 +#define SPMP_U 0x100 +#define SPMP_SHARED 0x200 + #define MCTRCTL_U 0x0000000000000001 #define MCTRCTL_S 0x0000000000000002 #define MCTRCTL_M 0x0000000000000004 @@ -492,7 +495,8 @@ #define PTE_A 0x040 /* Accessed */ #define PTE_D 0x080 /* Dirty */ #define PTE_SOFT 0x300 /* Reserved for Software */ -#define PTE_RSVD 0x1FC0000000000000 /* Reserved for future standard use */ +#define PTE_SVRSW60T59B 0x1800000000000000 /* Svrsw60t59b: Reserved for software use */ +#define PTE_RSVD 0x07C0000000000000 /* Reserved for future standard use */ #define PTE_PBMT 0x6000000000000000 /* Svpbmt: Page-based memory types */ #define PTE_N 0x8000000000000000 /* Svnapot: NAPOT translation contiguity */ #define PTE_ATTR 0xFFC0000000000000 /* All attributes and reserved bits */ diff --git a/riscv/isa_parser.h b/riscv/isa_parser.h index 29bb1441..8815ec2d 100644 --- a/riscv/isa_parser.h +++ b/riscv/isa_parser.h @@ -49,6 +49,7 @@ typedef enum { EXT_SVPBMT, EXT_SVINVAL, EXT_SVUKTE, + EXT_SVRSW60T59B, EXT_ZDINX, EXT_ZFA, EXT_ZFBFMIN, diff --git a/riscv/mmu.cc b/riscv/mmu.cc index 7ca85bba..027c939a 100644 --- a/riscv/mmu.cc +++ b/riscv/mmu.cc @@ -561,6 +561,8 @@ reg_t mmu_t::s2xlate(reg_t gva, reg_t gpa, access_type type, access_type trap_ty if (pte & PTE_RSVD) { break; + } else if (!proc->extension_enabled(EXT_SVRSW60T59B) && (pte & PTE_SVRSW60T59B)) { + break; } else if (!proc->extension_enabled(EXT_SVNAPOT) && (pte & PTE_N)) { break; } else if (!pbmte && (pte & PTE_PBMT)) { @@ -691,6 +693,8 @@ reg_t mmu_t::walk(mem_access_info_t access_info) if (pte & PTE_RSVD) { break; + } else if (!proc->extension_enabled(EXT_SVRSW60T59B) && (pte & PTE_SVRSW60T59B)) { + break; } else if (!proc->extension_enabled(EXT_SVNAPOT) && (pte & PTE_N)) { break; } else if (!pbmte && (pte & PTE_PBMT)) {