summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.h
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-01 21:59:42 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-01 21:59:42 -0400
commit954277863e8206d2ddf6058b8958a34eee22576b (patch)
tree9cbb8f9787cc44df1a9bbad1a4cc5b4fc9f48271 /kernel/gsp_phys_booter.h
parent684dbe2e5c01b7f27e6fe15242b318057454ac5a (diff)
downloadopen-iov-954277863e8206d2ddf6058b8958a34eee22576b.tar.gz
open-iov-954277863e8206d2ddf6058b8958a34eee22576b.zip
gsp-phys: backend session API skeleton (P0, inert)
Diffstat (limited to 'kernel/gsp_phys_booter.h')
-rw-r--r--kernel/gsp_phys_booter.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/kernel/gsp_phys_booter.h b/kernel/gsp_phys_booter.h
index 0902830..15068ff 100644
--- a/kernel/gsp_phys_booter.h
+++ b/kernel/gsp_phys_booter.h
@@ -90,6 +90,60 @@ void gsp_phys_boot_quiesce(void __iomem *bar0);
void gsp_phys_boot_staging_free(struct pci_dev *pdev);
/*
+ * Backend session transport API (P0 skeleton; inert until the guest plane
+ * forwards). The session state/refcount/owner live in gsp_phys_gpu.c; these
+ * entry points share gsp_phys_rm_lock with the boot/probe/ladder paths so
+ * there is one real-GSP RPC at a time. Callers check gsp_phys_backend_state()
+ * first and call here; this file never takes the session lock itself (lock
+ * order: session lock outermost, rm lock inner).
+ *
+ * gsp_phys_backend_rpc() re-checks READY and the generation under the rm
+ * lock and refuses (-EAGAIN) without touching the device when the session is
+ * not live. On success *reply owns a kmalloc'd copy of the reply payload
+ * (*reply_len bytes, NULL/0 for an empty payload, caller frees).
+ *
+ * gsp_phys_backend_static_snapshot() returns the cached static-config fields
+ * decoded from the function-65 reply; the cache is filled at READY in a
+ * later phase, so it currently reports -ENODATA.
+ */
+#define GSP_PHYS_BACKEND_GPU_NAME_LEN 64
+
+struct gsp_phys_backend_static_config {
+ bool valid; /* cache holds a decoded function-65 reply */
+ u32 fw_crc32; /* cache key: loaded firmware image */
+ u32 payload_len; /* decoded reply payload bytes */
+ u32 h_internal_client;
+ u32 h_internal_device;
+ u32 h_internal_subdevice;
+ u64 bar1_pde_base;
+ u64 bar2_pde_base;
+ u64 fb_length;
+ u64 fbio_mask;
+ u64 fbp_mask;
+ u32 fb_bus_width;
+ u32 fb_ram_type;
+ u32 l2_cache_size;
+ u32 engine_caps[3];
+ char gpu_name[GSP_PHYS_BACKEND_GPU_NAME_LEN + 1];
+ char gpu_short_name[GSP_PHYS_BACKEND_GPU_NAME_LEN + 1];
+ u32 sriov_max_gfid;
+ u32 vbios_sub_vendor;
+ u32 vbios_sub_device;
+ u8 b_vbios_valid;
+ u8 b_page_retirement;
+ u8 b_split_vas;
+ u8 b_self_hosted;
+ u8 b_ats_supported;
+ u8 b_poison_fuse;
+ u8 b_gpu_uefi;
+ u8 b_efi_init;
+};
+
+int gsp_phys_backend_rpc(u32 function, const void *req, u32 req_len,
+ void **reply, u32 *reply_len, u32 timeout_ms);
+int gsp_phys_backend_static_snapshot(struct gsp_phys_backend_static_config *out);
+
+/*
* Command-queue TX: build a msgq record with the 570.144 element/rpc header
* layout, splitting it into 1..16 4 KB elements when it does not fit one
* (reference elemCount = ceil((48 + rpc.length) / 4096), each element copied