Skip to contentSkip to conversation

drm/i915/gvt: do not check len & max_len for lri

PATCH In review Yan Zhao 2 participants 3 messages Aug 11, 2020 – Sep 15, 2020

Subsystems (4)
lore
Share & tools
lore

Yan Zhao

author
#0 lore raw

PATCH 1/1 drm/i915/gvt: do not check len & max_len for lri

hi
This is the upstream commit dbafc67307ec06036b25b223a251af03fe07969a, and we'd like to backport it to v5.4.
have done the code rebase for the attached patch.

lri usually of variable len and far exceeding 127 dwords.

Fixes 00a33be40634 ("drm/i915/gvt: Add valid length check for MI variable commands")
---
 drivers/gpu/drm/i915/gvt/cmd_parser.c | 12 ------------
 1 file changed, 12 deletions(-)
drivers/gpu/drm/i915/gvt/cmd_parser.c +0 -12
index e753b1e706e2..582e28be383c 100644
@@ -963,18 +963,6 @@ static int cmd_handler_lri(struct parser_exec_state *s)
 	int i, ret = 0;
 	int cmd_len = cmd_length(s);
 	struct intel_gvt *gvt = s->vgpu->gvt;
-	u32 valid_len = CMD_LEN(1);
-
-	/*
-	 * Official intel docs are somewhat sloppy , check the definition of
-	 * MI_LOAD_REGISTER_IMM.
-	 */
-	#define MAX_VALID_LEN 127
-	if ((cmd_len < valid_len) || (cmd_len > MAX_VALID_LEN)) {
-		gvt_err("len is not valid:  len=%u  valid_len=%u\n",
-			cmd_len, valid_len);
-		return -EFAULT;
-	}
 
 	for (i = 1; i < cmd_len; i += 2) {
 		if (IS_BROADWELL(gvt->dev_priv) && s->ring_id != RCS0) {
Signature · 1 line
2.17.1
author
#1 lore raw

ping for backport.

Quoted 42 lines · Yan Zhao

hi
This is the upstream commit dbafc67307ec06036b25b223a251af03fe07969a, and we'd like to backport it to v5.4.
have done the code rebase for the attached patch.

lri usually of variable len and far exceeding 127 dwords.

Fixes 00a33be40634 ("drm/i915/gvt: Add valid length check for MI variable commands")
---
 drivers/gpu/drm/i915/gvt/cmd_parser.c | 12 ------------
 1 file changed, 12 deletions(-)
drivers/gpu/drm/i915/gvt/cmd_parser.c +0 -12
index e753b1e706e2..582e28be383c 100644
@@ -963,18 +963,6 @@ static int cmd_handler_lri(struct parser_exec_state *s)
 	int i, ret = 0;
 	int cmd_len = cmd_length(s);
 	struct intel_gvt *gvt = s->vgpu->gvt;
-	u32 valid_len = CMD_LEN(1);
-
-	/*
-	 * Official intel docs are somewhat sloppy , check the definition of
-	 * MI_LOAD_REGISTER_IMM.
-	 */
-	#define MAX_VALID_LEN 127
-	if ((cmd_len < valid_len) || (cmd_len > MAX_VALID_LEN)) {
-		gvt_err("len is not valid:  len=%u  valid_len=%u\n",
-			cmd_len, valid_len);
-		return -EFAULT;
-	}
 
 	for (i = 1; i < cmd_len; i += 2) {
 		if (IS_BROADWELL(gvt->dev_priv) && s->ring_id != RCS0) {
Signature · 1 line
2.17.1
#2 lore raw
Quoted 18 lines · Yan Zhao

ping for backport.

Quoted 15 lines · Yan Zhao

hi
This is the upstream commit dbafc67307ec06036b25b223a251af03fe07969a, and we'd like to backport it to v5.4.
have done the code rebase for the attached patch.

lri usually of variable len and far exceeding 127 dwords.

Fixes 00a33be40634 ("drm/i915/gvt: Add valid length check for MI variable commands")
---
 drivers/gpu/drm/i915/gvt/cmd_parser.c | 12 ------------
 1 file changed, 12 deletions(-)

Now queued up, thanks.

greg k-h