From f8f86c4cb91935a7a346a24d57a837bd30e51b49 Mon Sep 17 00:00:00 2001
From: Philippe Pittoli <karchnu@karchnu.fr>
Date: Wed, 12 Feb 2025 07:48:13 +0100
Subject: [PATCH] Update on chapter 3 notes.

---
 notes/chapter3-page-tables | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/notes/chapter3-page-tables b/notes/chapter3-page-tables
index 337cf86..9b7f4e4 100644
--- a/notes/chapter3-page-tables
+++ b/notes/chapter3-page-tables
@@ -76,3 +76,10 @@ Before setting satp, instructions use phy@.
 Each CPU its own satp so each CPU can handle user code.
 
 XV6 = 1 page table per process and 1 page table for the kernel
+XV6 kernel page table:
+- direct mapping for most pages
+- no direct mapping for the trampoline page
+- no direct mapping for stacks' pages
+  => these pages are related to the processes (`kstack` in the `proc` structure)
+  => the kstack is followed by an invalid guard page (PTE_V not set)
+     to prevent memory corruption from stack overflows