From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 027CB740047 for ; Wed, 6 Sep 2023 07:56:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Fb4UV0TXC6+sRsn+BeK3wyHE8A/Qz6xtZxK7wgls+T0=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Message-ID:Date:User-Agent:Subject:To:CC:References:From:In-Reply-To:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1693986986; v=1; b=Z21BMoo4G+QqN9oFHkuCyStLGEEf+gUynM953g5hbEBA/VhXmJQwGwA1nxcZhbngx/yUo3JP 1j+ZiUtlfVUHc0n76YcHGn1vQ9cws1TTfR+rc/Nb9o6s/8eLeEHwaYn7jvU81695dWlYjq5hoZL OIUR0rR1Y/Ug9GPvSFUWNzNY= X-Received: by 127.0.0.2 with SMTP id PiSpYY7687511xqYNn2zHOxd; Wed, 06 Sep 2023 00:56:26 -0700 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.110]) by mx.groups.io with SMTP id smtpd.web10.3581.1693986985499046982 for ; Wed, 06 Sep 2023 00:56:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NCf57p3H41IxPMKeyV0xG4MAsSUTBVohzEqm6WQcPjxewNG5yDQbIbiPdaoU6mHBuSg/Df83SnUnW0+FUXnAW1KanVorkjdyMOJ96pRA2J+xVjG5TnTnb3PzJS9O10jCZgAhjZG1ZXCbCPRTiCXY+VpmBt4SPw8fU2GgnA7+BwNpO25UEFJqk2JouQi720F4yaVFciw7VC9qNqIMjCfbuOInNVKLjBgmPjNQDN8dOdySBxcusfRe7nWZsObbs3V3gDgd+rgdMm9yYQ/zTA8qYpqjar7llwG6PxLO+YBppiqD4PpVYdRLkbeg/ZbD/yI6i+HLoIPHYpj81dM3mIg2gg== 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=DI0InEWHn+EO8swKfFRiGdz3EEIkjxLlFp7PmN0BcNg=; b=XZ97DCfdVzaJoaQ+iI/crOKGLI7oM+ZmpPbatb7/UKvSbRaHRwGUKrndG9yH9KTn5V+vM4dRQ62t1l5fFGAzLi+SC259yJl/BKPE2v2n9iqD5NbANVSEcwRk2DG6K+iWfseI2GBI5BEzB8eHzQBduhMAPgUY5iHMhEeFu7iiQH/QI2FY8C0z5QDrS0k/dGOXcibmGZCSvu2m0D9GFFQ+2XsfVR4WSiwbfJLBp5PFWS3ozMty5+3Mm8WJWN6yQsIUbQ78xm3YMRQDglvLUHwsST7lAdaOYF8+91ZyqKPEI6Dq3RuNMM4rVhD1Ujx8OyjbCJQeFqF4JGFnVVduZxPaiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=amperemail.onmicrosoft.com; dkim=pass header.d=amperemail.onmicrosoft.com; arc=none X-Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by CH0PR01MB6841.prod.exchangelabs.com (2603:10b6:610:110::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.34; Wed, 6 Sep 2023 07:56:19 +0000 X-Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::dc7b:d4c5:71cf:1ea0]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::dc7b:d4c5:71cf:1ea0%4]) with mapi id 15.20.6745.030; Wed, 6 Sep 2023 07:56:19 +0000 Message-ID: <2485a946-3cab-9b9e-feb9-47084074c35c@amperemail.onmicrosoft.com> Date: Wed, 6 Sep 2023 14:55:55 +0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [edk2-devel] [PATCH v1 2/2] StandaloneMmPkg: Fix HOB space and heap space conflicted issue To: "Ni, Ray" , "devel@edk2.groups.io" , "nhi@os.amperecomputing.com" , Ard Biesheuvel , "osde@linux.microsoft.com" CC: "huangming@linux.alibaba.com" , Sami Mujawar , Ard Biesheuvel , "Yao, Jiewen" , Supreeth Venkatesh , "ming.huang-@outlook.com" References: <20220209122558.60329-1-huangming@linux.alibaba.com> <20220209122558.60329-3-huangming@linux.alibaba.com> <14f25a95-7153-4eec-8804-a3da768ccb11@linux.alibaba.com> <0e0bc14c-88a1-21a8-0be7-34ed023e1127@amperemail.onmicrosoft.com> <59c604a4-7e65-4319-8441-806a29327f6f@linux.microsoft.com> From: "Nhi Pham via groups.io" In-Reply-To: X-ClientProxiedBy: SI1PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:1f7::20) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|CH0PR01MB6841:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c7bfd9c-0cd6-49f1-ee44-08dbaeaec10b X-LD-Processed: 3bc2b170-fd94-476d-b0ce-4229bdc904a7,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: rF+/mBjzky5JxgYvKOAQ8eSr8W1ERJMU7o+q3uLJzZXRGXNPPn3tEjApekEU6hLqrO5R4SVM1yCK3JklTTo3t3C/DQ/F13I8lT/zF31qOO/1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bkIz?= =?utf-8?Q?O6x60pmkX9o3B/Gv7ZxhcDk=3D?= X-OriginatorOrg: amperemail.onmicrosoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c7bfd9c-0cd6-49f1-ee44-08dbaeaec10b X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2023 07:56:19.2992 (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: jfxlBftUu1JxnyYcpGrZRLxUvls9NgLZ/tYPRxX2oKruYMAcTiki12xO600g3HxI+h+1p27fBvoAgDOZZbcmLzraKikQDnnjFor236Nl4AQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR01MB6841 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nhi@os.amperecomputing.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 0uZVTe3chj4QLizYriP7awEax7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Z21BMoo4; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") On 9/6/2023 1:33 PM, Ni, Ray wrote: > [EXTERNAL EMAIL NOTICE: This email originated from an external sender.=20 > Please be mindful of safe email handling and proprietary information=20 > protection practices.] >=20 > I am a bit confused. >=20 > The HOB list in standalone MM is read-only. Why could any module call=20 > BuildGuidHob() to modify the HOB. >=20 > I saw Oliver mentioned something=C2=A0about StMM. I don't know what that = is.=20 > But it seems that's ARM specific. Then, I don't think it's proper to=20 > modify code here for a specific arch ARM. The HOB creation is available in the=20 StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf. If=20 other architectures also use that instance, I think the issue is not=20 specific to ARM. Regards, -Nhi >=20 > Thanks, > Ray > ------------------------------------------------------------------------ > *From:* devel@edk2.groups.io on behalf of Oliver= =20 > Smith-Denny > *Sent:* Wednesday, September 6, 2023 5:29 AM > *To:* Nhi Pham ; devel@edk2.groups.io=20 > ; nhi@os.amperecomputing.com=20 > ; Ard Biesheuvel > *Cc:* huangming@linux.alibaba.com ; Sami=20 > Mujawar ; Ard Biesheuvel=20 > ; Yao, Jiewen ;=20 > Supreeth Venkatesh ; ming.huang-@outlook.com= =20 > > *Subject:* Re: [edk2-devel] [PATCH v1 2/2] StandaloneMmPkg: Fix HOB=20 > space and heap space conflicted issue > On 9/4/2023 7:20 PM, Nhi Pham wrote: >> On 9/2/2023 3:43 AM, Oliver Smith-Denny wrote: >>> On 8/31/2023 1:20 AM, Nhi Pham via groups.io wrote: >>> >>> If I am understanding this correctly, this is only an issue when >>> HOBs are created in StMM, i.e. not from HOBs that are passed in. Is thi= s >>> correct? >> Yes, the issue only occurs when HOB are created in StandaloneMM by the= =20 >> HOB library instance=20 >> StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf >>> >>> If so, is HOB creation in StMM and supported use case? The only instanc= e >> I think it is intended to work as the CreateHob() function is implemente= d. >=20 > Well, that may just be a copy/paste sort of thing :). >=20 >>> a quick search turns up is the ARM StMM Core entry, where some >>> information from TF-A is converted to HOB format. Do we have any other >>> use cases (and curious more on this use case). My thought process would >>> be that StMM would not create any HOBs. Depending on FW configuration, >>> it may receive HOBs from PEI. >>=20 >> I have a use case when enabling the UEFI Variable driver running in=20 >> StandaloneMM. Instead of using the PCDs, the in-memory NVRAM region is= =20 >> allocated **dynamically** at boot time in the StMM secure memory. Then,= =20 >> they will be passed into the gVariableFlashInfoHobGuid for being=20 >> consumed by other variable MM drivers. >>=20 >=20 > I do believe that per the PI spec, we should have HOB producer and HOB > consumer phases, where in this case PEI (if it was the launching entity > for StMM) is the HOB producer and StMM is the HOB producer. This is the > same pattern the PI spec details for PEI and DXE, where DXE is not > intended to create new HOBs, but just to consume information from the > previous phase. >=20 > As I mentioned, there are other interfaces for passing information > within a phase, such as protocols, dynamic PCDs, variables, etc. that > are built for this application. I think it is useful to adhere to the > model for HOBs (which are hand off blocks, one phase handing information > to another phase) and that we will create more issues if we rely on > HOB consumer phases producing HOBs. >=20 > My proposal would be to remove the HOB creation code from StMM > completely. I believe in your use case that you are describing a dynamic > PCD or a protocol could work to pass the information. >=20 > If we are saying that prior to your patch that HOB creation in StMM was > completely broken, anyway, it seems that folks were not relying on this > code? >=20 > Thanks, > Oliver >=20 >=20 >=20 >=20 >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108311): https://edk2.groups.io/g/devel/message/108311 Mute This Topic: https://groups.io/mt/89020085/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-