diff options
author | Ian Moffett <ian@osmora.org> | 2025-09-27 06:46:21 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-09-27 06:53:33 -0400 |
commit | add156b750d77132ca2d063a4718ac1a5139e59a (patch) | |
tree | 5a449e43ee4c81333f08a244b4a6e30392d5d13c | |
parent | 232ccad4e8f8f343461fa3248538157798d88005 (diff) |
kern/amd64: mmu: Map with zero if prot is also zero
To ensure that all residual data does not remain for the mapping in its
table, we write a flat zero if prot is also zero i.e., no permissions
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | src/sys/arch/amd64/cpu/mmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sys/arch/amd64/cpu/mmu.c b/src/sys/arch/amd64/cpu/mmu.c index 89f53f0..04b43c1 100644 --- a/src/sys/arch/amd64/cpu/mmu.c +++ b/src/sys/arch/amd64/cpu/mmu.c @@ -342,7 +342,7 @@ mmu_map_single(struct vm_vas *vas, struct mmu_map *spec, int prot) * TLB entry. */ index = mmu_get_level(spec->va, MMU_TBL); - pte[index] = pte_flags | spec->pa; + pte[index] = (prot == 0) ? 0 : (pte_flags | spec->pa); __invlpg((void *)spec->va); return 0; } |