Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/riscv Don't set A, D in page table pointers, but do...



details:   https://anonhg.NetBSD.org/src/rev/89155a1375fd
branches:  trunk
changeset: 371230:89155a1375fd
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Sep 30 06:23:58 2022 +0000

description:
Don't set A, D in page table pointers, but do set them in leaf entries.

Beagle-v now boots to the msgbufaddr panic same as qemu

diffstat:

 sys/arch/riscv/include/pte.h  |  4 ++--
 sys/arch/riscv/riscv/locore.S |  4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r cb5fc9f1713f -r 89155a1375fd sys/arch/riscv/include/pte.h
--- a/sys/arch/riscv/include/pte.h      Thu Sep 29 18:58:04 2022 +0000
+++ b/sys/arch/riscv/include/pte.h      Fri Sep 30 06:23:58 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pte.h,v 1.7 2022/09/21 06:34:30 skrll Exp $ */
+/* $NetBSD: pte.h,v 1.8 2022/09/30 06:23:58 skrll Exp $ */
 
 /*
  * Copyright (c) 2014, 2019, 2021 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
 #define        PTE_V           __BIT(0)        // Valid
 
 #define PTE_HARDWIRED  (PTE_A | PTE_D)
-#define PTE_KERN       (PTE_V | PTE_G)
+#define PTE_KERN       (PTE_V | PTE_G | PTE_A | PTE_D)
 #define PTE_RW         (PTE_R | PTE_W)
 #define PTE_RX         (PTE_R | PTE_X)
 
diff -r cb5fc9f1713f -r 89155a1375fd sys/arch/riscv/riscv/locore.S
--- a/sys/arch/riscv/riscv/locore.S     Thu Sep 29 18:58:04 2022 +0000
+++ b/sys/arch/riscv/riscv/locore.S     Fri Sep 30 06:23:58 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.28 2022/09/28 06:05:28 skrll Exp $ */
+/* $NetBSD: locore.S,v 1.29 2022/09/30 06:23:59 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2022 The NetBSD Foundation, Inc.
@@ -190,7 +190,7 @@
 
        call    clear_bss               // zero through kernel_end (inc. stack)
 
-       li      s7, PTE_KERN            // for megapages
+       li      s7, PTE_V               // page table pointer {X,W,R} = {0,0,0}
 
        // We allocated the kernel first PDE page so let's insert in the
        // page table.



Home | Main Index | Thread Index | Old Index