Re: How can I impliment Paging
Posted: Sun Mar 03, 2024 12:41 pm
Even in that case there still is a race condition as what if the CPU speculatively reads from the junk PTE? Then you just read junk data into the pipeline
The Place to Start for Operating System Developers
http://f.osdev.org/
OK, understood, it's a difference in terminology.iProgramInCpp wrote:I said specifically the last level. The memory associated with the last level (whose entry belongs in a PT on x86 32-bit) isn't associated with the paging structure, rather being actual usable memory. It doesn't matter if the TLB reads the entry associated with that page before it's mapped. In fact you don't strictly have to zero that page out at all! Sure, you will be able to read what was in that page, but you're the kernel, and when dishing out pages to user space you of course would zero them out anyway.thewrongchristian wrote:Loading in uninitialised memory into the paging structure is very dangerous
Of course the other levels need to be zeroed out before being inserted. I was saying that the whole time!
What junk PTE? There is no junk PTE. The last level means the actual page itself.nexos wrote:Even in that case there still is a race condition as what if the CPU speculatively reads from the junk PTE? Then you just read junk data into the pipeline