From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=jdZsatQT; spf=none, err=SPF record not found (domain: amd.com, ip: , mailfrom: thomas.lendacky@amd.com) Received: from NAM05-CO1-obe.outbound.protection.outlook.com (NAM05-CO1-obe.outbound.protection.outlook.com []) by groups.io with SMTP; Mon, 19 Aug 2019 14:35:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g/O0dZ/wZ0ysu8KJSsF1tFn8WHGlUINxK1A0R6dWIxfACl8wR0XWF9VkrvReqyzgQRneT5laXfnd/G4WS4tFy3IJc7seh29A+qmhLQcnZ1WFcC2MuKHD7J+E/rrYaUyb480aSvniXNUNcP0dGxn+zK9iAd7OaoBlZReiWkKZF5UuJT3RGIMhPAXMwGkN+0J8zFYwZtuNDxnA4gf8RwUBAgldWPJP8TRkT1OaKnHL9lD5CjbPaeFxlwECuyaU23v3b+lwLc+OyASHgGxyF3BptoYnori2sJe4DoUSJIECTYeZ1pb57Awm48htCMIpCD1gKJepRIOIbWmseBVQGn/CEw== 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-SenderADCheck; bh=tkNsWWZ5R0C/BCPQGn3a7qld1WCg1PCSBosb59WiJFk=; b=ghOWugwEtzaA/4xjY4jArIgrsoavrF77bhQV49mAp/ezq1OFXfZJRhhl4LbK46WyrSReeVDasBCDrzQjK2NUR73fNygyBfipBU08T5un8xZ4mKQYxR2vnULaIbgbNiAA16J7XSQG8/4ZFjOmWjnXpN6QxxrhU5SUz8kOn/fUsWazec47mhDtgD9S2GltOqTbNjL0SfmtumVF/+VG2wM71WAKDgukGepd/hQcAUMJ9HqqjwI3JmlztFj25/tgx5FOoeVBN5HBRuQeS3ZdLkPobiPho8fEy2dWqTWt/Mg0HBoRVH9jOdM0utAluRkkNKRJPH383ox90xd4nXpkS5NzDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tkNsWWZ5R0C/BCPQGn3a7qld1WCg1PCSBosb59WiJFk=; b=jdZsatQT9iEu2mAwt1wR3AIO0IP6dedSmmYvwcMTmNMXUG0Snl8DnHh8T+JuHUnUQ/G2fyobIxgdZnmpVVVe6zf7ktjWqsqLjlUZoFWmZmyIukF40rhME0NTCipqG/PN91xfvFrOZhJJ5kImaWRQDYwkrvKaL8NZwVvvTo9Z8Js= Received: from BYAPR12MB3158.namprd12.prod.outlook.com (20.179.92.19) by BYAPR12MB3112.namprd12.prod.outlook.com (20.178.54.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.20; Mon, 19 Aug 2019 21:35:48 +0000 Received: from BYAPR12MB3158.namprd12.prod.outlook.com ([fe80::39b9:76bd:a491:1f27]) by BYAPR12MB3158.namprd12.prod.outlook.com ([fe80::39b9:76bd:a491:1f27%6]) with mapi id 15.20.2157.022; Mon, 19 Aug 2019 21:35:48 +0000 From: "Lendacky, Thomas" To: "devel@edk2.groups.io" CC: Jordan Justen , Laszlo Ersek , Ard Biesheuvel , Michael D Kinney , Liming Gao , Eric Dong , Ray Ni , "Singh, Brijesh" Subject: [RFC PATCH 01/28] OvmfPkg/Sec: Enable cache early to speed up booting Thread-Topic: [RFC PATCH 01/28] OvmfPkg/Sec: Enable cache early to speed up booting Thread-Index: AQHVVtYQwtbGWnPlRU21i0AUmukzUQ== Date: Mon, 19 Aug 2019 21:35:47 +0000 Message-ID: <6a37c84f4989304b21205d6263c6491f81da3233.1566250534.git.thomas.lendacky@amd.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-clientproxiedby: SN2PR01CA0031.prod.exchangelabs.com (2603:10b6:804:2::41) To BYAPR12MB3158.namprd12.prod.outlook.com (2603:10b6:a03:132::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.77.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cdd0c0e7-2f03-4be7-d5a8-08d724ed32ce x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);SRVR:BYAPR12MB3112; x-ms-traffictypediagnostic: BYAPR12MB3112: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0134AD334F x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(346002)(376002)(366004)(396003)(136003)(189003)(199004)(66556008)(66476007)(5660300002)(52116002)(76176011)(186003)(86362001)(4744005)(305945005)(7736002)(6116002)(66446008)(6916009)(5640700003)(36756003)(6436002)(6486002)(102836004)(6506007)(386003)(26005)(2351001)(476003)(2501003)(2616005)(486006)(11346002)(66066001)(118296001)(25786009)(446003)(54906003)(2906002)(4326008)(6512007)(99286004)(71200400001)(8936002)(50226002)(71190400001)(316002)(14444005)(8676002)(478600001)(256004)(53936002)(3846002)(81166006)(1730700003)(81156014)(66946007)(64756008)(14454004);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR12MB3112;H:BYAPR12MB3158.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Ral7ecc9Aqqgr4xMF2c4nIM7taCsg8BhywnIhhlc+cRzuxerx4EqiNoR3YkxN+eDBJaiX9l0rPYJqmEIWprOeq4+gDYBzTCPDsHkLQVKHy8OWHASVVzu9Nbj50CypPMb94HVluteuiPzyj8CVzqSVfzmQ+IyAJNShzG2fSLqjXIZfLB+tcLjD2o6h7Q6SXjZA+YEDo/3Gq0NoleveHVZ7gj7cbxPeyBBms/7Nz1YMqiEM0W6A3DkjWrPxm9b1mYvglR6QrkJcB95iEp+O+g5+4WcDJR+7KsxrsK5/GYa8J/RL7q9FRrQZWyEauGoI1Ylexp2+3JtE5JhjjN/HQOVs9FEGAc31T0PXWKBTuIahN8b/rQWNfkRd02/M6NBehblB963Ar6GUsPKUvwN+dJkRSpth1Gs1JccSwEJhxUT8ww= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdd0c0e7-2f03-4be7-d5a8-08d724ed32ce X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Aug 2019 21:35:47.8327 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: IBY6nCsTSIMSd5u8kgyNvORpIufRkSjDakHDgRdpwuJNyITFzuKxF5e6WrTIhaqS3ykiu9N/aLBcijt/6q3jgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3112 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable From: Tom Lendacky Currently, the OVMF code relies on the hypervisor to enable the cache support on the processor in order to improve the boot speed. However, with SEV-ES, the hypervisor is not allowed to change the CR0 register to enable caching. Update the OVMF Sec support to enable caching in order to improve the boot speed. Signed-off-by: Tom Lendacky --- OvmfPkg/Sec/SecMain.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c index 3914355cd17b..2448be0cd408 100644 --- a/OvmfPkg/Sec/SecMain.c +++ b/OvmfPkg/Sec/SecMain.c @@ -739,6 +739,11 @@ SecCoreStartupWithStack ( =20 ProcessLibraryConstructorList (NULL, NULL); =20 + // + // Enable caching + // + AsmEnableCache (); + DEBUG ((EFI_D_INFO, "SecCoreStartupWithStack(0x%x, 0x%x)\n", (UINT32)(UINTN)BootFv, --=20 2.17.1