提交 1c3dcd1c 编写于 作者: B Ben Widawsky 提交者: Daniel Vetter

drm/i915: Round l3 parity reads down

We always read a register for l3 parity reads, and we don't really want
to ever let userspace trick us into giving back less than the dword.

Writes are okay because we assume everything will be 0 filled, and as
such, if a user really wants to write less than a dword, let them.
Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 472f8acc
...@@ -121,6 +121,8 @@ i915_l3_read(struct file *filp, struct kobject *kobj, ...@@ -121,6 +121,8 @@ i915_l3_read(struct file *filp, struct kobject *kobj,
uint32_t misccpctl; uint32_t misccpctl;
int i, ret; int i, ret;
count = round_down(count, 4);
ret = l3_access_valid(drm_dev, offset); ret = l3_access_valid(drm_dev, offset);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册