aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/arch/memory/mmu.hpp2
-rw-r--r--arch/x86_64/arch/memory/page_table.hpp34
2 files changed, 26 insertions, 10 deletions
diff --git a/arch/x86_64/arch/memory/mmu.hpp b/arch/x86_64/arch/memory/mmu.hpp
index 934aa63f..f824ba53 100644
--- a/arch/x86_64/arch/memory/mmu.hpp
+++ b/arch/x86_64/arch/memory/mmu.hpp
@@ -11,6 +11,8 @@ namespace arch::memory
auto tlb_flush(kapi::memory::linear_address address) -> void;
//! Invalidate all translation lookaside buffer (TLB) entries
+ //!
+ //! @note Once CR4.PGE is set, this function will no longer flush TLB entries for global pages.
auto tlb_flush_all() -> void;
} // namespace arch::memory
diff --git a/arch/x86_64/arch/memory/page_table.hpp b/arch/x86_64/arch/memory/page_table.hpp
index 0c0f1a77..c34f72e0 100644
--- a/arch/x86_64/arch/memory/page_table.hpp
+++ b/arch/x86_64/arch/memory/page_table.hpp
@@ -40,16 +40,30 @@ namespace arch::memory
enum struct flags : std::uint64_t
{
empty = 0,
- present = 1uz << 0, //!< The page is mapped.
- writable = 1uz << 1, //!< The page is writable.
- user_accessible = 1uz << 2, //!< The page is accessible in user mode.
- write_through = 1uz << 3, //!< Any writes to the page must immediately hit memory.
- disable_cache = 1uz << 4, //!< Any writes to the page must never be cached.
- accessed = 1uz << 5, //!< The page was accessed.
- dirty = 1uz << 6, //!< The page was written to.
- huge_page = 1uz << 7, //!< The page is huge.
- global = 1uz << 8, //!< The TLB entry for this page must not be flushed on context switches.
- no_execute = 1uz << 63, //!< The data in this page must not be executed.
+ //! The page is mapped.
+ present = 1uz << 0,
+ //! The page is writable.
+ writable = 1uz << 1,
+ //! The page is accessible in user mode.
+ user_accessible = 1uz << 2,
+ //! Any writes to the page must immediately hit memory.
+ write_through = 1uz << 3,
+ //! Any writes to the page must never be cached.
+ disable_cache = 1uz << 4,
+ //! The page was accessed.
+ accessed = 1uz << 5,
+ //! The page was written to.
+ dirty = 1uz << 6,
+ //! The page is huge.
+ huge_page = 1uz << 7,
+ //! The TLB entry for this page must not be flushed on context switches.
+ //!
+ //! @note This flag is currently not honored by this implementation, since the CR4.PGE bit is not set. As a
+ //! consequence, any CR3 reload or a call to arch::memory::tlb_flush_all will still flush this entry on context
+ //! switches.
+ global = 1uz << 8,
+ //! The data in this page must not be executed.
+ no_execute = 1uz << 63,
};
//! Construct an empty entry.