From: Jerome Forissier <jerome.forissier@linaro.org>
To: Etienne Carriere <etienne.carriere@linaro.org>,
Olivier Masse <olivier.masse@nxp.com>
Cc: "sumit.garg@linaro.org" <sumit.garg@linaro.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"fredgc@google.com" <fredgc@google.com>,
"linaro-mm-sig@lists.linaro.org" <linaro-mm-sig@lists.linaro.org>,
"afd@ti.com" <afd@ti.com>,
"op-tee@lists.trustedfirmware.org"
<op-tee@lists.trustedfirmware.org>,
"jens.wiklander@linaro.org" <jens.wiklander@linaro.org>,
"joakim.bech@linaro.org" <joakim.bech@linaro.org>,
"sumit.semwal@linaro.org" <sumit.semwal@linaro.org>,
"Cyrille Fleury" <cyrille.fleury@nxp.com>,
"Peter Griffin" <peter.griffin@linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"Clément Faure" <clement.faure@nxp.com>,
"christian.koenig@amd.com" <christian.koenig@amd.com>
Subject: Re: [EXT] Re: [PATCH v2 1/1] tee: new ioctl to a register tee_shm from a dmabuf file descriptor
Date: Fri, 3 Feb 2023 13:31:57 +0100 [thread overview]
Message-ID: <f3ccd7ad-0bbb-be39-c989-765552e2c6af@linaro.org> (raw)
In-Reply-To: <CAN5uoS-A8EovbnxvcXqiYHcy95d-PTYUZvnNr3=kf84AGkG8Kw@mail.gmail.com>
On 2/3/23 12:37, Etienne Carriere wrote:
> Hell all,
>
> +jerome f.
>
> On Fri, 3 Feb 2023 at 12:01, Olivier Masse <olivier.masse@nxp.com> wrote:
>>
>> On jeu., 2023-02-02 at 10:58 +0100, Etienne Carriere wrote:
>>> Caution: EXT Email
>>>
>>> On Thu, 2 Feb 2023 at 09:35, Sumit Garg <sumit.garg@linaro.org>
>>> wrote:
>>>> Hi Cyrille,
>>>>
>>>> Please don't top post as it makes it harder to follow-up.
>>>>
>>>> On Thu, 2 Feb 2023 at 13:26, Cyrille Fleury <cyrille.fleury@nxp.com
>>>>> wrote:
>>>>> Hi Sumit, all
>>>>>
>>>>> Upstream OP-TEE should support registering a dmabuf since a
>>>>> while, given how widely dmabuf is used in Linux for passing
>>>>> buffers around between devices.
>>>>>
>>>>> Purpose of the new register_tee_shm ioctl is to allow OPTEE to
>>>>> use memory allocated from the exiting linux dma buffer. We don't
>>>>> need to have secure dma-heap up streamed.
>>>>>
>>>>> You mentioned secure dma-buffer, but secure dma-buffer is a dma-
>>>>> buffer, so the work to be done for secure or "regular" dma
>>>>> buffers by the register_tee_shm ioctl is 100% the same.
>>>>>
>>>>> The scope of this ioctl is limited to what existing upstream dma-
>>>>> buffers are:
>>>>> -> sharing buffers for hardware (DMA) access across
>>>>> multiple device drivers and subsystems, and for synchronizing
>>>>> asynchronous hardware access.
>>>>> -> It means continuous memory only.
>>>>>
>>>>> So if we reduce the scope of register tee_shm to exiting dma-
>>>>> buffer area, the current patch does the job.
>>>>
>>>> Do you have a corresponding real world use-case supported by
>>>> upstream
>>>> OP-TEE? AFAIK, the Secure Data Path (SDP) use-case is the one
>>>> supported in OP-TEE upstream but without secure dmabuf heap [1]
>>>> available, the new ioctl can't be exercised.
>>>>
>>>> [1] https://github.com/OP-TEE/optee_test/blob/master/host/xtest/sdp_basic.h#L15
>>>
>>> OP-TEE has some SDP test taht can exercice SDP: 'xtest
>>> regression_1014'.
>>> https://github.com/OP-TEE/optee_test/blob/3.20.0/host/xtest/regression_1000.c#L1256
>>>
>>> The test relies on old staged ION + local secure dmabuf heaps no more
>>> maintained, so this test is currently not functional.
>>> If we upgrade the test to mainline dmabuf alloc means, and apply the
>>> change discussed here, we should be able to regularly test SDP in
>>> OP-TEE project CI.
>>> The part to update is the userland allocation of the dmabuf:
>>> https://github.com/OP-TEE/optee_test/blob/3.20.0/host/xtest/sdp_basic.c#L91
>>>
>>>
>>
>> the test was already updated to support secure dma heap with Kernel
>> version 5.11 and higher. the userland allocation could be find here:
>> https://github.com/OP-TEE/optee_test/blob/3.20.0/host/xtest/sdp_basic.c#L153
>>
>
> Oh, right. So fine, optee_test is ready for the new flavor of secure
> buffer fd's.
>
>
>> This upgrade need a Linux dma-buf patch:
>> https://lore.kernel.org/all/20220805154139.2qkqxwklufjpsfdx@000377403353/T/
>
> @Jens, @Jerome, do we want to pick the 2 necessary Linux patches in
> our Linux kernel fork (github.com/linaro-swg/linux.git) to exercise
> SDP in our CI and be ready if dma-buf secure heaps (ref right above)
> is accepted and merged in mainline kernel?.
How would that help? I mean, when the kernel patches are merged and if
things break we can make the necessary adjustments in the optee_test app
or whatever, but in the meantime I don't see much point. I suppose the
people who are actively developing the patches do make sure it works with
OP-TEE ;-)
Regards,
--
Jerome
next prev parent reply other threads:[~2023-02-03 12:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 14:30 [PATCH v2 0/1] tee: Add tee_shm_register_fd Olivier Masse
2022-08-12 14:30 ` [PATCH 1/1] tee: new ioctl to a register tee_shm from a dmabuf file descriptor Olivier Masse
2022-08-14 1:13 ` kernel test robot
2023-01-27 10:54 ` [PATCH v2 " Olivier Masse
2023-01-27 11:19 ` Christian König
2023-01-30 13:04 ` Etienne Carriere
2023-02-01 5:33 ` Sumit Garg
2023-02-02 7:56 ` [EXT] " Cyrille Fleury
2023-02-02 8:35 ` Sumit Garg
2023-02-02 9:58 ` Etienne Carriere
2023-02-03 11:01 ` Olivier Masse
2023-02-03 11:37 ` Etienne Carriere
2023-02-03 12:31 ` Jerome Forissier [this message]
2023-02-03 14:13 ` Cyrille Fleury
2023-02-13 11:02 ` Jens Wiklander
2023-02-13 12:41 ` Cyrille Fleury
2023-02-13 15:22 ` Jens Wiklander
2023-02-03 11:52 ` Sumit Garg
2022-08-16 8:17 ` [PATCH v2 0/1] tee: Add tee_shm_register_fd Jens Wiklander
2022-08-16 9:06 ` [EXT] " Olivier Masse
2022-08-19 8:24 ` Sumit Garg
2022-09-06 19:59 ` Daniel Vetter
2022-09-08 10:26 ` Sumit Garg
2022-09-08 9:18 ` [EXT] " Olivier Masse
2022-09-08 10:28 ` Sumit Garg
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=f3ccd7ad-0bbb-be39-c989-765552e2c6af@linaro.org \
--to=jerome.forissier@linaro.org \
--cc=afd@ti.com \
--cc=christian.koenig@amd.com \
--cc=clement.faure@nxp.com \
--cc=cyrille.fleury@nxp.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=etienne.carriere@linaro.org \
--cc=fredgc@google.com \
--cc=jens.wiklander@linaro.org \
--cc=joakim.bech@linaro.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=olivier.masse@nxp.com \
--cc=op-tee@lists.trustedfirmware.org \
--cc=peter.griffin@linaro.org \
--cc=sumit.garg@linaro.org \
--cc=sumit.semwal@linaro.org \
/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
all inboxes | Powered by JetHome®