From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.10173.1675431083233710621 for ; Fri, 03 Feb 2023 05:31:23 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Zy/LWNpU; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675431083; x=1706967083; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=EF1ZCaaUHGeVWJ7NxLnrf6nDcRfI4wXE2TwLoykkjF4=; b=Zy/LWNpU5DxvO0pcN6DbcgO3SxaOZrN1q0xZlBXZqHPv+Qus/1auare5 VXltO1Vx5Gi1gov/4SEKpssNZF2L25Ti5XSh/b7yVtPctdU9kc4796o49 HY0DS2/AJMcLu1MwBMHwYinnLEm4fBGpyfuXDC4T5mINcBTkYRRy/IiKk 1deb1jkuhRqVfcb9QS07IPTFfOQEcBJk2tr2/y8gZIyW29YOl9Zuuu2Jo fgIMP+ICiRulXRDnU1ezo8SFzAmM0H/gjpEnCQtRZ0nkFrPfJaXYHvPye ujE0FFQnuYfZYu4a9b6b6Bxu5L5H4zuibPA0f5tq+CDd81P3xmcMoUQMm g==; X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="308386606" X-IronPort-AV: E=Sophos;i="5.97,270,1669104000"; d="scan'208";a="308386606" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2023 05:31:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="774336343" X-IronPort-AV: E=Sophos;i="5.97,270,1669104000"; d="scan'208";a="774336343" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga002.fm.intel.com with ESMTP; 03 Feb 2023 05:31:22 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 3 Feb 2023 05:31:22 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 3 Feb 2023 05:31:22 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Fri, 3 Feb 2023 05:31:22 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.173) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 3 Feb 2023 05:31:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YeENkKVfq82OT5W6wUsgiOlNrDpxyMAVIZefm2xJ3OqrgtL9VsXgNSe0xnK1o7/rtqrLT/KdI5u1TYdahvfuvyMRkmGvCwm8aB4zBqyKC4EQKVkFs5Wb5u0WF7HayLXvs/O35OY3XXRZ9ySz3UuNyvAk0BLSZO7HKMt/0bp6ogxK7XvUMk6MIzyP5F3O3LPUZe1VbjicnwV1fN1tmUdQmBrhgE5WSIAT+u3KqYLJbVsrxUUC9S0TILzWN9u2e63cNnS6C6WQVcQuFOdvLpv53/6LYOJlUL7ETqKs2sYxI/BQkDortbHnrjLLHWsk3HRsyEqf+xG1rIDu9s3q8ktMQQ== 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=cb6bcqekCVDXqfgeyCVK8Em/gC6/j/yOkQZuKGOqd7U=; b=Is+qJaFfFVvhhF6pehm5phPr/AUlhGNZW4tbmNBOAGoM+fAECbSCT0Ydq7zimFl721hnTB2pxw3r5N/JtxoTDSIirbB2hpDZ2JvuHjslK1qe/rRvTIBooHQZK9cTaYJLl8mbC4hRqNQcp8fp0rdp7q74POVv3lSlW441ZWaZJ0jWtYdLbs9IAPwGfP82+kHvWkeZnQq+1gh5eW0uLjGjXQahPXaJyFCAY1a6ZfXPd/YqUzBGDQHy5nfDXvsJMijvVYF5P0p+ZpR4xRdRYXh3aRm4qexSvLv3P3sD0WzVArhQBM7BuM4O0qO+e8j58nAzI4u3QLVZi4XabvNJnRTcHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by PH7PR11MB7025.namprd11.prod.outlook.com (2603:10b6:510:208::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Fri, 3 Feb 2023 13:31:18 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::f890:e4ec:e2d8:5831]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::f890:e4ec:e2d8:5831%3]) with mapi id 15.20.6064.027; Fri, 3 Feb 2023 13:31:17 +0000 From: "Ni, Ray" To: "Wu, Jiaxin" , "kraxel@redhat.com" CC: "Johnson, Brian" , "devel@edk2.groups.io" , Laszlo Ersek , "Dong, Eric" , "Zeng, Star" , "Kumar, Rahul R" , "Kinney, Michael D" , "Zimmer, Vincent" Subject: Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data Thread-Topic: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data Thread-Index: AQHZKyMs7t74sVIYH0SPAgkW85kk6a6kBxyAgAA3bfCAAruMAIAUI0iggACWoQCAAKFFAIAAT1lwgABOo4CAAFuyAIAAAdRw Date: Fri, 3 Feb 2023 13:31:17 +0000 Message-ID: References: <20230118095620.9860-1-jiaxin.wu@intel.com> <20230118095620.9860-2-jiaxin.wu@intel.com> <20230118111913.xgjlxdhngzwhvf76@sirius.home.kraxel.org> <8142cc40-ca21-2748-a3de-d0432ccbdc07@redhat.com> <20230202125158.bx7amq2nfibhimvf@sirius.home.kraxel.org> <525d8100-b306-d1fb-08c4-e5e2cc6204e2@hpe.com> <20230203075437.fkp3mwri4jg7rn4q@sirius.home.kraxel.org> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|PH7PR11MB7025:EE_ x-ms-office365-filtering-correlation-id: e550971a-dbf0-4bf1-9e64-08db05eaee16 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PO5MuaA3b1pFyyNb6FYtOQ1uR73HICp009Gcjs5shahbJWl7o3W2EJkD4Rf7ZVHaLJb8WlpBAV8J82Cd/ptYrQvu3SPSnoL2pxFDtsyy0yPflCJ2C9w/fOdmvc1LRjxL2737X4VdrpHwABKrV4IKnhwt+V5SsNKlKsPhajfBNuyun4EY2OcC/2dnfugY9gKbP7zlmFXVAEJcWi+COnHnMcNo8ylsrEIqt0bP5AFK+vsbNUID3RW0oC8htUcU+hZ1P4U5cVJlXL14maNxXYOlbKrnuj42aQhmV0d4bq8F0qezJv8yYb7BXRPtqUnXtZ+euNoSIAAPgzxhi1niqTcG3STZrgbQ48Zk5uFWfIlgmS1YGHYq6UYvtl1ZYI1Av526t5ABHjN5maJD12vLI1Fjjnlijs7lDeBTH/m7ZXWZU1tsV+dy+mFshOCE9PXfe7PfmSFYqefs+OvzSARHLhe5vpKNoDH7Dw6cyTTyBO5KRMYjaa7qTIiRamNTvHqn9WN+e4bVGXJmAoLv0/3cbi76WX3i28owqPucJl05jgQHn6Mg7OAdA/UwJz9b553auphFHTktq7nJFanaEkJCA7ypSFyWT7/2AtpULJXCMZ+tJK1os7DcVQ3n49QFWjCCT5jn3MO3k5oDU+7yrV/TVTIY7AnAFJ/ixrzli7GdcCo0PgEIG0Luvqf+hb1ORAMjCczS601i3vplSnuxi4UMkDsb8w== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN6PR11MB8244.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(346002)(376002)(396003)(136003)(39860400002)(366004)(451199018)(82960400001)(9686003)(38100700002)(186003)(7696005)(26005)(38070700005)(110136005)(2906002)(478600001)(55016003)(86362001)(83380400001)(52536014)(107886003)(54906003)(5660300002)(53546011)(8936002)(66946007)(6506007)(316002)(8676002)(71200400001)(66446008)(66556008)(66476007)(76116006)(122000001)(4326008)(64756008)(33656002)(41300700001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?B6/DqxJsus2Pvl640D9VafEXXYCtbBT9NWDs+RW90MtmPMXnQu22jnZaUQbr?= =?us-ascii?Q?K0hqoe6FrQxdBOS606UEcH2iXBy1LklbnIICw1+qM5caciDLItsuyYkxM8il?=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eaQx9CC/s00RP7cdoWd5hecsqQ?= =?us-ascii?Q?uU3IRyVDK1BZ3oJ+OeEHXSdSB/+h6kUu18i+viaFn82yk9lzzQ94Zu3ZkrsH?= =?us-ascii?Q?ZYFozXP7K7Z2115SwfD9aQH0gBe52Y84yF8cGoYxbunHp2sSFdvRrq7kexJX?= =?us-ascii?Q?5fZPfjB7iGPrMle7r8Qn/t5UUypUHmt/4Y+xmdGUuBAn3jmRUga52X5Q/LNr?= =?us-ascii?Q?6mrdybwrrjn2WQI1rwYYyP7gR8dy60iRq4YvuZG0xBZi6akbx6Kj+N+rnQiN?= =?us-ascii?Q?uTuKAnZwlON5ehxPe2FcAwSH+QRqsyazh0Xp1xuoHDYmUVmvXVtbq3Cz3qey?= =?us-ascii?Q?2gHXamoNL54ZmGfcp7UpcbimVLhm9mC31G2J+x//PBqr5+JbFTlKtEC6fouF?= =?us-ascii?Q?ne+XGf3hEzYv02Re0vwPhlgS1fWo4L+1QsuMYGR93RiAWvtCU7Tx8zc2V4oB?= =?us-ascii?Q?cvtLqLOC7QTS8TAkr3sBOsurKseGzk3J/Pf93B6kDIqVPSw5f8tpPLYbwLgU?= =?us-ascii?Q?SgRB8/Zgd3p+dJHDzfDvMDlPmE9DK4tNe2991FN+KE5f92AMF7aXRad5aBXb?= =?us-ascii?Q?E0SzEAY3ocV+XV+S2T4=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e550971a-dbf0-4bf1-9e64-08db05eaee16 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2023 13:31:17.7846 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: NwTAm8cFyG/ClZixvV4vpnovEUAXHbtdkUV2qtQRMIkzNbf6gR+iJEBoUCD2u7Zlm2rtr9xGYWUAs2Zij985jA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB7025 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I think we need to define a new chunk hob type for solution proposed by Ger= d. I will leave that to PIWG (PI spec working group) for discussion. In this topic, I prefer to solve the problem in the CPU domain.=20 > -----Original Message----- > From: Wu, Jiaxin > Sent: Friday, February 3, 2023 9:23 PM > To: kraxel@redhat.com; Ni, Ray > Cc: Johnson, Brian ; devel@edk2.groups.io; Laszlo > Ersek ; Dong, Eric ; Zeng, Star > ; Kumar, Rahul R ; Kinney, > Michael D ; Zimmer, Vincent > > Subject: RE: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM > Base HOB Data >=20 > Hi Gerd, >=20 > Is it still the solution with multiple hobs created for big data but you = want the > hob splitting and reassembling can be encapsulated in the Hoblib? >=20 > Does it need define the new hob type for chunk? >=20 > Thanks, > Jiaxin >=20 > > -----Original Message----- > > From: kraxel@redhat.com > > Sent: Friday, February 3, 2023 3:55 PM > > To: Ni, Ray > > Cc: Johnson, Brian ; devel@edk2.groups.io; Laszl= o > > Ersek ; Wu, Jiaxin ; Dong, Eric > > ; Zeng, Star ; Kumar, Rahul R > > ; Kinney, Michael D ; > > Zimmer, Vincent > > Subject: Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add > > SMM Base HOB Data > > > > On Fri, Feb 03, 2023 at 03:14:42AM +0000, Ni, Ray wrote: > > > Gerd, > > > Can you please explain a bit more on the chunk idea? > > > > > > > to introduce a generic and reusable concept of chunked HOBs, so y= ou > can > > > > > add helper functions to HobLib for splitting and reassembling, wi= th a > > > > > struct along the lines of: > > > > > > > > > > typedef struct { > > > > > // offset and size of this particular chunk > > > > > UINT32 ChunkOffset; > > > > > UINT32 ChunkSize; > > > > > > > > > > // number of chunks and size of all chunks combined. > > > > > UINT32 ChunkCount; > > > > > UINT32 TotalSize; > > > > > > > > > > // chunk data > > > > > UINT8 Data[0]; > > > > > } EFI_HOB_CHUNK; > > > > Reassembling would work like this: > > > > // once > > AssembledHob =3D malloc(HobChunk->TotalSize); > > > > // for each chunk > > memcpy(AssembledHob + HobChunk->ChunkOffset, HobChunk->Data, > > HobChunk->ChunkSize); > > > > Possible shortcut: > > > > if (HobChunk->ChunkSize =3D=3D HobChunk->TotalSize) > > // data is not splitted into multiple chunks > > AssembledHob =3D HobChunk->Data > > > > Advantage: you avoid the allocation in case the data fits into a single > > HOB. Disadvantage: you need to track whenever AssembledHob is allocate= d > > (and must eventually be freed) or not. > > > > HobChunk->ChunkCount is not really needed but might be useful for sanit= y > > checking. > > > > take care, > > Gerd