diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-05 12:25:05 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-05 12:25:05 -0400 |
| commit | 549d1e8126f96b3515d37037ae22e0dce430c20b (patch) | |
| tree | 5fc949da9f724b75a84dc8b5fdc4e6462ff94335 /kernel/include/nvidia-vgpu-vfio.h | |
| parent | 3b1dcb87279a2f58210b87028a39c9a0932faf2c (diff) | |
| download | open-iov-549d1e8126f96b3515d37037ae22e0dce430c20b.tar.gz open-iov-549d1e8126f96b3515d37037ae22e0dce430c20b.zip | |
vgsp: per-mdev emulated VRAM size (1.0 multiple mediate sizes)
- nv_vgpu_type_info/ioctl gain vram_mb; nv_vgpu_device gains fb_emul_size
bound from the mdev type at create (default 512 MiB).
- New nvidia-vgpu-turing-1g type (1024 MiB); turing max_instances 1 -> 2;
show_description reports the per-type framebuffer and max_instance.
- Thread fb_emul_size through GSCI fb_length/region/frtsOffset, WPR2,
NV_PFB_PRI_MMU_LOCAL_MEMORY_RANGE, the vidmem allocator bound and the BAR1
shadow; bar_info callback uses the per-device size.
- UNTESTED at commit time: builds clean; validation blocked by the Xid 140
incident (reboot pending). See Handoff-vGPU-IO.md ADDENDUM 48.
Diffstat (limited to 'kernel/include/nvidia-vgpu-vfio.h')
| -rw-r--r-- | kernel/include/nvidia-vgpu-vfio.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/include/nvidia-vgpu-vfio.h b/kernel/include/nvidia-vgpu-vfio.h index ccd7262..bed90a7 100644 --- a/kernel/include/nvidia-vgpu-vfio.h +++ b/kernel/include/nvidia-vgpu-vfio.h @@ -137,6 +137,11 @@ struct nv_vgpu_device { u64 fb_base; u64 fb_size; + /* Emulated framebuffer/vidmem size for this mdev, from its type's + * vram_mb (nv_vgpu_type_info); defaults to NV_VGPU_EMUL_FB_SIZE. All + * emulated-GSP consumers (GSCI fb_length/lb region/frtsOffset, WPR2, + * LOCAL_MEMORY_RANGE, vidmem allocator, BAR shadow) must agree. */ + u64 fb_emul_size; u64 bar0_config_base; struct list_head list; @@ -223,6 +228,13 @@ static inline struct nv_vgpu_device *mdev_to_vgpu(struct mdev_device *mdev) return dev_get_drvdata(&mdev->dev); } +/* Per-mdev emulated framebuffer size in bytes (default 512 MiB). */ +static inline u64 nv_vgpu_fb_emul_size(const struct nv_vgpu_device *vgpu) +{ + return (vgpu && vgpu->fb_emul_size) ? vgpu->fb_emul_size : + NV_VGPU_EMUL_FB_SIZE; +} + /* NULL-tolerant logging: emulation paths may run with a NULL vgpu * (e.g. unit tests, early init) - fall back to plain pr_*. */ #define nv_vgpu_dbg(vgpu, fmt, ...) do { \ |
