pub struct Kpti { /* private fields */ }Expand description
KPTI (Kernel Page Table Isolation) support for Meltdown mitigation.
On x86_64, this manages separate kernel and user page tables so that kernel memory is not mapped in user-space page tables.
Implementations§
Source§impl Kpti
impl Kpti
pub fn new() -> Self
Sourcepub fn set_page_tables(&self, kernel_cr3: u64, user_cr3: u64)
pub fn set_page_tables(&self, kernel_cr3: u64, user_cr3: u64)
Set page table addresses for KPTI.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if KPTI is enabled.
Sourcepub fn kernel_cr3(&self) -> u64
pub fn kernel_cr3(&self) -> u64
Get the kernel page table address.
Sourcepub fn switch_to_kernel(&self)
pub fn switch_to_kernel(&self)
Switch to kernel page table (called on syscall entry / interrupt).
Sourcepub fn switch_to_user(&self)
pub fn switch_to_user(&self)
Switch to user page table (called on syscall exit / iret).