aarch64: reenable L2 device pages
This commit is contained in:
parent
699816d61d
commit
ac0432100d
@ -297,13 +297,6 @@ unsafe fn map_device_memory_l2(
|
||||
tlb_flush_vaae1(DEVICE_MAPPING_OFFSET + (i + j) * L2::SIZE);
|
||||
}
|
||||
|
||||
// log::debug!(
|
||||
// "map l2s: base={:#x}, count={} -> {:#x}",
|
||||
// base,
|
||||
// count,
|
||||
// DEVICE_MAPPING_OFFSET + i * L2::SIZE
|
||||
// );
|
||||
|
||||
return Ok(DEVICE_MAPPING_OFFSET + i * L2::SIZE);
|
||||
}
|
||||
|
||||
@ -320,21 +313,20 @@ pub(crate) unsafe fn map_device_memory(
|
||||
let page_count = (l3_offset + size).page_count::<L3>();
|
||||
|
||||
if page_count > 256 {
|
||||
ArchitectureImpl::halt();
|
||||
// // Large mapping, use L2 mapping instead
|
||||
// let l2_aligned = base.page_align_down::<L2>();
|
||||
// let l2_offset = base.page_offset::<L2>();
|
||||
// let page_count = (l2_offset + size).page_count::<L2>();
|
||||
// Large mapping, use L2 mapping instead
|
||||
let l2_aligned = base.page_align_down::<L2>();
|
||||
let l2_offset = base.page_offset::<L2>();
|
||||
let page_count = (l2_offset + size).page_count::<L2>();
|
||||
|
||||
// let base_address = map_device_memory_l2(l2_aligned, page_count, attrs)?;
|
||||
// let address = base_address + l2_offset;
|
||||
let base_address = map_device_memory_l2(l2_aligned, page_count, attrs)?;
|
||||
let address = base_address + l2_offset;
|
||||
|
||||
// Ok(RawDeviceMemoryMapping::from_raw_parts(
|
||||
// address,
|
||||
// base_address,
|
||||
// page_count,
|
||||
// L2::SIZE,
|
||||
// ))
|
||||
Ok(RawDeviceMemoryMapping::from_raw_parts(
|
||||
address,
|
||||
base_address,
|
||||
page_count,
|
||||
L2::SIZE,
|
||||
))
|
||||
} else {
|
||||
// Just map the pages directly
|
||||
let base_address = map_device_memory_l3(l3_aligned, page_count, attrs)?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user