From nobody Tue Nov 26 00:23:24 2024 Delivered-To: importer@patchew.org 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+63880+1787277+3901457@groups.io; helo=web01.groups.io; 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+63880+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 1596829497519538.0230979598176; Fri, 7 Aug 2020 12:44:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id wxxPYY1788612xptszuVQ4KC; Fri, 07 Aug 2020 12:44:57 -0700 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.78]) by mx.groups.io with SMTP id smtpd.web11.4307.1596829496600690780 for ; Fri, 07 Aug 2020 12:44:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nXszT6CO26rbDvugwufLF+FitnYFFhFmUNatna3h9PWG2eIn8A8l91dynheLC8CBhL1HvEIbBAZaiBNz2vT/4yqz1lut8uz+t/+iuYnAtP+6RvwolrCjr2Izwvz8e8d3xRc9/zaM0tI0udWgDoCNmGH92xw3OowfNdgBNaApHI5h1qaPY2iZD6za+gs59m1A1XkjfgWYxQmL+sfBNXMO7JyDlflfjEjImG2enm3SkXM8nERFWLqQR/AjSONLPTY3lghfAm0B37YlR9YjIsngd/SPFO7kUItQ06FyjFPAB1SKJ9SMnS9S/V0rLJQvi+eNSLeeOdVq8Zf+1qTNXWtAig== 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=3E0ymlPSxNH6aH1t6SQyGEJdjjI6yseFWWKhpBgBa7E=; b=iVkszRdbZWAuaG+isRvh9/bagJKi9ZPIPZkpOED1VaDqInvF3dOGhFSh+2oVF1buuDfmi7UA+JwEkjXEyc1u/xoWSngC4OGXw2OOtncmi9Tx+w9QMeXiqB3woDqsVHZaJoZ1untDSx8uQN0O6HLTqGGOUM90IRl/YBvFW8a94JkThSkHIrW5dwQRoN90Wqitv//xv43Zj11fTIWIB3eecxFEe0Qji8mSBHy4KnFhtzTnAnwC+FyhOdISrM3g4CuDCR/2IGF53E6AUEaJOI54kFfjMwf3QMwfZp1BJwTQDOI6xJYybFQsmg5WLs84ZEOrMwIe3hZXREDRRtL15Z0Afw== 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 CY4PR12MB1352.namprd12.prod.outlook.com (2603:10b6:903:3a::13) by CY4PR12MB1541.namprd12.prod.outlook.com (2603:10b6:910:7::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.18; Fri, 7 Aug 2020 19:44:54 +0000 X-Received: from CY4PR12MB1352.namprd12.prod.outlook.com ([fe80::9181:78bf:bf0:702b]) by CY4PR12MB1352.namprd12.prod.outlook.com ([fe80::9181:78bf:bf0:702b%5]) with mapi id 15.20.3239.024; Fri, 7 Aug 2020 19:44:54 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , Ard Biesheuvel , Eric Dong , Jordan Justen , Laszlo Ersek , Liming Gao , Michael D Kinney , Ray Ni Subject: [edk2-devel] [PATCH v14 38/46] OvmfPkg/Sec: Enable cache early to speed up booting Date: Fri, 7 Aug 2020 14:39:23 -0500 Message-ID: <7a15fb273bb19a9cb0ddfef46aad5d91d6d84042.1596829170.git.thomas.lendacky@amd.com> In-Reply-To: References: X-ClientProxiedBy: DM5PR19CA0018.namprd19.prod.outlook.com (2603:10b6:3:151::28) To CY4PR12MB1352.namprd12.prod.outlook.com (2603:10b6:903:3a::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from tlendack-t1.amd.com (165.204.77.1) by DM5PR19CA0018.namprd19.prod.outlook.com (2603:10b6:3:151::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.18 via Frontend Transport; Fri, 7 Aug 2020 19:44:53 +0000 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0af24061-6dda-4edc-b1c3-08d83b0a5b74 X-MS-TrafficTypeDiagnostic: CY4PR12MB1541: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: IzjxNYcC/4ZHCZzz5EkeXmDGGXwnc/bwl/Xk+6ym3KeYZvq8T9XVaAJgFRj/i6x1nXC8UWq794ix2eD0J00yr08eATHFq17YN1eSUPv1DZwAeTX1GIX579TIjGSPHtjKeGRf3LJRf6hmM8q3InnL7gL+ET6bFwc+UnvSUPlU4wOgj2XEtewSMqNF9IUJ2zwXWivdukpobGL/Tbcb9fajfP/nSbWBFA9N12pZ7q33XLwlmQB7UTY8v0dJQYZMHXD4qjFiF98kkYxC0kPr8ObjWPOKzPPW/mr4TKmmzQSnpPCDmunZ4ryjt2RN/nRxVAJlpUcosB4ZoeUfe1hFSZw89B9FkFZ8ck5SoAp0GLCAG8JT1QP6/OXg8kFCdLfLg4/h4xWs3vpkKQki3EFvhtCPqyS2thu4TP2yoW+/OvRQSeUXwxlG7LwB8VGZtFoG+kGHyo7sQfJxANnxXGJaqDM2Gg== X-MS-Exchange-AntiSpam-MessageData: yyzXl5qijsnsOAH0oiTFNwCRM1Tj3mxqPR8ykVad/CX4R/qmSHisjzUia4k5R6avyQKOyWHZ9uT5acY5FhzoDSjvcmcxteBT9Zi77SSrgW4pPFUfx2xcn8l+zyqVCwH91VBq1yZjeCd/FOYA/Ok+VqjVx9rmSF/OiZFNU4Kz64OdLB9MBtyGqmPB9TJ406HGh8CufVgySE6bSkFPPgunWmWyKy9MdvmzjMIejALIWKeBimdz4p8HL/OY+ckkF32Dc3+GQyZ0wV5URP/JjDttFmEX2KRa9/yzMduxmJB8dojrLnpnYtaEqXxbcA21Q5XXWM31pO/h6Kx3rFEhe9mlv3Zsls0CunT8zcoBjvefOIS9bWWh4cJEolvoo9zd+pnwoBoyDYA1n6XYdAOD1U3Eh8I6IC93As2Hw3EPdQUgvAqqtH6WiiHrU22hEPI7BDIms+ZpeIPsEPRcjQs2L6OpgFnaAcd9OtRzlLPZskgJmtvoLbx6CwaNjYGgXunMIURvFDDPUnc0jMmmCH/vTH2Gm+OV6IpOTRnGa1siyECT6CWbypJCoAM78T5apL0LNn/jwJNQj8tC6DpE4ix0FbXJOFDrWcarvlM/Rq8sl+JLTdiLKsQp5odcDHLAinsquFiP2ia2sxoVJo728XykAItsAQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0af24061-6dda-4edc-b1c3-08d83b0a5b74 X-MS-Exchange-CrossTenant-AuthSource: CY4PR12MB1352.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2020 19:44:54.4940 (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: R/36PbQdDbnCQT7UhnmG4P6R99rjC5JfpZ7GAJkNpRIpY8WprNmNEZULVX6uQYGNFPSNnH4U7uv2FgMLNlTvdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1541 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: KXTaVQtrBDCj9D5RRL1Im1xIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1596829497; bh=C8YaaFjJZZaXVDL1p9c7GNFV2Y2SV249NNzODoANIb4=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=joBD1KXpCzjqWYb/rTxW/Kuv4gCiElHbCAHGDHRbLdP/9ojdaNNRUJXyCG82FB9QYuH tnBT+uCX98Ce1F3x6I62wg9DOrubwJHCYEl8xMo3vI6aRp1I0jI4fjLfxrY9qnKKNEsJT eaMrTXmSc5MeQOUA8BPjxTx6n7VHcOzRbwc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Tom Lendacky 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 c2a35463dce4..271a06348ed8 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 ((DEBUG_INFO, --=20 2.27.0 -=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 (#63880): https://edk2.groups.io/g/devel/message/63880 Mute This Topic: https://groups.io/mt/76056590/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-