From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.81]) by mx.groups.io with SMTP id smtpd.web11.10323.1639398405365952883 for ; Mon, 13 Dec 2021 04:26:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=047f9uI3; spf=pass (domain: arm.com, ip: 40.107.15.81, mailfrom: sami.mujawar@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=xtVSXKthSbHpC+nWAYGVd09pbbguLpl5tmi/g4GByVg=; b=047f9uI3DLisecQUjlJviNiJ7JDF529VSV2lkipzARFWfJyywDmsO4W4wXNJsjEIvmFMU5NT7K+TXw5r11gbRgLZnn5LILmUT2WEAq0HUnmuE/hwpL829n82doCdF0eDXuwaQ4a0bNEvDkISZUEBfWC5XDcBv6QBYux9ER/O1sg= Received: from DB8PR04CA0022.eurprd04.prod.outlook.com (2603:10a6:10:110::32) by VI1PR08MB5311.eurprd08.prod.outlook.com (2603:10a6:803:13a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Mon, 13 Dec 2021 12:26:42 +0000 Received: from DB5EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:110:cafe::68) by DB8PR04CA0022.outlook.office365.com (2603:10a6:10:110::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12 via Frontend Transport; Mon, 13 Dec 2021 12:26:41 +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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT041.mail.protection.outlook.com (10.152.21.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12 via Frontend Transport; Mon, 13 Dec 2021 12:26:41 +0000 Received: ("Tessian outbound de6049708a0a:v110"); Mon, 13 Dec 2021 12:26:41 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 053174856dda9774 X-CR-MTA-TID: 64aa7808 Received: from e0d49ba2fa82.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 789E44E1-A179-44FE-B69A-D4697C567DE3.1; Mon, 13 Dec 2021 12:26:34 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e0d49ba2fa82.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 13 Dec 2021 12:26:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KjlNQ5yTHO3kq4Q6vbOB878fo40+6O0Sme1Lq1WOXbjg+ybW7PVop8QYBjZ/ReGVYQo3I0oa8Wzg1g/F64qLtENvrszALxPX3PoSAek+0Kf7J6kohSs5HtbiNkpdkzMvdaYhlphAw3UBBzB6YPYA7tc9LUd9olm+LCfKHpgxlcN6zRZPaIcBL0q9yJFVwI3+HPrCFoXzE/9T/qYhoYsCLs2YclijHt+61cHUnK+hzvHEAF1oLzSg39U/eirh3wa5yctwe1b3PyWhH54Q3uAP2mUtD0Stu+6ng8x43qCVSka+sjXR/1Pb79RgFyeVnJZRL3h4tgFImPHWjcVqCaNzzw== 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=xtVSXKthSbHpC+nWAYGVd09pbbguLpl5tmi/g4GByVg=; b=GfB9k+CZ7OISDhl5RrSNcXUvkyQOifesIMGwuNZsw2GMvepidFhw475HMnSx/N+7WWu6Vrev+vUVEAcf40QCmYzCmmlkHYdwQVIatiIi+zB0O28NCKs0f/NbTaoIUqx4+vJhtPpCdLFjTWx75haDU8ykYFzfTINVAFt/LII/6xK68jj8V3/mLytvg2t46SKxxIb/LIsghFFiVT/NyxAMjHRdp4cRs7TpN+l6tVEl62UumS1wh3B1oBgC1lfrpcq2JVLuLTRS2A0yfK9U2hnNOAekD4UtCBVDU87ckYky47SaFdDYfypNdVO89WnkeuWPkI/9GuNOYsNWyG3Z/OVmEw== 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=xtVSXKthSbHpC+nWAYGVd09pbbguLpl5tmi/g4GByVg=; b=047f9uI3DLisecQUjlJviNiJ7JDF529VSV2lkipzARFWfJyywDmsO4W4wXNJsjEIvmFMU5NT7K+TXw5r11gbRgLZnn5LILmUT2WEAq0HUnmuE/hwpL829n82doCdF0eDXuwaQ4a0bNEvDkISZUEBfWC5XDcBv6QBYux9ER/O1sg= 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 AS8PR08MB6152.eurprd08.prod.outlook.com (2603:10a6:20b:298::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.14; Mon, 13 Dec 2021 12:26:33 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::bdcf:cfa6:b2bb:38ac]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::bdcf:cfa6:b2bb:38ac%6]) with mapi id 15.20.4755.021; Mon, 13 Dec 2021 12:26:33 +0000 Subject: Re: [PATCH v2 2/2] ArmPkg: Update SMC calls to use the new ArmCallSmc1/2/3/4 functions To: Rebecca Cran , devel@edk2.groups.io, Ard Biesheuvel , Gerd Hoffmann , Samer El-Haj-Mahmoud , Leif Lindholm , nd References: <20211101221153.18620-1-rebecca@nuviainc.com> <20211101221153.18620-3-rebecca@nuviainc.com> From: "Sami Mujawar" Message-ID: <1134469a-0108-fac6-52f9-4d0363086687@arm.com> Date: Mon, 13 Dec 2021 12:26:38 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20211101221153.18620-3-rebecca@nuviainc.com> X-ClientProxiedBy: LNXP265CA0061.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5d::25) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 Received: from [10.1.196.43] (217.140.106.50) by LNXP265CA0061.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5d::25) with Microsoft SMTP Server (version=TLS1_2, cipher=) via Frontend Transport; Mon, 13 Dec 2021 12:26:33 +0000 X-MS-Office365-Filtering-Correlation-Id: ab3b1e02-683f-4472-148e-08d9be33d194 X-MS-TrafficTypeDiagnostic: AS8PR08MB6152:EE_|DB5EUR03FT041:EE_|VI1PR08MB5311:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6108;OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: fnp3TSNqn0qiZvWgAO1S4aG6ncjWZmoxgMl1MV5lnkUkc0cYuA/GKj1aUD75iyEpJEpn99rlg0JUED1DvHSPplwejcH5bakpGA7uUo9OCL3U0VM3y75XIx2CRseaLVXSCymoDI+eyydW3C3Agijhuv1OJHJqtWW7904/zXSx5I2jjRh8fadXbzBB4guyDHjdZbV6vwH0kP+qLaSzGowAwGVwvLdEfaN3l1QWAE+itTV2jH7KUFnDh6HgBLwWE93zRZJ29farNHRNKAoHrzC8HY1lmGtXGzpYVHFxddzKraca3jzcleTBgoWkJAzDpc7dPmHZVC1hM1nhbZ2IqeiWer4rdITnS7LiBjXQHXYnugO+VfE0qJI79QL2UKs93yMWS10TARoAG55VLL8THZvVD3ZwLQ8yyMW2mvpIYI9WSgUuHF7R1cVIb3WtBVKWfbwEuRe82Qi5P/gvSKSpvLNkT+2u3fRQWx/YezPK35SrWnP2jbH50Dssmb4pW2xCudIAiTEOxIBC7uDY0P9zqdmQ/k3JKctJOk0sYI60u+76ydJib0hS3i3R/eDu/g04mLyUsyac6l9uxP7ChI87KIqOgw8jTFli5uVP4E6GSHb+Xrp3ISlXfCrQ3Jt+oajFML1PUI0wZsyJ4TQpvYP4jgx2K3Iv40H+yF+xo/ekgaE7Gs/MMYIAq2piOZj4lk/ATlSa/z3/j/0cDk99dxTZJHTSQJdx2jEyYvijrB8uLpMqVsNRvFBGQ072g7mh2PK+om/PP7ktmmMo7l4Z1tQQKLljRA== 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:(4636009)(366004)(16576012)(110136005)(508600001)(8676002)(6486002)(5660300002)(31696002)(36756003)(53546011)(6636002)(316002)(8936002)(19627235002)(66946007)(83380400001)(38350700002)(186003)(2906002)(86362001)(26005)(52116002)(38100700002)(956004)(66556008)(2616005)(66476007)(44832011)(31686004)(15650500001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6152 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: DB5EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ab3e9af9-3224-4dca-807c-08d9be33ccae X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fDOKoTnmJV3I8ipyq4YMx4qQtWvPizp435Dj5tJJSi4SK2OUuOB0BYyxRTVuUeTt13eK5bb11iCcwEtcKNVuMSXGlWeLmBfSyiPPr/N22uYob8lXvNV+TrzqrLC7yOWepAZtG+0//R/MUECbBkO0Fl8xD4gb9YnWnrRtb0GySCOUuzX9JNYFJkdn27vRtweiKGMz6apjSQnb7mObDdU2gLhekMVcua9XmcOQlkKUMy7iOr+yzpFqGr7LdUbCaZdFzDMMI/cZsX9fy36yYuGpemo575gIDMCHASheRkGzp8mg73MzYV8XM2+t01meMuR49sAIdZyxyApd1A88C5c5iEowsbZ2HVLW8Ifaf1wD3yAbTMUcr9cEIbb+6dee6Jfe+eq5NHrHBzW7Aw5fKZ09KlNl3YB6j2QiIUbD0jGtHGMCXkpO7osxQP181einyhx5BaDkjYc9gc1W0Fls/W9HyT1gf06YvNgLYoKeyDcqrN6TzGGW6hR2/gyn1R7Do+Ijho98D2Vfi+F2njiYVe4L9vqyxWmejgGMH0Hdin0AIY/KJ+b2zCy2B5Tx03vZ+DdQDm4/lVpKO/vL5EGDiQ1DT3wttTOhpI2aGHNqMtV6Tw8O4wKfucOsWJEwKp1gDufSLFMCQHae34K9Bwt5hBzODueLjDfaPJCKv87/J3MsgeZL1iUWxH9ndd6a0RV2ANlrm0B2MyP6AOdYkAGT6hNXrQoRTO6wyjis6lEQoHgSyzs= 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:(4636009)(46966006)(36840700001)(36756003)(81166007)(316002)(16576012)(6636002)(31696002)(336012)(110136005)(508600001)(5660300002)(53546011)(15650500001)(86362001)(82310400004)(186003)(26005)(36860700001)(31686004)(2906002)(44832011)(6486002)(8676002)(47076005)(19627235002)(83380400001)(956004)(70206006)(2616005)(8936002)(70586007)(356005)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2021 12:26:41.8231 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab3b1e02-683f-4472-148e-08d9be33d194 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: DB5EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5311 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-GB Hi Rebecca, Thank you for this patch. I believe the patch subject line needs to be updated to "... ArmCallSmc0/1/2/3 ...". Other than that, this patch looks good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 01/11/2021 10:11 PM, Rebecca Cran wrote: > New SMC helper functions have been added to reduce the amount of > template code. Update ArmSmcPsciResetSystemLib and > Smbios/ProcessorSubClassDxe to use them. > > Signed-off-by: Rebecca Cran > --- > ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c = | 10 ++----- > ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c= | 31 ++++++++------------ > 2 files changed, 14 insertions(+), 27 deletions(-) > > diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSyste= mLib.c b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c > index 8b5ff5c27e44..319f05c9f1e2 100644 > --- a/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c > +++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c > @@ -31,11 +31,8 @@ ResetCold ( > VOID > ) > { > - ARM_SMC_ARGS ArmSmcArgs; > - > // Send a PSCI 0.2 SYSTEM_RESET command > - ArmSmcArgs.Arg0 =3D ARM_SMC_ID_PSCI_SYSTEM_RESET; > - ArmCallSmc (&ArmSmcArgs); > + ArmCallSmc0 (ARM_SMC_ID_PSCI_SYSTEM_RESET, NULL, NULL, NULL); > } > > /** > @@ -66,11 +63,8 @@ ResetShutdown ( > VOID > ) > { > - ARM_SMC_ARGS ArmSmcArgs; > - > // Send a PSCI 0.2 SYSTEM_OFF command > - ArmSmcArgs.Arg0 =3D ARM_SMC_ID_PSCI_SYSTEM_OFF; > - ArmCallSmc (&ArmSmcArgs); > + ArmCallSmc0 (ARM_SMC_ID_PSCI_SYSTEM_OFF, NULL, NULL, NULL); > } > > /** > diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessor= ArmCommon.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorA= rmCommon.c > index d644cd33d249..c6d41e3984f8 100644 > --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmComm= on.c > +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmComm= on.c > @@ -88,22 +88,19 @@ HasSmcArm64SocId ( > VOID > ) > { > - ARM_SMC_ARGS Args; > INT32 SmcCallStatus; > BOOLEAN Arm64SocIdSupported; > + UINTN SmcParam; > > Arm64SocIdSupported =3D FALSE; > > - Args.Arg0 =3D SMCCC_VERSION; > - ArmCallSmc (&Args); > - SmcCallStatus =3D (INT32)Args.Arg0; > + SmcCallStatus =3D ArmCallSmc0 (SMCCC_VERSION, NULL, NULL, NULL); > > if (SmcCallStatus < 0 || (SmcCallStatus >> 16) >=3D 1) { > - Args.Arg0 =3D SMCCC_ARCH_FEATURES; > - Args.Arg1 =3D SMCCC_ARCH_SOC_ID; > - ArmCallSmc (&Args); > + SmcParam =3D SMCCC_ARCH_SOC_ID; > + SmcCallStatus =3D ArmCallSmc1 (SMCCC_ARCH_FEATURES, &SmcParam, NULL,= NULL); > > - if (Args.Arg0 >=3D 0) { > + if (SmcCallStatus >=3D 0) { > Arm64SocIdSupported =3D TRUE; > } > } > @@ -125,30 +122,26 @@ SmbiosGetSmcArm64SocId ( > OUT INT32 *SocRevision > ) > { > - ARM_SMC_ARGS Args; > INT32 SmcCallStatus; > EFI_STATUS Status; > + UINTN SmcParam; > > Status =3D EFI_SUCCESS; > > - Args.Arg0 =3D SMCCC_ARCH_SOC_ID; > - Args.Arg1 =3D 0; > - ArmCallSmc (&Args); > - SmcCallStatus =3D (INT32)Args.Arg0; > + SmcParam =3D 0; > + SmcCallStatus =3D ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NUL= L); > > if (SmcCallStatus >=3D 0) { > - *Jep106Code =3D (INT32)Args.Arg0; > + *Jep106Code =3D (INT32)SmcParam; > } else { > Status =3D EFI_UNSUPPORTED; > } > > - Args.Arg0 =3D SMCCC_ARCH_SOC_ID; > - Args.Arg1 =3D 1; > - ArmCallSmc (&Args); > - SmcCallStatus =3D (INT32)Args.Arg0; > + SmcParam =3D 1; > + SmcCallStatus =3D ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NUL= L); > > if (SmcCallStatus >=3D 0) { > - *SocRevision =3D (INT32)Args.Arg0; > + *SocRevision =3D (INT32)SmcParam; > } else { > Status =3D EFI_UNSUPPORTED; > } IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.