From f4b83713672acaf88a526b930b8e417453f6edc5 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Sun, 3 Oct 2021 21:49:00 -0400 Subject: Comment fixup and abort if runlist is stored in VRAM --- nvdebug_entry.c | 1 + runlist.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nvdebug_entry.c b/nvdebug_entry.c index 14ad6e9..0854b8b 100644 --- a/nvdebug_entry.c +++ b/nvdebug_entry.c @@ -6,6 +6,7 @@ * - Add sysfs trigger for a preemption */ +#include // For struct device, bus_find_device*(), struct bus_type #include #include #include // So we can set up entries in /proc diff --git a/runlist.c b/runlist.c index 03528af..c8ff99f 100644 --- a/runlist.c +++ b/runlist.c @@ -1,4 +1,4 @@ -#include // For struct device, bus_find_device*() +#include // For struct device, bus_find_device*(), struct bus_type //#include // For struct iommu_domain #include // Kernel types #include @@ -68,6 +68,11 @@ int get_runlist_iter(struct runlist_iter *rl_iter) { runlist_iova = ((u64)rl_base.ptr) << 12; printk(KERN_INFO "[nvdebug] Runlist ptr: %x, type: %d, raw: %x, IOVA: %px\n", rl_base.ptr, rl_base.type, rl_base.raw, (void*)runlist_iova); + // TODO: Support reading video memory + if (rl_base.type == TARGET_VID_MEM) { + printk(KERN_ERR "[nvdebug] Runlist is located in video memory. Access to video memory is unimplemented."); + return -ENOTSUPP; + } // Segfaults //u32 attempted_read = ioread32(runlist_iova); //printk(KERN_INFO "[nvdebug] first word of runlist: %0x\n", attempted_read); -- cgit v1.2.2