AMD General Reviewed-by: Emily Deng <[email protected]>
Emily Deng Best Wishes >-----Original Message----- >From: Li, Chong(Alan) <[email protected]> >Sent: Wednesday, May 6, 2026 5:26 PM >To: [email protected] >Cc: Deng, Emily <[email protected]>; Chang, HaiJun ><[email protected]>; Li, Chong(Alan) <[email protected]> >Subject: [PATCH] drm/amdgpu: Sync the pf2vf structure between guest and host > >There are gaps in the pf2vf message structure between the guest driver and the >host >driver. > >The pf2vf message info structure must be kept in sync between both sides to >ensure >correct interpretation of fields. > >Signed-off-by: chong li <[email protected]> >--- > drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 4 ++++ > drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h | 13 +++++++++++-- > 2 files changed, 15 insertions(+), 2 deletions(-) > >diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h >b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h >index 9da0c6e9b869..d563deec0916 100644 >--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h >+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h >@@ -163,6 +163,8 @@ enum AMDGIM_FEATURE_FLAG { > AMDGIM_FEATURE_RAS_CPER = (1 << 11), > AMDGIM_FEATURE_XGMI_TA_EXT_PEER_LINK = (1 << 12), > AMDGIM_FEATURE_XGMI_CONNECTED_TO_CPU = (1 << 13), >+ AMDGIM_FEATURE_PTL_SUPPORT = (1 << 14), >+ AMDGIM_FEATURE_UNITID_SUPPORT = (1 << 15), > }; > > enum AMDGIM_REG_ACCESS_FLAG { >@@ -441,6 +443,8 @@ static inline bool is_virtual_machine(void) > ((adev)->virt.gim_feature & AMDGIM_FEATURE_VCN_RB_DECOUPLE) >#define amdgpu_sriov_is_mes_info_enable(adev) \ > ((adev)->virt.gim_feature & AMDGIM_FEATURE_MES_INFO_ENABLE) >+#define amdgpu_sriov_is_unitid_support(adev) \ >+ ((adev)->virt.gim_feature & AMDGIM_FEATURE_UNITID_SUPPORT) > > #define amdgpu_virt_xgmi_migrate_enabled(adev) \ > ((adev)->virt.is_xgmi_node_migrate_enabled && (adev)- >>gmc.xgmi.node_segment_size != 0) diff --git >a/drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h >b/drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h >index 847cfd1fd004..9dcf0b07d513 100644 >--- a/drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h >+++ b/drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h >@@ -162,7 +162,9 @@ union amd_sriov_msg_feature_flags { > uint32_t ras_cper : 1; > uint32_t xgmi_ta_ext_peer_link : 1; > uint32_t xgmi_connected_to_cpu : 1; >- uint32_t reserved : 18; >+ uint32_t ptl_support : 1; >+ uint32_t unitid_support : 1; >+ uint32_t reserved : 16; > } flags; > uint32_t all; > }; >@@ -256,7 +258,7 @@ struct amd_sriov_msg_pf2vf_info_header { > uint32_t reserved[2]; > }; > >-#define AMD_SRIOV_MSG_PF2VF_INFO_FILLED_SIZE (55) >+#define AMD_SRIOV_MSG_PF2VF_INFO_FILLED_SIZE (59) > struct amd_sriov_msg_pf2vf_info { > /* header contains size and version */ > struct amd_sriov_msg_pf2vf_info_header header; @@ -314,6 +316,13 @@ >struct amd_sriov_msg_pf2vf_info { > uint32_t more_bp; //Reserved for future use. > union amd_sriov_ras_caps ras_en_caps; > union amd_sriov_ras_caps ras_telemetry_en_caps; >+ /* PTL status response for guest */ >+ uint32_t ptl_enabled; // PTL enable status: 0=disabled, 1=enabled >+ uint32_t ptl_pref_format1; // Current preferred format 1 >+ uint32_t ptl_pref_format2; // Current preferred format 2 >+ /* unit ID assigned by host; vf_idx [0..254] maps to unitid [1..255] (0 >= pf) */ >+ uint8_t unitid; >+ uint8_t padding[3]; //use the 3 bytes to align > > /* reserved */ > uint32_t reserved[256 - AMD_SRIOV_MSG_PF2VF_INFO_FILLED_SIZE]; >-- >2.48.1
