* [PATCH] drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
@ 2018-05-18 14:26 Lionel Landwerlin
2018-05-18 14:29 ` Lionel Landwerlin
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Lionel Landwerlin @ 2018-05-18 14:26 UTC (permalink / raw)
To: intel-gfx
On Gen8+ this register is not priviledged and we want to use it in
Mesa to implement a feature required by GPA called Null Hardware. The
idea is to have the command parser turn 3DPRIMITIVE/GPGPU_WALKER into
NOOPs.
This patch just whitelists the bits that we need and that are
currently not used by the kernel.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
drivers/gpu/drm/i915/i915_cmd_parser.c | 8 ++++++++
drivers/gpu/drm/i915/i915_reg.h | 3 +++
2 files changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
index 95478db9998b..1db6447460eb 100644
--- a/drivers/gpu/drm/i915/i915_cmd_parser.c
+++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
@@ -534,6 +534,14 @@ struct drm_i915_reg_descriptor {
{ .addr = _reg ## _UDW(idx) }
static const struct drm_i915_reg_descriptor gen7_render_regs[] = {
+ REG32(INSTPM,
+ .mask = ~((INSTPM_3D_STATE_INSTRUCTION_DISABLE |
+ INSTPM_3D_RENDERING_INSTRUCTION_DISABLE |
+ INSTPM_3D_MEDIA_INSTRUCTION_DISABLE) << 16 |
+ (INSTPM_3D_STATE_INSTRUCTION_DISABLE |
+ INSTPM_3D_RENDERING_INSTRUCTION_DISABLE |
+ INSTPM_3D_MEDIA_INSTRUCTION_DISABLE)),
+ .value = 0),
REG64(GPGPU_THREADS_DISPATCHED),
REG64(HS_INVOCATION_COUNT),
REG64(DS_INVOCATION_COUNT),
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 196a0eb79272..2db9b6a177d9 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -2531,6 +2531,9 @@ enum i915_power_well_id {
#define INSTPM_FORCE_ORDERING (1<<7) /* GEN6+ */
#define INSTPM_TLB_INVALIDATE (1<<9)
#define INSTPM_SYNC_FLUSH (1<<5)
+#define INSTPM_3D_MEDIA_INSTRUCTION_DISABLE (1<<3) /* GEN6+ */
+#define INSTPM_3D_RENDERING_INSTRUCTION_DISABLE (1<<2) /* GEN6+ */
+#define INSTPM_3D_STATE_INSTRUCTION_DISABLE (1<<1) /* GEN6+ */
#define ACTHD _MMIO(0x20c8)
#define MEM_MODE _MMIO(0x20cc)
#define MEM_DISPLAY_B_TRICKLE_FEED_DISABLE (1<<3) /* 830 only */
--
2.17.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
2018-05-18 14:26 [PATCH] drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits Lionel Landwerlin
@ 2018-05-18 14:29 ` Lionel Landwerlin
2018-05-18 14:40 ` Chris Wilson
2018-05-18 14:54 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Lionel Landwerlin @ 2018-05-18 14:29 UTC (permalink / raw)
To: intel-gfx
On 18/05/18 15:26, Lionel Landwerlin wrote:
> On Gen8+ this register is not priviledged and we want to use it in
> Mesa to implement a feature required by GPA called Null Hardware. The
> idea is to have the command parser turn 3DPRIMITIVE/GPGPU_WALKER into
> NOOPs.
>
> This patch just whitelists the bits that we need and that are
> currently not used by the kernel.
>
One thing I don't really know is whether is should be considered an
issue with the current command parser and therefore be backported as a fix.
It would certainly make things easier because we can't really detect the
behavior from userspace.
-
Lionel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
2018-05-18 14:29 ` Lionel Landwerlin
@ 2018-05-18 14:40 ` Chris Wilson
2018-05-18 15:39 ` Lionel Landwerlin
0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2018-05-18 14:40 UTC (permalink / raw)
To: Lionel Landwerlin, intel-gfx
Quoting Lionel Landwerlin (2018-05-18 15:29:21)
> On 18/05/18 15:26, Lionel Landwerlin wrote:
> > On Gen8+ this register is not priviledged and we want to use it in
> > Mesa to implement a feature required by GPA called Null Hardware. The
> > idea is to have the command parser turn 3DPRIMITIVE/GPGPU_WALKER into
> > NOOPs.
> >
> > This patch just whitelists the bits that we need and that are
> > currently not used by the kernel.
> >
>
> One thing I don't really know is whether is should be considered an
> issue with the current command parser and therefore be backported as a fix.
> It would certainly make things easier because we can't really detect the
> behavior from userspace.
You can always bump the cmdparser version. The cmdparser doesn't no-op,
it just rejects if a command is outside the whitelist, right? It would
be detectable...
The key question is whether INSTPM is context saved on gen7. A test in
gem_exec_parse to confirm we allow INSTPM in the command parser and that
one context does not leak to another would be useful.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✗ Fi.CI.CHECKPATCH: warning for drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
2018-05-18 14:26 [PATCH] drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits Lionel Landwerlin
2018-05-18 14:29 ` Lionel Landwerlin
@ 2018-05-18 14:54 ` Patchwork
2018-05-18 15:09 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-18 21:11 ` ✓ Fi.CI.IGT: " Patchwork
3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-05-18 14:54 UTC (permalink / raw)
To: Lionel Landwerlin; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
URL : https://patchwork.freedesktop.org/series/43420/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
2fac9bc00108 drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
-:44: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV)
#44: FILE: drivers/gpu/drm/i915/i915_reg.h:2534:
+#define INSTPM_3D_MEDIA_INSTRUCTION_DISABLE (1<<3) /* GEN6+ */
^
-:45: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV)
#45: FILE: drivers/gpu/drm/i915/i915_reg.h:2535:
+#define INSTPM_3D_RENDERING_INSTRUCTION_DISABLE (1<<2) /* GEN6+ */
^
-:46: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV)
#46: FILE: drivers/gpu/drm/i915/i915_reg.h:2536:
+#define INSTPM_3D_STATE_INSTRUCTION_DISABLE (1<<1) /* GEN6+ */
^
total: 0 errors, 0 warnings, 3 checks, 23 lines checked
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
2018-05-18 14:26 [PATCH] drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits Lionel Landwerlin
2018-05-18 14:29 ` Lionel Landwerlin
2018-05-18 14:54 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2018-05-18 15:09 ` Patchwork
2018-05-18 21:11 ` ✓ Fi.CI.IGT: " Patchwork
3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-05-18 15:09 UTC (permalink / raw)
To: Lionel Landwerlin; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
URL : https://patchwork.freedesktop.org/series/43420/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4208 -> Patchwork_9052 =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_9052 need to be verified
manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_9052, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/43420/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9052:
=== IGT changes ===
==== Warnings ====
igt@gem_exec_gttfill@basic:
fi-pnv-d510: SKIP -> PASS
== Known issues ==
Here are the changes found in Patchwork_9052 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-cnl-psr: PASS -> FAIL (fdo#100368)
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c-frame-sequence:
fi-cnl-psr: PASS -> FAIL (fdo#103481)
==== Possible fixes ====
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
fi-skl-6770hq: FAIL (fdo#103481) -> PASS
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
== Participating hosts (43 -> 39) ==
Missing (4): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-skl-6700hq
== Build changes ==
* Linux: CI_DRM_4208 -> Patchwork_9052
CI_DRM_4208: a25e1590436f9d962fa1833a706a7c09bd83c3ea @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4487: eccae1360d6d01e73c6af2bd97122cef708207ef @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9052: 2fac9bc001084e7f06ee4611d83ac86594757b6b @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4487: 6ab75f7eb5e1dccbb773e1739beeb2d7cbd6ad0d @ git://anongit.freedesktop.org/piglit
== Linux commits ==
2fac9bc00108 drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9052/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
2018-05-18 14:40 ` Chris Wilson
@ 2018-05-18 15:39 ` Lionel Landwerlin
0 siblings, 0 replies; 7+ messages in thread
From: Lionel Landwerlin @ 2018-05-18 15:39 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
On 18/05/18 15:40, Chris Wilson wrote:
> Quoting Lionel Landwerlin (2018-05-18 15:29:21)
>> On 18/05/18 15:26, Lionel Landwerlin wrote:
>>> On Gen8+ this register is not priviledged and we want to use it in
>>> Mesa to implement a feature required by GPA called Null Hardware. The
>>> idea is to have the command parser turn 3DPRIMITIVE/GPGPU_WALKER into
>>> NOOPs.
>>>
>>> This patch just whitelists the bits that we need and that are
>>> currently not used by the kernel.
>>>
>> One thing I don't really know is whether is should be considered an
>> issue with the current command parser and therefore be backported as a fix.
>> It would certainly make things easier because we can't really detect the
>> behavior from userspace.
> You can always bump the cmdparser version. The cmdparser doesn't no-op,
> it just rejects if a command is outside the whitelist, right? It would
> be detectable...
Ah right!
>
> The key question is whether INSTPM is context saved on gen7.
Documentation says it is. I'm not sure I trust it though :(
> A test in
> gem_exec_parse to confirm we allow INSTPM in the command parser and that
> one context does not leak to another would be useful.
Sure.
> -Chris
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.IGT: success for drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
2018-05-18 14:26 [PATCH] drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits Lionel Landwerlin
` (2 preceding siblings ...)
2018-05-18 15:09 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-05-18 21:11 ` Patchwork
3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-05-18 21:11 UTC (permalink / raw)
To: Lionel Landwerlin; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits
URL : https://patchwork.freedesktop.org/series/43420/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4208_full -> Patchwork_9052_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_9052_full need to be verified
manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_9052_full, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/43420/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_9052_full:
=== IGT changes ===
==== Warnings ====
igt@gem_exec_schedule@deep-vebox:
shard-kbl: PASS -> SKIP
== Known issues ==
Here are the changes found in Patchwork_9052_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_exec_schedule@deep-bsd1:
shard-kbl: SKIP -> DMESG-WARN (fdo#103558, fdo#103313, fdo#105602)
igt@kms_flip@2x-flip-vs-absolute-wf_vblank:
shard-hsw: PASS -> FAIL (fdo#103928)
igt@kms_flip@2x-modeset-vs-vblank-race-interruptible:
shard-hsw: PASS -> FAIL (fdo#103060)
igt@kms_flip@flip-vs-blocking-wf-vblank:
shard-hsw: PASS -> FAIL (fdo#100368)
igt@kms_flip_tiling@flip-x-tiled:
shard-glk: PASS -> FAIL (fdo#104724, fdo#103822)
igt@kms_frontbuffer_tracking@fbc-2p-primscrn-shrfb-pgflip-blt:
shard-glk: PASS -> FAIL (fdo#104724, fdo#103167)
igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite:
shard-apl: PASS -> DMESG-FAIL (fdo#103558, fdo#105602)
igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
shard-apl: PASS -> DMESG-WARN (fdo#103558, fdo#105602) +5
igt@pm_rpm@legacy-planes:
shard-kbl: PASS -> DMESG-WARN (fdo#103558, fdo#103313)
==== Possible fixes ====
igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing:
shard-glk: FAIL (fdo#105703) -> PASS
igt@kms_flip@2x-wf_vblank-ts-check-interruptible:
shard-glk: FAIL (fdo#100368) -> PASS
igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-shrfb-draw-mmap-cpu:
shard-glk: FAIL (fdo#104724, fdo#103167) -> PASS
igt@kms_setmode@basic:
shard-apl: FAIL (fdo#99912) -> PASS
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#105703 https://bugs.freedesktop.org/show_bug.cgi?id=105703
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (9 -> 9) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_4208 -> Patchwork_9052
CI_DRM_4208: a25e1590436f9d962fa1833a706a7c09bd83c3ea @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4487: eccae1360d6d01e73c6af2bd97122cef708207ef @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9052: 2fac9bc001084e7f06ee4611d83ac86594757b6b @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4487: 6ab75f7eb5e1dccbb773e1739beeb2d7cbd6ad0d @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9052/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-05-18 21:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-18 14:26 [PATCH] drm/i915/cmdparser: Whitelist INSTPM instruction parsing disable bits Lionel Landwerlin
2018-05-18 14:29 ` Lionel Landwerlin
2018-05-18 14:40 ` Chris Wilson
2018-05-18 15:39 ` Lionel Landwerlin
2018-05-18 14:54 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-05-18 15:09 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-18 21:11 ` ✓ Fi.CI.IGT: " Patchwork
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.