From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.7.58; helo=eur04-he1-obe.outbound.protection.outlook.com; envelope-from=achin.gupta@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70058.outbound.protection.outlook.com [40.107.7.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1C3142194D3AE for ; Thu, 7 Mar 2019 03:16:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UgRyzQUlk3LJrDdT9/nOIt4fAHnh9exmq8bIGo4GZso=; b=GAbo5FhVCfCvRi6LBUVipkbGO9a3btX4MdnHGHEuH6gYbnBXcuZaBpGuzMOWWhC2PkqabWyTSGrLnRH8WbOhgWs7bkodTL4ZhwjhJxwYHGokCzk8VmEl4KFXWXiJlY8iGOlqv5MZGH1TlEwYS4xLHgN1bz5O8zRs76eH1sSw1SY= Received: from AM0PR08MB2980.eurprd08.prod.outlook.com (52.134.92.153) by AM0PR08MB3123.eurprd08.prod.outlook.com (52.134.92.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Thu, 7 Mar 2019 11:16:25 +0000 Received: from AM0PR08MB2980.eurprd08.prod.outlook.com ([fe80::a133:50fa:bbbe:81a6]) by AM0PR08MB2980.eurprd08.prod.outlook.com ([fe80::a133:50fa:bbbe:81a6%5]) with mapi id 15.20.1686.018; Thu, 7 Mar 2019 11:16:25 +0000 From: Achin Gupta To: Ard Biesheuvel CC: "ray.ni@intel.com" , Charles Garcia-Tobin , "edk2-devel@lists.01.org" , nd Thread-Topic: [edk2] Does ARM platform produce MP protocol? Thread-Index: AdTT37l+uf+kVpDOSDippkHRe/INcQAD8+GAAANymQAAAL0+AAAGaCyAAAFukoAALeAzgA== Date: Thu, 7 Mar 2019 11:16:25 +0000 Message-ID: <20190307111558.GY21602@mac-ubuntu-vm> References: <734D49CCEBEEF84792F5B80ED585239D5C060382@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C060A85@SHSMSX104.ccr.corp.intel.com> <20190306124125.GJ21602@mac-ubuntu-vm> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mutt/1.9.4 (2018-02-28) x-originating-ip: [217.140.96.140] x-clientproxiedby: LO2P265CA0339.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:d::15) To AM0PR08MB2980.eurprd08.prod.outlook.com (2603:10a6:208:5b::25) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 136a539e-407a-4e96-9e1c-08d6a2ee5644 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3123; x-ms-traffictypediagnostic: AM0PR08MB3123: x-ms-exchange-purlcount: 1 nodisclaimer: True x-microsoft-exchange-diagnostics: 1; AM0PR08MB3123; 20:rtcSItt3cu6buriCFrMfWzam09M0aLL7uJ/BP4LdqzhFE8EkeuRdKFmEDajF8LVYpr4zo15KSab7Oc4hfVVZg7FRIlPXWxYZuPoNf8BtV+inuTty5wFD4fBvT0m0ocjumKD5x9DrEqnrYi90vei/3u0dJU5JVbsJ+z93IJ5tSHQ= x-microsoft-antispam-prvs: x-forefront-prvs: 096943F07A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(7916004)(396003)(366004)(346002)(376002)(136003)(39860400002)(40434004)(13464003)(199004)(189003)(476003)(81156014)(486006)(186003)(52116002)(446003)(11346002)(2906002)(6436002)(44832011)(25786009)(8936002)(102836004)(478600001)(26005)(68736007)(4326008)(6346003)(97736004)(229853002)(8676002)(72206003)(14454004)(966005)(53546011)(386003)(33656002)(86362001)(106356001)(81166006)(6506007)(105586002)(99286004)(7736002)(6246003)(6916009)(305945005)(6486002)(33716001)(76176011)(71190400001)(66066001)(6512007)(54906003)(71200400001)(6116002)(9686003)(3846002)(1076003)(53936002)(93886005)(5024004)(256004)(14444005)(316002)(6306002)(58126008)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3123; H:AM0PR08MB2980.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Achin.Gupta@arm.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: NaFZMOaB3IjHPoiFqOGkmHLNXz0idLEVUCYC5YqYGX3PgAxdlWct6j4PaSiLE8HsCVie0V3fBcR35GKxjVqkbcpgfcOqdg5beknXV2/tKhZAT+7EEAPSORYsPHDXj9cCxLgeOymqf/8yMopwNdRRsyRt3Bee2uLVYQcTAVmYydE7GPB4XCM1meqggoBkPz7laQ/zBA/56DPoyCmxszSF/G/nUn8eFkR9vldrv/mCKmg5+QnXLi7Lrn+kZkWk1Zde46g2D5A7SsmLFVrCK3VJe8GEJWSAxkR3P5glQg2FyuoBhrQz1jzLaMS4U4FdaVZs2OcBNHhTJ/s0nOCh48nyRtSN96WSNPJSyvEZCScAxgeFAF0VQ+Rrs7Tlk8xMYdqduzCDUtf4AjJXnNfT3fhZgJcNLcvXjbhR3PklW385UEo= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 136a539e-407a-4e96-9e1c-08d6a2ee5644 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Mar 2019 11:16:25.5959 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3123 Subject: Re: Does ARM platform produce MP protocol? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2019 11:16:29 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-ID: <808F719815E66044B765F0F92750AA43@eurprd08.prod.outlook.com> Content-Transfer-Encoding: quoted-printable On Wed, Mar 06, 2019 at 02:22:25PM +0100, Ard Biesheuvel wrote: > On Wed, 6 Mar 2019 at 13:41, Achin Gupta wrote: > > > > On Wed, Mar 06, 2019 at 10:37:58AM +0100, Ard Biesheuvel wrote: > > > (adding Achin and Charles) > > > > > > On Wed, 6 Mar 2019 at 10:16, Ni, Ray wrote: > > > > > > > > > -----Original Message----- > > > > > From: edk2-devel On Behalf Of A= rd > > > > > Biesheuvel > > > > > Sent: Wednesday, March 6, 2019 3:38 PM > > > > > To: Ni, Ray > > > > > Cc: edk2-devel@lists.01.org > > > > > Subject: Re: [edk2] Does ARM platform produce MP protocol? > > > > > > > > > > On Wed, 6 Mar 2019 at 06:44, Ni, Ray wrote: > > > > > > > > > > > > Ard, Leif, > > > > > > I am a bit interested in how ARM platform supports the MP? > > > > > > PI Spec defines below protocol but I failed to find a driver in= ARM platform > > > > > producing this protocol. > > > > > > Or did I miss anything? > > > > > > > > > > > > > > > > No you are right. We don't expose that on ARM, since UEFI only ru= ns on a > > > > > single core. Bringing up and taking down cores is done via a prot= ocol called > > > > > PSCI, which is implemented by firmware running at a higher privil= ege level. > > > > > > > > > > So while it would be possible to implement the MP protocol on top= of PSCI, > > > > > we haven't identified a use case for it yet. (The OS calls PSCI d= irectly to boot > > > > > the secondary cores) > > > > IIUC, the MP protocol enables communication between processors that are= already > > up instead of bringing them up or taking them down. So, it is orthogona= l to > > PSCI. Is that what you meant? > > > > Surely, StartupThisAP starts up the AP, no? I was talking about the EFI_MM_MP_PROTOCOL which I thought was the original= bone of contention. PSCI has a direct intersection with the EFI_MP_SERVICES_PROTOCOL. cheers, Achin > > In any case, I didn't dig any deeper, but I know that PSCI can be used > (even in the UEFI context) to execute pieces of code on another core > (ACS uses this IIRC) > > > > > > > > > Is below EFI_MM_MP_PROTOCOL (added in PI spec 1.6) implemented in A= RM? > > > > Or will it be implemented by an ARM module? > > > > > > No it is currently not implemented, and I am not aware of any plans t= o do so. > > > > +1. There is no need to do this until UEFI runs on a single core on Arm= . > > > > until -> as long as ?? > > > > > > > > I am asking this because MP_SERVICES protocol exposes CPU location = information > > > > (Package/Core/Thread) through *GetProcessorInfo*, but MM_MP protoco= l doesn't > > > > have a way to expose that information. > > > > If such location information isn't exposed by MM_MP, is that becaus= e ARM doesn't > > > > care about the location information? Or because ARM cares but forgo= t to add similar > > > > *GetProcessorInfo* interface to MM_MP when changing the PI spec? > > > > Or ARM doesn't use the MM_MP at all? > > > > Even if Arm used this protocol, it can work with the logical processor = number. I > > don't see a need to expose the location information to the caller. It s= eems very > > Intel specific. Is the EFI_MP_SERVICES_PROTOCOL used on Arm? > > > > No, that is what started the discussion. > > > > > > > > > > > I don't know the history of this protocol and who proposed it, but > > > today, we don't have a need for running per-CPU initialization code i= n > > > the context of MM. Even if MM is a component of the more privileged > > > firmware running on an ARM system, it is running in a sandbox that wa= s > > > primarily designed around exposing MM services to UEFI code running a= t > > > the same privilege level as the OS (such as the authenticated variabl= e > > > store). Platform initialization code (which is more likely to require > > > dispatch to each core) runs in the secure world as well, but not in > > > the context of MM. > > > > > > I will let Achin chime in here as well. > > > > +1. > > > > I will let Charles comment on the history. Maybe this protocol was desi= gned > > for Arm systems where MM is the most privileged firmware. The upstream > > implementation runs MM in the lowest privilege level. Either way, this = protocol > > sense only when MM on Arm is MP capable. > > > > cheers, > > Achin > > > > > > > > > > > > > > typedef struct _EFI_MM_MP_PROTOCOL { > > > > UINT32 Revision, > > > > UINT32 Attributes, > > > > EFI_MM_ GET_NUMBER_OF_PROCESSORS GetNumberOfProcessors, > > > > EFI_MM_DISPATCH_PROCEDURE DispatchProcedure, > > > > EFI_MM_BROADCAST_PROCEDURE BroadcastProcedure, > > > > EFI_MM_SET_STARTUP_PROCEDURE SetStartupProcedure, > > > > EFI_CHECK_FOR_PROCEDURE CheckOnProcedure, > > > > EFI_WAIT_FOR_PROCEDURE WaitForProcedure, > > > > }EFI_MM_MP_PROTOCOL; > > > > > > > > > > > typedef struct _EFI_MP_SERVICES_PROTOCOL { > > > > > > EFI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS > > > > > GetNumberOfProcessors; > > > > > > EFI_MP_SERVICES_GET_PROCESSOR_INFO GetProcessorInfo; > > > > > > EFI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs; > > > > > > EFI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP; > > > > > > EFI_MP_SERVICES_SWITCH_BSP SwitchBSP; > > > > > EFI_MP_SERVICES_ENABLEDISABLEAP > > > > > > EnableDisableAP; EFI_MP_SERVICES_WHOAMI WhoAmI; } > > > > > > EFI_MP_SERVICES_PROTOCOL; > > > > > > > > > > > > Thanks, > > > > > > Ray > > > > > _______________________________________________ > > > > > edk2-devel mailing list > > > > > edk2-devel@lists.01.org > > > > > https://lists.01.org/mailman/listinfo/edk2-devel > > IMPORTANT NOTICE: The contents of this email and any attachments are co= nfidential and may also be privileged. If you are not the intended recipien= t, please 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.