From: chong li <chongli2@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: <Emily.Deng@amd.com>, <HaiJun.Chang@amd.com>,
chong li <chongli2@amd.com>
Subject: [PATCH] drm/amdgpu: Sync the pf2vf structure between guest and host
Date: Wed, 6 May 2026 17:25:59 +0800 [thread overview]
Message-ID: <20260506092559.546713-1-chongli2@amd.com> (raw)
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 <chongli2@amd.com>
---
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
next reply other threads:[~2026-05-06 9:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 9:25 chong li [this message]
2026-05-07 4:37 ` [PATCH] drm/amdgpu: Sync the pf2vf structure between guest and host Deng, Emily
-- strict thread matches above, loose matches on Subject: below --
2026-04-28 11:12 chong li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260506092559.546713-1-chongli2@amd.com \
--to=chongli2@amd.com \
--cc=Emily.Deng@amd.com \
--cc=HaiJun.Chang@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox