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 A1FB3740032 for ; Wed, 6 Sep 2023 07:38:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=kPKTKiTR7MpvR/cw01e49dvUUFoHNYjT5jch2hTpQJ4=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Message-ID:Date:User-Agent:From:Subject:To:Cc:References: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=1693985896; v=1; b=kSpBdxRWFieSt/RfJ2IwpYZlCoVr3+acAYObBl9LLYkofwCj/1YnCncShBw8kwmhG+rXmiAT 9NjIEDS+vl24zjt+QaECGOyTWJ8uVrLv6Yu9gs+PWDoaIWWgTnyokICHCs9yGtNleZFLpFX6MVV /m7QjYwvT8uVGvp7Ca7jaTnA= X-Received: by 127.0.0.2 with SMTP id LT0DYY7687511xWVzxj6tcfC; Wed, 06 Sep 2023 00:38:16 -0700 X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.96.102]) by mx.groups.io with SMTP id smtpd.web11.3258.1693985895334729629 for ; Wed, 06 Sep 2023 00:38:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WABJn4iozvn2Jxsj0P+8vvgMtADo6TExV4idUvtg1J3zWAy/OIpJ510CkcLNY9weaJm2dKpS5JQcXXhsASj1Oa/JCt61OQxYeiEXVwSd1LfFjNmW5QthJEvngr6AgUa3oBorYyo/fSpVLBCMsu4P/DBLvP4VwTxbYdizOfWudroyy3lW+8zG3WCFjYhAfiW9OZJE9a0Ik05kAvdlXbJrEITXCSRTRk+XxY5SIa5x1rwTHi0lbpd00cJN22gzNK87K4UnqRgID7G6KHgSa2QMJ7Ab/6LHHtsXUq0Ipo/higff/j7TuKizfS9MYlWQ+3+wvT8qxpniO3wuzVJoyy3g5Q== 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=pV6Pv20cIRB5i51R66rGA1/iHOh69jLb1GJA0pqcP/Y=; b=ML5kWlSCPE6WKlcOj107O09kuss/8DB9O0rh4NtFg9Nk5oeNiD3r+rmSYU9m7fqpYDbGubeZw6cOezyMfpE2xnPdTCYkikxTFxfcGs0y1KKIZkTjuiW1WJ3guA/038lHYnB7yjrM8N/HtGWl6JVHwNKMzyLwW/WKbKIJQwcLFdzI7ZDyH7nrhgJvBBqYD1J9zUzNjmfVQ4J/ZskgcSlU2M0G5hPl5y1uA/+AfSvBNAb4jNoYiA5mOHb8CVcs9LnkP0/TFMaJcefltYD8nmdOPi9KmJggd8dKAd+VDYUENee+SzSvVkKKxwfxzTd+fyIAhLqrY+ItTInCQPrbALJSjA== 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 SA0PR01MB6362.prod.exchangelabs.com (2603:10b6:806:ec::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33; Wed, 6 Sep 2023 07:38:11 +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:38:10 +0000 Message-ID: <40c050e4-35ad-bb7c-ea0d-e1e1d86635cc@amperemail.onmicrosoft.com> Date: Wed, 6 Sep 2023 14:35:56 +0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 From: "Nhi Pham via groups.io" 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, nhi@os.amperecomputing.com, Ard Biesheuvel , michael.kubacki@microsoft.com Cc: huangming@linux.alibaba.com, Sami Mujawar , Ard Biesheuvel , Jiewen Yao , 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> In-Reply-To: <59c604a4-7e65-4319-8441-806a29327f6f@linux.microsoft.com> X-ClientProxiedBy: SG2PR01CA0169.apcprd01.prod.exchangelabs.com (2603:1096:4:28::25) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|SA0PR01MB6362:EE_ X-MS-Office365-Filtering-Correlation-Id: 7f0e0ebb-b8e0-4de0-1aa1-08dbaeac385d 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: tqgSweAdgkwlsPLTkSMDNrxgDr9ik6hQ5Da/uvWdWdXrIWoS4a21XKyRO8JY/8yvvrs0Vqaxg/vth9Ij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vUzcrV1dRWWhwNU5pem5yTXpDK0EwSTli?= =?utf-8?Q?Jw6+ckZYpoQYAfn3dhha1T8=3D?= X-OriginatorOrg: amperemail.onmicrosoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f0e0ebb-b8e0-4de0-1aa1-08dbaeac385d X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2023 07:38:10.9079 (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: qA8lyn3xHDnRm2hkLOfhHvul0jHaA4lE4FDXVOvguRe40fbMA3sPhdton3fer044ox4dkr042MVPLnB0qJcq0m/smWuLVBgSB33rBNbCGhQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR01MB6362 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: ybxpVTtK24PFDDqLQydixRnNx7686176AA= 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=kSpBdxRW; 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 4:29 AM, Oliver Smith-Denny wrote: > 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=20 >>> this >>> correct? >> Yes, the issue only occurs when HOB are created in StandaloneMM by=20 >> the HOB library instance=20 >> StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf >>> >>> If so, is HOB creation in StMM and supported use case? The only=20 >>> instance >> I think it is intended to work as the CreateHob() function is=20 >> implemented. > > Well, that may just be a copy/paste sort of thing :). > >>> 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. >> >> 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=20 >> is allocated **dynamically** at boot time in the StMM secure memory.=20 >> Then, they will be passed into the gVariableFlashInfoHobGuid for=20 >> being consumed by other variable MM drivers. >> > > 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. > > 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. Thanks Oliver for the explanation. That makes sense to me. > > 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. I think the dynamic PCD is supposed to not being supported in=20 StandaloneMM and protocol does not fit because the Variable Flash Info=20 is created in PEI for UEFI variable non-MM flow and in StMM for UEFI=20 variable MM flow. > > 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? Right, it is just my curiosity that I don't see any showcase for=20 Variable MM + Variable Flash Info HOB in StandaloneMM. Adding Michael Kubacki as the owner of the Variable Flash Info HOB for=20 getting further input. > > Thanks, > Oliver -=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 (#108310): https://edk2.groups.io/g/devel/message/108310 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-