public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@linaro.org>
To: Leif Lindholm <leif.lindholm@linaro.org>
Cc: edk2-devel@lists.01.org,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	 Michael D Kinney <michael.d.kinney@intel.com>,
	tee-dev@lists.linaro.org,
	 Daniel Thompson <daniel.thompson@linaro.org>,
	Joakim Bech <joakim.bech@linaro.org>,
	 Matteo.Carlini@arm.com, Achin.Gupta@arm.com, udit.kumar@nxp.com
Subject: Re: [PATCH v4 1/1] ArmPkg/OpteeLib: Add APIs to communicate with OP-TEE
Date: Thu, 18 Oct 2018 14:43:37 +0530	[thread overview]
Message-ID: <CAFA6WYMMUmHkzQO_5TFT3bgkYZQD+WaKztYgbJBvfYSY-6Dd3A@mail.gmail.com> (raw)
In-Reply-To: <20181018083411.iplsdsrrswvuhacl@bivouac.eciton.net>

On Thu, 18 Oct 2018 at 14:04, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>
> On Thu, Oct 18, 2018 at 12:59:32PM +0530, Sumit Garg wrote:
> > > So, looking at the OpTee sources, TEE_UUID is defined as a struct, to
> > > exactly the same layout as the EFI_GUID type (which is a typedef of
> > > the GUID struct). Could we add a OPTEE_UUID typedef for the same
> > > struct in OpteeLib.h?
> > >
> > > Since it comes in as an OPTEE_MESSAGE_PARAM_VALUE, alignment is
> > > already guaranteed to be 64-bit.
> > >
> > > (This also deserves a comment explaining how EFI_GUID basically
> > > follows rfc4122, but uses little-endian for the timestamp fields.)
> >
> > Actually, OP-TEE also uses little-endian format for timestamp fields.
> > You can refer to [1] for conversion from network byte order (octets)
> > to little-endian and vice-versa.
> >
> > So for communications among secure world and non-secure world it uses
> > network byte order for UUID/GUID to comply with rfc4122.
> >
> > [1] https://github.com/OP-TEE/optee_os/blob/master/core/tee/uuid.c
>
> Huh, ok. That's good to know.
> It does however not change my comments. Since we're dealing with data
> structures of a known layout, I am not a fan of treating them as byte
> arrays.
>

But calling UUID struct with swapped timestamp as OPTEE_UUID would
also be misnomer. I am not sure regarding appropriate naming for that
struct.

On the other hand, we have byte array of 16 octets as per network byte
order complying with rfc4122 which also doesn't imply swapped
timestamp.

-Sumit

> /
>     Leif


  reply	other threads:[~2018-10-18  9:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10  5:18 [PATCH v4 0/1] Add ArmPkg/Optee library APIs Sumit Garg
2018-10-10  5:18 ` [PATCH v4 1/1] ArmPkg/OpteeLib: Add APIs to communicate with OP-TEE Sumit Garg
2018-10-18  6:23   ` Leif Lindholm
2018-10-18  7:29     ` Sumit Garg
2018-10-18  8:34       ` Leif Lindholm
2018-10-18  9:13         ` Sumit Garg [this message]
2018-10-18  9:24           ` Leif Lindholm
2018-10-18 10:12             ` Sumit Garg
2018-10-17 12:00 ` [PATCH v4 0/1] Add ArmPkg/Optee library APIs 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-list 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=CAFA6WYMMUmHkzQO_5TFT3bgkYZQD+WaKztYgbJBvfYSY-6Dd3A@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /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