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 31227941AEB for ; Wed, 10 Jan 2024 17:07:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=asbyBcqb6dFucuMzRn/aPKPwYbPRmG4KQwD1k0cVfv8=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results: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:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1704906420; v=1; b=nKACQDZV0vvlARi45w/tx3rYApVuZzBbMMZmkwE5waLM/Xy/wnkMgRr+QaA9B8SgHa7ubYpE q0Ig0exV0A6oAFdfXETiuF+FmzaKiiEFY7QbxO/3aiCi+EHolHYjN2VMimNifBQadl94S/VO/aI PgwK+yzpJSj2tujn2u4cKJWc= X-Received: by 127.0.0.2 with SMTP id vL3IYY7687511xEfsqlD8iYn; Wed, 10 Jan 2024 09:07:00 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.16546.1704905035169449106 for ; Wed, 10 Jan 2024 08:43:55 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="464971002" X-IronPort-AV: E=Sophos;i="6.04,184,1695711600"; d="scan'208";a="464971002" X-Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2024 08:43:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,184,1695711600"; d="scan'208";a="30664815" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Jan 2024 08:43:55 -0800 X-Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 10 Jan 2024 08:43:53 -0800 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; Wed, 10 Jan 2024 08:43:50 -0800 X-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.35 via Frontend Transport; Wed, 10 Jan 2024 08:43:50 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) 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.35; Wed, 10 Jan 2024 08:43:50 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xv8jNxH41Pqlk5d8X/w3Lz1/CkcIbDWDUXk2V30wmsMMGoPhiqcWIK50nRLzBEBlbDK4mmt4XYHnUv0b+9VhO1HgdJNhjXpkkbd4doHFKgbvr4zqzZWR/gGglLdKMTi2oGBYKg+19qqR9gKe+ModlaRC0OZyl7d56++6IFWKEPphEsT4/AhqToDs4EP0M3FmnAxqkyhovjBvSw328soOr+EspDulw9lLy5zQBJgmJuCbYFlVB5SC1O+Stoqd+rqRYgITLEilFROAAyfFz8J7xrYexTavY0qXNhn/p4Gq3eTCWy/IxSbXS8ajGMfxMVm13xu4cAp31chWxZlgilOMcQ== 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=0dUG2Ioa64sIGzTlktLRL3mDvo2GeRDKBwj2g62VXmM=; b=GX0tXT/EJrhFVPN/H8N9B962/3B3IyE+rk9H8mvQohbbu9aVjgps0hLMmf0sAjGhAtWX4RflHCxc+XFrbn4I2IT8kGLWGNRGQBZO2FPJ582v94o8psaHQYjiRuPCvOEx9SSE6xoSEEe0pfKAXCBpFk0uem5Ep0heEf3d0qp34qLlwWrzJgCw+ureqjRNLIegnPk2ddwkA90+FGIyS7wMgunnSF3VWDNrXUW3Y8McHblWOWnDVenI+NDicZhqWbJacnQCZxbcFk0+2LfkLhFAbsQT8jpZM/YNrlm2ovBOpuFCN/7t0nasqMlAWuzYbmLSHQHcw1NC7ik1qARvLbqVYQ== 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 X-Received: from SN7PR11MB7591.namprd11.prod.outlook.com (2603:10b6:806:32b::18) by MW4PR11MB7029.namprd11.prod.outlook.com (2603:10b6:303:22e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.24; Wed, 10 Jan 2024 16:43:47 +0000 X-Received: from SN7PR11MB7591.namprd11.prod.outlook.com ([fe80::e66:d92a:e07d:d404]) by SN7PR11MB7591.namprd11.prod.outlook.com ([fe80::e66:d92a:e07d:d404%6]) with mapi id 15.20.7181.015; Wed, 10 Jan 2024 16:43:47 +0000 From: "West, Catharine" To: "Xu, Min M" , "devel@edk2.groups.io" , "Ni, Ray" , "Wu, MingliangX" CC: "Yao, Jiewen" , "Xue, Shengfeng" , "Dong, Eric" , "Kumar, Rahul R" , "kraxel@redhat.com" , "De, Debkumar" Subject: Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0 Thread-Topic: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0 Thread-Index: AQHZv6Y/U60BMGIetU+4xp3Iu3zPhq/Lzo4AgAx2CYCA+228MIAAlh4g Date: Wed, 10 Jan 2024 16:43:47 +0000 Message-ID: References: <20230726094754.171-1-xueshengfeng@byosoft.com.cn> <177562550EF0534C.27380@groups.io> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN7PR11MB7591:EE_|MW4PR11MB7029:EE_ x-ms-office365-filtering-correlation-id: b895bee5-6bac-409f-eb74-08dc11fb5146 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: Vn5cGLU3U+rRRNKvou4LooKoY1fQsPP9cC3fiu3JDoqhcMkCZkmjxFpho49XCkLenMfkntm4P2AaAmfmbwLbwuBtuZubwr1qJTZNNE2ptMyyKnc1qq+ev5fbpyOO+lHub2ZgRvJTK6nDfGG0NbNmk8rbjvGIgoFdKeE1rDkDMu/8Ke74O7nbajlhOaO+I374ZjCxZjZEsZCjgvD/qsCU/+DssIuW/o4fBhj8SZgh5W3magPp5UA2q1dVSDR76KD/REuRdeQqnRdO3+fcjWzE2jlPY0oIIptbnxs51u7HQl/Wt/gbE1fvykS6fJo6ocR3kMgNGGwoncziPt+V3tnHAcd2lHkmzUHf5qw+goZyfQyyvm34MWsZq7Eib/HuJwP4Y7p3Km0WL+xD51ya6waxZCiglbKKYz8v0a8SSIPtZLPQdF/2hRyZJz5FA1wVS0BhcKU3fUj/BcLnxfHGp9i/XY/K0hw2EL7KE5/NIQE0P5OjlGaHRg8tRMcJzWtfz/AKUTMCxB1+JmHgeaM/Ew1t3vs9ZBlla0MdvoJs1LWeBG9KINjogjM6CUrJgklFZV9IJsfuEMCHdCXaKfD13L9aXtFclfKhhevlbMyAZyvNSNCa/MsfnEL56uTep1dOWoRqk1C7JwWNk+QohCcPUpXuug== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?oSn3npG4eDILU3GmNEkS/5V7kQkS/6qBg8d9bjx6aoe1yBgyOsi88FQL1F2w?= =?us-ascii?Q?bKL3TXcwn0FJTMmM7YQHpl7REXbRBM59rFlI6jVcISY1zsD0hOBDTlILfnf/?= =?us-ascii?Q?pG4fK091tFKNK1oOGl9IPD6x/6ZkiEQreURMjZgAG+vORcuPom458oDuFkI5?= =?us-ascii?Q?bLKwkrHsnXJYskblGbM5xhhi1KK7YeUvVA5wgZHLGGpTzs0XbMk1jn/vDN3E?= =?us-ascii?Q?swQfxjfvvz9Ezqs8tMPbOFebsYyqP5DXHv6fi7rMAZqaoBe8+wjWY1pnBCBY?= =?us-ascii?Q?5nhBgsLVqG+rD4E8uYDjd6NsHsKok1cybaPoX6hxCwqlAS284/1ACdgVN1zQ?= =?us-ascii?Q?45imnvU6G+uDAe67TmP58xp/jqK4X5Ia92X07Nj1zBQmvnFy9fMiwYd2WlWA?= =?us-ascii?Q?j6Y8yRZS4U7+barej+3X++YT/bcqJlgfUtyzDOCxnCPTy8xgppG2sKuJGm3z?= =?us-ascii?Q?AdVI2Xag6nqvpBwI/dBHzDLZ2t8/VuCD1YnFS0EEnGUAvA0+l83GEVjNGCxg?= =?us-ascii?Q?PHTYSQW2A0ikXSv55ZjIFzqX52yddSbDwgIoFgQ3AJfOKeFYTNBVgzTueUaA?= =?us-ascii?Q?Uz04/6p5twHASVEl1lJ0rnPuy5b6rMqGWGbYvTT52ztMW0dA0yV0YQg9VdQj?= =?us-ascii?Q?H4PVpaGQx3a9p34vPTp/0SmbvgSjetW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EX9Pxk5+Lu3iNfQookx+C0+f5A+a10NlN?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB7591.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b895bee5-6bac-409f-eb74-08dc11fb5146 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2024 16:43:47.7660 (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: hlLts4lxpkk3allPevrGY1zn+0MLYwUKp4BeO8YomRKOQJ98XR+4KHFdd8i6y4/YijP7PRxF0fCB/iiReoTah4gbrOjJQEpePg+7NkSqPGI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB7029 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 Reply-To: devel@edk2.groups.io,catharine.west@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: eyT6beyUdV85hA8PWYfClOfdx7686176AA= 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=20140610 header.b=nKACQDZV; 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 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Disabling cache by default results in violation of BTG protections (if BTG = enabled). =20 BIOS cannot assume that cache is disabled before it executes as ACM may be = required to enable NEM. Whatever solution needs to be done here cannot evict ACM-enabled NEM. Why is boot time increasing? In this failing case was ACM executed / cache= enabled by ACM? If not, then CD should be 0 by hardware default right? thanks Catharine -----Original Message----- From: Xu, Min M =20 Sent: Tuesday, January 9, 2024 11:52 PM To: devel@edk2.groups.io; Ni, Ray ; Wu, MingliangX Cc: Yao, Jiewen ; Xue, Shengfeng ; Dong, Eric ; Kumar, Rahul R ; kraxel@redhat.com; De, Debkumar ; West, = Catharine ; Xu, Min M Subject: RE: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disa= ble should not be set by default in CR0 This patch causes a regression when launching a vm guest with below command= : $ /usr/libexec/qemu-kvm \ -name guestVM1 -machine q35 -accel kvm -m 10240 -smp 8 -cpu host -monitor p= ty \ -drive format=3Draw,file=3D/home/tdvf/centos-stream-9.img \ -bios /ho= me/tdvf/OVMF.fd \ -nic user,hostfwd=3Dtcp::2222-:22 -nographic \ -object io= mmufd,id=3Diommufd0 \ -device intel-iommu,caching-mode=3Don,dma-drain=3Don,= x-scalable-mode=3D"modern",x-pasid-mode=3Dtrue,device-iotlb=3Don,iommufd=3D= iommufd0 \ -device vfio-pci,sysfsdev=3D/sys/bus/dsa/devices/vdev0.0,iommufd= =3Diommufd0,bypass-iommu=3Dfalse Commit e8aa4c6546 (this patch has been merged) clear the CD bit in CR0 when= transferring from real16 mode to 32bit protect mode. After the patch is ap= plied, it costs about 60s in DecompressMemFvs@SecMain.c.=20 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Ni, Ray > Sent: Thursday, August 3, 2023 4:14 PM > To: devel@edk2.groups.io; Ni, Ray ; Xue, Shengfeng=20 > ; Dong, Eric ;=20 > Kumar, Rahul R ; kraxel@redhat.com; De,=20 > Debkumar ; West, Catharine=20 > > Cc: Wu, MingliangX > Subject: Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache=20 > Disable should not be set by default in CR0 >=20 > The patch resolves an issue in Boot Guard enabled system that NEM is=20 > already enabled by Boot Guard, disabling cache evicts all cache=20 > content which is unexpected. >=20 > Reviewed-by: Ray Ni >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Ni,=20 > > Ray > > Sent: Wednesday, July 26, 2023 5:56 PM > > To: Xue, Shengfeng ;=20 > > devel@edk2.groups.io; Dong, Eric ; Kumar, Rahul=20 > > R ; kraxel@redhat.com; De, Debkumar=20 > > ; West, Catharine > > Cc: Wu, MingliangX > > Subject: Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector:=20 > > Cache Disable should not be set by default in CR0 > > > > This patch is not right. > > > > Intel SDM explicitly says the initial CR0 value is 6000_0010. CD bit is= set. > > > > So the ResetVector code that still sets CD bit should be good. > > > > If you are facing NEM enable failure, can you change your NEM enable=20 > > logic to explicitly clear CD bit instead of changing here? > > > > Thanks, > > Ray > > > > > > > -----Original Message----- > > > From: xueshengfeng > > > Sent: Wednesday, July 26, 2023 5:48 PM > > > To: devel@edk2.groups.io; Dong, Eric ; Ni,=20 > > > Ray ; Kumar, Rahul R ;=20 > > > kraxel@redhat.com; De, Debkumar ; West,=20 > > > Catharine > > > Cc: Wu, MingliangX ; Wu > > > Subject: [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable=20 > > > should not be set by default in CR0 > > > > > > From: "Wu, MingliangX" > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4511 > > > > > > With 64 bit build we are seeing the CD in control register CR 0 set. > > > This causes the NEM to disabled for some specific bios profiles. > > > > > > Cc: Eric Dong > > > Cc: Ray Ni > > > Cc: Rahul Kumar > > > Cc: Gerd Hoffmann > > > Cc: Debkumar De > > > Cc: Catharine West > > > Signed-off-by: Wu, Mingliang > > > --- > > > UefiCpuPkg/ResetVector/Vtf0/Ia16/Real16ToFlat32.asm | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/UefiCpuPkg/ResetVector/Vtf0/Ia16/Real16ToFlat32.asm > > > b/UefiCpuPkg/ResetVector/Vtf0/Ia16/Real16ToFlat32.asm > > > index f59fc6ead4ba..4af2e875c31c 100644 > > > --- a/UefiCpuPkg/ResetVector/Vtf0/Ia16/Real16ToFlat32.asm > > > +++ b/UefiCpuPkg/ResetVector/Vtf0/Ia16/Real16ToFlat32.asm > > > @@ -7,7 +7,7 @@ > > > ; > > > > > > ;----------------------------------------------------------------- > > > -- > > > ----------- > > > > > > -%define SEC_DEFAULT_CR0 0x40000023 > > > +%define SEC_DEFAULT_CR0 0x00000023 > > > %define SEC_DEFAULT_CR4 0x640 > > > > > > BITS 16 > > > -- > > > 2.26.2.windows.1 > > > > > > > > > > > > > >=20 >=20 >=20 >=20 >=20 -=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 (#113536): https://edk2.groups.io/g/devel/message/113536 Mute This Topic: https://groups.io/mt/100367559/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-