Skip to content

Commit b6c7651

Browse files
committed
gpu: nova-core: bindings: add missing explicit padding
Explicit padding is needed in order to avoid uninitialized bytes and safely implement `AsBytes`. The `--explicit-padding` of bindgen was omitted by mistake when these bindings were generated. Fixes: 13f8598 ("gpu: nova-core: gsp: Retrieve GSP static info to gather GPU information") Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com> Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20251216-nova-fixes-v3-1-c7469a71f7c4@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
1 parent 3d3352e commit b6c7651

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ pub struct NV0080_CTRL_GPU_GET_SRIOV_CAPS_PARAMS {
325325
pub totalVFs: u32_,
326326
pub firstVfOffset: u32_,
327327
pub vfFeatureMask: u32_,
328+
pub __bindgen_padding_0: [u8; 4usize],
328329
pub FirstVFBar0Address: u64_,
329330
pub FirstVFBar1Address: u64_,
330331
pub FirstVFBar2Address: u64_,
@@ -340,18 +341,21 @@ pub struct NV0080_CTRL_GPU_GET_SRIOV_CAPS_PARAMS {
340341
pub bClientRmAllocatedCtxBuffer: u8_,
341342
pub bNonPowerOf2ChannelCountSupported: u8_,
342343
pub bVfResizableBAR1Supported: u8_,
344+
pub __bindgen_padding_1: [u8; 7usize],
343345
}
344346
#[repr(C)]
345347
#[derive(Debug, Default, Copy, Clone)]
346348
pub struct NV2080_CTRL_BIOS_GET_SKU_INFO_PARAMS {
347349
pub BoardID: u32_,
348350
pub chipSKU: [ffi::c_char; 9usize],
349351
pub chipSKUMod: [ffi::c_char; 5usize],
352+
pub __bindgen_padding_0: [u8; 2usize],
350353
pub skuConfigVersion: u32_,
351354
pub project: [ffi::c_char; 5usize],
352355
pub projectSKU: [ffi::c_char; 5usize],
353356
pub CDP: [ffi::c_char; 6usize],
354357
pub projectSKUMod: [ffi::c_char; 2usize],
358+
pub __bindgen_padding_1: [u8; 2usize],
355359
pub businessCycle: u32_,
356360
}
357361
pub type NV2080_CTRL_CMD_FB_GET_FB_REGION_SURFACE_MEM_TYPE_FLAG = [u8_; 17usize];
@@ -371,6 +375,7 @@ pub struct NV2080_CTRL_CMD_FB_GET_FB_REGION_FB_REGION_INFO {
371375
#[derive(Debug, Default, Copy, Clone)]
372376
pub struct NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_PARAMS {
373377
pub numFBRegions: u32_,
378+
pub __bindgen_padding_0: [u8; 4usize],
374379
pub fbRegion: [NV2080_CTRL_CMD_FB_GET_FB_REGION_FB_REGION_INFO; 16usize],
375380
}
376381
#[repr(C)]
@@ -495,13 +500,16 @@ pub struct FW_WPR_LAYOUT_OFFSET {
495500
#[derive(Debug, Copy, Clone)]
496501
pub struct GspStaticConfigInfo_t {
497502
pub grCapsBits: [u8_; 23usize],
503+
pub __bindgen_padding_0: u8,
498504
pub gidInfo: NV2080_CTRL_GPU_GET_GID_INFO_PARAMS,
499505
pub SKUInfo: NV2080_CTRL_BIOS_GET_SKU_INFO_PARAMS,
506+
pub __bindgen_padding_1: [u8; 4usize],
500507
pub fbRegionInfoParams: NV2080_CTRL_CMD_FB_GET_FB_REGION_INFO_PARAMS,
501508
pub sriovCaps: NV0080_CTRL_GPU_GET_SRIOV_CAPS_PARAMS,
502509
pub sriovMaxGfid: u32_,
503510
pub engineCaps: [u32_; 3usize],
504511
pub poisonFuseEnabled: u8_,
512+
pub __bindgen_padding_2: [u8; 7usize],
505513
pub fb_length: u64_,
506514
pub fbio_mask: u64_,
507515
pub fb_bus_width: u32_,
@@ -527,16 +535,20 @@ pub struct GspStaticConfigInfo_t {
527535
pub bIsMigSupported: u8_,
528536
pub RTD3GC6TotalBoardPower: u16_,
529537
pub RTD3GC6PerstDelay: u16_,
538+
pub __bindgen_padding_3: [u8; 2usize],
530539
pub bar1PdeBase: u64_,
531540
pub bar2PdeBase: u64_,
532541
pub bVbiosValid: u8_,
542+
pub __bindgen_padding_4: [u8; 3usize],
533543
pub vbiosSubVendor: u32_,
534544
pub vbiosSubDevice: u32_,
535545
pub bPageRetirementSupported: u8_,
536546
pub bSplitVasBetweenServerClientRm: u8_,
537547
pub bClRootportNeedsNosnoopWAR: u8_,
548+
pub __bindgen_padding_5: u8,
538549
pub displaylessMaxHeads: VIRTUAL_DISPLAY_GET_NUM_HEADS_PARAMS,
539550
pub displaylessMaxResolution: VIRTUAL_DISPLAY_GET_MAX_RESOLUTION_PARAMS,
551+
pub __bindgen_padding_6: [u8; 4usize],
540552
pub displaylessMaxPixels: u64_,
541553
pub hInternalClient: u32_,
542554
pub hInternalDevice: u32_,

0 commit comments

Comments
 (0)