Skip to content

Commit d69300a

Browse files
committed
drm/xe/pf: Drop GuC notifications for non-existing VF
It is unlikely that GuC will ever send a G2H notification with an invalid VFID and it is currently harmless if that actually happen. But in upcoming patches we will start using that VFID as an index and we must be sure it is a valid to avoid a crash due to a buggy firmware or a currupted G2H message. Signed-off-by: Michal Wajdeczko <[email protected]> Reviewed-by: Piotr Piórkowski <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 65fe961 commit d69300a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/gpu/drm/xe/xe_gt_sriov_pf_control.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "xe_device.h"
99
#include "xe_gt.h"
1010
#include "xe_gt_sriov_pf_control.h"
11+
#include "xe_gt_sriov_pf_helpers.h"
1112
#include "xe_gt_sriov_printk.h"
1213
#include "xe_guc_ct.h"
1314
#include "xe_sriov.h"
@@ -212,6 +213,11 @@ static void pf_handle_vf_flr_done(struct xe_gt *gt, u32 vfid)
212213

213214
static int pf_handle_vf_event(struct xe_gt *gt, u32 vfid, u32 eventid)
214215
{
216+
xe_gt_sriov_dbg_verbose(gt, "received VF%u event %#x\n", vfid, eventid);
217+
218+
if (vfid > xe_gt_sriov_pf_get_totalvfs(gt))
219+
return -EPROTO;
220+
215221
switch (eventid) {
216222
case GUC_PF_NOTIFY_VF_FLR:
217223
pf_handle_vf_flr(gt, vfid);

0 commit comments

Comments
 (0)