mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-25 18:33:24 +00:00
Implement fine grained locks for the page table and adjust APIs
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
ef1ab72ebe
commit
2dbeb92326
@ -227,18 +227,20 @@ fn handle_kernel_page_fault(f: &TrapFrame) {
|
||||
// correctness follows the semantics of the direct mapping of physical memory.
|
||||
// Do the mapping
|
||||
unsafe {
|
||||
page_table.map_unchecked(
|
||||
&(vaddr..vaddr + PAGE_SIZE),
|
||||
&(paddr..paddr + PAGE_SIZE),
|
||||
MapProperty {
|
||||
perm: VmPerm::RW,
|
||||
global: true,
|
||||
#[cfg(feature = "intel_tdx")]
|
||||
extension: PageTableFlags::SHARED.bits() as u64,
|
||||
#[cfg(not(feature = "intel_tdx"))]
|
||||
extension: 0,
|
||||
cache: CachePolicy::Uncacheable,
|
||||
},
|
||||
)
|
||||
page_table
|
||||
.map(
|
||||
&(vaddr..vaddr + PAGE_SIZE),
|
||||
&(paddr..paddr + PAGE_SIZE),
|
||||
MapProperty {
|
||||
perm: VmPerm::RW,
|
||||
global: true,
|
||||
#[cfg(feature = "intel_tdx")]
|
||||
extension: PageTableFlags::SHARED.bits() as u64,
|
||||
#[cfg(not(feature = "intel_tdx"))]
|
||||
extension: 0,
|
||||
cache: CachePolicy::Uncacheable,
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user