From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.groups.io (mail04.groups.io [45.79.224.9]) by spool.mail.gandi.net (Postfix) with ESMTPS id 17185941677 for ; Tue, 16 Apr 2024 10:12:19 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=MWWQU0ypM8dMhIj+PvrMl4ezimJVFPi0o1+wRGMdv30=; 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=1713262338; v=1; b=m6pEIXviXCAIFxOiK7KAfS/hcdkVAUhw0cggdEhhLeq/ln8BwmjgrsQwdD7JeIcYUg0h7jVA 9Q2RKFZfQ2q5fWc3tnYReg2QiYpw/pIRVm7OQ8bjlhIIIxqi9TI0ErgHfRWCXqiIymtWG6CvGEG Gjnc4tsUlJ1+2uuHTx+9y/XLEzRLiHkvovG0z9vfxL1EZZoLd8mgJThdD5nK0ogHmKw9MskJsO7 RLdLnKHVpc6IrF9dSWHhj5LZJu4/f+r5mtzoUrXT6tXoNmhsiPoo3QjOlLXcet5K573/McgpHrW 9QZIjkWw1BdrpnTOdHa2VqeD4b1KA+YG7lTnJ7phTxM5g== X-Received: by 127.0.0.2 with SMTP id vrS9YY7687511xdQfW9BILK0; Tue, 16 Apr 2024 03:12:18 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by mx.groups.io with SMTP id smtpd.web10.16740.1713262338163760655 for ; Tue, 16 Apr 2024 03:12:18 -0700 X-CSE-ConnectionGUID: eedVBfbkTYCk6iZ888wMWQ== X-CSE-MsgGUID: QRBg1YsARvWNq3wqFBcBww== X-IronPort-AV: E=McAfee;i="6600,9927,11045"; a="19294880" X-IronPort-AV: E=Sophos;i="6.07,205,1708416000"; d="scan'208";a="19294880" X-Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 03:12:18 -0700 X-CSE-ConnectionGUID: l+VyDNO3Rve8ngInRO/BtQ== X-CSE-MsgGUID: FB8Qvy8UQCm0X8Mw7IBaRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,205,1708416000"; d="scan'208";a="22250743" X-Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmviesa010.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 16 Apr 2024 03:12:17 -0700 X-Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 16 Apr 2024 03:12:17 -0700 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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; Tue, 16 Apr 2024 03:12:16 -0700 X-Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) 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, 16 Apr 2024 03:12:16 -0700 X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.40) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 16 Apr 2024 03:12:16 -0700 X-Received: from MN0PR11MB6158.namprd11.prod.outlook.com (2603:10b6:208:3ca::18) by PH7PR11MB7001.namprd11.prod.outlook.com (2603:10b6:510:208::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.9; Tue, 16 Apr 2024 10:12:14 +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.7452.049; Tue, 16 Apr 2024 10:12:14 +0000 From: "Wu, Jiaxin" To: Gerd Hoffmann CC: "thomas.lendacky@amd.com" , "devel@edk2.groups.io" , "Ni, Ray" , "Zeng, Star" , Ard Biesheuvel , "Yao, Jiewen" , "Kumar, Rahul R" Subject: Re: [edk2-devel] [PATCH v1 03/13] UefiCpuPkg/SmmRelocationLib: Add library instance for OVMF Thread-Topic: [PATCH v1 03/13] UefiCpuPkg/SmmRelocationLib: Add library instance for OVMF Thread-Index: AQHai99oFIlHXkFAQ0+HiVjxVR3nL7FpUJEwgAE4/gCAACrqMA== Date: Tue, 16 Apr 2024 10:12:14 +0000 Message-ID: References: <20240410135724.15344-1-jiaxin.wu@intel.com> <20240410135724.15344-4-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_|PH7PR11MB7001:EE_ x-ms-office365-filtering-correlation-id: 6cc272b2-40cf-43d1-b78c-08dc5dfdb029 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: lCej7/3h8LPM2BLK8lAeLgcwlq7DeSCqRC6VhHhHfpclwBeCWIG7eEHA4tnI1UB4VtM0yFpUpadkQ+C4qlTbvXGA+fliVipMzia69ZM0eu8JywrYM5PT7Oe2O72YdKwS12gj6fV6h1lIE1MUWKRcdVzUV+xz8+A28CuL/lIS/XeqEIOWFEqoVirakly0rQtnSsbAD5T77VozeLZwPsUzHf+873bb1lHKJ8sh57/mAJMLk+tzH9ZsWRnqymme+k6Sq/Rdan54eCcoAB6KoNzmPh24nal1OXcqx+OrM/5y3shZ8W+RNa9z93kJy1vAKKl0hZAKJeqwclr3oWrE+XHiqjINPhzIb1tGi7JB+20Pkq0TQk+6c9wrz1wHxEImFw49l6Cosu5bfvv15eYemmXRnnFOtenS0QLH9HYYL8PfSHKBxOeN1BsivGvo3hbvtO1W3kPXocequgZ1EjI2MqA5A8NtYmDb/IcIWKuwgg9vzOxPv/vzoFc7v/vufU153mCUPx0RTlN7eQYz4y8uFuX5EmLBYGryRzOlcQLKCknt8nR8kTV7wp7OUtsTOc/8uz1eLNDGy4WL+AlAT3m/AVm5sqyYvDF/aSdlN43hrbmWSyJgFV9wP03qbcWRp2IkydZ4SSbakqZ3Yj5S8NNOH8/TeBY55gvLjEJYm6rOyvoQjdh9GT6Aj2BxkaXbHjdu7fMUWihTJiJOKSTZw4R2UupMTwhCAGUowqPfnPOGExcYKgk= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?RYQLfYzg6vOsN0bPaGUTLIICr6aaZVyAGo4lOFNodpAuVUi+zmqF8l8AkFYF?= =?us-ascii?Q?P2oYUCn4mlwfyQLstmyJzhLJKiNXvH1FDfZof8dBYGIQqaswUsvXoNoOv9iO?= =?us-ascii?Q?RPg1I02NgT8+FeHFR2TyMxegDi4j0D6UAm64xH6JF/uTUEATgKOu8FiIvYUh?= =?us-ascii?Q?b+DuRDhgofDELuYzqcfe5i4z3Xr8CEtwOS9Ybb7acde+vhF5HW0YXhXKn6kQ?= =?us-ascii?Q?pWblemQNh2mbAUh0yknlBH/ewCRjENtIFtRrj3m1EvqsXuKMx9KKaiK6bjJ5?= =?us-ascii?Q?GOnJGpkX66mrVm4H8642Qn91wv7tjjm2lkZvYaVTB7CZHYpSKZDOMlX1yz0x?= =?us-ascii?Q?4DZ/DAerDtPfo9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ascii?Q?zX7p8Gbzey38bTHHcVwFdQS5ZieHFudvVCprgjhGT/WMIjOH8Y2gi8pLyYK5?= =?us-ascii?Q?AjiCD/9C+huTjDJIMgkqaJ0QXfhcOCcWgK6+9Qls8oPw4zsFmoCUUNOcqSey?= =?us-ascii?Q?sxQBDWeuQkJjo5iQayzGoe8gPIYEMtlNCWZcnhuXDAvqlb4DxUPCm9JL58iV?= =?us-ascii?Q?HQ5I7wrV5gZFbDJ63+s8xzlDRSUBxGzAv19bi6ZRMgaaMUN7HI9zeKP0VnGY?= =?us-ascii?Q?KOWvUjjnWNHgcB1KpFAb+0My2+2zfmPY5zdgBveGWa+7oWPBv1b2ZtQD+hEV?= =?us-ascii?Q?QOo0uwbAiERrYCVGiyOQ77O1klW3TUqOQnbOtBgM?= 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: 6cc272b2-40cf-43d1-b78c-08dc5dfdb029 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Apr 2024 10:12:14.3299 (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: fQu1fcNtZLXGXsz9dn8hyxHhD5dITASbVbQGWHd0Y/LpWqJFxWkzmMML5gI0kay3h9nya1gz1Je/VvRIb0jFFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB7001 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, 16 Apr 2024 03:12:18 -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: zloctvEyk3OTuZzTxvQPj0Qsx7686176AA= 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=m6pEIXvi; 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.9 as permitted sender) smtp.mailfrom=bounce@groups.io >=20 > On Mon, Apr 15, 2024 at 01:04:58PM +0000, Wu, Jiaxin wrote: > > Hi Gred, > > > > Because: > > 1) The mode of the CPU check is different between the AMD & OVMF. > > OVMF: > > CpuSaveState->x86.SMMRevId & 0Xffff > > > > AMD: > > LMAValue =3D (UINT32)AsmReadMsr64 (EFER_ADDRESS) & LMA > > > > 2) Existing SmBase configuration is different between the AMD & OVMF. > > OVMF: > > AmdCpuState->x64.SMBASE =3D (UINT32)mSmBaseForAllCpus[CpuIndex]; > > > > AMD: > > if ((CpuSaveState->x86.SMMRevId & 0xFFFF) =3D=3D 0) { > > CpuSaveState->x86.SMBASE =3D (UINT32)mSmBaseForAllCpus[CpuIndex]; > > } else { > > CpuSaveState->x64.SMBASE =3D (UINT32)mSmBaseForAllCpus[CpuIndex]; > > } > > > > This series patch won't change the existing implementation code logic, = so, we > need override one version for OVMF. >=20 > The real question is why do these differences exist and are they > actually needed. >=20 > I'd expect the CPU mode check return identical results. I don't the background why AMD and OVMF has such difference. Maybe OVFM doe= sn't not support the MSR "EFER_ADDRESS". >=20 > The SmBase configuration for OVMF looks suspicious to me. I'm wondering > whenever the OVMF code actually works in Ia32 builds ... >=20 Yes, I will fix it in the next version. Currently, please build it with SMM= _REQUIRE =3D=3D TRUE. In the next version, I will make sure all pass the ch= eck. > take care, > Gerd -=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 (#117874): https://edk2.groups.io/g/devel/message/117874 Mute This Topic: https://groups.io/mt/105441992/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-