All of lore.kernel.org
 help / color / mirror / Atom feed
From: Etienne Carriere <etienne.carriere@linaro.org>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4 3/7] optee-examples: new package
Date: Tue, 19 Feb 2019 08:25:12 +0100	[thread overview]
Message-ID: <CAN5uoS-O5spwS+Yimg7De01T6fZuqFSphgkAGu_surWODoXG4w@mail.gmail.com> (raw)
In-Reply-To: <20190217222839.322d0955@windsurf.home>

Hello Thomas,

On Sun, 17 Feb 2019 at 22:28, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello ?tienne,
>
> On Wed, 30 Jan 2019 11:47:25 +0100
> Etienne Carriere <etienne.carriere@linaro.org> wrote:
>
> > This package generates embedded Linux based OS userland client
> > applications and OP-TEE OS trusted applications all embedded in
> > the file system. These applications shows how to use the APIs
> > OP-TEE OS is based on, both in the non secure and secure worlds.
> >
> > Package is added next to the OP-TEE client package in the BR
> > package configuration.
> >
> > This change references in Buildroot the today's latest OP-TEE
> > revision release tagged 3.4.0 with an added patch to fix an issue
> > reported by recent GCC toolchains.
> >
> > Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
>
> I have applied to next, but with a number of changes, see below.
>
>
> > diff --git a/package/optee-examples/3.4.0/0001-fix-deprecated-size_t-type-for-size.patch b/package/optee-examples/3.4.0/0001-fix-deprecated-size_t-type-for-size.patch
> > new file mode 100644
> > index 0000000..ba1716a
> > --- /dev/null
> > +++ b/package/optee-examples/3.4.0/0001-fix-deprecated-size_t-type-for-size.patch
> > @@ -0,0 +1,37 @@
> > +commit fca0caba591f31f66325826c74acd26aefd52dee
> > +Author: Etienne Carriere <etienne.carriere@linaro.org>
> > +Date:   Tue Dec 18 22:35:16 2018 +0100
> > +
> > +    secure_storage: fix deprecated size_t type for size
> > +
> > +    size_t types is an deprecated type used in GPD API v1.0.
> > +    Update
> > +
> > +    Error reported by GCC 7.3-2018.05:
> > +      secure_storage_ta.c:203:6: warning: passing argument 4 of 'TEE_ReadObjectData' from incompatible pointer type [-Wincompatible-pointer-types]
> > +          &read_bytes);
> > +
> > +    Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
>
> Patches should be generated with "git format-patch" and not "git show".
> Indeed, patches generated by "git format-patch" can conveniently be
> applied by "git am".
>
> I've re-generated the patch to use the proper format.

Ok, sorry, I'll be careful for the next ones.

>
> > diff --git a/package/optee-examples/3.4.0/optee-examples.hash b/package/optee-examples/3.4.0/optee-examples.hash
> > new file mode 100644
> > index 0000000..077fd97
> > --- /dev/null
> > +++ b/package/optee-examples/3.4.0/optee-examples.hash
> > @@ -0,0 +1,4 @@
> > +# From https://github.com/linaro-swg/optee_examples/archive/3.4.0.tar.gz
> > +sha256 d833753980ac438c1675787857bb8352997352212334274de9419770097ce039  optee-examples-3.4.0.tar.gz
> > +# Locally computed
> > +sha256 6f1ef8449cb82ae79d2155605f7985bdf0f08e7ab5007de9b4362e8bf28733b9  LICENSE
> > diff --git a/package/optee-examples/Config.in b/package/optee-examples/Config.in
> > new file mode 100644
> > index 0000000..a240e54
> > --- /dev/null
> > +++ b/package/optee-examples/Config.in
> > @@ -0,0 +1,59 @@
> > +config BR2_PACKAGE_OPTEE_EXAMPLES
> > +     bool "optee-examples"
> > +     depends on BR2_TARGET_OPTEE_OS
>
> In fact, building OP-TEE itself is not sufficient, because this does
> not guarantee the SDK has been built, so I have added a:
>
>         select BR2_TARGET_OPTEE_OS_SDK
>
> here.
>
> > +     select BR2_PACKAGE_OPTEE_CLIENT
>
> This now depends on !BR2_STATIC_LIBS, so I've propagated this
> dependency.
>
> > +     help
> > +       Enable the OP-TEE examples package that brings examples of
> > +       implementation of OP-TEE non-secure client applications and
> > +       secure trusted applications. OP-TEE examples is a
> > +       component delivered by the OP-TEE project.
> > +
> > +       Trusted application binary files are installed in the target
> > +       directory /lib/optee_armtz as other trusted applications.
> > +       At runtime OP-TEE OS can load trusted applications from this
> > +       non-secure filesystem/directory into the secure world for
> > +       execution.
> > +
> > +       https://github.com/linaro-swg/optee_examples
> > +
> > +if BR2_PACKAGE_OPTEE_EXAMPLES
> > +
> > +choice
> > +     prompt "version"
> > +     default BR2_PACKAGE_OPTEE_EXAMPLES_LATEST
> > +     help
> > +       Select the version of OP-TEE exmaples you want to use
> > +
> > +config BR2_PACKAGE_OPTEE_EXAMPLES_LATEST
> > +     bool "3.4.0"
> > +     help
> > +       This fetches the registered release tag from the
> > +       OP-TEE official Git repository.
> > +
> > +config BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_GIT
> > +     bool "Custom Git repository"
> > +     help
> > +       Sync with a specific OP-TEE Git repository.
> > +
> > +endchoice
>
> Here as well, I don't think the version selection makes a lot of sense,
> so I dropped it.

Fair.

>
>
> > +ifeq ($(BR2_aarch64),y)
> > +OPTEE_EXAMPLES_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm64
> > +endif
> > +ifeq ($(BR2_arm),y)
>
> Changed:
>
> endif
> ifeq ($(BR2_arm),y)
>
> to just:
>
> else ifeq ($(BR2_arm),y)
>
> > +OPTEE_EXAMPLES_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm32
> > +endif
> > +
> > +# Trusted Application are not built from CMake due to ta_dev_kit dependencies.
> > +# We must build and install them on target.
> > +define OPTEE_EXAMPLES_BUILD_TAS
> > +     @$(foreach f,$(wildcard $(@D)/*/ta/Makefile), \
> > +             $(TARGET_CONFIGURE_OPTS) \
> > +             $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \
> > +                     TA_DEV_KIT_DIR=$(OPTEE_EXAMPLES_SDK) \
> > +                     O=out -C $(dir $f) all &&) true
>
> Convoluted syntax here. Changed to:
>
>         $(foreach f,$(wildcard $(@D)/*/ta/Makefile), \
>                 $(TARGET_CONFIGURE_OPTS) \
>                 $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \
>                         TA_DEV_KIT_DIR=$(OPTEE_EXAMPLES_SDK) \
>                         O=out -C $(dir $f) all
>         )
>
> Also: could this be fixed upstream, so that the CMake build system
> builds/installs everything ?

That a tricky part. The binaries that executes in the secure world, that is
Trusted Application, i.e those built from the optee-test package as well
as the OP-TEE OS core (optee-os) uses build sequence written with
GNU Makefile that we (I mean people contributing to op-tee) did not
manage yet to port to CMake. This is an open task and it would greatly
help integration of OP-TEE in many build env, but it is not available yet.
Sorry

Best regards,
etienne

>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

  reply	other threads:[~2019-02-19  7:25 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30 10:47 [Buildroot] [PATCH v4 1/7] boot/optee-os: new package Etienne Carriere
2019-01-30 10:47 ` [Buildroot] [PATCH v4 2/7] optee-client: " Etienne Carriere
2019-02-17 20:52   ` Thomas Petazzoni
2019-01-30 10:47 ` [Buildroot] [PATCH v4 3/7] optee-examples: " Etienne Carriere
2019-02-17 21:28   ` Thomas Petazzoni
2019-02-19  7:25     ` Etienne Carriere [this message]
2019-01-30 10:47 ` [Buildroot] [PATCH v4 4/7] optee-test: " Etienne Carriere
2019-02-17 21:50   ` Thomas Petazzoni
2019-02-17 21:51   ` Thomas Petazzoni
2019-02-19  7:18     ` Etienne Carriere
2019-01-30 10:47 ` [Buildroot] [PATCH v4 5/7] optee-benchmark: " Etienne Carriere
2019-02-17 22:08   ` Thomas Petazzoni
2019-02-19  7:26     ` Etienne Carriere
2019-03-05  8:02       ` Etienne Carriere
2019-01-30 10:47 ` [Buildroot] [PATCH v4 6/7] configs/qemu_armv7a_tz_virt: Armv7-A emulation with TrustZone services Etienne Carriere
2019-02-17 22:12   ` Thomas Petazzoni
2019-02-18 18:14     ` Yann E. MORIN
2019-02-18 21:28       ` Etienne Carriere
2019-02-18 21:43         ` Thomas Petazzoni
2019-02-19  8:31     ` Arnout Vandecappelle
2019-03-05  9:14       ` Etienne Carriere
2019-03-05  9:55         ` Thomas Petazzoni
2019-03-05 10:58           ` Etienne Carriere
2019-01-30 10:47 ` [Buildroot] [PATCH v4 7/7] configs/qemu_aarch64_tz_virt: AArch64 " Etienne Carriere
2019-02-10 16:14 ` [Buildroot] [PATCH v4 1/7] boot/optee-os: new package Thomas Petazzoni

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=CAN5uoS-O5spwS+Yimg7De01T6fZuqFSphgkAGu_surWODoXG4w@mail.gmail.com \
    --to=etienne.carriere@linaro.org \
    --cc=buildroot@busybox.net \
    /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.