public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ilias Apalodimas" <ilias.apalodimas@linaro.org>
To: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Sughosh Ganu <sughosh.ganu@linaro.org>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	 Ard Biesheuvel <Ard.Biesheuvel@arm.com>,
	Leif Lindholm <leif@nuviainc.com>,
	 Sahil Malhotra <sahil.malhotra@linaro.org>
Subject: Re: [PATCH edk2-platforms v3 1/2] Drivers/OpTeeRpmb: Add an OP-TEE backed RPMB driver
Date: Mon, 1 Feb 2021 16:00:39 +0200	[thread overview]
Message-ID: <CAC_iWj+LvaaAqjvKjXtc+Krxs8vCsxOkYVswjhQ2LAYgycwTFQ@mail.gmail.com> (raw)
In-Reply-To: <CAC_iWjLb1SAG4PqCaFb2M1bViPy5AnS4zpOY0Pv2zeMrr1ks6w@mail.gmail.com>

Hi Sami,


[...]
> > +STATIC
> > +EFI_STATUS
> > +ReadWriteRpmb (
> > +  UINTN  SvcAct,
> > +  UINTN  Addr,
> > +  UINTN  NumBytes,
> > +  UINTN  Offset
> > +  )
> > +{
> > +  ARM_SVC_ARGS  SvcArgs;
> > +  EFI_STATUS    Status;
> > +
> > +  ZeroMem (&SvcArgs, sizeof (SvcArgs));
> > +
> > +  SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64;
> > +  SvcArgs.Arg1 = storage_id;
> > +  SvcArgs.Arg2 = 0;
> > +  SvcArgs.Arg3 = SvcAct;
> > +  SvcArgs.Arg4 = Addr;
> > +  SvcArgs.Arg5 = NumBytes;
> > +  SvcArgs.Arg6 = Offset;
> > +
> > +  ArmCallSvc (&SvcArgs);
> > +  if (SvcArgs.Arg3) {
> > +    DEBUG ((DEBUG_ERROR, "%a: Svc Call 0x%08x Addr: 0x%08x len: 0x%x Offset: 0x%x failed with 0x%x\n",
> > +     __func__, SvcAct, Addr, NumBytes, Offset, SvcArgs.Arg3));
> > +  }
> > +
> > +  switch (SvcArgs.Arg3) {
> > +  case ARM_SVC_SPM_RET_SUCCESS:
> > +    Status = EFI_SUCCESS;
> > +    break;
> > +
> > +  case ARM_SVC_SPM_RET_NOT_SUPPORTED:
> > +    Status = EFI_UNSUPPORTED;
> > +    break;
> > +
> > +  case ARM_SVC_SPM_RET_INVALID_PARAMS:
> > +    Status = EFI_INVALID_PARAMETER;
> > +    break;
> > +
> > +  case ARM_SVC_SPM_RET_DENIED:
> > +    Status = EFI_ACCESS_DENIED;
> > +    break;
> > +
> > +  case ARM_SVC_SPM_RET_NO_MEMORY:
> > +    Status = EFI_BAD_BUFFER_SIZE;
> > +    break;
> > +
> > +  default:
> > +    Status = EFI_ACCESS_DENIED;
> > +  }
> > [SAMI] Should the error handling here be updated similar to the FF-A StandaloneMmPkg patches?
> > [/SAMI]
>
> I actually picked up the error handling from the previous non-FFA code.
> I'll check what's on Sughosh latest patches and fix it if there are
> any differences.
> Looking at it again EFI_BAD_BUFFER_SIZE can change to indicate out of
> memory properly anyway.
>

Had another look at this. This seems fine if I just change
EFI_BAD_BUFFER_SIZE -> EFI OUT_OF_RESOURCES because OP-TEE is only
using these errors from FFA. Eventually the OP-TEE code that launches
StMM today, will move to FFA and become a separate SP, so that will
naturally be handled once that's done. I don't see a point of adding
unused error cases.

Regards
/Ilias

  parent reply	other threads:[~2021-02-01 14:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 11:09 [PATCH edk2-platforms v3 0/2] Add support for running StandaloneMm as OP-TEE TA Sughosh Ganu
2020-12-16 11:09 ` [PATCH edk2-platforms v3 1/2] Drivers/OpTeeRpmb: Add an OP-TEE backed RPMB driver Sughosh Ganu
2021-01-27 17:10   ` Sami Mujawar
2021-01-29  8:02     ` Ilias Apalodimas
2021-01-29 11:45       ` Sami Mujawar
2021-02-01 14:00       ` Ilias Apalodimas [this message]
2021-02-02 10:40         ` Sami Mujawar
2021-02-02 12:33           ` Ilias Apalodimas
2021-02-02 14:49             ` Ilias Apalodimas
2021-02-02 15:13               ` Sami Mujawar
2021-02-02 16:27                 ` Ilias Apalodimas
2020-12-16 11:09 ` [PATCH edk2-platforms v3 2/2] StMMRpmb: Add support for building StandaloneMm image for OP-TEE Sughosh Ganu
2021-01-29 10:29   ` Sami Mujawar
2021-01-29 11:47     ` Ilias Apalodimas

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=CAC_iWj+LvaaAqjvKjXtc+Krxs8vCsxOkYVswjhQ2LAYgycwTFQ@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