From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.44]) by mx.groups.io with SMTP id smtpd.web11.3.1661272124209764184 for ; Tue, 23 Aug 2022 09:28:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=7e5zzIw1; spf=pass (domain: arm.com, ip: 40.107.6.44, mailfrom: sami.mujawar@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=dwXNs2vz4MGSQWEqHhbhsc0cnVoMMVJgBQIy0ub0mY6NiltoasYLMQ3twAPqeOK6z0Ho0g2iUw7fRM7GNVxmn0K3EjeUe9zoEYnMja7L1s6r96iK6AxeIQjYZyzbJA6sI+FFkrBJrXN7JilTWuiXCJ5rovb3cTuIMlXYuMsYSxRTpwYPjoTf8m7I1zL7X0qAXNpLg7t9Yd6U8x+AtS+7lHlaLMjM3AL2dXfcrj1cB6AfVn6kwuyU16TjAyoCdmQz9xJuKU1JOgHXMgGGVwfJK7fuMqVvUuN99ecsV1UNUIuL8saTIuUDAeVR0ueKgfxK31QTSwmd8fPPYwQwnfOvOg== ARC-Message-Signature: i=2; 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=umannM06nciE4EjafUNMYMPHV/kj3CsBd3oDaiJGnVA=; b=Qgu6I70+Vvh5wsAnLNVDZQS62TMxa3L2ooKXqbUee1+ZuoQslWkdLVaj+61ILcSnUbobLCcSzB2xFCqrPmdvA5Av1kBY9WdXB2c8F78xRS0bo+wHZfZFkt/ijCXXTbDhAo9bA5cQjaA5iRVzhukQbAtsZDPSZbP7RLBVj1dEGbzjPtl4WFYKe3lt9UmjD54BziLKFt+M2i4xi6Eo/Q1bOl/DduEdvy1jcNZmNyu8bshabO3C1bR/pmGMholikW1/WppVUcQNU9R9ejPT/9QIfL43v9tTGUV7fvR+JGCvT01sTIKVSE2wrWMYSXjHX/hiIeD4pEgJGqKOmQQcB1vOYA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=umannM06nciE4EjafUNMYMPHV/kj3CsBd3oDaiJGnVA=; b=7e5zzIw1gUmEY+SL/RkDMNgXKD1DkxWaJCe5BUnD8cFFJnPH+JwxmhCK/ktyKyEbXfT2KmSmemxSAeWuCoRjRmtVwHWw91vqJlm5sWxd45xtgBIy1UvDvTUIESqDHf3CAF+d5RF4KBo7rx9nJr5RJW3KpwH8U7n9ZdkjyynzMbs= Received: from DB6PR1001CA0042.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::28) by AM0PR08MB5537.eurprd08.prod.outlook.com (2603:10a6:208:148::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Tue, 23 Aug 2022 16:28:40 +0000 Received: from DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:55:cafe::94) by DB6PR1001CA0042.outlook.office365.com (2603:10a6:4:55::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.19 via Frontend Transport; Tue, 23 Aug 2022 16:28:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT040.mail.protection.outlook.com (100.127.142.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.15 via Frontend Transport; Tue, 23 Aug 2022 16:28:40 +0000 Received: ("Tessian outbound c883b5ba7b70:v123"); Tue, 23 Aug 2022 16:28:40 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 41344e9835c4b54e X-CR-MTA-TID: 64aa7808 Received: from 8378f84e5d6a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B4C829EB-D872-4C6F-AFD2-32F2DF8618AB.1; Tue, 23 Aug 2022 16:28:33 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8378f84e5d6a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 Aug 2022 16:28:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OejGzEzEFLVnWpF5QuNeGVJFYB79b6DFym0Ut4csE1xOM+5BoldD7jIyT/EPxsd8OWs1WXpV/q49bV+KiinhptaiylL8rJkypYYamO8kvB/0ww41+KrQ6Ck1XV2rEFeXT3F6FvnXLW8Djw9bd2jEKlmmOs1I7ykhR/ZIvHhShzgEPaPu6MaFJurwPOAZfsH1xT5UnvbMfxG58bU3BccRTbEHJwwVf9PpD7K0g9pqBp/auazpy3Kb07i+9W1YoDi+rVJTS9nEswGexK37Z99BFZpbe55kokupIEbU2b2k/SeQZ2OGBBqqKFuV6RrjSmsKqR1ThaZjMaImO+G7KIvIDw== 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=umannM06nciE4EjafUNMYMPHV/kj3CsBd3oDaiJGnVA=; b=mR9RHYm55AQyqrG82yNeNPSwSI/HBPPidmeuAEpKtCPswSDU8rZicY7at16nuHw7LIqa1D4Xf9dAZMXNupqZC+teb04bE59PyYdjLkx4RYT9NjfMOZ8+N3k52ppx95BmgL1uI8tg60ssVxVfBLzf3PStkglAC/o/txAeISG+BQzZ3E5FCWLzu9lka6xzu2dpStYEhUJbWZ2gFY/2xakGvM4eSJq+tCA1V43X4eM8CrwPN+MeIKMUKDX9ORmzU/XqRhdzd3eTVe63YEPjqQJfVSikChTzv8JsQ8seDvH+N9YOahq5inRfQDF+4YFGXpo5YyYtWT39hIpGJE5C9DxSZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=umannM06nciE4EjafUNMYMPHV/kj3CsBd3oDaiJGnVA=; b=7e5zzIw1gUmEY+SL/RkDMNgXKD1DkxWaJCe5BUnD8cFFJnPH+JwxmhCK/ktyKyEbXfT2KmSmemxSAeWuCoRjRmtVwHWw91vqJlm5sWxd45xtgBIy1UvDvTUIESqDHf3CAF+d5RF4KBo7rx9nJr5RJW3KpwH8U7n9ZdkjyynzMbs= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AM0PR08MB5122.eurprd08.prod.outlook.com (2603:10a6:208:160::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.21; Tue, 23 Aug 2022 16:28:31 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::b480:677a:ac9b:8f24]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::b480:677a:ac9b:8f24%6]) with mapi id 15.20.5546.022; Tue, 23 Aug 2022 16:28:31 +0000 Message-ID: Date: Tue, 23 Aug 2022 17:28:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call To: Nhi Pham , devel@edk2.groups.io, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, quic_rcran@quicinc.com Cc: patches@amperecomputing.com, Minh Nguyen , "nd@arm.com" References: <20220823105926.1379824-1-nhi@os.amperecomputing.com> <20220823105926.1379824-3-nhi@os.amperecomputing.com> From: "Sami Mujawar" In-Reply-To: <20220823105926.1379824-3-nhi@os.amperecomputing.com> X-ClientProxiedBy: LO2P265CA0435.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e::15) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: b6febcde-930b-485b-8606-08da852489d1 X-MS-TrafficTypeDiagnostic: AM0PR08MB5122:EE_|DBAEUR03FT040:EE_|AM0PR08MB5537:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: cinttLgfmLCyphXktkNMm+5MEB2g3Lx6PuQi63giL8b4Uq8aeNg3M1LTteH5XelcQx/SVb2kzqJWC2bYgs197f9RyW4+px5RR8aE3Y/l0nsD+Xdy8/emFTmCRNlCgCOmTP2FkpfE/SnSEoG6wRWrm94FKzQUTCZKI5HJGFHi3ljPoXdBwNBy2tsGJRmh4TPvdF414lEo5VJBlqk55562/ZgKhxKHpTZAtedzXAE01gUfwuKPdAZm7mYVj3J0zI3zb8n10bgQM0GJK6zhvypQnsbGrZeax/7fFXc0HCuKR2hzTTmIm5DWdFYBvqbY1LJXb+SJbCtX/fd7lfCflwBMkdo+X/fwTDxGoNdULrenWILi5X2PlTfRgY6TBMHhXcrhEEm1NO4ZXlSzGjDuCiL4ojILDHEmH9G0JpqsdpViuz4HVSJHOm3CjK4cCbrUJOkDYuvJBLnTvxyF/ICoaLNPa41gVyn2LyTyIh/qQYdD1nFqrHOonuY6kJ/1RWVvVHTCz51cg/ghyNl4HU1vhQDesPLIOLAo/NGwc4wApMBMcv4QhDBH/aSenRIPUS4mFHPx2Y1EMaSI+lCmS0PxZwaEba0mNyWnNwSoFg1iiLbfbsvwmL8PLVRDX3yPQpNhgh4v68tE0oZhQMc6YO8A9uSPxyntFJWUENJ43T/8ElnICN8YjdnPFS7ySBKsdB5CsGvjrS3Z8BPnbL0OmzgXj90dJqduAYojL+k+YRg0S5vSHL+Z7ZeC9G7vDe5zEZjETf8y5ztTGcFJI+Pk6XP2n98fCDq0J44RuDvGUUuwzchbob4= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(376002)(346002)(366004)(396003)(136003)(39860400002)(36756003)(316002)(66476007)(19627235002)(54906003)(478600001)(6486002)(4326008)(8676002)(31686004)(86362001)(41300700001)(8936002)(66946007)(31696002)(5660300002)(66556008)(44832011)(6506007)(53546011)(26005)(2906002)(38100700002)(6512007)(2616005)(83380400001)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5122 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e9d2551e-0756-4a73-a3b9-08da85248467 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WxhJ1QcADe1VYRZeiIMBBs+uOVpaY1X7OIHNOpt5z/3f5UMawoTmKq29MOteiUkFyTP7YBV8qALrIUsFjRDgv640w+XwuTeREk6z531s4vs+Cj/q1HiPOa+866mLbkB7mKu8/mYrpHI+PDQ7IS7ISovgMZEgL3fXYAzBfQQXiwkLSSB7Ohj/e39FZFjpwENagfHB8koTolI01IwydaSXXfwiuRi8+ej1eIgyBxZGhMrYOHhDNQqJjaVWXWZB4dgwcYWdXyl+tj2cUFVOkmmzI6oL9VZnDch27M3sWqDQB1SJeJwBodvEJDyB6IGn4d147rWxF3Br72sPMpEASj51FGexqvruvsL2NBdJEbqwZl+bs9uILhI9zI/MU2znl/49lfQkgpvieS/9ecAxOn69MZgwwJb2E5s3PhoYhmRN1R352Tj+WBV1wmY6ipkt7iowy69bFxefnRZPlB4ddiQu5b0bfmYnTPJjO2WhwsWYJY/g9B8XhudPNwzsdUOODSDvStcHQWVL7HJxqtOQGvPernWFdhhWNUYhid8ViSg8ZI7v1d/8SuV2Z5XX91VfO/SIxkxeBSCqgzELC3nnoXLl6mbQ9TqXSqrSuEijRjxG9JDBvUCPqZIeyHMgzm3xTkFPkifULlPSQKvgRlMlPBTbZsvwLEAlAoKwt8sVuaadIDchjyz2rBZeBsOuecNkM3l/d2mwzDsAqYHsazEPjJU493meF2dWpeF5v0snLM9O+6bVf0zgHFib0riz25O5iXFBFqUMKvWHXUVBVUignR8XnkBqnLa+lW35P98TWKV2W2t0pHwf6wFeAkCD0091X+27 X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(396003)(136003)(376002)(346002)(36840700001)(46966006)(40470700004)(478600001)(82310400005)(356005)(41300700001)(53546011)(6506007)(31696002)(336012)(86362001)(81166007)(36756003)(26005)(6512007)(83380400001)(31686004)(2616005)(6486002)(186003)(47076005)(40480700001)(70586007)(40460700003)(8676002)(316002)(4326008)(70206006)(19627235002)(54906003)(82740400003)(36860700001)(44832011)(8936002)(5660300002)(2906002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2022 16:28:40.3717 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6febcde-930b-485b-8606-08da852489d1 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5537 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Nhi, Thank you for this fix. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 23/08/2022 11:59 am, Nhi Pham wrote: > 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/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.
> > - Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
> > + Copyright (c) 2021 - 2022, Ampere Computing LLC. All rights reserved.
> > > > 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; > > } >