From: Julien Grall <julien.grall@arm.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "tee-dev@lists.linaro.org" <tee-dev@lists.linaro.org>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v5 06/10] xen/arm: optee: add support for RPC SHM buffers
Date: Mon, 3 Jun 2019 13:33:45 +0100 [thread overview]
Message-ID: <559ecc94-3e88-1912-07b3-a3cb0e3f1dca@arm.com> (raw)
In-Reply-To: <20190521212530.12706-7-volodymyr_babchuk@epam.com>
Hi Volodymyr,
On 21/05/2019 22:26, Volodymyr Babchuk wrote:
> OP-TEE usually uses the same idea with command buffers (see
> previous commit) to issue RPC requests. Problem is that initially
> it has no buffer, where it can write request. So the first RPC
> request it makes is special: it requests NW to allocate shared
> buffer for other RPC requests. Usually this buffer is allocated
> only once for every OP-TEE thread and it remains allocated all
> the time until guest shuts down. Guest can ask OP-TEE to disable
> RPC buffers caching, in this case OP-TEE will ask guest to
> allocate/free buffer for the each RPC.
>
> Mediator needs to pin this buffer to make sure that page will be
> not free while it is shared with OP-TEE.
>
> Life cycle of this buffer is controlled by OP-TEE. It asks guest to
> create buffer and it asks it to free it. So it there is not much sense
> to limit number of those buffers, because we already limit the number
> of concurrent standard calls and prevention of RPC buffer allocation will
> impair OP-TEE functionality.
>
> Those buffers can be freed in two ways: either OP-TEE issues
> OPTEE_SMC_RPC_FUNC_FREE RPC request or guest tries to disable
> buffer caching by calling OPTEE_SMC_DISABLE_SHM_CACHE function.
> In the latter case OP-TEE will return cookie of the SHM buffer it
> just freed.
>
> OP-TEE expects that this RPC buffer have size of
> OPTEE_MSG_NONCONTIG_PAGE_SIZE, which equals to 4096 and is aligned
> with the same size. So, basically it expects one 4k page from the
> guest. This is the same as Xen's PAGE_SIZE.
>
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
WARNING: multiple messages have this Message-ID (diff)
From: Julien Grall <julien.grall@arm.com>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "tee-dev@lists.linaro.org" <tee-dev@lists.linaro.org>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [Xen-devel] [PATCH v5 06/10] xen/arm: optee: add support for RPC SHM buffers
Date: Mon, 3 Jun 2019 13:33:45 +0100 [thread overview]
Message-ID: <559ecc94-3e88-1912-07b3-a3cb0e3f1dca@arm.com> (raw)
Message-ID: <20190603123345.zRN0jYHpnEAojoUOrdB4KF0lcoB_iAFf-JlwHCEQUr4@z> (raw)
In-Reply-To: <20190521212530.12706-7-volodymyr_babchuk@epam.com>
Hi Volodymyr,
On 21/05/2019 22:26, Volodymyr Babchuk wrote:
> OP-TEE usually uses the same idea with command buffers (see
> previous commit) to issue RPC requests. Problem is that initially
> it has no buffer, where it can write request. So the first RPC
> request it makes is special: it requests NW to allocate shared
> buffer for other RPC requests. Usually this buffer is allocated
> only once for every OP-TEE thread and it remains allocated all
> the time until guest shuts down. Guest can ask OP-TEE to disable
> RPC buffers caching, in this case OP-TEE will ask guest to
> allocate/free buffer for the each RPC.
>
> Mediator needs to pin this buffer to make sure that page will be
> not free while it is shared with OP-TEE.
>
> Life cycle of this buffer is controlled by OP-TEE. It asks guest to
> create buffer and it asks it to free it. So it there is not much sense
> to limit number of those buffers, because we already limit the number
> of concurrent standard calls and prevention of RPC buffer allocation will
> impair OP-TEE functionality.
>
> Those buffers can be freed in two ways: either OP-TEE issues
> OPTEE_SMC_RPC_FUNC_FREE RPC request or guest tries to disable
> buffer caching by calling OPTEE_SMC_DISABLE_SHM_CACHE function.
> In the latter case OP-TEE will return cookie of the SHM buffer it
> just freed.
>
> OP-TEE expects that this RPC buffer have size of
> OPTEE_MSG_NONCONTIG_PAGE_SIZE, which equals to 4096 and is aligned
> with the same size. So, basically it expects one 4k page from the
> guest. This is the same as Xen's PAGE_SIZE.
>
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-06-03 12:33 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-21 21:25 [PATCH v5 00/10] TEE mediator (and OP-TEE) support in XEN Volodymyr Babchuk
2019-05-21 21:25 ` [Xen-devel] " Volodymyr Babchuk
2019-05-21 21:25 ` [PATCH v5 01/10] xen/arm: add generic TEE mediator framework Volodymyr Babchuk
2019-05-21 21:25 ` [Xen-devel] " Volodymyr Babchuk
2019-05-22 8:45 ` Jan Beulich
2019-05-22 8:45 ` [Xen-devel] " Jan Beulich
2019-05-22 9:27 ` Julien Grall
2019-05-22 9:27 ` [Xen-devel] " Julien Grall
2019-05-22 10:02 ` Jan Beulich
2019-05-22 10:02 ` [Xen-devel] " Jan Beulich
2019-05-22 12:04 ` Julien Grall
2019-05-22 12:04 ` [Xen-devel] " Julien Grall
2019-06-03 11:46 ` Julien Grall
2019-06-03 11:46 ` [Xen-devel] " Julien Grall
2019-06-03 11:48 ` Julien Grall
2019-06-03 11:48 ` [Xen-devel] " Julien Grall
2019-06-06 16:02 ` Julien Grall
2019-06-07 9:36 ` Julien Grall
2019-06-11 18:18 ` Volodymyr Babchuk
2019-06-11 18:26 ` Julien Grall
2019-05-21 21:25 ` [PATCH v5 02/10] xen/arm: optee: add OP-TEE header files Volodymyr Babchuk
2019-05-21 21:25 ` [Xen-devel] " Volodymyr Babchuk
2019-06-03 11:49 ` Julien Grall
2019-06-03 11:49 ` [Xen-devel] " Julien Grall
2019-06-10 18:20 ` Volodymyr Babchuk
2019-06-10 18:53 ` Julien Grall
2019-05-21 21:25 ` [PATCH v5 03/10] xen/arm: optee: add OP-TEE mediator skeleton Volodymyr Babchuk
2019-05-21 21:25 ` [Xen-devel] " Volodymyr Babchuk
2019-06-03 12:34 ` Julien Grall
2019-06-03 12:34 ` [Xen-devel] " Julien Grall
2019-05-21 21:25 ` [PATCH v5 04/10] xen/arm: optee: add fast calls handling Volodymyr Babchuk
2019-05-21 21:25 ` [Xen-devel] " Volodymyr Babchuk
2019-06-03 12:34 ` Julien Grall
2019-06-03 12:34 ` [Xen-devel] " Julien Grall
2019-05-21 21:26 ` [PATCH v5 05/10] xen/arm: optee: add std call handling Volodymyr Babchuk
2019-05-21 21:26 ` [Xen-devel] " Volodymyr Babchuk
2019-06-03 12:34 ` Julien Grall
2019-06-03 12:34 ` [Xen-devel] " Julien Grall
2019-05-21 21:26 ` [PATCH v5 06/10] xen/arm: optee: add support for RPC SHM buffers Volodymyr Babchuk
2019-05-21 21:26 ` [Xen-devel] " Volodymyr Babchuk
2019-06-03 12:33 ` Julien Grall [this message]
2019-06-03 12:33 ` Julien Grall
2019-05-21 21:26 ` [PATCH v5 07/10] xen/arm: optee: add support for arbitrary shared memory Volodymyr Babchuk
2019-05-21 21:26 ` [Xen-devel] " Volodymyr Babchuk
2019-06-03 12:29 ` Julien Grall
2019-06-03 12:29 ` [Xen-devel] " Julien Grall
2019-05-21 21:26 ` [PATCH v5 08/10] xen/arm: optee: add support for RPC commands Volodymyr Babchuk
2019-05-21 21:26 ` [Xen-devel] " Volodymyr Babchuk
2019-06-03 12:33 ` Julien Grall
2019-06-03 12:33 ` [Xen-devel] " Julien Grall
2019-05-21 21:26 ` [PATCH v5 09/10] tools/arm: tee: add "tee" option for xl.cfg Volodymyr Babchuk
2019-05-21 21:26 ` [Xen-devel] " Volodymyr Babchuk
2019-06-03 12:44 ` Julien Grall
2019-06-03 12:44 ` [Xen-devel] " Julien Grall
2019-06-03 14:47 ` Ian Jackson
2019-06-03 14:47 ` [Xen-devel] " Ian Jackson
2019-05-21 21:26 ` [PATCH v5 10/10] tools/arm: optee: create optee firmware node in DT if tee=optee Volodymyr Babchuk
2019-05-21 21:26 ` [Xen-devel] " Volodymyr Babchuk
2019-06-03 14:50 ` Ian Jackson
2019-06-03 14:50 ` [Xen-devel] " Ian Jackson
2019-06-01 14:50 ` [PATCH v5 00/10] TEE mediator (and OP-TEE) support in XEN Julien Grall
2019-06-01 14:50 ` [Xen-devel] " Julien Grall
2019-06-01 16:07 ` Volodymyr Babchuk
2019-06-01 16:07 ` [Xen-devel] " Volodymyr Babchuk
2019-06-01 16:55 ` Julien Grall
2019-06-01 16:55 ` [Xen-devel] " Julien Grall
2019-06-04 13:31 ` Volodymyr Babchuk
2019-06-06 15:33 ` Julien Grall
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=559ecc94-3e88-1912-07b3-a3cb0e3f1dca@arm.com \
--to=julien.grall@arm.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=sstabellini@kernel.org \
--cc=tee-dev@lists.linaro.org \
--cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).