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 94CF374004C for ; Tue, 23 Apr 2024 12:18:56 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=6seRtBIeuORqKlElIpvmmRTrSWYuoXgwX/yo7waV9Z0=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To: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=1713874735; v=1; b=JyoAskmoL1AO+dDQTFSOrc40ha9w9lecQLv5iQXNHWVodhZMiUI7vu5OhZ2j5G8cBGSr3Db/ 5p1rUSOWUlLbzOjhr5weZkRzU1gUVNhUKpzQs6gxxclgChJ0WzVOLzWjkfY7dGhp8C7eK6Y5NSB IYM03ONbuLHzNJ90/QFMN6pGPRMqbXrHRWooWvmxKYTmg+FoLWtQBa8G8NBEoB5cm37VRL96bsd c7Z63yPooZ5iRNtBKTjaSrNwyt+o6mn3H36eTwexl0CWSTXEVVRo9zvimZZ4XyiceZZMAtki0o0 5jqKGN6TA3RRWDgP1F2Gxw4lQDsADdCmbMBfo8RMXa7AA== X-Received: by 127.0.0.2 with SMTP id J0M9YY7687511xiwbaPdDdaJ; Tue, 23 Apr 2024 05:18:55 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) by mx.groups.io with SMTP id smtpd.web11.16860.1713874734390739947 for ; Tue, 23 Apr 2024 05:18:54 -0700 X-CSE-ConnectionGUID: K7iu7LlgTOGlwatstgVyPg== X-CSE-MsgGUID: zhXytLxKQgq8c3WGLXQzGw== X-IronPort-AV: E=McAfee;i="6600,9927,11052"; a="12388388" X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="12388388" X-Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 05:18:54 -0700 X-CSE-ConnectionGUID: s3i53dVwT1OT7SbIxe3iXg== X-CSE-MsgGUID: lcHwM+N4SSq7GkyrXy3TAQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="24793672" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 23 Apr 2024 05:18:52 -0700 X-Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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 05:18:51 -0700 X-Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) 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 05:18:51 -0700 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) by edgegateway.intel.com (134.134.137.102) 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 05:18:50 -0700 X-Received: from MN0PR11MB6158.namprd11.prod.outlook.com (2603:10b6:208:3ca::18) by CO1PR11MB4930.namprd11.prod.outlook.com (2603:10b6:303:9b::11) 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 12:18:49 +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 12:18:49 +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+k29oKYKFLF1xUuw Date: Tue, 23 Apr 2024 12:18:49 +0000 Message-ID: References: <20240418065556.5696-1-jiaxin.wu@intel.com> <20240418065556.5696-9-jiaxin.wu@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN0PR11MB6158:EE_|CO1PR11MB4930:EE_ x-ms-office365-filtering-correlation-id: 41b3ac31-6293-478d-e62b-08dc638f8824 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: =?us-ascii?Q?ymhN/U4SypaD4j/b3V+bkAUwODliwan4yJWt28/W9EjDjrTzS9jAnce+PJPx?= =?us-ascii?Q?aUyM14apPJ5pGY41+T5lPWiRrbRbP5A71cTCSsbHDxzntJSPuQj4P8/tleXH?= =?us-ascii?Q?yp53J0w0A+oT1EceNw7jMr85E803gRRNAHFcweqbUi3GhhRJMYbO9j8oI37a?= =?us-ascii?Q?A9EZwPY4lKCZJZ5MxD89UFOuDMlWRoYp7kJhwG5GG1XpUXzKoCC3oj6bQIJr?= =?us-ascii?Q?huyn+Q2I/5bmFSHJlDj1TrygZKg4JyNw6szHHsES4j8ba8t/Hhg4uLyRvMyl?= =?us-ascii?Q?GD/p7oics2NOVZx3CEwxJLBvklAM6Wh6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yoKTIsqT/EKqTEx+Z8qBFMEmig8W9AxDm/WFBP0PVSwE1ktq7MzAZN/0mq0V?= =?us-ascii?Q?kU1/XSkjkURyUu6ll5BmOKCriWs4P5EVh87J8X16m18hU8v9yPPr5i6qrz3h?= =?us-ascii?Q?NtO3CnLM4RyDCB6lngX6Q6bIlnq9RABdp579GoDL6y+1qQ=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Gioq8leCSxF0RAy2LrzXHd9+3XDP54q7Mad0DXrUIw/xdNUYt7vzJN4iDUNw?= =?us-ascii?Q?0l/j87z4ZZqCk4Q4OmbFDtrycKImBJ954j9QWSdFCfIai6C3dIhsyrhQ7gvt?= =?us-ascii?Q?WR9aSQKYC+km5F1TJEXfaW8uK4ABwRvMI5BtVQljZ4//YjUuwmlN/jOkjrJ4?= =?us-ascii?Q?I9mW95C9SPu4l+9mpUzFl/vup/Oh5syLH+s/xf5wqd+OuSqLCXe3gbtEQ8i4?= =?us-ascii?Q?cs8836IMUXy32B2lvfGDU0lbyCwMn2Rwl6e98YsPzrzmROgbpfXMV/r6qp/Q?= =?us-ascii?Q?wrFES8FFL6k19Ub2BNi68/kV8wAx8XmCOucEOqeuzSzW4DFHV2xq2ugaK6ST?= =?us-ascii?Q?WPLNapV7FfEcibwFges/mudBYMn3HW1TR1RhaGe7UHseRs7I2KT+UasY79LC?= =?us-ascii?Q?Mg4fXVql3El33QJ+bef9AI7m0XyqXNXGUts9ihZHUGNMcI4i6raF8XDkvwhS?= =?us-ascii?Q?obP0uEb66jUr4eFtEidX5YpysoX87r/SVGgCFvrgDZfM83CCFqv6buyKg589?= =?us-ascii?Q?iTqqhKrbhNeWyYq05aEuc6BETUsTpBTqdEzDAIod+1v+4BkIiTRovk/7MlK7?= =?us-ascii?Q?Rg6MUEtlwuLQhXEAeeK6VCc3MRUD9nTUAq1agu2w+lV4BWgTE/hJivSuMTqe?= =?us-ascii?Q?eWTKAoJb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aYFMbwDT0ibN7lYUNpLQ7pm/?= =?us-ascii?Q?yPjcJ3CyI45ws9CAcEgowjtOocd9DS7zroaLe6oK?= 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: 41b3ac31-6293-478d-e62b-08dc638f8824 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2024 12:18:49.4758 (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: khl/u6d+S9D+AQvcW4s7avEKomq+RlpW2X9PtMDZWr9lTZX7Gz7YxuKmI3Mcam4AF99RxLuNdbZwvI3ZuHgRSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4930 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 05:18:54 -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: QoGdgto5c33N5dnues0B8Sj0x7686176AA= 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=JyoAskmo; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io >=20 > > + SmramHobDescriptorBlock =3D > (EFI_SMRAM_HOB_DESCRIPTOR_BLOCK *)(Hob.Raw); >=20 > > + 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; >=20 > > + 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 TsegSize = - > EFI_PAGE_SIZE; > > + SmramHobDescriptorBlock->Descriptor[1].RegionState =3D > EFI_SMRAM_CLOSED | EFI_CACHEABLE; >=20 > This is not going to fly. >=20 > 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? 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 (#118138): https://edk2.groups.io/g/devel/message/118138 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-