Spike uarch needs TLB flush after SPTBR write
authorAndrew Waterman <andrew@sifive.com>
Sat, 18 Feb 2017 11:03:10 +0000 (03:03 -0800)
committerAndrew Waterman <andrew@sifive.com>
Sat, 18 Feb 2017 11:03:10 +0000 (03:03 -0800)
riscv/encoding.h
riscv/processor.cc

index d205761b3eef43d83c2070a731971d2fe23ebdf3..9a87807c818b2d2cdc0e8336883b5e0a8f4e3438 100644 (file)
@@ -19,7 +19,6 @@
 #define MSTATUS_MPRV        0x00020000
 #define MSTATUS_PUM         0x00040000
 #define MSTATUS_MXR         0x00080000
-#define MSTATUS_VM          0x1F000000
 #define MSTATUS32_SD        0x80000000
 #define MSTATUS64_SD        0x8000000000000000
 
index 1883757cca09fc1c9453fbf6202f09b81070d9ef..ddef0e271c257106aca41ac6ff7cdf1a20ee453b 100644 (file)
@@ -362,6 +362,7 @@ void processor_t::set_csr(int which, reg_t val)
       return set_csr(CSR_MIE,
                      (state.mie & ~state.mideleg) | (val & state.mideleg));
     case CSR_SPTBR: {
+      mmu->flush_tlb();
       if (max_xlen == 32)
         state.sptbr = val & (SPTBR32_PPN | SPTBR32_MODE);
       if (max_xlen == 64 && (get_field(val, SPTBR64_MODE) == SPTBR_MODE_OFF ||