summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_gpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/gsp_phys_gpu.h')
-rw-r--r--kernel/gsp_phys_gpu.h43
1 files changed, 41 insertions, 2 deletions
diff --git a/kernel/gsp_phys_gpu.h b/kernel/gsp_phys_gpu.h
index f93603c..a89493b 100644
--- a/kernel/gsp_phys_gpu.h
+++ b/kernel/gsp_phys_gpu.h
@@ -3,6 +3,8 @@
#include <linux/types.h>
+struct nv_vgpu_device;
+
/*
* Physical GPU ownership (real-GSP execution backend, bring-up rung 1).
* Claim is disabled unless the gsp_phys_gpu module parameter is set.
@@ -352,6 +354,10 @@ int gsp_phys_rmcall_gr_mail_patch_value(void);
/* m106: pre-install the data PT window pool in stage 3. */
int gsp_phys_rmcall_gr_data_prewin_value(void);
+/* B-2: use the grown 64 MiB boot-fixed data-bounce region (default 1; 0 =
+ * legacy 205-page window). Read by the stage-3 plant and the SVC fill. */
+int gsp_phys_gr_data_region_value(void);
+
/* m113: re-register the VAS page directory after planting data. */
int gsp_phys_rmcall_gr_recommit_value(void);
@@ -365,6 +371,10 @@ unsigned int gsp_phys_rmcall_gr_lmem_tpc_size_value(void);
/* m72: log SKED CWD/HWW register transitions during the launch poll. */
int gsp_phys_rmcall_gr_skedrec_value(void);
+/* m153: re-execute a forwarded launch whose retirement wait saw zero or
+ * wrong-place engine writes (default 1 = enabled). */
+int gsp_phys_rmcall_gr_nowrite_retry_value(void);
+
/* m73: use host-visible sysmem chunks for V7 instance/RAMFC (m62 shape). */
int gsp_phys_rmcall_gr_inst_sys_value(void);
@@ -425,21 +435,50 @@ bool gsp_phys_rmcall_vas_shared_value(void);
int gsp_phys_gpa_to_hpa(u64 gpa, u64 *hpa_out);
/*
+ * Per-mdev variant: translate the GPA for the named owning vgpu (a captured
+ * forwarding request, a held release). The vgpu's own guest-RAM record is
+ * authoritative; the legacy record still serves the FIRST open mdev so
+ * single-guest callers are unchanged. NULL keeps the historical resolution
+ * (first open mdev). A named vgpu whose session is closed returns -ENODEV
+ * rather than being retargeted at another guest.
+ */
+int gsp_phys_gpa_to_hpa_vgpu(struct nv_vgpu_device *vgpu, u64 gpa,
+ u64 *hpa_out);
+
+/*
* Guest RAM backing-file configuration (debugfs gsp-phys-guest-ram). One
- * shared file per module cycle, up to four GPA->file-offset ranges keyed by
+ * record per guest session, up to four GPA->file-offset ranges keyed by
* gpa_base. The first configure opens the file; the same path adds/replaces
* ranges, a different path is refused -EBUSY, and the ranges are dropped and
- * the file closed by gsp_phys_guest_ram_clear() on physical-GPU release. The
+ * the file closed by gsp_phys_guest_ram_clear() on physical-GPU release (or
+ * gsp_phys_guest_ram_vgpu_clear() when one mdev is removed). The
+ * gsp_phys_guest_ram_configure() entry point configures the legacy record
+ * (the historical top-level debugfs write: serves the first/only open mdev);
+ * gsp_phys_guest_ram_configure_vgpu() binds the record to one mdev. The
* state accessor is lock-safe and writes "active=0" or the active path,
* range count and per-range gpa/off/size into the caller's buffer.
*/
int gsp_phys_guest_ram_configure(const char *path, u64 gpa_base,
u64 file_offset, u64 size);
+int gsp_phys_guest_ram_configure_vgpu(struct nv_vgpu_device *vgpu,
+ const char *path, u64 gpa_base,
+ u64 file_offset, u64 size);
void gsp_phys_guest_ram_clear(void);
+void gsp_phys_guest_ram_vgpu_clear(struct nv_vgpu_device *vgpu);
bool gsp_phys_guest_ram_active(void);
void gsp_phys_guest_ram_state(char *buf, size_t len);
/*
+ * Open-mdev helpers for the per-mdev debugfs selector and the single-guest
+ * guards: count the mdevs whose VFIO device is open, or resolve one open
+ * mdev by its device name (the mdev UUID). The returned device is not
+ * reference-counted; the caller must only use it while that mdev's fd is
+ * known to be open.
+ */
+int gsp_phys_open_mdev_count(void);
+struct nv_vgpu_device *gsp_phys_open_mdev_by_name(const char *name);
+
+/*
* Domain shape of the physical (claimed) device, as the P6a engine path
* needs it: the module programs raw host PAs into the CE page tables, so the
* engine may only run when the physical device's DMA addresses ARE host PAs.