Skip to content

Commit 851eee4

Browse files
hoshinolinajannau
authored andcommitted
drm/asahi: mmu: Wire up kernel AS dumper
Signed-off-by: Asahi Lina <[email protected]>
1 parent 0df8326 commit 851eee4

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

drivers/gpu/drm/asahi/mmu.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,17 @@ pub(crate) const IOVA_USER_TOP: u64 = 1 << (UAT_IAS as u64);
100100
pub(crate) const IOVA_USER_RANGE: Range<u64> = IOVA_USER_BASE..IOVA_USER_TOP;
101101

102102
/// Upper/kernel base VA
103-
// const IOVA_TTBR1_BASE: usize = 0xffffff8000000000;
103+
#[cfg(CONFIG_DEV_COREDUMP)]
104+
const IOVA_TTBR1_BASE: u64 = 0xffffff8000000000;
104105
/// Driver-managed kernel base VA
105106
const IOVA_KERN_BASE: u64 = 0xffffffa000000000;
106107
/// Driver-managed kernel top VA
107108
const IOVA_KERN_TOP: u64 = 0xffffffb000000000;
108-
/// Lower/user VA range
109+
/// Driver-managed kernel VA range
109110
const IOVA_KERN_RANGE: Range<u64> = IOVA_KERN_BASE..IOVA_KERN_TOP;
111+
/// Full kernel VA range
112+
#[cfg(CONFIG_DEV_COREDUMP)]
113+
const IOVA_KERN_FULL_RANGE: Range<u64> = IOVA_TTBR1_BASE..(!UAT_PGMSK as u64);
110114

111115
const TTBR_VALID: u64 = 0x1; // BIT(0)
112116
const TTBR_ASID_SHIFT: usize = 48;
@@ -1390,6 +1394,12 @@ impl Uat {
13901394
&self.kernel_lower_vm
13911395
}
13921396

1397+
#[cfg(CONFIG_DEV_COREDUMP)]
1398+
pub(crate) fn dump_kernel_pages(&self) -> Result<KVVec<pgtable::DumpedPage>> {
1399+
let mut inner = self.kernel_vm.inner.exec_lock(None, false)?;
1400+
inner.page_table.dump_pages(IOVA_KERN_FULL_RANGE)
1401+
}
1402+
13931403
/// Returns the base physical address of the TTBAT region.
13941404
pub(crate) fn ttb_base(&self) -> u64 {
13951405
let inner = self.inner.lock();

0 commit comments

Comments
 (0)