All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@linaro.org>
To: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Jerome Forissier <jerome@forissier.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	OP-TEE TrustedFirmware <op-tee@lists.trustedfirmware.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	Sughosh Ganu <sughosh.ganu@linaro.org>
Subject: Re: [PATCH v6 5/5] optee: add FF-A support
Date: Tue, 12 Oct 2021 13:05:18 +0530	[thread overview]
Message-ID: <CAFA6WYMR1F+zzi=kHpeQD5H_FgDapCt9gEJ1kYKa3a8oTWezdg@mail.gmail.com> (raw)
In-Reply-To: <CAHUa44GccfP3M3uFPQfH_nUZSOTi_wGV0UhL=iHK8uVL2xWvnA@mail.gmail.com>

On Mon, 11 Oct 2021 at 14:59, Jens Wiklander <jens.wiklander@linaro.org> wrote:
>
> On Fri, Oct 8, 2021 at 9:21 PM Jerome Forissier <jerome@forissier.org> wrote:
> >
> > Hi Sudeep,
> >
> > On 10/8/21 6:32 PM, Sudeep Holla wrote:
> > > On Fri, Oct 08, 2021 at 02:27:32PM +0100, Sudeep Holla wrote:
> > >> On Wed, Oct 06, 2021 at 09:09:02AM +0200, Jens Wiklander wrote:
> > >>> Adds support for using FF-A [1] as transport to the OP-TEE driver.
> > >>>
> > >>> Introduces struct optee_msg_param_fmem which carries all information
> > >>> needed when OP-TEE is calling FFA_MEM_RETRIEVE_REQ to get the shared
> > >>> memory reference mapped by the hypervisor in S-EL2. Register usage is
> > >>> also updated to include the information needed.
> > >>>
> > >>> The FF-A part of this driver is enabled if CONFIG_ARM_FFA_TRANSPORT is
> > >>> enabled.
> > >>>
> > >>
> > >> I am not sure if I missed this with earlier version but I see the below
> > >> warning the second time I insert the optee module. I am sure I tested it
> > >> with previous version when I was fixing issues with FF-A as a module.
> > >>
> > >> Not sure if I am missing something in my steps.
> > >>
> > >
> > > OK, more info, indeed I didn't observe this issue 2 weeks back with optee
> > > at commit 57e642f12085 ("core: enable system PTA upon user TA support").
> > > The UUID(d96a5b40-c3e5-21e3-8794-1002a5d5c61b) wasn't enumerated with above
> > > commit. Today I am testing the latest commit 2de2880065f3 ("core: update
> > > reference link to PrimeCell Cache Controller").
> > >
> > > Though it looks like an issue with the driver, the latest optee changes
> > > triggered the driver to hit this issue in my setup. Hope this helps.
> >
> > Totally makes sense. The optee_os commit triggering this is almost
> > certainly 811c42d40cd0 ("plat-vexpress: enable CFG_ENABLE_EMBEDDED_TESTS
> > by default"). With this commit, the "invoke tests" PTA gets included by
> > default in the TEE binary. This PTA has the TA_FLAG_DEVICE_ENUM flag so
> > it is enumerated by the Linux driver. AFAICT the vexpress platform has
> > no other PTA with that flag, so as you said the OP-TEE commit is simply
> >  exposing a bug in the Linux driver.
> >
> > > IIUC we are not undoing optee_register_device executed via
> > > optee_enumerate_devices in the exit path.
> >

Thanks Sudeep for spotting this issue. I have sent a corresponding fix
[1], give it a try and let me know if you observe any further issues.

[1] https://lkml.org/lkml/2021/10/12/136

-Sumit

> > That doesn't sound good indeed ;)
>
> Thanks for the analysis, I'll look into this.
>
> Cheers,
> Jens

WARNING: multiple messages have this Message-ID (diff)
From: Sumit Garg <sumit.garg@linaro.org>
To: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Jerome Forissier <jerome@forissier.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	 Linux ARM <linux-arm-kernel@lists.infradead.org>,
	 OP-TEE TrustedFirmware <op-tee@lists.trustedfirmware.org>,
	Marc Bonnici <marc.bonnici@arm.com>,
	 Sughosh Ganu <sughosh.ganu@linaro.org>
Subject: Re: [PATCH v6 5/5] optee: add FF-A support
Date: Tue, 12 Oct 2021 13:05:18 +0530	[thread overview]
Message-ID: <CAFA6WYMR1F+zzi=kHpeQD5H_FgDapCt9gEJ1kYKa3a8oTWezdg@mail.gmail.com> (raw)
In-Reply-To: <CAHUa44GccfP3M3uFPQfH_nUZSOTi_wGV0UhL=iHK8uVL2xWvnA@mail.gmail.com>

On Mon, 11 Oct 2021 at 14:59, Jens Wiklander <jens.wiklander@linaro.org> wrote:
>
> On Fri, Oct 8, 2021 at 9:21 PM Jerome Forissier <jerome@forissier.org> wrote:
> >
> > Hi Sudeep,
> >
> > On 10/8/21 6:32 PM, Sudeep Holla wrote:
> > > On Fri, Oct 08, 2021 at 02:27:32PM +0100, Sudeep Holla wrote:
> > >> On Wed, Oct 06, 2021 at 09:09:02AM +0200, Jens Wiklander wrote:
> > >>> Adds support for using FF-A [1] as transport to the OP-TEE driver.
> > >>>
> > >>> Introduces struct optee_msg_param_fmem which carries all information
> > >>> needed when OP-TEE is calling FFA_MEM_RETRIEVE_REQ to get the shared
> > >>> memory reference mapped by the hypervisor in S-EL2. Register usage is
> > >>> also updated to include the information needed.
> > >>>
> > >>> The FF-A part of this driver is enabled if CONFIG_ARM_FFA_TRANSPORT is
> > >>> enabled.
> > >>>
> > >>
> > >> I am not sure if I missed this with earlier version but I see the below
> > >> warning the second time I insert the optee module. I am sure I tested it
> > >> with previous version when I was fixing issues with FF-A as a module.
> > >>
> > >> Not sure if I am missing something in my steps.
> > >>
> > >
> > > OK, more info, indeed I didn't observe this issue 2 weeks back with optee
> > > at commit 57e642f12085 ("core: enable system PTA upon user TA support").
> > > The UUID(d96a5b40-c3e5-21e3-8794-1002a5d5c61b) wasn't enumerated with above
> > > commit. Today I am testing the latest commit 2de2880065f3 ("core: update
> > > reference link to PrimeCell Cache Controller").
> > >
> > > Though it looks like an issue with the driver, the latest optee changes
> > > triggered the driver to hit this issue in my setup. Hope this helps.
> >
> > Totally makes sense. The optee_os commit triggering this is almost
> > certainly 811c42d40cd0 ("plat-vexpress: enable CFG_ENABLE_EMBEDDED_TESTS
> > by default"). With this commit, the "invoke tests" PTA gets included by
> > default in the TEE binary. This PTA has the TA_FLAG_DEVICE_ENUM flag so
> > it is enumerated by the Linux driver. AFAICT the vexpress platform has
> > no other PTA with that flag, so as you said the OP-TEE commit is simply
> >  exposing a bug in the Linux driver.
> >
> > > IIUC we are not undoing optee_register_device executed via
> > > optee_enumerate_devices in the exit path.
> >

Thanks Sudeep for spotting this issue. I have sent a corresponding fix
[1], give it a try and let me know if you observe any further issues.

[1] https://lkml.org/lkml/2021/10/12/136

-Sumit

> > That doesn't sound good indeed ;)
>
> Thanks for the analysis, I'll look into this.
>
> Cheers,
> Jens

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-10-12  7:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06  7:08 [PATCH v6 0/5] Add FF-A support in OP-TEE driver Jens Wiklander
2021-10-06  7:08 ` Jens Wiklander
2021-10-06  7:08 ` [PATCH v6 1/5] tee: add sec_world_id to struct tee_shm Jens Wiklander
2021-10-06  7:08   ` Jens Wiklander
2021-10-06  8:36   ` Jerome Forissier
2021-10-06  8:36     ` Jerome Forissier
2021-10-06 10:58     ` Jens Wiklander
2021-10-06 10:58       ` Jens Wiklander
2021-10-06  7:08 ` [PATCH v6 2/5] optee: simplify optee_release() Jens Wiklander
2021-10-06  7:08   ` Jens Wiklander
2021-10-06  7:09 ` [PATCH v6 3/5] optee: refactor driver with internal callbacks Jens Wiklander
2021-10-06  7:09   ` Jens Wiklander
2021-10-06  7:09 ` [PATCH v6 4/5] optee: isolate smc abi Jens Wiklander
2021-10-06  7:09   ` Jens Wiklander
2021-10-18  6:38   ` Jens Wiklander
2021-10-18  6:38     ` Jens Wiklander
2021-10-06  7:09 ` [PATCH v6 5/5] optee: add FF-A support Jens Wiklander
2021-10-06  7:09   ` Jens Wiklander
2021-10-08 13:27   ` Sudeep Holla
2021-10-08 13:27     ` Sudeep Holla
2021-10-08 16:32     ` Sudeep Holla
2021-10-08 16:32       ` Sudeep Holla
2021-10-08 19:21       ` Jerome Forissier
2021-10-08 19:21         ` Jerome Forissier
2021-10-11  9:29         ` Jens Wiklander
2021-10-11  9:29           ` Jens Wiklander
2021-10-12  7:35           ` Sumit Garg [this message]
2021-10-12  7:35             ` 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='CAFA6WYMR1F+zzi=kHpeQD5H_FgDapCt9gEJ1kYKa3a8oTWezdg@mail.gmail.com' \
    --to=sumit.garg@linaro.org \
    --cc=jens.wiklander@linaro.org \
    --cc=jerome@forissier.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.bonnici@arm.com \
    --cc=op-tee@lists.trustedfirmware.org \
    --cc=sudeep.holla@arm.com \
    --cc=sughosh.ganu@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 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.