* [igt-dev] [PATCH igt] igt/gem_exec_capture: MI_STORE_DWORD requires EXEC_SECURE + DRM_MASTER on ctg/ilk
@ 2018-02-10 21:43 Chris Wilson
2018-02-10 22:03 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2018-02-12 17:30 ` [igt-dev] [PATCH igt] " Ville Syrjälä
0 siblings, 2 replies; 5+ messages in thread
From: Chris Wilson @ 2018-02-10 21:43 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev
On ctg/ilk, for whatever reason, MI_STORE_DWORD is a privileged operation
so we must request a SECURE batch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
tests/gem_exec_capture.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tests/gem_exec_capture.c b/tests/gem_exec_capture.c
index 1c7d1e7cb..3a1f70567 100644
--- a/tests/gem_exec_capture.c
+++ b/tests/gem_exec_capture.c
@@ -22,6 +22,7 @@
*/
#include "igt.h"
+#include "igt_device.h"
#include "igt_sysfs.h"
#define LOCAL_OBJECT_CAPTURE (1 << 7)
@@ -141,6 +142,8 @@ static void __capture(int fd, int dir, unsigned ring, uint32_t target)
execbuf.buffers_ptr = (uintptr_t)obj;
execbuf.buffer_count = ARRAY_SIZE(obj);
execbuf.flags = ring;
+ if (gen > 3 && gen < 6)
+ execbuf.flags |= I915_EXEC_SECURE;
gem_execbuf(fd, &execbuf);
/* Wait for the request to start */
@@ -204,7 +207,14 @@ igt_main
igt_skip_on_simulation();
igt_fixture {
+ int gen;
+
fd = drm_open_driver(DRIVER_INTEL);
+
+ gen = intel_gen(intel_get_drm_devid(fd));
+ if (gen > 3 && gen < 6) /* ctg and ilk need secure batches */
+ igt_device_set_master(fd);
+
igt_require_gem(fd);
gem_require_mmap_wc(fd);
igt_require(has_capture(fd));
--
2.16.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for igt/gem_exec_capture: MI_STORE_DWORD requires EXEC_SECURE + DRM_MASTER on ctg/ilk
2018-02-10 21:43 [igt-dev] [PATCH igt] igt/gem_exec_capture: MI_STORE_DWORD requires EXEC_SECURE + DRM_MASTER on ctg/ilk Chris Wilson
@ 2018-02-10 22:03 ` Patchwork
2018-02-12 17:30 ` [igt-dev] [PATCH igt] " Ville Syrjälä
1 sibling, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-02-10 22:03 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev
== Series Details ==
Series: igt/gem_exec_capture: MI_STORE_DWORD requires EXEC_SECURE + DRM_MASTER on ctg/ilk
URL : https://patchwork.freedesktop.org/series/38051/
State : failure
== Summary ==
IGT patchset tested on top of latest successful build
8b9f68a13442c9307ef602cb9f0282e0c4ec43e2 igt/pm_rc6_residency: Check debugfs existence before reading
with latest DRM-Tip kernel build CI_DRM_3751
2bea3467efba drm-tip: 2018y-02m-09d-22h-30m-41s UTC integration manifest
No testlist changes.
Test debugfs_test:
Subgroup read_all_entries:
incomplete -> PASS (fi-snb-2520m) fdo#103713
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
pass -> INCOMPLETE (fi-cnl-y3)
Test kms_psr_sink_crc:
Subgroup psr_basic:
incomplete -> SKIP (fi-elk-e7500)
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:420s
fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:426s
fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:376s
fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:487s
fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:287s
fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:489s
fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:483s
fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:474s
fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:460s
fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:566s
fi-cnl-y3 total:218 pass:197 dwarn:0 dfail:0 fail:0 skip:20
fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:417s
fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:283s
fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:513s
fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:392s
fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:417s
fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:460s
fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:414s
fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:459s
fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:499s
fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:500s
fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:599s
fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:427s
fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:509s
fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:527s
fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:493s
fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:479s
fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:412s
fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:428s
fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:539s
fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:396s
Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:470s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_899/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [igt-dev] [PATCH igt] igt/gem_exec_capture: MI_STORE_DWORD requires EXEC_SECURE + DRM_MASTER on ctg/ilk
2018-02-10 21:43 [igt-dev] [PATCH igt] igt/gem_exec_capture: MI_STORE_DWORD requires EXEC_SECURE + DRM_MASTER on ctg/ilk Chris Wilson
2018-02-10 22:03 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
@ 2018-02-12 17:30 ` Ville Syrjälä
2018-02-12 17:37 ` [Intel-gfx] " Chris Wilson
1 sibling, 1 reply; 5+ messages in thread
From: Ville Syrjälä @ 2018-02-12 17:30 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev, intel-gfx
On Sat, Feb 10, 2018 at 09:43:38PM +0000, Chris Wilson wrote:
> On ctg/ilk, for whatever reason, MI_STORE_DWORD is a privileged operation
> so we must request a SECURE batch.
IIRC ctg supposedly introduced some form of ppgtt. Isn't that the
reason?
Hmm. Now I wonder how anything works on these platforms. Should the
batch itself be executed via ppgtt if it's non-secure? Maybe the hw
has a fallback mechanism of some sort to execute via ggtt if ppgtt
isn't enabled...
ppgtt enable bit:
"When this bit is clear, all memory accesses will be completed using the
GGTT. Privileged memory protections will not be enforced (it is
acceptable for a non-secure batch buffer to access GGTT space)"
OK. That seems to confirm that part of the theory.
For pre-ctg the spec says:
"Although Buffer Security Indicator is implemented, there is no usage
model for it and it need not be validated."
So I'm thinking we should never set the non-secure bit on these old
platforms.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> tests/gem_exec_capture.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/tests/gem_exec_capture.c b/tests/gem_exec_capture.c
> index 1c7d1e7cb..3a1f70567 100644
> --- a/tests/gem_exec_capture.c
> +++ b/tests/gem_exec_capture.c
> @@ -22,6 +22,7 @@
> */
>
> #include "igt.h"
> +#include "igt_device.h"
> #include "igt_sysfs.h"
>
> #define LOCAL_OBJECT_CAPTURE (1 << 7)
> @@ -141,6 +142,8 @@ static void __capture(int fd, int dir, unsigned ring, uint32_t target)
> execbuf.buffers_ptr = (uintptr_t)obj;
> execbuf.buffer_count = ARRAY_SIZE(obj);
> execbuf.flags = ring;
> + if (gen > 3 && gen < 6)
> + execbuf.flags |= I915_EXEC_SECURE;
> gem_execbuf(fd, &execbuf);
>
> /* Wait for the request to start */
> @@ -204,7 +207,14 @@ igt_main
> igt_skip_on_simulation();
>
> igt_fixture {
> + int gen;
> +
> fd = drm_open_driver(DRIVER_INTEL);
> +
> + gen = intel_gen(intel_get_drm_devid(fd));
> + if (gen > 3 && gen < 6) /* ctg and ilk need secure batches */
> + igt_device_set_master(fd);
> +
> igt_require_gem(fd);
> gem_require_mmap_wc(fd);
> igt_require(has_capture(fd));
> --
> 2.16.1
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Ville Syrjälä
Intel OTC
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-gfx] [igt-dev] [PATCH igt] igt/gem_exec_capture: MI_STORE_DWORD requires EXEC_SECURE + DRM_MASTER on ctg/ilk
2018-02-12 17:30 ` [igt-dev] [PATCH igt] " Ville Syrjälä
@ 2018-02-12 17:37 ` Chris Wilson
2018-02-12 18:35 ` Ville Syrjälä
0 siblings, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2018-02-12 17:37 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: igt-dev, intel-gfx
Quoting Ville Syrjälä (2018-02-12 17:30:52)
> On Sat, Feb 10, 2018 at 09:43:38PM +0000, Chris Wilson wrote:
> > On ctg/ilk, for whatever reason, MI_STORE_DWORD is a privileged operation
> > so we must request a SECURE batch.
>
> IIRC ctg supposedly introduced some form of ppgtt. Isn't that the
> reason?
>
> Hmm. Now I wonder how anything works on these platforms. Should the
> batch itself be executed via ppgtt if it's non-secure? Maybe the hw
> has a fallback mechanism of some sort to execute via ggtt if ppgtt
> isn't enabled...
>
> ppgtt enable bit:
> "When this bit is clear, all memory accesses will be completed using the
> GGTT. Privileged memory protections will not be enforced (it is
> acceptable for a non-secure batch buffer to access GGTT space)"
>
> OK. That seems to confirm that part of the theory.
>
> For pre-ctg the spec says:
> "Although Buffer Security Indicator is implemented, there is no usage
> model for it and it need not be validated."
>
> So I'm thinking we should never set the non-secure bit on these old
> platforms.
That does open a large can of worms with the ability to write any
register from userspace or manipulate the pagetables; i.e. requires the
cmdparser. The usage model has been such that very few commands are
affected; certainly no one [else] has noticed (afaik).
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [igt-dev] [PATCH igt] igt/gem_exec_capture: MI_STORE_DWORD requires EXEC_SECURE + DRM_MASTER on ctg/ilk
2018-02-12 17:37 ` [Intel-gfx] " Chris Wilson
@ 2018-02-12 18:35 ` Ville Syrjälä
0 siblings, 0 replies; 5+ messages in thread
From: Ville Syrjälä @ 2018-02-12 18:35 UTC (permalink / raw)
To: Chris Wilson; +Cc: igt-dev, intel-gfx
On Mon, Feb 12, 2018 at 05:37:56PM +0000, Chris Wilson wrote:
> Quoting Ville Syrjälä (2018-02-12 17:30:52)
> > On Sat, Feb 10, 2018 at 09:43:38PM +0000, Chris Wilson wrote:
> > > On ctg/ilk, for whatever reason, MI_STORE_DWORD is a privileged operation
> > > so we must request a SECURE batch.
> >
> > IIRC ctg supposedly introduced some form of ppgtt. Isn't that the
> > reason?
> >
> > Hmm. Now I wonder how anything works on these platforms. Should the
> > batch itself be executed via ppgtt if it's non-secure? Maybe the hw
> > has a fallback mechanism of some sort to execute via ggtt if ppgtt
> > isn't enabled...
> >
> > ppgtt enable bit:
> > "When this bit is clear, all memory accesses will be completed using the
> > GGTT. Privileged memory protections will not be enforced (it is
> > acceptable for a non-secure batch buffer to access GGTT space)"
> >
> > OK. That seems to confirm that part of the theory.
> >
> > For pre-ctg the spec says:
> > "Although Buffer Security Indicator is implemented, there is no usage
> > model for it and it need not be validated."
> >
> > So I'm thinking we should never set the non-secure bit on these old
> > platforms.
>
> That does open a large can of worms with the ability to write any
> register from userspace or manipulate the pagetables; i.e. requires the
> cmdparser. The usage model has been such that very few commands are
> affected; certainly no one [else] has noticed (afaik).
I suppose. I can't find any notes about this being wrong in the gen2/3
docs. And the gen4 quote just says "need not be validated" after all so
I suppose it doesn't necessarily mean it wasn't validated. And I guess
we should have found out long ago if it's hopelessly broken.
Patch is
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
--
Ville Syrjälä
Intel OTC
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-02-12 18:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-10 21:43 [igt-dev] [PATCH igt] igt/gem_exec_capture: MI_STORE_DWORD requires EXEC_SECURE + DRM_MASTER on ctg/ilk Chris Wilson
2018-02-10 22:03 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2018-02-12 17:30 ` [igt-dev] [PATCH igt] " Ville Syrjälä
2018-02-12 17:37 ` [Intel-gfx] " Chris Wilson
2018-02-12 18:35 ` Ville Syrjälä
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox