* [bug report] drm/i915/gvt: vGPU command scanner
@ 2016-10-20 11:45 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-10-20 11:45 UTC (permalink / raw)
Cc: intel-gfx, dri-devel, Zhi Wang
Hello Zhi Wang,
The patch be1da7070aea: "drm/i915/gvt: vGPU command scanner" from May
3, 2016, leads to the following static checker warning:
drivers/gpu/drm/i915/gvt/cmd_parser.c:1420 cmd_handler_mi_op_2f()
warn: shift has higher precedence than mask
drivers/gpu/drm/i915/gvt/cmd_parser.c
1417 static int cmd_handler_mi_op_2f(struct parser_exec_state *s)
1418 {
1419 int gmadr_bytes = s->vgpu->gvt->device_info.gmadr_bytes_in_cmd;
1420 int op_size = ((1 << (cmd_val(s, 0) & GENMASK(20, 19) >> 19)) *
1421 sizeof(u32));
The size calculation is wrong but I've got no idea what the fix is.
1422 unsigned long gma, gma_high;
1423 int ret = 0;
1424
1425 if (!(cmd_val(s, 0) & (1 << 22)))
1426 return ret;
1427
1428 gma = cmd_val(s, 1) & GENMASK(31, 2);
1429 if (gmadr_bytes == 8) {
1430 gma_high = cmd_val(s, 2) & GENMASK(15, 0);
1431 gma = (gma_high << 32) | gma;
1432 }
1433 ret = cmd_address_audit(s, gma, op_size, false);
1434 return ret;
1435 }
regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-10-20 11:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-20 11:45 [bug report] drm/i915/gvt: vGPU command scanner Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.