From nobody Fri Dec 19 19:19:18 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57867+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1587577402188816.7397962645973; Wed, 22 Apr 2020 10:43:22 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id oj8bYY1788612xM6jXBS6yHM; Wed, 22 Apr 2020 10:43:21 -0700 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web12.504.1587577397852627360 for ; Wed, 22 Apr 2020 10:43:21 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VbfMXq6xM/wfD/FwtcqxxCH+6f8u/7FeTSvQagQF2ZQMpAt+hQQ/ha1FZnZWfXAxx5wiB1nQdrjDs659+L+ekjrILNOFyHvC8dqnftuoxeOd1wRDHrDJP6vuYflFKbGug9vhUGTg7bq0Yg6R1oMUU/KcTMCbS/5sGoEeKouNzg5BBLMKkjr2/T5sY+MkkAf/7RpfpmGFg4RcFZNKDew5ziCotjLC1ravbvhBEuOGcvo/CVla/KEJgdoBvrR6Qprp4YlYwOpWYOTNCtZ9D056adyMv8eIycXkb0CYUNbbMKvBACrr6F74kH7xf7fGRSULIRwChnRutNPDuwSLxdgVmA== 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=0/TZP6+C0EcNKhv2bEIyP+wC/Offi74IWbzl7HzJ1T4=; b=bWog36piPNU0MzH5bwLF0DPYZwm68Z65SmdNtSxnTP+3gGtvYCjRs82SMGULJKrXL4+ohVdCt2oaFlmmdDyue++4c9jH9Hd4qNl68l7c34/8cVfOCN41JUbSLMx7NooIvObExLBZof39FNITVfZ277P1pZzthNOMLwuCy9khVAC3y3kU6yTbxHL46jE3LQCMJiJw50AEH4bCfGsVCGvn+Jlnu7weFnHNOVttGH8uK+SzZDbMdIIW7hY565/jFA/9Jqa9/QXtiyAZi7D/B3zbei05rQHdU3WyNlt0oTHZh8hmiQYncT5hlFI/iAxxUuMb56lO3MiW36wfb6goQ7b4dA== 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 X-Received: from DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:15e::26) by DM6PR12MB3673.namprd12.prod.outlook.com (2603:10b6:5:1c5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Wed, 22 Apr 2020 17:43:18 +0000 X-Received: from DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::9ae:cb95:c925:d5bf]) by DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::9ae:cb95:c925:d5bf%4]) with mapi id 15.20.2921.030; Wed, 22 Apr 2020 17:43:18 +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 , Brijesh Singh Subject: [edk2-devel] [PATCH v7 36/43] OvmfPkg/Sec: Enable cache early to speed up booting Date: Wed, 22 Apr 2020 12:41:51 -0500 Message-Id: In-Reply-To: References: X-ClientProxiedBy: DM5PR04CA0060.namprd04.prod.outlook.com (2603:10b6:3:ef::22) To DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:15e::26) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from tlendack-t1.amd.com (165.204.77.1) by DM5PR04CA0060.namprd04.prod.outlook.com (2603:10b6:3:ef::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Wed, 22 Apr 2020 17:42:51 +0000 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e302a87b-dd7c-4e2c-42f4-08d7e6e49486 X-MS-TrafficTypeDiagnostic: DM6PR12MB3673:|DM6PR12MB3673: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+57867+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: B6TJa1mqIIEHZLYEeWlAU8OL1vrb/qcAfIjxtg/WpJcgjPu5w8fjxEIgI+uwLOTESY3AqbrvjoUYbwHCwPHDIIAU0QMJqCaSQjylR7cU+oW9VPY4qgNcd3e6o8xr0YjELLFoS0InODuHFHBK4gSL6Ok1CUCOPo84uj37W12PfRww8beVfjikEI12Yv4SJfyn7rWIZ/jlr9++jPd27dYCKarGazRb6iR6hGDbrSOC6Is1nOGHmtF0ysYJXbUtnFUFFGz3ptm5dIaInJwhRe557/4exMXMGT5c79+DwxamhfDfZ/RX0IBdZhqFoonrJ/Gy0Vv5yrtjlU7ddhzPuE9DFPbhJ+ijgeCNpbBbgs7StW+kaH/uf0RlAOw9G7kySF3PMa8OcGUABt/vELdDs0Jb02JZucD7lNn52C171Am9Ia9qpEIkezXe/fhHZn8hQ/v/o2bGbBVnPvBs5p32rOwYWpn7Vm/OdN8p6kcVUyFTJJyoN4pH7DmcBh9rXqHOuKx2dAoECHjYHsqmr9UHs2gq/dzMLfYQUUlmxjbqd3L3vNsFrDWBZk5zSqdiwqTvVHgeUBqZV6LjKaa66fRBi/V7rQ== X-MS-Exchange-AntiSpam-MessageData: Oj1zv0IPTUrVVRw/PT5Qf/IKfHpp8+Phr2jUlTTUQSAv0db6ArQ5mSWkfumM+Z4mqoZ98nEMBMiw/C5cArZixNfuQTei0DGV+tf/CU37LS5JlxcHjqYZq70wetoSWrPgcJdA8ay/21j67BHIEdk8fQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e302a87b-dd7c-4e2c-42f4-08d7e6e49486 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2020 17:42:51.6542 (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: FnC89+s/UX7odF6bYV33wgIikwc2z7kR9TbwYKLYXgTcmjpYV/3UgLmm//OwvNiX/uxG2eUftp2C6z+dB36qtw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3673 Precedence: Bulk List-Unsubscribe: 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,thomas.lendacky@amd.com X-Gm-Message-State: jIilZSp0tuTJX37DwnXfKFRYx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1587577401; bh=edrU4zl/oVMFU3Kj+F1ptGkyVfgq0knfCpKMhVNY9nI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=JKJPPSbtP7yLOLZfeH7Uly+xqq/UB124FnyhLwcoj+BsS1B5ZPYtSCQQ6jmZWEFcbAi gb2dXOeYOoYdCAc1Ns6m2CdBKq+zm2Sp0PTImBFoXXHqCZP3XGv/2f9hfe7r4tx39gP16 66MlA/nTRA9DM0l5YQ+2OdIX80mjiJiken0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2198 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 when running as an SEV-ES guest. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Reviewed-by: Laszlo Ersek Signed-off-by: Tom Lendacky --- OvmfPkg/Sec/SecMain.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c index 4acfce8086e7..e0c81067e8c7 100644 --- a/OvmfPkg/Sec/SecMain.c +++ b/OvmfPkg/Sec/SecMain.c @@ -905,6 +905,13 @@ SecCoreStartupWithStack ( // For non SEV-ES guests, just load the IDTR. // AsmWriteIdtr (&IdtDescriptor); + } else { + // + // Under SEV-ES, the hypervisor can't modify CR0 and so can't enable + // caching in order to speed up the boot. Enable caching early for + // an SEV-ES guest. + // + AsmEnableCache (); } =20 DEBUG ((EFI_D_INFO, --=20 2.17.1 -=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 (#57867): https://edk2.groups.io/g/devel/message/57867 Mute This Topic: https://groups.io/mt/73201946/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-