From ba433a148b519124fbe7060a10854de7f7e1f4d0 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Sun, 8 Nov 2026 07:29:37 -0500 Subject: vgsp: bar1_full A/B knob for the display instance-memory mapping The guest sees a 256 MiB BAR1 over a 512 MiB FB, so the display instance block at 0x1fff0000 (top of FB) is not directly mappable and the guest's hash-table writes never reach the emulated vidmem shadow (r1633: notifier ctxDMA handles 0x10013/0x10075 unresolvable; not in the shadow, not in guest RAM; 0x20800afa GSP-DMA never sent). bar1_full=1 exposes the whole emulated FB as BAR1 (the m143 behaviour) so the test can settle whether the aperture is the missing link; the default keeps the historical 256 MiB physical aperture (CUDA-safe). --- kernel/bar_init.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'kernel/bar_init.c') diff --git a/kernel/bar_init.c b/kernel/bar_init.c index 6515613..5fa889a 100644 --- a/kernel/bar_init.c +++ b/kernel/bar_init.c @@ -8,6 +8,11 @@ #include "gsp_phys_gpu.h" #include "irq.h" +static bool nv_vgpu_bar1_full; +module_param_named(bar1_full, nv_vgpu_bar1_full, bool, 0644); +MODULE_PARM_DESC(bar1_full, + "Expose the full emulated FB size as the BAR1 aperture (default 0 = physical 256 MiB; A/B for the display instance-memory mapping)"); + int nv_vgpu_bar_init(struct nv_vgpu_device *vgpu) { struct pci_dev *pdev = vgpu->pdev; @@ -72,7 +77,19 @@ int nv_vgpu_bar_init(struct nv_vgpu_device *vgpu) * its BAR1 from the VFIO region info and vidmem bounds/mmap * math must match the shadow.) */ - vgpu->bars[1].size = bar_size; + /* + * A/B knob for the display instance-memory mapping: the RM + * addresses the 64 KB display instance block at the top of + * the emulated FB (0x1fff0000 with a 512 MiB FB). With the + * physical 256 MiB BAR1 aperture that address is not + * directly mappable, and the guest's instance-memory writes + * never reach the emulated vidmem shadow (r1633: notifier + * context-DMA handles unresolvable). bar1_full=1 exposes + * the whole emulated FB as BAR1 for this test; default 0 + * keeps the historical 256 MiB aperture (CUDA-safe). + */ + vgpu->bars[1].size = nv_vgpu_bar1_full ? + nv_vgpu_fb_emul_size(vgpu) : bar_size; /* Emulated vidmem: a dedicated host-RAM buffer backing the guest's * VRAM aperture. Do NOT map the host GPU's real BAR1 - guest VRAM * accesses must hit our own clean buffer, not the (broken) host -- cgit v1.2.3