This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 37bf542c9e mpfs/mpfs_shead.S: Remove MMU mappings and flush TLB upon
boot
37bf542c9e is described below
commit 37bf542c9ee19d54b295f0a6b70df9237d5c702d
Author: Ville Juven <[email protected]>
AuthorDate: Fri Jun 9 13:42:48 2023 +0300
mpfs/mpfs_shead.S: Remove MMU mappings and flush TLB upon boot
This fixes warm reset crash when trying to access memory via old stale
MMU mappings
---
arch/risc-v/src/mpfs/mpfs_shead.S | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/risc-v/src/mpfs/mpfs_shead.S
b/arch/risc-v/src/mpfs/mpfs_shead.S
index 508025ff31..9c124c4011 100644
--- a/arch/risc-v/src/mpfs/mpfs_shead.S
+++ b/arch/risc-v/src/mpfs/mpfs_shead.S
@@ -84,6 +84,11 @@ __start:
la gp, __global_pointer$
.option pop
+ /* Remove MMU mappings (if any) and flush TLB */
+
+ csrw satp, zero
+ sfence.vma x0, x0
+
/* Make sure the writes to CSR stick before continuing */
fence