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.102]) by mx.groups.io with SMTP id smtpd.web12.29940.1661252523145416299 for ; Tue, 23 Aug 2022 04:02:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=Zf3wFxdD; spf=pass (domain: os.amperecomputing.com, ip: 40.107.92.102, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gsXcr9m2FN4R4dc5lwcjUbyKbJ/ylKI0GrA16n9V3mdfuSV7LcGWO2GbhvpuQfmqVg+wNbpM7zbdXkcFn5zEAzwJLWryWHoqOqoQqhQF8HFGj/bgKb0giqLl+GR/1nCmosZDzuu7Rfizv5+LVgjCFFjLa6oT8M5+1Vos1FX3f5TyuQNfoK5iOVH5PXJ2tdTHrXZYVrNnm7h0cg866kFFBF7CIEnVk2AAIs54tJMRsKXNkXpxZjUgE1l94kacAwZN75HH7MV8T/fgIaDS9hTHMImSt7BP2yNKHAN5y2ZmarrqOpubIcHCA9gUdUxvkNIfyRuTZUwAmO/O3APcu7Q1AA== 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=fHPBj1jSA3bzFCqwEyFwq/KA5ecvS3iD15fmXfxLW5U=; b=F2zym5SHwAUCZawoS8So2ba5rdcR970Kv24KLmmqx/NArR+PbWx2x3+hpZs9ZV+QcI7uqbCrdIg/UdzDYyVa6p1BsQoe+GnKH5JsD/QYn3OE/UMG3NqLERqOWzFS1B5ircr3tynXg2g9YzLh9Ei+KvnoRj1nezWxE4IG7zJN5hZi/d4RVPOnf9t5H+QJE9n9oC342SnKZqXjbs/S+QoAcsg+sKrTgepNB9mVkPPcLfY2Z/a1td4kP2OIm6z401AOiunE7HMscDgZusEa9CJq48cTDzkkDU9iz8BZd00vrmjzF6beZQM2BeDGi9rlz2jRtbMQf3pjrH4j9GPd7ciHAA== 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=fHPBj1jSA3bzFCqwEyFwq/KA5ecvS3iD15fmXfxLW5U=; b=Zf3wFxdDF2emNBx8gciYFWasDcRrVwOQ9+fMYB16nRbkXAoSkxUfGiqCK8f4zrjp02G8QomdvEQwjjYCeo9/Zipl2mAgooXDPH995qflkfvYduRwFYO3NeQCr/3iCSDSqJZi2oRxZqZJAfOg47ylS6iQX9yGOnRukSWeupC/viY= 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 SJ0PR01MB6430.prod.exchangelabs.com (2603:10b6:a03:297::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14; Tue, 23 Aug 2022 11:02:01 +0000 Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::bceb:a82f:b3ef:53b9]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::bceb:a82f:b3ef:53b9%5]) with mapi id 15.20.5546.022; Tue, 23 Aug 2022 11:02:01 +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 Subject: [PATCH 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call Date: Tue, 23 Aug 2022 17:59:22 +0700 Message-Id: <20220823105926.1379824-3-nhi@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220823105926.1379824-1-nhi@os.amperecomputing.com> References: <20220823105926.1379824-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SI2P153CA0028.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::9) 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-Office365-Filtering-Correlation-Id: 05753ea8-5221-4ea2-187e-08da84f6e78b X-MS-TrafficTypeDiagnostic: SJ0PR01MB6430:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BoQyYA25nDv9byZE1SSKn/dIZagHDHBfIFYwqlRL5YUwCU98L3PreV4IQ8cYq65PLEk82WjdJulwP+pBMI8djDpuYnhA07Qc5uNqgZrXIdCrSj5weqbUJaOWOmzwhVX9PxvbdbEzFYmk0/isPBV3+Um6Y1QAfxXs1OAC0sLbF+9cOfuJzRrBKKaVH6JvnJBROYktd7GbZComMX9h+GcLpnkG+FepULFKHF7n0w2IQRLltentXJdxmrW2tJ/qsDmfLjMNPyVOy8/D6YOvyOiqJP15l7lkmUXPv8Eh7t4yKA50G1GMD57ttfjst7m0zB4z0XOyEapjfoIWsJTH6at8zhPyCnPVQSHlu5wACy9fKf2R8qUX/vslvfIMDqL/6NYKp/RXgo9DFhYy7aGBSiAB8GHtZWH5o08MlkkF4k0scZ2d9GBYcDFJgVd90YrotBzWpN984fay33fYQOT0rtBp5D9Pd/5ORAEOkM83sSveGs5jYMVmM55yxIpCqUeYk/wLmLYuhyxJz0JLYypSmg6cXlDBSfbzuZeffFu9bxTY6Seh7zvczC38aBVG5qP9/JU0VxsBweX5sd57422MST1MCDJuCo0aQ8cZqrwLfjMLGNCTyrMvFV/MPd7OM4ww9PQPkZ+Opzhf3OoF99DJGgpUMGtyvlsRMunSxNMg7Ldjl15A+IIfZyJR+EOfsibqS50H1mML9lq7bV5wvi3uxv/3aSsV4+B1zyWhKc1ACAkknmbs3uW4C3YyEzXUE9z99UV/pDkCKPqWOWFf9B+vLdna/w== 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:(13230016)(4636009)(376002)(346002)(39850400004)(136003)(396003)(366004)(2906002)(38100700002)(83380400001)(2616005)(186003)(1076003)(38350700002)(8936002)(5660300002)(26005)(4326008)(6512007)(8676002)(66476007)(66556008)(66946007)(6506007)(52116002)(6666004)(6486002)(316002)(41300700001)(54906003)(107886003)(86362001)(478600001)(19627235002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?4dAVryDZ4pbS4WA0qbbsuXAfjMmJUVg9kN7zrlAYmjuIR5Ks1EBIVblFCz7K?= =?us-ascii?Q?oQ4nn/NIOutl0gHhjt/B3zeAPtxBmbE+UHxffM5qk8X/lHxkgppHMc8KFBiO?= =?us-ascii?Q?EAuMVk5vxYEV0e4rlAK3+MERdtkiFffcVSJuydixCZ91R3wWrxxetIs9sqfu?= =?us-ascii?Q?t1XSQ9WeabIExHGSel5JECvOTY7eHVWcQexTP7fp/Y04B5pc3dH2PZt/komT?= =?us-ascii?Q?S8k3VFYYsb0fhQBAh1o37Ci/4i+cviaUtyCNbv8nQ6J7Wiq2bFlcmNAR7okX?= =?us-ascii?Q?rSvx3Uip9OKSDK51ixLcFPdvASwUHFukcvdKlTLULFha3OXfjQRI9Odp+v9D?= =?us-ascii?Q?Yy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PJLjFbIZm9I?= =?us-ascii?Q?3oPXPmPqX9Ciqtt9vjz1QBMVWfwsyTaCaznX3jRFcvJ3tkHucQ+BBI3zYJRD?= =?us-ascii?Q?guXoB/IAz4KtxBs6MAtbdKrjC2xzhezmJ2mf28ACEctJjbhVXENz53reXRDw?= =?us-ascii?Q?+g5F4ItVSTOQhOHjkUEsab0t0RIHZJ7e5qxt+JNITUyDfpjx8N/RFpVCfcIW?= =?us-ascii?Q?M1t6Y2U4N2svUpwzSguJ3sAvm9ngMCV0ffHhDttCT850iKyOlwXGgtFcXxh5?= =?us-ascii?Q?VXUUO4tRqvdjPJ3qdzRkY6eo0zwgALVHlHl+EbbVufT2gJJIJouk8udsdcbp?= =?us-ascii?Q?3R3t7QIb8PqSqBcqcNmd8C1Y+SJqpIXmshA6gnsvqhrWj5KBC+Y1BSF6T/JD?= =?us-ascii?Q?EZAByqY2/a/PA4d2etcuz+w=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05753ea8-5221-4ea2-187e-08da84f6e78b X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2022 11:02:00.9695 (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: o/w8ChcFC0SlOeRV+IsFJ1fvHHgqrZe5jUC3k6gbFYGV6Dx3kKw7vke1lxPkjhSYgrAQqn91iR9cyULzZFlwRE96rmivE5gTlF+YbC7iPoY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR01MB6430 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 --- 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