summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/bar_init.c19
1 files changed, 18 insertions, 1 deletions
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