pub struct El2;Expand description
Non-VHE EL2 stage-one translation and native exception registers. Guest stage-two translation is a separate VTTBR/VTCR capability.
Implementations§
Source§impl El2
impl El2
Sourcepub unsafe fn init_boot_trap()
pub unsafe fn init_boot_trap()
Installs the early vector using the boot owner’s exception policy.
§Safety
Execute at the corresponding EL with a valid stack and IRQs masked. The vector and boot handler must remain mapped and callable; runtime TLS and CPU-local services need not be initialized.
Sourcepub fn vector_base() -> VirtAddr
pub fn vector_base() -> VirtAddr
Reads the currently installed vector base for this exception level.
Source§impl El2
impl El2
Sourcepub unsafe fn enter(entry: VirtAddr, stack: VirtAddr, argument: usize) -> !
pub unsafe fn enter(entry: VirtAddr, stack: VirtAddr, argument: usize) -> !
Transfers from EL3 to a non-secure AArch64 EL2 boot entry with IRQs masked.
§Safety
Execute at EL3 with exclusive ownership of the lower exception registers. Entry and its 16-byte-aligned exclusive stack must be accessible at EL2; entry accepts its argument in x0. No live stack resource needs destruction.
Source§impl El2
impl El2
Sourcepub fn read_kernel_page_table() -> PhysAddr
pub fn read_kernel_page_table() -> PhysAddr
Returns the non-VHE EL2 kernel’s TTBR0 base.
Sourcepub unsafe fn write_kernel_page_table(root: PhysAddr)
pub unsafe fn write_kernel_page_table(root: PhysAddr)
Replaces the non-VHE EL2 stage-one root without invalidation.
§Safety
The caller must retain the tables and all active EL2 code, stack and data mappings and perform required translation synchronization.
Sourcepub const fn address_space_tag_capacity() -> u32
pub const fn address_space_tag_capacity() -> u32
Non-VHE EL2 native translations have no userspace ASID allocation.
Sourcepub fn flush_tlb_range(start: VirtAddr, size: usize)
pub fn flush_tlb_range(start: VirtAddr, size: usize)
Invalidates all non-VHE EL2 translations intersecting a local byte range.
Source§impl El2
impl El2
Sourcepub unsafe fn configure_stage1(mair: u64)
pub unsafe fn configure_stage1(mair: u64)
Programs the existing four-level, 4-KiB stage-one geometry and MAIR.
§Safety
The caller must own this CPU with IRQs masked before enabling this translation regime. Existing translations must not depend on the old configuration. MAIR slots must agree with every installed descriptor.
Source§impl El2
impl El2
Sourcepub fn is_mmu_enabled() -> bool
pub fn is_mmu_enabled() -> bool
Returns whether this translation regime’s MMU is enabled.
Sourcepub unsafe fn enable_mmu_and_caches()
pub unsafe fn enable_mmu_and_caches()
Enables translation and native cache access for this regime.
§Safety
Valid roots, MAIR and geometry must be installed. The new mappings must retain current code, stack and data until the owner’s next handoff.