From fcd603db457c0fb035df882abc55397bc854a1cd Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 22 Sep 2026 21:55:54 -0400 Subject: BAR2 verify test fix: remove PRAMIN sync + contiguous ALLOC + vidmem VA allocator Fixes the BAR2 verify test (kbusVerifyBar2_GM107): 1. Removed PRAMIN window sync from emulated BAR1 - the sync was overwriting test data written by the driver through the vBar2 aperture. The shadow BAR0 is already consistent (guest writes/reads hit the same shadow location). 2. Added contiguous page allocation for golden image (alloc_pages with order for large allocations, falling back to individual pages). 3. Added vidmem VA allocator - ALLOC now returns GPU VAs within the emulated GPU's vidmem range (0x100000 - fb_size) instead of default 4GB, so the memmgr accepts them. Verified: driver probes past RmInitNvDevice bus init, reaches golden image channel allocation (progress from fn-10 FREE timeout). --- kernel/main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'kernel/main.c') diff --git a/kernel/main.c b/kernel/main.c index f37be6e..0fea09e 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -1138,6 +1138,11 @@ static int nv_vgpu_vfio_dev_mmap(struct vfio_device *vdev, struct vm_area_struct vma->vm_page_prot)) return -EAGAIN; } + /* Debug: log PRAMIN window mapping for BAR2 verify debugging */ + if (shadow_off <= 0x70e000 && shadow_off + size > 0x70e000) { + pr_info("nvidia-vgpu-vfio: BAR0 mmap covers PRAMIN[0xe000] shadow_off=0x%lx size=0x%lx\n", + shadow_off, size); + } return 0; } -- cgit v1.2.3