From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=p8yQtnOF; spf=pass (domain: os.amperecomputing.com, ip: 40.107.244.128, mailfrom: nhi@os.amperecomputing.com) 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 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=hkd1Bs0swuA8e6GNYBAeO+Yq55o2z3iajwIVod/ZMKM=; b=p8yQtnOFxlLMxpp+XKBiMAhLJdyJ4S6PCjne2AHLIzrfaVpiQ2KB4WCQAis/Cjty7mxeskgaNYoNsqeJvOqyK29cOlNMhxrE9YYHFepaO//lHjbCNmQRu+CsJYTz52ePIpK52dV/iwC5ZqbAD/+B6SxZwRVfOz6iSEw/8RlEYTk= 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 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 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" 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 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> X-Mailer: git-send-email 2.25.1 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) Return-Path: nhi@os.amperecomputing.com 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: BCL: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-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)(366004)(136003)(346002)(39840400004)(376002)(396003)(451199015)(66946007)(5660300002)(8676002)(4326008)(66556008)(66476007)(8936002)(54906003)(86362001)(316002)(19627235002)(38100700002)(38350700002)(83380400001)(6666004)(41300700001)(52116002)(6486002)(6506007)(478600001)(2616005)(186003)(1076003)(6512007)(26005)(2906002);DIR:OUT;SFP:1102; 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?HJ6wWRKQHd1a8nHkuikPR18Ek28Ifg7gDBSEhchJpkJcPV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9GI4QIvy0JBbc7lO5XGjg82eYtoU4ob8W2gJXYuUGScDGne1J8x?= =?us-ascii?Q?cZuQQiDj4GF3lKDaYBGxy5eL3SBzWTGTNOhrXCi5MriUK5kkurNF8jXok+wz?= =?us-ascii?Q?6Ty44psC721nxddS+6n2+qX5zvH0Mt2VqTaXvfNPxvZqOe5ba9jZMGhVnPsg?= =?us-ascii?Q?y/WLoaTrjY875cCHFlS0pt35Us7kzpu02WF8dJA66WiuVj+v3TbBrTuz6/Ny?= =?us-ascii?Q?9jXHGXEuv7jPMBX+IoNo+HvCtk5bURWbJFxx3PXWFMxP0ox4rJTKpAMMN2aw?= =?us-ascii?Q?UrkKxLvTA62cRQUG+G66rH04GQvO0crqIL4KfhRshUNoDf5cdojhv9EFDfQA?= =?us-ascii?Q?bnO8g8rxDsiBSLs0XW5DDX9zRqLeuDkBw+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 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 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.=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