Skip to content

Commit be07cbf

Browse files
hoshinolinajannau
authored andcommitted
drm/asahi: mmu: Wire up kernel AS dumper
Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent fca87dd commit be07cbf

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

drivers/gpu/drm/asahi/mmu.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,15 @@ pub(crate) const IOVA_USER_TOP: u64 = 1 << (UAT_IAS as u64);
6666
pub(crate) const IOVA_USER_RANGE: Range<u64> = IOVA_USER_BASE..IOVA_USER_TOP;
6767

6868
/// Upper/kernel base VA
69-
// const IOVA_TTBR1_BASE: usize = 0xffffff8000000000;
69+
const IOVA_TTBR1_BASE: u64 = 0xffffff8000000000;
7070
/// Driver-managed kernel base VA
7171
const IOVA_KERN_BASE: u64 = 0xffffffa000000000;
7272
/// Driver-managed kernel top VA
7373
const IOVA_KERN_TOP: u64 = 0xffffffb000000000;
74-
/// Lower/user VA range
74+
/// Driver-managed kernel VA range
7575
const IOVA_KERN_RANGE: Range<u64> = IOVA_KERN_BASE..IOVA_KERN_TOP;
76+
/// Full kernel VA range
77+
const IOVA_KERN_FULL_RANGE: Range<u64> = IOVA_TTBR1_BASE..(!UAT_PGMSK as u64);
7678

7779
const TTBR_VALID: u64 = 0x1; // BIT(0)
7880
const TTBR_ASID_SHIFT: usize = 48;
@@ -1356,6 +1358,11 @@ impl Uat {
13561358
&self.kernel_lower_vm
13571359
}
13581360

1361+
pub(crate) fn dump_kernel_pages(&self) -> Result<KVVec<pgtable::DumpedPage>> {
1362+
let mut inner = self.kernel_vm.inner.exec_lock(None, false)?;
1363+
inner.page_table.dump_pages(IOVA_KERN_FULL_RANGE)
1364+
}
1365+
13591366
/// Returns the base physical address of the TTBAT region.
13601367
pub(crate) fn ttb_base(&self) -> u64 {
13611368
let inner = self.inner.lock();

0 commit comments

Comments
 (0)