From: Paul Durrant <xadimgnik@gmail.com>
To: "'Stefano Stabellini'" <sstabellini@kernel.org>,
<xadimgnik@gmail.com>, <pdurrant@amazon.com>
Cc: julien@xen.org, xen-devel@lists.xenproject.org,
'Volodymyr Babchuk' <Volodymyr_Babchuk@epam.com>
Subject: RE: [PATCH] xen/arm: optee: allow plain TMEM buffers with NULL address
Date: Fri, 19 Jun 2020 09:47:16 +0100 [thread overview]
Message-ID: <00a801d64616$3d3a15d0$b7ae4170$@xen.org> (raw)
In-Reply-To: <alpine.DEB.2.21.2006181523070.14005@sstabellini-ThinkPad-T480s>
> -----Original Message-----
> From: Stefano Stabellini <sstabellini@kernel.org>
> Sent: 18 June 2020 23:27
> To: xadimgnik@gmail.com; paul@xen.org; pdurrant@amazon.com
> Cc: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>; sstabellini@kernel.org; xen-
> devel@lists.xenproject.org; paul@xen.org; julien@xen.org
> Subject: Re: [PATCH] xen/arm: optee: allow plain TMEM buffers with NULL address
>
> Hi Paul, Julien, Volodymyr,
>
> This is another bug fix that I would like to get in 4.14. It doesn't
> look like we need any changes to this patch, assuming that it is
> accurate to the spec.
>
> It would be nice if Volodymyr could provide more info on the spec side,
> but honestly I trust his experience on this.
>
> Paul, are you OK with this going into 4.14?
>
In principle, yes. It appears, from Julien's comments though, that the commit message may need a little expansion (for the benefit
of those mining this code in future).
Paul
>
>
> On Sat, 6 Jun 2020, Julien Grall wrote:
> > (+Paul)
> >
> > Hi,
> >
> > On 18/05/2020 02:53, Volodymyr Babchuk wrote:
> > > Trusted Applications use popular approach to determine required size
> > > of buffer: client provides a memory reference with the NULL pointer to
> > > a buffer. This is so called "Null memory reference". TA updates the
> >
> > NIT: You use double space after '.' here but all the others use a single
> > space.
> >
> > > reference with the required size and returns it back to client. Then
> > > client allocates buffer of needed size and repeats the operation.
> > >
> > > This behavior is described in TEE Client API Specification, paragraph
> > > 3.2.5. Memory References.
> >
> > From the spec, it is not a clear cut that NULL will always used as fetching
> > the required size of an output buffer. In particular, they suggest to refer to
> > the protocol.
> >
> > In your commit message you indirectly point to an example where 0/NULL would
> > have a different meaning depending on the flags. This is not explained in the
> > TEE Client API Specification. Do you have some pointer I could use to check
> > the behavior?
> >
> > >
> > > OP-TEE represents this null memory reference as a TMEM parameter with
> > > buf_ptr == NULL. This is the only case when we should allow TMEM
> > > buffer without the OPTEE_MSG_ATTR_NONCONTIG flag.
> >
> > IIUC, 0 with OPTEE_MSG_ATTR_NONCONTIG set would mean "use the buffer at
> > address 0" but with the flag cleared, it would mean "return the size". Am I
> > correct?
> >
> > >
> > > Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > The code looks to match your commit message, but I wasn't able to match it
> > with the spec. Do you have other pointer I could use to check the behavior?
> >
> > I assume this wants to be part of Xen 4.14. The change is only for OP-TEE
> > which is a tech preview feature. So the risk is very limited.
next prev parent reply other threads:[~2020-06-19 8:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-18 1:53 [PATCH] xen/arm: optee: allow plain TMEM buffers with NULL address Volodymyr Babchuk
2020-06-06 15:19 ` Julien Grall
2020-06-18 22:26 ` Stefano Stabellini
2020-06-18 23:32 ` Volodymyr Babchuk
2020-06-19 8:47 ` Paul Durrant [this message]
2020-06-18 23:29 ` Volodymyr Babchuk
2020-06-19 9:23 ` Julien Grall
2020-06-19 9:52 ` Volodymyr Babchuk
2020-06-19 10:25 ` Julien Grall
2020-06-19 17:15 ` Stefano Stabellini
2020-06-19 17:40 ` Julien Grall
2020-06-19 18:04 ` Stefano Stabellini
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='00a801d64616$3d3a15d0$b7ae4170$@xen.org' \
--to=xadimgnik@gmail.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=julien@xen.org \
--cc=paul@xen.org \
--cc=pdurrant@amazon.com \
--cc=sstabellini@kernel.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 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.