From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 430CED81111 for ; Tue, 23 Apr 2024 13:20:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=PLf1O++kGLx8Iqebr0FFjX/CT9jP38fUZ61GslQ4Abs=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1713878428; v=1; b=T6LL6ANS06rB4dNSqLFXTJMHsmiM0vuJHDmA6q9R1CBBtlebF3q7vBlHhE1sACrRWZs/rj4O wrrmKufAERgqpPsWm6Va74ls7270OOsCcwaJfzaY2GpEWgacQMeMcS9qzLe7rHGUxKQdw2xlBhA dOgPTu9RXRaA8Hnk8/hsIwpKogF6VRklfYkq4Yf9JKWdo6oX2Z/7xbKvNeCfm9YDOwWGFgPCdU+ olr3BB9IPSYebi7tJEG2+C4mIz41v3f+vydkTfOh+hgJ4WhngAY7SrD00daLf767ohqtBeLQO6d 4GR12eFeFqLihyOOnAZ19RnMm1yYsePA+/L/mi7Ng8JzA== X-Received: by 127.0.0.2 with SMTP id ezeqYY7687511xYuw1nlniWD; Tue, 23 Apr 2024 06:20:28 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mx.groups.io with SMTP id smtpd.web10.18437.1713878422897633055 for ; Tue, 23 Apr 2024 06:20:23 -0700 X-CSE-ConnectionGUID: 7A7PCgC3TJKaG19Z8QJclQ== X-CSE-MsgGUID: u1eWyOg4RWGvEPl+M0OCuQ== X-IronPort-AV: E=McAfee;i="6600,9927,11053"; a="26917504" X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="26917504" X-Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 06:20:17 -0700 X-CSE-ConnectionGUID: +q3lCOMgTSaXAvahMBLtsQ== X-CSE-MsgGUID: Uzsu5bMORK2ihEhRuTLJcA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="24405426" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 23 Apr 2024 06:20:16 -0700 X-Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.35; Tue, 23 Apr 2024 06:20:15 -0700 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 23 Apr 2024 06:20:15 -0700 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.35 via Frontend Transport; Tue, 23 Apr 2024 06:20:15 -0700 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.41) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 23 Apr 2024 06:20:15 -0700 X-Received: from MN0PR11MB6158.namprd11.prod.outlook.com (2603:10b6:208:3ca::18) by DM6PR11MB4659.namprd11.prod.outlook.com (2603:10b6:5:2a5::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.21; Tue, 23 Apr 2024 13:20:13 +0000 X-Received: from MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::b0c8:dcaf:59ea:9e99]) by MN0PR11MB6158.namprd11.prod.outlook.com ([fe80::b0c8:dcaf:59ea:9e99%6]) with mapi id 15.20.7519.018; Tue, 23 Apr 2024 13:20:13 +0000 From: "Wu, Jiaxin" To: Gerd Hoffmann CC: "devel@edk2.groups.io" , Ard Biesheuvel , "Yao, Jiewen" , "Ni, Ray" Subject: Re: [edk2-devel] [PATCH v3 08/13] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid Thread-Topic: [PATCH v3 08/13] OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid Thread-Index: AQHalWA1zBvqODpvrE2R+k29oKYKFLF1xUuwgAAQorA= Date: Tue, 23 Apr 2024 13:20:13 +0000 Message-ID: References: <20240418065556.5696-1-jiaxin.wu@intel.com> <20240418065556.5696-9-jiaxin.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN0PR11MB6158:EE_|DM6PR11MB4659:EE_ x-ms-office365-filtering-correlation-id: 3fa4caee-56f5-498b-0521-08dc63981bc1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?CAx4aMn9PEKGqvvl4zTVhz1d0mEAYK9kDCdmjp17q5hB+1pqLDJHMveQJehZ?= =?us-ascii?Q?L6GqQVUId/JejVZaKnYksJGyFsr05cemfuWWjK4kZI6qSpa8bWkQrCZwA0Nw?= =?us-ascii?Q?ujGzDT+mRj1Ay36WmaQgLIA54V65LWy3V7Hd/x4f2e3PpLaRFt+i3/UcaPAM?= =?us-ascii?Q?p6ZqbTnrKqG0KS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ep?= =?us-ascii?Q?CPaH5ZyPtrb24sNycvOQZNfuLyByVoKpG1fwdO6ld3Qw+otAtQF8J9eSJ7CG?= =?us-ascii?Q?ZCXcgyQ6iRIdggY629uSy6B/Art94qrOTQF7hutwDDyQneAty5VuMavSNXDh?= =?us-ascii?Q?ON45DAHqyOTemgWIkgI+5gBy+AXt3tXHQcj2Rr46p9Eq1GpUresmM0BmZ9dK?= =?us-ascii?Q?mTUI68P3H2DCY4gukqSTBghJgZa/uTOz4ng+1wAyCJfK3Y62iMh3fnHoXFNq?= =?us-ascii?Q?pYeFz0m3tWG7A4EdbfqN/1Y38kzXH6eHYg5Wy9vhHcXZlA=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?CU0H3euKuljJ0IAAuq/JmJfdT10owQSwZQ6gpBLb6JyQo1L14m+VUloxeqD7?= =?us-ascii?Q?msYmp8vv0JMiZ3oerbCVVcd2p6pqlmfYmZI3J3o9q9YQ+SKzoPQf5oMusELa?= =?us-ascii?Q?Jy4vjVKJEX3W1vbhkn9fOC95pkWzyTbM8JoS1ObQ5ypuNC/ADwPGLELReSMe?= =?us-ascii?Q?6JBK0UZl9TfQ4v3i5j9yg2trODQgoq2R2VrKsZfup01+jxu0asd2cY1hXocx?= =?us-ascii?Q?XM53tW05eg/hNxSV8d8oqZB26Xdtbtzhw7Rmg0IqGcIFuOH4cKgPIV1aRYgQ?= =?us-ascii?Q?beUoOTFLgglUjPWeObXmBENzaCBm0XeYFXgg+AQQBnusffJG0AtuzOmHfr7i?= =?us-ascii?Q?HkAlYZCJplXpZz1EjWH7d1nBTV/z48AWB/++5qOVTPG3p0PdqSo6rYY9G6HF?= =?us-ascii?Q?RK7lIrb+lxuIFfxmePO6jv/NDQutaLWRikofPlEgIQ0BdV72ZdQ75YcEYMZZ?= =?us-ascii?Q?lCuPrRGMKhTOKKdE1ynHLvui1pOOq1gp7C57XuUvOWYW2W3kWoU/IeKx8NO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2mEymjxO1XInY3tDCHKNcx?= =?us-ascii?Q?PRHqw3nlMHQW4pLqWJ1VAwaLgmz+Cuu08H6wo1lpcYCLXDd1hlQyXZj6f18w?= =?us-ascii?Q?tX+tIOE9IkXp1IbAmL0UFLqS5j8BAcAJhxmufwyykYIZFCuU0UFenP5azauf?= =?us-ascii?Q?Qk9MRAtuRNDYIS/hv9/uiHr/eRbzPJUaYomZ28cH?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6158.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3fa4caee-56f5-498b-0521-08dc63981bc1 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2024 13:20:13.0959 (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: b+ds5WqI5nLu/cuLCIZt+tNFLGxZ2xlEg8NAEFcfGFSQ9eKP6vvjwancVjOmEGtEheasyFMa+KNBX9kaO1LAKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4659 X-OriginatorOrg: intel.com 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 Resent-Date: Tue, 23 Apr 2024 06:20:23 -0700 Resent-From: jiaxin.wu@intel.com Reply-To: devel@edk2.groups.io,jiaxin.wu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: AbvvDYoXr7IlhBgXFdExMoy4x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=T6LL6ANS; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) More info: I quick dump the SMRAM info with original SmmAccess implementation, it's sa= me as I produced in the gEfiSmmSmramMemoryGuid HOB. SmmAccess: SmmAccessPeiEntryPoint: SMRAM map follows, 2 entries SmmAccessPeiEntryPoint: 7F000000 1000 = 7F000000 1A ---> for the S3 Resume in gEfiAcpiVaria= bleGuid SmmAccessPeiEntryPoint: 7F001000 FFF000 = 7F001000 A Smram map in the gEfiSmmSmramMemoryGuid: PlatformQemuInitializeRam: 7F000000 1000 = 7F000000 1A --> ---> for the S3 Resume in gEfiAc= piVariableGuid PlatformQemuInitializeRam: 7F001000 FFF000 = 7F001000 A Thanks, Jiaxin > -----Original Message----- > From: Wu, Jiaxin > Sent: Tuesday, April 23, 2024 8:19 PM > To: Gerd Hoffmann > Cc: devel@edk2.groups.io; Ard Biesheuvel ; Yao= , > Jiewen ; Ni, Ray > Subject: RE: [PATCH v3 08/13] OvmfPkg/PlatformInitLib: Create > gEfiSmmSmramMemoryGuid >=20 > > > > > + SmramHobDescriptorBlock =3D > > (EFI_SMRAM_HOB_DESCRIPTOR_BLOCK *)(Hob.Raw); > > > > > + SmramHobDescriptorBlock->Descriptor[0].PhysicalStart =3D > > PlatformInfoHob->LowMemory - TsegSize; > > > + SmramHobDescriptorBlock->Descriptor[0].CpuStart =3D > > PlatformInfoHob->LowMemory - TsegSize; > > > + SmramHobDescriptorBlock->Descriptor[0].PhysicalSize =3D > EFI_PAGE_SIZE; > > > + SmramHobDescriptorBlock->Descriptor[0].RegionState =3D > > EFI_SMRAM_CLOSED | EFI_CACHEABLE | EFI_ALLOCATED; > > > > > + SmramHobDescriptorBlock->Descriptor[1].PhysicalStart =3D > > SmramHobDescriptorBlock->Descriptor[0].PhysicalStart + EFI_PAGE_SIZE; > > > + SmramHobDescriptorBlock->Descriptor[1].CpuStart =3D > > SmramHobDescriptorBlock->Descriptor[0].CpuStart + EFI_PAGE_SIZE; > > > + SmramHobDescriptorBlock->Descriptor[1].PhysicalSize =3D TsegSiz= e - > > EFI_PAGE_SIZE; > > > + SmramHobDescriptorBlock->Descriptor[1].RegionState =3D > > EFI_SMRAM_CLOSED | EFI_CACHEABLE; > > > > This is not going to fly. > > > > First, smram allocation doesn't work that way. Have a look at > > OvmfPkg/SmmAccess. I guess that easily explains why this series > > breaks S3 suspend. > > >=20 > Oh? Could you explain a bit more for 1) how smram allocation works? 2) > what's the possible reason break the S3? I haven't check yet. >=20 > > Second, storing these descriptors in a HOB (which is PEI memory) > > is questionable from a security point of view. > > >=20 > HOB is only to expose the SMRAM address and size, not the contents in > smram, what's the security concern? >=20 >=20 > Thanks, > Jiaxin -=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 (#118141): https://edk2.groups.io/g/devel/message/118141 Mute This Topic: https://groups.io/mt/105593577/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-