public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: Nhi Pham <nhi@os.amperecomputing.com>,
	devel@edk2.groups.io, quic_llindhol@quicinc.com,
	ardb+tianocore@kernel.org, quic_rcran@quicinc.com
Cc: patches@amperecomputing.com,
	Minh Nguyen <minhn@amperecomputing.com>,
	"nd@arm.com" <nd@arm.com>
Subject: Re: [PATCH 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call
Date: Tue, 23 Aug 2022 17:28:30 +0100	[thread overview]
Message-ID: <ff899fde-0506-5e51-4bef-a86d8df389de@arm.com> (raw)
In-Reply-To: <20220823105926.1379824-3-nhi@os.amperecomputing.com>

Hi Nhi,

Thank you for this fix.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 23/08/2022 11:59 am, Nhi Pham wrote:
> From: Minh Nguyen <minhn@amperecomputing.com>
>
> According to "SMC Calling Convention" specification, section 7.4,
> return value of Arm Architecture Calls is stored at first argument of
> SMC aguments (ARM_SMC_ARGS). This value can be negative values indicating
> error or positive values (including zero) indicating success. Positive
> value would contain information of respective Function ID (Section 7.3.4
> and 7.4.4).
>
> For that reason, "SMCCC_VERSION" and "SMCCC_ARCH_FEATURES"
> Function ID calls read return value from "SmcCallStatus" variable
> (Args.Arg0 - first argument of SMC call). But "SMCCC_ARCH_SOC_ID"
> Function ID call is reading return value from "SmcParam" variable
> (Args.Arg1 - second argument of SMC call) so it leads to unexpected
> results of "Jep106Code" and "SocRevision". This patch is to correct it.
>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
>   ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> index e0010a40e489..b961be213358 100644
> --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> @@ -2,7 +2,7 @@
>     Functions for processor information common to ARM and AARCH64.
>
>   
>
>     Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
>
> -  Copyright (c) 2021, Ampere Computing LLC. All rights reserved.<BR>
>
> +  Copyright (c) 2021 - 2022, Ampere Computing LLC. All rights reserved.<BR>
>
>   
>
>     SPDX-License-Identifier: BSD-2-Clause-Patent
>
>   
>
> @@ -131,7 +131,7 @@ SmbiosGetSmcArm64SocId (
>     SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL);
>
>   
>
>     if (SmcCallStatus >= 0) {
>
> -    *Jep106Code = (INT32)SmcParam;
>
> +    *Jep106Code = SmcCallStatus;
>
>     } else {
>
>       Status = EFI_UNSUPPORTED;
>
>     }
>
> @@ -140,7 +140,7 @@ SmbiosGetSmcArm64SocId (
>     SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL);
>
>   
>
>     if (SmcCallStatus >= 0) {
>
> -    *SocRevision = (INT32)SmcParam;
>
> +    *SocRevision = SmcCallStatus;
>
>     } else {
>
>       Status = EFI_UNSUPPORTED;
>
>     }
>

  reply	other threads:[~2022-08-23 16:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23 10:59 [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
2022-08-23 10:59 ` [PATCH 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib Nhi Pham
2022-08-23 16:21   ` Sami Mujawar
2022-08-24 16:10     ` Nhi Pham
2022-08-23 10:59 ` [PATCH 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call Nhi Pham
2022-08-23 16:28   ` Sami Mujawar [this message]
2022-08-23 10:59 ` [PATCH 3/6] ArmPkg/SmbiosMiscDxe: Support fetching System UUID Nhi Pham
2022-08-23 16:31   ` Sami Mujawar
2022-08-23 10:59 ` [PATCH 4/6] ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02" Nhi Pham
2022-08-23 16:34   ` Sami Mujawar
2022-08-23 10:59 ` [PATCH 5/6] ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2 Nhi Pham
2022-08-23 16:36   ` Sami Mujawar
2022-08-23 10:59 ` [PATCH 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib Nhi Pham
2022-08-23 16:57   ` Sami Mujawar
2022-08-23 14:24 ` [edk2-devel] [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Rebecca Cran
2022-08-23 15:57 ` PierreGondois

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=ff899fde-0506-5e51-4bef-a86d8df389de@arm.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