From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.99]) by mx.groups.io with SMTP id smtpd.web11.1629.1663050170434474977 for ; Mon, 12 Sep 2022 23:22:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=mndOlJV3; spf=pass (domain: os.amperecomputing.com, ip: 40.107.92.99, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jZsAMcFPnKLvaA44jp/8Cokg3U+xeVxE8J3s11phBaPIOdbWfld6lq537UmQDSf3dnRzyXhgZg33qaxOVuOPDS4blU1cb4uycL0z7M5JDu7GEWogH3m74ib7x3tP6/k+xx1KxZqEnRETLhCgjURN3psAkXcpwZKJPMk0hJAz6UYXPidlHkKkQcdnNWUFcVwhUeKTkFWkM9I2e+r+5pqD39xMZnVVCygTirq5PMP3t6+DHoMv8ckNevnNndNFRKM+uKrRoiPck5QwhfcfOCVhK1TC4AD9W8FF27+NaNQVbgJAbcPjEHvNJBgVJprwsXIsrc25fmS5sCwAFusAnP4BbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nfeIubZi6tDFhHSj56K5YtYQ7cXbhTQ90dK6cJ1Xco4=; b=a+kxpwoy4VRfGabKQIIPKV8CEjhzQATMHp+hqNLUi4m2PaPvHdE+nMsNZTM7VyY4do35vsn2FyZIFUcBdR9yR0UG2hwAoK32VQXKlU3ZQ5Ti9AfHLJbhoR7EZ86QjJ+FyP3/31alBRcPRUlb/62Bxtun4Rji6hTUY1yshg8ogCVUtaJJaeVZhVdOiRHiK8m9xLZKySr7J/2S6cevxL9H+UTRAz8q6VfA6tS5HbRZphu/BCfoZD9uZcH25ZOXTto+PWyaQVm7jRHmBhDC1GBP1aZxTwRIX4suoR0InsYL/NvnkdeV0QrgdDKEaNqE4H2muM+gxgI0HDLFIztqZka5VA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nfeIubZi6tDFhHSj56K5YtYQ7cXbhTQ90dK6cJ1Xco4=; b=mndOlJV3md6qu7jAAC6xwcArPfcqqflWrq/yVKoDYoF5kYCU55GLMyRvIViXZisHk4eyrJ1gaPhU2T0lE4aodiRzPuWx23jb282NLnmG4Bk/UH6tR9kixs5w/5bNjiNIL/HFUxIxodjLxVEuHKTpkZb5fQk76yYNXq8ElFrV7dY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by DM6PR01MB3644.prod.exchangelabs.com (2603:10b6:5:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Tue, 13 Sep 2022 06:22:46 +0000 Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc6b:4f56:8f32:dfa5]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc6b:4f56:8f32:dfa5%4]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 06:22:46 +0000 From: "Nhi Pham" To: devel@edk2.groups.io, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, sami.mujawar@arm.com, quic_rcran@quicinc.com Cc: patches@amperecomputing.com, Minh Nguyen , Nhi Pham , Rebecca Cran , Ard Biesheuvel Subject: [PATCH v3 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call Date: Tue, 13 Sep 2022 13:19:43 +0700 Message-Id: <20220913061947.735951-3-nhi@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220913061947.735951-1-nhi@os.amperecomputing.com> References: <20220913061947.735951-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SG2PR06CA0194.apcprd06.prod.outlook.com (2603:1096:4:1::26) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|DM6PR01MB3644:EE_ X-MS-Office365-Filtering-Correlation-Id: d4847abc-ec3c-4a65-ba1d-08da95505fa2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rc7glPf+gVgme0H8+eH8bky/Pxi+tn38q+QAXyGrzlCNYF7OAGKB08i5a6apV2Kl+S6tQrqe4YeOHURpRCXpftT69F0uIjabaFoU75cOUl8R8ZchZv8Rtb6BByUqTo5TuvF0sEwbcAJkA126yCqn5Y4qd4Lz7GBZjHadKWdPAU7XAjsLt5iLBaZGPDBZ8IrWbnZFjX8j1FgY6sef3RlT8kgKctKGVcvPREFHM2vVF8fPlCdX84vNGsyug3NLV9MfIWNM19dPzWW0UjDVJuGuCXKswScTc1KfqAg3F1a/hhsqikv8c8XvH6dAkhC+WTRvYTPWgkSLHRbUH+5dhl5lgww5QtPPUl5uwl1R3/7t7NESc8MG78wDebHrQHS0QTmMtIQ0pE30ws0/Nq0PMcQgEOVuGFBeXFXbU0tsCWLRwZleE29EDDw/Iz9H2VH1eKUabTrlVy5kOIAWwKjSt3kpYq4/oKun7EJ7lHIR6JETiStQFKgN3D7VZuvgpU0ezDxCVFfzHi9xkGaju0Au3xNoecadLeXiN2JqotmhIJnDdXgmMiUP3WFKPb6CCQ+s0PEYslxVM+Mblix4Rd/281W/vmJMgfy9f8NPHkVnyxFl13nYNC0rUgccDbUv5JN2tTZQn12wUWEglykMz8AChnvw4t/qN8lOt9P+1Jo76RdLArXtCQ+86MBtbCGMQ97LqX5xfsFt2+LgsrTKzqNLKnAJlkYLMyw2CXZuLx+f6zDW7GZtg587eNFg1L6fpXOUGjSgIVrkKMeULy3IzeCXXA09RQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7287.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(396003)(39850400004)(136003)(366004)(376002)(346002)(451199015)(19627235002)(66556008)(6666004)(8676002)(316002)(66946007)(478600001)(4326008)(66476007)(83380400001)(2616005)(6512007)(86362001)(41300700001)(6486002)(26005)(54906003)(2906002)(6506007)(186003)(5660300002)(1076003)(38100700002)(8936002)(38350700002)(52116002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?5+cvehoV7hQTu7YTd+Um2aCJDNZWsVbksY41lJk/2sPIHh5+OYIq7ez8C3ME?= =?us-ascii?Q?YT+lzFrcbrU+QyMWz/8t0jd8ENpo0OK9kODGhWEEgyYe+CLzsJU+4oi7Eg2P?= =?us-ascii?Q?juSkep1udiJPesUcft5Q3S3T5cjoKxpcdAqnr6i+DAgIYYpnPnqf4M9yUuhs?= =?us-ascii?Q?daV9qUV8ndCWHRrDFsV+vYUZ6HIIVVNZmgv+HMgjBbvrGbsxAGbpAU7FMwNO?= =?us-ascii?Q?356x3+RBq8poi6jQZu+ACb7TR7KikWhMnLBxwjr+REBWb4PIud+fPe6b2xOW?= =?us-ascii?Q?VqBK7cY2cxcE4HBwBLI+S5idHHGzzUdQPAXTjqiEANv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Xo8IXo6Zkl9SP7gvz9h/D6wCrwPFGGqiwlFafX?= =?us-ascii?Q?bX26Z4lnF5oG5w+G+GHUzzOfJWY0cFdInqcwbJ6JR3d3BaJkx4ZSmZyknKzP?= =?us-ascii?Q?ZRwIvmSekH1HxsDaMeD7jAFeUauYIHKEKKUlUk3sAU3SoGRdWKePiS3XbuU8?= =?us-ascii?Q?fVa0zPMYdJtFTeZuv+kiaC4o1kRaUV7TzbG30tgLf0ut0/LXsM8Bch2ddUAq?= =?us-ascii?Q?sennjPjaT0IODIZsmaSRQnIg0SjUleqymdNam6MbDpiAVwCDWhz4onrcjTOH?= =?us-ascii?Q?rLp+eiBj4/ORSREzn1xrQDpXvsYOSSDXQQRA0JHS7Wvcaz0/zOyvClnkQ5FX?= =?us-ascii?Q?WGSZWpmPBQveH1gznu5KfYqHwzGyWT8PaYolHGmkQ5Txw8sV0kL/yDuok5qT?= =?us-ascii?Q?xahLyfRNi4S6WNMrZhyzw18=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4847abc-ec3c-4a65-ba1d-08da95505fa2 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 06:22:46.2800 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XXrOCkHrY32NGzATTyN5Km1kMFLWEtQRmBgLwkMLgEnBIQ0DUb7g0QoMnx+u3mY0upVDiJ5leBWoyfL+TFKFQHJauFmsJ4NNoZxx2FrcFQI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB3644 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Minh Nguyen 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 Reviewed-by: Rebecca Cran Reviewed-by: Sami Mujawar Acked-by: Ard Biesheuvel --- ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c | = 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorAr= mCommon.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArm= Common.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.=0D =0D Copyright (c) 2021, NUVIA Inc. All rights reserved.
=0D - Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
=0D + Copyright (c) 2021 - 2022, Ampere Computing LLC. All rights reserved.=0D =0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D @@ -131,7 +131,7 @@ SmbiosGetSmcArm64SocId ( SmcCallStatus =3D ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL)= ;=0D =0D if (SmcCallStatus >=3D 0) {=0D - *Jep106Code =3D (INT32)SmcParam;=0D + *Jep106Code =3D SmcCallStatus;=0D } else {=0D Status =3D EFI_UNSUPPORTED;=0D }=0D @@ -140,7 +140,7 @@ SmbiosGetSmcArm64SocId ( SmcCallStatus =3D ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL)= ;=0D =0D if (SmcCallStatus >=3D 0) {=0D - *SocRevision =3D (INT32)SmcParam;=0D + *SocRevision =3D SmcCallStatus;=0D } else {=0D Status =3D EFI_UNSUPPORTED;=0D }=0D --=20 2.25.1