From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Lionel Landwerlin <lionel.g.landwerlin@intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
"Teres Alexis, Alan Previn" <alan.previn.teres.alexis@intel.com>
Cc: "Lahtinen, Joonas" <joonas.lahtinen@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v6 5/8] drm/i915/pxp: Add ARB session creation and cleanup
Date: Mon, 27 Mar 2023 17:15:23 +0100 [thread overview]
Message-ID: <cf63d62b-3e2d-f8fe-82b6-95e71e376cc2@linux.intel.com> (raw)
In-Reply-To: <fef256a6-3027-8beb-0ef8-fddf972db441@intel.com>
On 27/03/2023 08:07, Lionel Landwerlin wrote:
> On 26/03/2023 14:18, Rodrigo Vivi wrote:
>> On Sat, Mar 25, 2023 at 02:19:21AM -0400, Teres Alexis, Alan Previn
>> wrote:
>>> alan:snip
>>>
>>> @@ -353,8 +367,20 @@ int intel_pxp_start(struct intel_pxp *pxp)
>>> alan:snip
>>>>> + if (HAS_ENGINE(pxp->ctrl_gt, GSC0)) {
>>>>> + /*
>>>>> + * GSC-fw loading, GSC-proxy init (requiring an mei
>>>>> component driver) and
>>>>> + * HuC-fw loading must all occur first before we start
>>>>> requesting for PXP
>>>>> + * sessions. Checking HuC authentication (the last
>>>>> dependency) will suffice.
>>>>> + * Let's use a much larger 8 second timeout considering
>>>>> all the types of
>>>>> + * dependencies prior to that.
>>>>> + */
>>>>> + if
>>>>> (wait_for(intel_huc_is_authenticated(&pxp->ctrl_gt->uc.huc), 8000))
>>>> This big timeout needs an ack from userspace drivers, as
>>>> intel_pxp_start
>>>> is called during context creation and the current way to query if the
>>>> feature is supported is to create a protected context.
>>>> Unfortunately, we
>>>> do need to wait to confirm that PXP is available (although in most
>>>> cases
>>>> it shouldn't take even close to 8 secs), because until everything is
>>>> setup we're not sure if things will work as expected. I see 2 potential
>>>> mitigations in case the timeout doesn't work as-is:
>>>>
>>>> 1) we return -EAGAIN (or another dedicated error code) to userspace if
>>>> the prerequisite steps aren't done yet. This would indicate that the
>>>> feature is there, but that we haven't completed the setup yet. The
>>>> caller can then decide if they want to retry immediately or later. Pro:
>>>> more flexibility for userspace; Cons: new interface return code.
>>>>
>>>> 2) we add a getparam to say if PXP is supported in HW and the
>>>> support is
>>>> compiled in i915. Userspace can query this as a way to check the
>>>> feature
>>>> support and only create the context if they actually need it for PXP
>>>> operations. Pro: simpler kernel implementation; Cons: new getparam,
>>>> plus
>>>> even if the getparam returns true the pxp_start could later fail, so
>>>> userspace needs to handle that case.
These two:
e6177ec586d1 ("drm/i915/huc: stall media submission until HuC is loaded")
b76c14c8fb2a ("drm/i915/huc: better define HuC status getparam possible return values.")
They do not help here? It is not possible to use or extend the refined I915_PARAM_HUC_STATUS return values combined with huc load fence for this all to keep working?
Regards,
Tvrtko
>>> alan: I've cc'd Rodrigo, Joonas and Lionel. Folks - what are your
>>> thoughts on above issue?
>>> Recap: On MTL, only when creating a GEM Protected (PXP) context for
>>> the very first time after
>>> a driver load, it will be dependent on (1) loading the GSC firmware,
>>> (2) GuC loading the HuC
>>> firmware and (3) GSC authenticating the HuC fw. But step 3 also
>>> depends on additional
>>> GSC-proxy-init steps that depend on a new mei-gsc-proxy component
>>> driver. I'd used the
>>> 8 second number based on offline conversations with Daniele but that
>>> is a worse-case.
>>> Alternatively, should we change UAPI instead to return -EAGAIN as per
>>> Daniele's proposal?
>>> I believe we've had the get-param conversation offline recently and
>>> the direction was to
>>> stick with attempting to create the context as it is normal in 3D UMD
>>> when it comes to
>>> testing capabilities for other features too.
>>>
>>> Thoughts?
>> I like the option 1 more. This extra return handling won't break
>> compatibility.
>
>
> I like option 2 better because we have to report support as fast as we
> can when enumerating devices on the system for example.
>
> If I understand correctly, with the get param, most apps won't ever be
> blocking on any PXP stuff if they don't use it.
>
> Only the ones that require protected support might block.
>
>
> -Lionel
>
>
>
next prev parent reply other threads:[~2023-03-27 16:15 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-28 2:21 [Intel-gfx] [PATCH v6 0/8] drm/i915/pxp: Add MTL PXP Support Alan Previn
2023-02-28 2:21 ` [Intel-gfx] [PATCH v6 1/8] drm/i915/pxp: Add GSC-CS back-end resource init and cleanup Alan Previn
2023-02-28 2:21 ` [Intel-gfx] [PATCH v6 2/8] drm/i915/pxp: Add MTL hw-plumbing enabling for KCR operation Alan Previn
2023-02-28 2:21 ` [Intel-gfx] [PATCH v6 3/8] drm/i915/pxp: Add MTL helpers to submit Heci-Cmd-Packet to GSC Alan Previn
2023-03-03 1:14 ` Teres Alexis, Alan Previn
2023-02-28 2:21 ` [Intel-gfx] [PATCH v6 4/8] drm/i915/pxp: Add GSC-CS backend to send GSC fw messages Alan Previn
2023-03-04 1:07 ` Ceraolo Spurio, Daniele
2023-03-24 2:22 ` Teres Alexis, Alan Previn
2023-02-28 2:21 ` [Intel-gfx] [PATCH v6 5/8] drm/i915/pxp: Add ARB session creation and cleanup Alan Previn
2023-03-04 1:34 ` Ceraolo Spurio, Daniele
2023-03-25 6:11 ` Teres Alexis, Alan Previn
2023-03-25 6:19 ` Teres Alexis, Alan Previn
2023-03-26 11:18 ` Rodrigo Vivi
2023-03-27 7:07 ` Lionel Landwerlin
2023-03-27 16:15 ` Tvrtko Ursulin [this message]
2023-03-28 17:01 ` Teres Alexis, Alan Previn
2023-03-28 17:52 ` Rodrigo Vivi
2023-03-29 7:43 ` Tvrtko Ursulin
2023-03-30 0:10 ` Teres Alexis, Alan Previn
2023-03-30 12:25 ` Tvrtko Ursulin
2023-03-30 19:44 ` Teres Alexis, Alan Previn
2023-03-31 12:46 ` Tvrtko Ursulin
2023-02-28 2:21 ` [Intel-gfx] [PATCH v6 6/8] drm/i915/pxp: MTL-KCR interrupt ctrl's are in GT-0 Alan Previn
2023-03-04 1:53 ` Ceraolo Spurio, Daniele
2023-04-06 5:51 ` Teres Alexis, Alan Previn
2023-02-28 2:21 ` [Intel-gfx] [PATCH v6 7/8] drm/i915/pxp: On MTL, KCR enabling doesn't wait on tee component Alan Previn
2023-03-04 1:58 ` Ceraolo Spurio, Daniele
2023-04-06 5:44 ` Teres Alexis, Alan Previn
2023-02-28 2:21 ` [Intel-gfx] [PATCH v6 8/8] drm/i915/pxp: Enable PXP with MTL-GSC-CS Alan Previn
2023-03-04 2:00 ` Ceraolo Spurio, Daniele
2023-02-28 2:57 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/pxp: Add MTL PXP Support (rev6) Patchwork
2023-02-28 3:12 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-02-28 6:21 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cf63d62b-3e2d-f8fe-82b6-95e71e376cc2@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=alan.previn.teres.alexis@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=joonas.lahtinen@intel.com \
--cc=lionel.g.landwerlin@intel.com \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox