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 5984878003C for ; Thu, 30 Nov 2023 13:59:31 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=5CZRkgKty7iyCUGHYLpiaZ6Jeiho/a/VV3kl6Q8PLoc=; 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=1701352769; v=1; b=tTxQsP1Ab/WRGf3Nx2C0NB0XOphI8gouSqU8zNe/g8efdqAaAIbQrX/X7WI66HgAEuQuQMrg F+pYiWC4KYVrIxtaXQJPMjvk8LulcYLuL5M2zv6n73rq/NBQIPHNfwbvi4hKvNgzzCDWNA8suQ2 HENbP3MC0KkXjzhh/cUJUnko= X-Received: by 127.0.0.2 with SMTP id m2LeYY7687511xCWPL1Ewz7T; Thu, 30 Nov 2023 05:59:29 -0800 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (NAM02-BN1-obe.outbound.protection.outlook.com [40.107.212.100]) by mx.groups.io with SMTP id smtpd.web11.72688.1701352768868374285 for ; Thu, 30 Nov 2023 05:59:29 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ArlYmxgWUPIG6r6+tbXEEFn11tn7ELpWXiJxo6oCa97aE846zFVZa6pMqA8rpDXCj+2dyJhaTFjvB20XyQPqZLkpBR/1lxfzPy9Fn5tO3kOX/5GBMImPWXwlVxBR3W/lSkdSlR+rtdfYq0pVC+QrBSbCZEYwE4nxT+kmWMwsymDulg90KFwJJ3+PLTZ2lq76Wdxye88//NAFZXWbqCgs/IByiELJs0LRRMNWgGwlxKcPygyTD8C/5rTsD1uEa11XBiHxh6pN4lN0wj/8B6Eavn9DgL2n6xLGhU31RYBkTdEnKVlTzNdpjfWkvXMK6wOk9TpCLI7NkSP4o5uwPjG9yw== 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=lvyVsc7AJIxRxkJJd6Ew99z8VYm2ZsXEhlQGaI3yUZA=; b=ThVIpVzkxvPJzFDhV8ZzO39BHpOJ8TE+bGdUXXDLE3/0tbIzQsH/ziwGhrx5K6H6NiRNJUmgU2qZ6PFCtJkfrmsOO4X2jc/3Vqa1+krni9mQDVSoocs13yUdRMsSzlHQ1LMFtMkIwAP9oMjlnImuulQTE10o65jT3EJqor6pBlIIqWIpeoVmwiY/PHMt8tcsbHLiaFf8P/0CgMRFbONECsvzrO3O44E7Njr3GwErXXCMHoWinRUtLYPwkfJ6cyB9xE1OxlxiEVb4zHYSEuxFDhBzDcjkEfVquMsKj9/gb2FmioPJ6SPhQswgaGUKlpLn1q/URFOI4o1kTHkmENqd8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none X-Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by BN0PR01MB7183.prod.exchangelabs.com (2603:10b6:408:15a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.23; Thu, 30 Nov 2023 13:59:25 +0000 X-Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::d431:52fd:b1f0:2f12]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::d431:52fd:b1f0:2f12%3]) with mapi id 15.20.7046.024; Thu, 30 Nov 2023 13:59:24 +0000 Message-ID: <048c809b-a825-4818-acea-7a2a2392b6a6@os.amperecomputing.com> Date: Thu, 30 Nov 2023 20:59:16 +0700 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 2/2] StandaloneMmPkg: Fix HOB space and heap space conflicted issue To: Oliver Smith-Denny , devel@edk2.groups.io, ardb@kernel.org Cc: "Ni, Ray" , "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> <2485a946-3cab-9b9e-feb9-47084074c35c@amperemail.onmicrosoft.com> <2654664c-63c1-41e2-b2d4-2946a7963afd@linux.microsoft.com> From: "Nhi Pham via groups.io" In-Reply-To: X-ClientProxiedBy: CH5P220CA0024.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:1ef::23) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|BN0PR01MB7183:EE_ X-MS-Office365-Filtering-Correlation-Id: dcfabe48-4a33-4985-4ad4-08dbf1ac8f47 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: aknQqs/TFeiwF8lcPFAHVLxFizJa3vEpQI4tmFldRjUeYPgELu5qIPN8MUeaSHmmrQmzr5MLAMKqKwZ5Hg4EflHHcyEjFd0PZn3WaTRz1gioY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LNUJ6RjNkbnFReXBXczF6alNMcjgyOG5lU0Mv?= =?utf-8?B?K1E9PQ==?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcfabe48-4a33-4985-4ad4-08dbf1ac8f47 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2023 13:59:24.5782 (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: PDPLWjqT93339YodR+p/T8iXXiURPhkSxwlm9OX4he/NvEHHn1WvWOn0R+4gZIhaKlEe7TrEEZadUafZrDuDHl37zDQe/EnWQmV/DxZRaMs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB7183 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: VV69XJxdPfda80D1d9OFlA1jx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 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=tTxQsP1A; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); 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 On 9/7/2023 10:38 PM, Nhi Pham wrote: > On 9/6/2023 11:22 PM, Oliver Smith-Denny wrote: >> On 9/6/2023 1:50 AM, Ard Biesheuvel wrote: >>> On Wed, 6 Sept 2023 at 09:56, Nhi Pham >>> wrote: >>>> >>>> On 9/6/2023 1:33 PM, Ni, Ray wrote: >>>>> [EXTERNAL EMAIL NOTICE: This email originated from an external sender= . >>>>> Please be mindful of safe email handling and proprietary information >>>>> protection practices.] >>>>> >>>>> I am a bit confused. >>>>> >>>>> The HOB list in standalone MM is read-only. Why could any module call >>>>> BuildGuidHob() to modify the HOB. >>>>> >>>>> I saw Oliver mentioned something about StMM. I don't know what that >>>>> is. >>>>> But it seems that's ARM specific. Then, I don't think it's proper to >>>>> modify code here for a specific arch ARM. >>>> >>>> The HOB creation is available in the >>>> StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf. If >>>> other architectures also use that instance, I think the issue is not >>>> specific to ARM. >>>> >>> >>> The question here is whether the implementation follows the PI spec, >>> and whether HOB creation should be supported to begin with. >>> >> >> My reading of the PI spec is that this implementation does not follow >> it. However, the PI spec is not very explicit about Standalone MM in >> general, but particularly in relation to HOBs. >> >> However, in the generic HOB section of PI spec v1.7, Vol. 3, section 4 >> (entitled HOB Design Discussion) it explicitly lays out that there are >> HOB producer phases and HOB consumer phases. It uses PEI as a HOB >> producer phase and DXE as a HOB consumer phase and explicitly says >> that the HOB consumer phase must treat HOBs as read-only memory, per >> Ray's comment. >> >> In vol. 4, section 2.2, in discussing the Standalone MM entry point, >> the document talks about the HOB list being passed to Standalone MM >> to consume, which per the reading of the above section would classify >> Standalone MM as a HOB consumer phase, where HOBs should then be >> read-only. >> >> So, I believe that we should not support HOB creation in Standalone MM >> and instead rely on other mechanisms to pass information within the >> phase. Per Nhi's other email in this thread, we should have the >> discussion on how to solve that specific problem and that may well >> lead to a discussion on whether HOBs are in fact the right mechanism >> here, but I tend to lean towards leaving something as architectural as >> HOBs to what the PI spec defines and using different mechanisms to >> accomplish in-phase communication. > Thanks Oliver so much for that. I agree. We should focus on my specific > problem with UEFI Variable Flash Info in StandaloneMM in another thread. >> >> Does this reading of the spec align with others' expectations? As I >> mentioned to Ray in another thread, Standalone MM feels like it could >> have extra clarification in a few areas in the PI spec. >=20 > Thanks again. The HOB library should be updated to remove the HOB > creation once we have the clarification. I found that we can hook a platform NULL library class to the StandaloneMmCore to create UEFI Variable Flash Info HOB. This way is compliant to the spec as the HOB is created in MM_CORE_STANDALONE phase. Should I write a patch to remove the HOB creation in StandaloneMmHobLib? Regards, Nhi -=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 (#111903): https://edk2.groups.io/g/devel/message/111903 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-