From: Megan Wachs Date: Fri, 27 Apr 2018 23:52:43 +0000 (-0700) Subject: debug: need to clear satp before changing priv X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=65b4e2e93c7cee0a53143c661e1347363e6d6194;p=riscv-tests.git debug: need to clear satp before changing priv ISA Manual does not require this register to be reset, and attempting to execute code with VM on when VM hasn't been set up is going to just lead to sadness. --- diff --git a/debug/gdbserver.py b/debug/gdbserver.py index d085e2e..af9a334 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -881,6 +881,13 @@ class PrivRw(PrivTest): # PMP registers are optional pass + # Ensure Virtual Memory is disabled if applicable (SATP register is not reset) + try: + self.gdb.p("$satp=0") + except testlib.CouldNotFetch: + # SATP only exists if you have S mode. + pass + # Leave the PC at _start, where the first 4 instructions should be # legal in any mode. for privilege in range(4):