From nobody Sun Nov 24 04:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+93928+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+93928+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1663554136709858.7499109336148; Sun, 18 Sep 2022 19:22:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id fp49YY1788612xT0CsspmixP; Sun, 18 Sep 2022 19:22:16 -0700 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.128]) by mx.groups.io with SMTP id smtpd.web10.15553.1663554135884982038 for ; Sun, 18 Sep 2022 19:22:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PmLDGYdQ/AaEY+aSySsYqDL3h+v9NmfGrfZv44DUKIUorHe6vwFm1KeciUU/OPwHlJ9wH+N+ZOxcWuZ75zVo4H/KG+UR5gx6lIsHzFOXFP464T3BI52YAq41StwwlOeSPrmQ/OTMWqZ/MUWU+zXdWXmCKpzo9QhhPosOCootQnlIURqk0a2Do/aLSf+z+XqH6/bxSwB273qv0BPcngOEnJixxXkvTSNP7J0fxKlgbQ3I06beTdHOwLKayjfPqsSzopTsgl8AN2y5yShIqP7VqTBsEUOLWj/G4MZsHY3W4RuJM6OSxh4J8mDpOuGiwJl2iirCmVOiClnmI4H1uJDlwQ== 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=hkd1Bs0swuA8e6GNYBAeO+Yq55o2z3iajwIVod/ZMKM=; b=elc6Xuc5R3hBvnwd5IQ4gQ6f5QGSbg+X5JV6/er83gvezeW1Yct3KMHBjrwe4c/GvnIKFZuPG+9nnOSKlyhUct1MnKHX0Q1RE9hiz9pa5C9axEoxZROhz7IgU8y8J+3r3oVI0QbHCetzPGf4qmO85VIwJaF43s0l77Svc2/uUxl8m49O2BqUefO0W26SHxhKAAPZOEf/SXhpHO6bvcJoWi/k2VrwMskKq5A+OK1t5q70CEDaqJxFl9B4b3UHnw3fvuU1s+HS9cqdzbjaJfLI8J4jb8O1JqO+tl4BfvZSbwuSvY1Ifckvzdnme7mqUGy4GbgYDDmhxZpzwemmzGeetQ== 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 X-Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by CO1PR01MB6791.prod.exchangelabs.com (2603:10b6:303:f7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.16; Mon, 19 Sep 2022 02:22:14 +0000 X-Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::441a:930:ac15:1ce9]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::441a:930:ac15:1ce9%4]) with mapi id 15.20.5632.019; Mon, 19 Sep 2022 02:22:14 +0000 From: "Nhi Pham via groups.io" 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: [edk2-devel] [PATCH v4 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call Date: Mon, 19 Sep 2022 09:19:46 +0700 Message-Id: <20220919021950.2110333-3-nhi@os.amperecomputing.com> In-Reply-To: <20220919021950.2110333-1-nhi@os.amperecomputing.com> References: <20220919021950.2110333-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SG2PR02CA0071.apcprd02.prod.outlook.com (2603:1096:4:54::35) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|CO1PR01MB6791:EE_ X-MS-Office365-Filtering-Correlation-Id: 181a51f5-fec6-4c53-8cd3-08da99e5c40c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 2cUYOl3NvkKk/iCWh3NURDeB7PnUvU/wsjA72iCqEKhq5FucuH5y332FM6vPqmaDIkHRvnsnpwojwswRC6eybmzTWFMlKUXZjCV1GRG/GHcY31FXZhhXZvBTDd9FNaHCu14kGf4J3PnB6cCmH3uZlGKltEKZSFlLqczIKbrxmads1onN/DMA0zQz0lEBtcqkOs/hgQhZVnRXnlCnaQu3tqghFBII2MATf4tZmkXy1w4lLnuAjFPDZJfe6Z09pX7RB33aZdnhntxvaPdTuUEm+A5J7coybPrGDLX/45+MhEo5+onCMvTPX10W0+P2AJxxWsbKmseESJtdGYH0w4hNaOYCtcl3RLwPG/T7mXpgjVqd/AG6QeBfTlbEQiNXXJWkX4HrSxTc37q5NZ8bXOTEI9PEVVul02sPGVFYWqe5o3Isyb248pYh3v2rlw1j0J9o/w0QHZE5fad274p0bPI1hM25a+4r5KhBQvqNMGV6YYmJ6ee55FgniL5Z14c1JIrHWQFbrOzkeQtS44Ezt63tdjtUZEZI7Agn9ogukaeelxRpJ2oVBzh6+JFz/PSUeU3eRe4N+ZNeiUqCP1WdAInZ/09/2RB34RQGAfgEthDod6MgKyyTUMOlnurfV8sTo6r34G37gOnyudrXHCrwqBXMnnlFcuyZtWTZX5LULS3cOlObvAXLe3tEP04SeifMVxP5XYc/rOAOr202yZp4OwaGhYLWl/0u/07aL9jhQEqwLMsuyF7/KJ0TP2IsIzzJsdlrqF38MwRQx+E4lqG0IR+tjw== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?8h4qfuSoSwhgppE/bHNtYf3cht/skx/SsqnseyL9VpZJtaIeqNt0OO8h2+1o?= =?us-ascii?Q?prnI9l2+0M4NVg2w+sqJu7jpK5Rn0UENZ4lnBSPjJps2jWGUQ/kRMpQ8Tqlw?= =?us-ascii?Q?bThf1UTj1WrnYI2LNd7b9gB9BO5b2Uh44eRIq85bfgHBdP92RcLaOfF5yZBL?= =?us-ascii?Q?Bf/jusBmNHO9iTxe98EvyjgqSY0O/SuigrEVMhC2yUY1h67bRvTObf81dAai?= =?us-ascii?Q?WDLlw1tuezZ/TU+FyV+hV6C2U/aKdYb6evdHji25/InJXAvjecKcmyhjKutu?= =?us-ascii?Q?HJ6wWRKQHd1a8nHkuikPR18Ek28Ifg7gDBSEhchJpkJcPVx8ssDJonD5Cht/?= =?us-ascii?Q?0LdIhkUtBoSVSwpl3Bg5ekwBT0obKWlAosgC10IF92PRrwfhjLl+6nMSKzyF?= =?us-ascii?Q?mTpBEAuXm7yX28gwIjLhnx903bEwh8+SIfe4RRT+EelpckYu7l1TMvILmkQF?= =?us-ascii?Q?01sB1VAR7O1RkTGoYOD3Nfe/iF8XD9870519W8SF2z5AhbXM6Hq+huA8H3Og?= =?us-ascii?Q?Yw00TLn8GytnXzJEtUXYBj8PlW3Q8SCyWzF2xLGpkHE6kGq1U/W+SyPzY0c/?= =?us-ascii?Q?TmlDZtcVbk410+2TXmT4/c+eLIWTbSIKZlXQI7HGWwucRF0zMkCU6xWUc7Mc?= =?us-ascii?Q?HSdslU2D/8z9XqNMgnRqjR00cTUnc1iE/eutg/n6xmjX4sCZr4hR/4mR0jO8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RqLeuDkBw+8IByuZDe6jhb2VGP4uE8bu9T6c?= =?us-ascii?Q?7IGWTcMClilBTRD7oFyVC8o=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 181a51f5-fec6-4c53-8cd3-08da99e5c40c X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 02:22:14.4419 (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: rkffBrpNX6P2fy+nZuFcIJqogDKy5ONrCyaRzgE56J7YFPMI6HyIuzgFK8EHW72qzPw2gTPdbcYmrozNp5iOFymEnoo8MZ18yc+U5yysWzg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR01MB6791 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nhi@os.amperecomputing.com X-Gm-Message-State: n3CP04vDxlVvgaSydEAgxF9yx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1663554136; bh=69yIUC7Tl5IAEEf4Uv7UI8rLdWiPIpvI72A5emHiKwQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=GKSih9IzeeJ8ZRq+E1JPtglgub4kWmxpjEUd93xzPbB5P67VaqsiZdesAYK8B8O3fuw UGAfe+b2mx8h5mAFjDz3VkScIuwfwM+zVrWCWbPVEizyt30usjx8u5fT/qRRfKv2Ybh9h 7jdGK0xO6Sprst2Vmh5jyFf2p76+dM5xq5Q= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1663554137211100003 Content-Type: text/plain; charset="utf-8" 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 Acked-by: Leif Lindholm --- 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. =20 Copyright (c) 2021, NUVIA Inc. All rights reserved.
- Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
+ Copyright (c) 2021 - 2022, Ampere Computing LLC. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -131,7 +131,7 @@ SmbiosGetSmcArm64SocId ( SmcCallStatus =3D ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL); =20 if (SmcCallStatus >=3D 0) { - *Jep106Code =3D (INT32)SmcParam; + *Jep106Code =3D SmcCallStatus; } else { Status =3D EFI_UNSUPPORTED; } @@ -140,7 +140,7 @@ SmbiosGetSmcArm64SocId ( SmcCallStatus =3D ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL); =20 if (SmcCallStatus >=3D 0) { - *SocRevision =3D (INT32)SmcParam; + *SocRevision =3D SmcCallStatus; } else { Status =3D EFI_UNSUPPORTED; } --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#93928): https://edk2.groups.io/g/devel/message/93928 Mute This Topic: https://groups.io/mt/93773959/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-