From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.201.62 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796200680; b=SGNvk+kzjasy4NpA5ZP/sOgnAJyZCDZx2uGF4PpPQpvURNNKh97oXLKrjLjaSILc0kPU S7jVMUfkYBZ6i6liGeNNoIIfTrdjT9LsmKqx/LqWzIakpxp6npIaPeZrQJEhMxDSLic2q jq/UxLRkqFjJSs25V3mwKNUqik6PGeH4pr0OvXOD7akNBWWXDP1oZgjgjM9VuL5v+W8UZ WjKTXgoPjJ26lUe74u93GYOhKHzjl6P/d+FB+oxVeLu/+b2RA6MGtM2kMgpYab+wg2HLx 9rJHY8Ut3tVRlGZjeuAR4rGf8G9OHdhxR46t/ai6itXsFZy6zRtSomaenEghyHUTBJA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796200680; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy:X-EOPAttributedMessage: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=nZlInpp1CKphgQ4oRrAd3RIZ2tGzCBtIzFKF8F5J1II=; b=ninDeDHjD4CeESY+JUgV6Q0qITq62GYBaWlUjqmmRhDJwTLDyeoF8dlwXLX1T59z7Oke BdiDBjohfTJzj3humi5xiQ3Cj91O+AW5KVOwayWkxU46UBw2t2TBT5cuzXq8XHM2IP6FW THzNqSDl0z8cTwHtYsQPRRT5kyRSaQZIXr9M4mmVj1MKOc2RnbKrdimmUp2NglPbJM3hR ymhWggr9IiENyd5RufhiSS7erHHLc65V8liDZi87tun60mBXLp9kv6QZRGHSJM426h5pA vEuYwn7stncKYEO5UUmw0Ue+na58NABQNxmkpcMTw8IVfFfOjRowKfszEDQATJuRjmg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=mQxKeitn; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.201.62 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010062.outbound.protection.outlook.com [52.101.201.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A64A2606A322; Wed, 2 Dec 2026 08:37:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A64A2606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=mQxKeitn ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DjWYt2XWSNFXVLRBytxazEznL13ZyUOXR7HvLUi76dhI8Pv7dXZo9GYmlwRhG8uJGWs4ki4GcrJcvmHyw5GiFXJnPtzApauKUxU+n24LVEdO+Co9OfOOL1zXJLl+BE1gDjzArokJIjPc5Xunii4XmgMG81RfH3iGLvKKEUxNGDKeK6szakeHAPhV/8al1jZQ2cOC/iUqUteRBG7G6EMhSDDSSg1KnKIJHoe7VlKELcXzPPWHFCqlbfW2xFObPERfA5xubr0JJ+tzt5PLPtQDNUJMqHg7lzV59nWp5fT8FGBLomSL6foDKngWgVuPsGlnED4OyrprD7Qnw2zoUfuj2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nZlInpp1CKphgQ4oRrAd3RIZ2tGzCBtIzFKF8F5J1II=; b=EAmCOTjv0odC8lUv3D/6rZIkI1C7KjV8Hy/ruFVYsMgo0gYV5E9JqgNYZgnw0q9IQWinsTXzfM77Yhs+cAwgV5i7hlUZgkdixhuln9ey3GB1LzwiaDCPoss6GwDjV0etu5kj3af4GWIlB3jHf3VyS5vdsh7eU9jsJLOVOmssiuQGwYlyvDAbFQPrChNUwGdLVQ5KWxldJoARdA2SJ8sWOgJANaKSlKRhwDnVI2ysf5G3NVqVfAnuEzuCPktzLGQfUx8hip6Jd9M7k/q6ZPpehPCZfDRJ+XZAfWImCsEuryLOoxDdCPYb7bObFKCzZesHU0HdNcze3+PFana6kzjTnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nZlInpp1CKphgQ4oRrAd3RIZ2tGzCBtIzFKF8F5J1II=; b=mQxKeitnmjPy0ODnZvXeEFiftFkWMI9IuyIG0Krmr3rYG/u8i3MXDtfvmMS3Rl8hNcCx4pxPQzrm3t328AJlp6ULgRz4dBpfhogdKmBET6RDftTpXp+UbYCujLBtCTOSGm/fOjLQ362z2jR8ZLp7ns7baMGhPb5+PrMUlIB63qJB2gLkWe9/06vTsRd6HLP+E6KeVugAZWf6j/M7oMnAnqM5+TJsH2d0dNHzueYA3heDNTt50o1nQPesvsinxEoS+mxr829rqRIUVptsJO0l4oDWqOUR81WwlIniQnLC1vN8rtuZrS9hBV8aPCeQg4DxKwpw+OnJfneSa18zsJ75bA== Received: from PH7PR10CA0006.namprd10.prod.outlook.com (2603:10b6:510:23d::25) by MN0PR12MB6224.namprd12.prod.outlook.com (2603:10b6:208:3c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.11; Wed, 2 Dec 2026 08:37:52 +0000 Received: from BY1PEPF0001AE18.namprd04.prod.outlook.com (2603:10b6:510:23d:cafe::37) by PH7PR10CA0006.outlook.office365.com (2603:10b6:510:23d::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Wed, 2 Dec 2026 08:37:52 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BY1PEPF0001AE18.mail.protection.outlook.com (10.167.242.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Wed, 2 Dec 2026 08:37:52 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Wed, 2 Dec 2026 00:37:38 -0800 Received: from kalok-SPC741D16QM3.nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Wed, 2 Dec 2026 00:37:24 -0800 From: Alok Kumar To: , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v6 23/34] gpu: nova-core: vgpu: encode vGPU boot requests Date: Wed, 2 Dec 2026 13:58:47 +0530 Message-ID: X-Mailer: git-send-email 2.53.0 In-Reply-To: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PEPF0001AE18:EE_|MN0PR12MB6224:EE_ X-MS-Office365-Filtering-Correlation-Id: 26bff17a-58c6-411e-0fd7-08df504f8dcb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|23010399003|376014|7416014|36860700016|1800799024|6133799003|22082099003|18002099003|3023799007|10067099003|11063799006|56012099006|261026121527099003|261026140227099003|261028144727099003|261021123027099003|261021121427099003|261022075727099003|261022105027099003|261009223027099003|261102123227099003; X-Microsoft-Antispam-Message-Info: uAeEgBmFy/JzTgfIC7xIbjlewbe1t0S8fAMF6povsh3igg4G8IacNmjU7L0p1ZveyToZomQvRhhG1xZqXKNrjIELp4E5qMXrB/XhmWx1mb62D7VTkjHhJremINNESctOeQcsNMput4V0uSuFPSiKNVPjItF0qZb0eFgQdDisN7zX+GRrYapPhCOo+R36ioU/DNomOTDcx+aWsFCemoQHIiuYqc828AUT8mFAiWv376ddDTGdEEinzwuFfwwr2Ol2PDl51LZ5VWSAPhxi3zW6jUEOYbJ6OOkiBZs2feQGzygGEZHhc8Fv1ZYppS3FuNF/AjVkQSvIIkhp7LR2qyWynL48OKnrWXDXFH25Z1ndKpicXqu2hIHr8wzFyBWvDFRBKInhaWeh7zN/8NCe6yTKY12dU62j9MsNXjMhft3OTAK1hnM0B6yPD3377mabtdu1LPRbIP6yHqSWcjJEtdmAzSNsmzPhb225NGCHiTv152kyYmZcxS4l98q3fs8XCp/UPvytfst33kiy36jIjrEin8R3AdaHyLFrcKla3nx9EqDDRr/UsAS/R3SMnCZhupvm8luzMDwxzBJOyJ0o5lZ0ARNeroG658DHIskrhgK7w+qDbU2xRJhV5Wu3+arbyX/zk2bu+Tyr9WSjQkmEbXl1I8EZXS6wZFXt6IVxhGjUJHqTxS5K00uQaKKSiTyY89Vp3/CMr8lilPmf9Sh5spCUDQ== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(23010399003)(376014)(7416014)(36860700016)(1800799024)(6133799003)(22082099003)(18002099003)(3023799007)(10067099003)(11063799006)(56012099006)(261026121527099003)(261026140227099003)(261028144727099003)(261021123027099003)(261021121427099003)(261022075727099003)(261022105027099003)(261009223027099003)(261102123227099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5HWZBCIRzYL/Jj5ZoMYolvsV3iP5aaTwLRWu5ud5ffSQ4017CXkzm4HW1+DnIOuxJ/uzsUxgzTrOfuZhMyUW0IqY2Iss4UaD0RAStcgt4tvUhQ595kXGFkGHqhHjKEksDq8XG+tIuayNstCN7sBos2bm5RtNMTF9wPP+I3NkLcfs4TNdZC788qsISPL+y7Z7MeevC1obI+WlUnzIqwVWWmi9fdMhdYHcKGMVVcQSAHO5flSBfBvadmhBv8aDDGSezU4jlpIQANeerlsindCqNn+dZiWNyGogTjLAbu75cedMqs8CAkTOTcaY/6XsvwNYmGo8F2g0PqAk1b0aq5TMOVrQGRsg5B2WwPu8lWp8O8O8gv0FJiK7iil4lgULOtsDY3PD0pr3MVfG5Ne/XXJEKAZF2hbPYkzkkPD+j/d3EgCe3s8frM/TSp+vy5JJ/JwI X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 08:37:52.1170 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 26bff17a-58c6-411e-0fd7-08df504f8dcb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BY1PEPF0001AE18.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6224 From: Zhi Wang The boot request describes a vGPU's identity, channel map, VRAM, plugin heap and log buffers to GSP-RM. Add the NVKV schema and encode it from a named boot description. Pass VRAM region views so each physical address stays paired with its length until encoding, and retain the control offset relative to the plugin heap. Represent channel-map engine and index fields in their 16-bit wire domains. Describe one guest VRAM segment and the current whole-GPU, non-SMIG resource layout. Keep separate MIG-RM heap fields zero for that supported firmware path. Co-developed-by: Eliot Courtney Signed-off-by: Eliot Courtney Signed-off-by: Zhi Wang Signed-off-by: Alok Kumar --- drivers/gpu/nova-core/gsp/nvkv.rs | 11 ++ drivers/gpu/nova-core/gsp/nvkv/encode.rs | 12 ++ drivers/gpu/nova-core/vgpu/fw/commands.rs | 143 +++++++++++++++++++++- 3 files changed, 164 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nova-core/gsp/nvkv.rs b/drivers/gpu/nova-core/gsp/nvkv.rs index 5887a61af02a..0e8e14f98059 100644 --- a/drivers/gpu/nova-core/gsp/nvkv.rs +++ b/drivers/gpu/nova-core/gsp/nvkv.rs @@ -131,6 +131,17 @@ pub(crate) struct Array { vec: ArrayVec, } +impl Array { + /// Creates an array filled from `values`. + /// + /// Fails with `EINVAL` if `values` is longer than `N`. + pub(crate) fn new(values: &[T]) -> Result { + let mut vec = ArrayVec::default(); + vec.extend_from_slice(values)?; + Ok(Self { vec }) + } +} + bitfield! { /// The op word that starts each NVKV operation. struct Op(u64) { diff --git a/drivers/gpu/nova-core/gsp/nvkv/encode.rs b/drivers/gpu/nova-core/gsp/nvkv/encode.rs index c6891c0441ff..c4578e3ecef9 100644 --- a/drivers/gpu/nova-core/gsp/nvkv/encode.rs +++ b/drivers/gpu/nova-core/gsp/nvkv/encode.rs @@ -7,6 +7,7 @@ use zerocopy::Immutable; use super::{ + Array, Index, IndexedKey, Key, @@ -130,6 +131,17 @@ fn encode(&self, encoder: &mut Encoder) -> Result { } } +impl Encodable for Array +where + T: Default + Copy, + for<'a> IndexedKey<&'a [T], KEY_ID>: Encodable, +{ + #[inline(always)] + fn encode(&self, encoder: &mut Encoder) -> Result { + IndexedKey::<&[T], KEY_ID>::new(Index::new::<0>(), self.vec.as_slice()).encode(encoder) + } +} + impl Encodable for Option { fn encode(&self, encoder: &mut Encoder) -> Result { if let Some(value) = self { diff --git a/drivers/gpu/nova-core/vgpu/fw/commands.rs b/drivers/gpu/nova-core/vgpu/fw/commands.rs index d1864d7ab530..286f9c1233a7 100644 --- a/drivers/gpu/nova-core/vgpu/fw/commands.rs +++ b/drivers/gpu/nova-core/vgpu/fw/commands.rs @@ -8,18 +8,157 @@ use kernel::{ alloc::ArrayVec, + bitfield, prelude::*, // }; use crate::{ gsp::nvkv::{ nvkv_decode, + nvkv_encode, Array, + Encodable, + Encoder, + Index, // Key, - Required, // - }, // + KeyId, + Required, + }, + mm::vram::VramRegion, + vgpu::Dbdf, // }; +#[derive(Clone, Copy)] +struct SwizzId(u32); + +impl SwizzId { + const WHOLE_GPU: Self = Self(0xFFFF_FFFF); +} + +impl From for u32 { + fn from(value: SwizzId) -> Self { + value.0 + } +} + +bitfield! { + pub(crate) struct ChannelMapEntry(u64) { + 15:0 engine_type; + 31:16 index; + 63:32 chid_offset; + } +} + +impl ChannelMapEntry { + const KEY: KeyId = 0x1001; + + #[expect(dead_code)] + pub(crate) fn new(engine_type: u16, index: u16, chid_offset: u32) -> Self { + Self::zeroed() + .with_engine_type(engine_type) + .with_index(index) + .with_chid_offset(chid_offset) + } +} + +impl Encodable for KVVec { + fn encode(&self, encoder: &mut Encoder) -> Result { + // SAFETY: `ChannelMapEntry` is a `bitfield!` over `u64`, i.e. + // `#[repr(transparent)]` around a `u64`, so the entries are + // layout-compatible with `u64` and can be viewed as a `u64` slice. + let slice = unsafe { core::slice::from_raw_parts(self.as_ptr().cast::(), self.len()) }; + encoder.encode_array64(ChannelMapEntry::KEY, Index::new::<0>(), slice) + } +} + +bitfield! { + struct VgpuBootloadOptions(u64) { + } +} + +nvkv_encode! { + struct VgpuBootloadRequest { + dbdf: Key, + gfid: Key, + vgpu_type: Key, + vm_pid: Key, + swizz_id: Key, + num_channels: Key, + num_plugin_channels: Key, + guest_fb_segment_count: Key, + options: Key, + channel_mapping: KVVec, + guest_fb_segment_phys_addr: Array, + guest_fb_segment_length: Array, + plugin_heap_phys_addr: Key, + plugin_heap_length: Key, + ctrl_buff_offset: Key, + init_task_log_offset: Key, + init_task_log_size: Key, + vgpu_task_log_offset: Key, + vgpu_task_log_size: Key, + kernel_log_offset: Key, + kernel_log_size: Key, + mig_rm_heap_phys_addr: Key, + mig_rm_heap_length: Key, + } +} + +/// Identity, channel mapping and VRAM regions passed to a GSP plugin at boot. +/// +/// Region addresses are physical VRAM addresses, including the log fields whose wire +/// names contain `offset`. The control-buffer offset is relative to the plugin heap. +pub(crate) struct BootloadInfo<'a, 'pool> { + pub(crate) dbdf: Dbdf, + pub(crate) gfid: u32, + pub(crate) vgpu_type: u32, + pub(crate) vm_pid: u32, + pub(crate) num_channels: u32, + pub(crate) num_plugin_channels: u32, + pub(crate) channel_mapping: KVVec, + pub(crate) guest_fb: &'a VramRegion<'pool>, + pub(crate) plugin_heap: &'a VramRegion<'pool>, + pub(crate) ctrl_buffer_offset: u64, + pub(crate) init_log: &'a VramRegion<'pool>, + pub(crate) vgpu_log: &'a VramRegion<'pool>, + pub(crate) kernel_log: &'a VramRegion<'pool>, +} + +/// Encodes a `VGPU_BOOTLOAD` request using the typed NVKV schema. +#[expect(dead_code)] +pub(crate) fn encode_vgpu_bootload(info: BootloadInfo<'_, '_>) -> Result> { + let request = VgpuBootloadRequest { + dbdf: info.dbdf.into(), + gfid: info.gfid.into(), + vgpu_type: info.vgpu_type.into(), + vm_pid: info.vm_pid.into(), + swizz_id: SwizzId::WHOLE_GPU.into(), + num_channels: info.num_channels.into(), + num_plugin_channels: info.num_plugin_channels.into(), + guest_fb_segment_count: 1.into(), + options: VgpuBootloadOptions::zeroed().into(), + channel_mapping: info.channel_mapping, + guest_fb_segment_phys_addr: Array::new(&[info.guest_fb.range().start])?, + guest_fb_segment_length: Array::new(&[info.guest_fb.len()])?, + plugin_heap_phys_addr: info.plugin_heap.range().start.into(), + plugin_heap_length: info.plugin_heap.len().into(), + ctrl_buff_offset: info.ctrl_buffer_offset.into(), + init_task_log_offset: info.init_log.range().start.into(), + init_task_log_size: info.init_log.len().into(), + vgpu_task_log_offset: info.vgpu_log.range().start.into(), + vgpu_task_log_size: info.vgpu_log.len().into(), + kernel_log_offset: info.kernel_log.range().start.into(), + kernel_log_size: info.kernel_log.len().into(), + // The current non-SMIG firmware path does not map a separate MIG-RM heap. + mig_rm_heap_phys_addr: 0.into(), + mig_rm_heap_length: 0.into(), + }; + + let mut encoder = Encoder::new(); + request.encode(&mut encoder)?; + Ok(encoder.finish()) +} + nvkv_decode! { pub(crate) struct VgpuPropertiesSchema => VgpuProperties { // TODO: `name`/`class` required?