public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Rebecca Cran" <rebecca@bsdio.com>
To: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>, devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Sami Mujawar <sami.mujawar@arm.com>
Subject: Re: [PATCH v2 1/1] Platform/SbsaQemu: read platform version
Date: Wed, 10 May 2023 09:49:51 -0600	[thread overview]
Message-ID: <40996fe8-7fc3-40cc-a106-a2e85e952703@bsdio.com> (raw)
In-Reply-To: <20230510154026.196475-1-marcin.juszkiewicz@linaro.org>

On 5/10/23 09:40, Marcin Juszkiewicz wrote:

> @@ -26,6 +36,9 @@ InitializeSbsaQemuPlatformDxe (
>     EFI_STATUS                     Status;
>     UINTN                          Size;
>     VOID*                          Base;
> +  UINTN                          Major;
> +  UINTN                          Minor;
> +  UINTN                          Result;
>   
>     DEBUG ((DEBUG_INFO, "%a: InitializeSbsaQemuPlatformDxe called\n", __FUNCTION__));
>   
> @@ -51,5 +64,16 @@ InitializeSbsaQemuPlatformDxe (
>       return Status;
>     }
>   
> +  Result = ArmCallSmc0 (SIP_SVC_VERSION, &Major, &Minor, NULL);
> +  if (Result == SMC_ARCH_CALL_SUCCESS)
> +  {
> +        Result = PcdSet32S (PcdPlatformVersionMajor, Major);
> +        ASSERT_EFI_ERROR (Result);
> +        Result = PcdSet32S (PcdPlatformVersionMinor, Minor);
> +        ASSERT_EFI_ERROR (Result);
> +  }
> +
> +  DEBUG((DEBUG_ERROR, "Platform version: %d.%d\n", Major, Minor));
> +
>     return EFI_SUCCESS;
>   }

That should probably be logged at DEBUG_INFO instead of DEBUG_ERROR.

Also, if the SMC call fails Major and Minor are uninitialized. With a 
slightly older TF-A I get:


Platform version: -71457408.-8905312


-- 

Rebecca Cran


  reply	other threads:[~2023-05-10 15:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-10 15:08 [PATCH 1/1] Platform/SbsaQemu: read platform version Marcin Juszkiewicz
2023-05-10 15:21 ` [edk2-devel] " Ard Biesheuvel
2023-05-10 15:26 ` Rebecca Cran
2023-05-10 15:40   ` [PATCH v2 " Marcin Juszkiewicz
2023-05-10 15:49     ` Rebecca Cran [this message]
2023-05-10 16:06       ` [PATCH v3 " Marcin Juszkiewicz
2023-05-10 16:14         ` Rebecca Cran
2023-05-10 17:30           ` [PATCH v4 " Marcin Juszkiewicz
2023-05-10 17:32           ` [PATCH v3 " Marcin Juszkiewicz
     [not found]   ` <175DD274B9968CD4.32438@groups.io>
2023-05-10 15:42     ` [edk2-devel] [PATCH v2 " Marcin Juszkiewicz

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=40996fe8-7fc3-40cc-a106-a2e85e952703@bsdio.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