From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=17.151.62.25; helo=mail-in2.apple.com; envelope-from=afish@apple.com; receiver=edk2-devel@lists.01.org Received: from mail-in2.apple.com (mail-out2.apple.com [17.151.62.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4DE9E21106F21 for ; Wed, 20 Jun 2018 10:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1529515384; x=2393428984; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=51wFuC+cFQDos4iuESDjkj3lCWzdCnZpFtk1gupb4Rw=; b=yI38+xC+Gal+R8KC1glLPKL8W0a7Y9ELFlSja3C8J/u+0WE7x3oaLZFwnl4jtZ2s QPnDA+tFOIIGGApZ8ZsXXueAUn/Lux1tPYFJE0EpogGlf1IusafpGMEiq/Xjf39v sxbRAL0Ht34xwor4HgfnSzF+u8ZROm1nKbgcPOVYFc/ZUbA+HwjYylfB+DzaiYG6 Y2uzYZWL7dymxma3ytxjoHHSz+mu8zrmQAwN20bw17CFvQr77LbvtOnRSvru83TK M3zUTaxZ6qDpF0WwtDagjhfe+/BiUjxM08+BLJ3oMlugNhuRRFlDVMq1hHW6fWXY SInGcoKYmwEd+6nouY+qlA==; X-AuditID: 11973e11-f0d049e000003aca-70-5b2a8d789aa3 Received: from ma1-mtap-s02.corp.apple.com (ma1-mtap-s02.corp.apple.com [17.40.76.6]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail-in2.apple.com (Apple Secure Mail Relay) with SMTP id 1A.63.15050.87D8A2B5; Wed, 20 Jun 2018 10:23:04 -0700 (PDT) MIME-version: 1.0 Received: from nwk-mmpp-sz12.apple.com (nwk-mmpp-sz12.apple.com [17.128.115.204]) by ma1-mtap-s02.corp.apple.com (Oracle Communications Messaging Server 8.0.2.2.20180329 64bit (built Mar 29 2018)) with ESMTPS id <0PAM00C84TMFYQD0@ma1-mtap-s02.corp.apple.com> for edk2-devel@lists.01.org; Wed, 20 Jun 2018 10:23:04 -0700 (PDT) Received: from process_viserion-daemon.nwk-mmpp-sz12.apple.com by nwk-mmpp-sz12.apple.com (Oracle Communications Messaging Server 8.0.2.2.20180403 64bit (built Apr 3 2018)) id <0PAM00700TJQC000@nwk-mmpp-sz12.apple.com> for edk2-devel@lists.01.org; Wed, 20 Jun 2018 10:23:03 -0700 (PDT) X-Va-A: X-Va-T-CD: 3b266a2f6a8b2663ff6662a8ca2180b2 X-Va-E-CD: b04aceb985429be62f13b9ac1284f711 X-Va-R-CD: c856e425ed10d3dbf16a9481c9679974 X-Va-CD: 0 X-Va-ID: 580deaaf-ac08-429d-b20a-4bc5978cba4b X-V-A: X-V-T-CD: 242eef930ced4d4f7f74b6d5f343603a X-V-E-CD: b04aceb985429be62f13b9ac1284f711 X-V-R-CD: c856e425ed10d3dbf16a9481c9679974 X-V-CD: 0 X-V-ID: bd92fdc8-90f8-454b-8279-7bbcbf75bebe Received: from process_milters-daemon.nwk-mmpp-sz12.apple.com by nwk-mmpp-sz12.apple.com (Oracle Communications Messaging Server 8.0.2.2.20180403 64bit (built Apr 3 2018)) id <0PAM00800TL53X00@nwk-mmpp-sz12.apple.com> for edk2-devel@lists.01.org; Wed, 20 Jun 2018 10:23:02 -0700 (PDT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-20_08:,, signatures=0 X-Proofpoint-Scanner-Instance: nwk-grpmailp-qapp16.corp.apple.com-10000_instance1 Received: from [17.114.153.76] (unknown [17.114.153.76]) by nwk-mmpp-sz12.apple.com (Oracle Communications Messaging Server 8.0.2.2.20180403 64bit (built Apr 3 2018)) with ESMTPSA id <0PAM00F2LTMEHU90@nwk-mmpp-sz12.apple.com> for edk2-devel@lists.01.org; Wed, 20 Jun 2018 10:23:02 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish Message-id: <31C6D3FB-91D3-491B-8059-4B6DEA11BDF9@apple.com> Date: Wed, 20 Jun 2018 10:23:01 -0700 To: edk2-devel X-Mailer: Apple Mail (2.3445.6.18) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLIsWRmVeSWpSXmKPExsUiqOHDplvRqxVtcO66nsWeQ0eZHRg9umf/ YwlgjOKySUnNySxLLdK3S+DKuNF7iL3g7i2Wij0zJrI3MH6byNLFyMEhIWAiseOhfRcjF4eQ wD4mid63Jxm7GDk5eAUEJX5MvscCYjMLhEk0PD3NDlF0lkni3PE1bBDOMiaJT7desYFUSQiw S/z5tYMFwtaW2Lr1JTuMfXDmbEYY+9/iI1D1XBILtp5mhbB1JQ42LoeqYZNYf2IJE4StJfF0 1wQ4++f0z6wQV2tJvP5XBBHmlDj/ZSLUKh2Jfc9PMkPctpRJ4lv3aqh7siVO//sCNSdY4vqW Nqhv1jJJbGjcAnaQsIC4xLszm5hBbDYBZYkV8z+wgywTFkiRuHKbAxIqNhLTju1hAgmzCKhK PFqvCRIWEdCQ2NrdygwxXkni/64jzBMYZWchheMspHCEsLUkvj9qBYpzANnyEgfPy0KENSWe 3fsEVaIt8eTdBdYFjGyrGIVyEzNzdDPzjPQSCwpyUvWS83M3MYLif7qd4A7G46usDjEKcDAq 8fDeCNOKFmJNLCuuzD3EKM3BoiTOezRJI1pIID2xJDU7NbUgtSi+qDQntfgQIxMHp1QD49Rr NcmzwudfUNjxJ+rxfMFHTGxWjr66PgxnOgOXeisoLw2YqDjzzTL3F2/7nJ0MkzdP4Cr/9elJ 6NK8HZn3FV57rLlWru/OuGrHxH8qDHsTu1vy8zU3613Vvtpgdodv++7rF21nbo0KLVTj7ZP3 /DX1xPTnqt1TJR8/LDjDdoJ9dU6e6bb7TUosxRmJhlrMRcWJADzA0kTgAgAA X-Content-Filtered-By: Mailman/MimeDel 2.1.26 Subject: Is the PEI Core MP Safe? UefiCpuPkg seems to think so calling GetFirstGuidHob on the APs? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2018 17:23:05 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT Is there some MP safe contract with the PEI Core implementation I don't know about? Looks like the APs are calling PeiServicesGetHobList() to figure out "who they are"? How does this work? Or am I missing something? https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/Library/MpInitLib/MpLib.c#L1945 /** This return the handle number for the calling processor. This service may be called from the BSP and APs. @param[out] ProcessorNumber Pointer to the handle number of AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by MpInitLibGetNumberOfProcessors(). @retval EFI_SUCCESS The current processor handle number was returned in ProcessorNumber. @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL. @retval EFI_NOT_READY MP Initialize Library is not initialized. **/ EFI_STATUS EFIAPI MpInitLibWhoAmI ( OUT UINTN *ProcessorNumber ) { CPU_MP_DATA *CpuMpData; if (ProcessorNumber == NULL) { return EFI_INVALID_PARAMETER; } CpuMpData = GetCpuMpData (); return GetProcessorNumber (CpuMpData, ProcessorNumber); } https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c#L34 /** Get pointer to CPU MP Data structure. @return The pointer to CPU MP Data structure. **/ CPU_MP_DATA * GetCpuMpData ( VOID ) { CPU_MP_DATA *CpuMpData; CpuMpData = GetCpuMpDataFromGuidedHob (); ASSERT (CpuMpData != NULL); return CpuMpData; } https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/Library/MpInitLib/MpLib.c#L2302 /** Get pointer to CPU MP Data structure from GUIDed HOB. @return The pointer to CPU MP Data structure. **/ CPU_MP_DATA * GetCpuMpDataFromGuidedHob ( VOID ) { EFI_HOB_GUID_TYPE *GuidHob; VOID *DataInHob; CPU_MP_DATA *CpuMpData; CpuMpData = NULL; GuidHob = GetFirstGuidHob (&mCpuInitMpLibHobGuid); if (GuidHob != NULL) { DataInHob = GET_GUID_HOB_DATA (GuidHob); CpuMpData = (CPU_MP_DATA *) (*(UINTN *) DataInHob); } return CpuMpData; } Thanks, Andrew Fish