Disable PMP for PrivRw test.
authorTim Newsome <tim@sifive.com>
Thu, 16 Nov 2017 23:40:27 +0000 (15:40 -0800)
committerTim Newsome <tim@sifive.com>
Thu, 16 Nov 2017 23:40:27 +0000 (15:40 -0800)
debug/gdbserver.py

index 43ac1e0ca9b02a2063f599424771caf300c429af..3e61449ce8daa9550a127bdb3060fcf27ebb8db0 100755 (executable)
@@ -814,6 +814,11 @@ class PrivTest(GdbTest):
 class PrivRw(PrivTest):
     def test(self):
         """Test reading/writing priv."""
+        # Disable physical memory protection by allowing U mode access to all
+        # memory.
+        self.gdb.p("$pmpcfg0=0xf")  # TOR, R, W, X
+        self.gdb.p("$pmpaddr0=0x%x" % ((self.hart.ram + self.hart.ram_size) >> 2))
+
         # Leave the PC at _start, where the first 4 instructions should be
         # legal in any mode.
         for privilege in range(4):