From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web11.698.1583190508386134261 for ; Mon, 02 Mar 2020 15:08:29 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=ZH0toAhk; spf=none, err=SPF record not found (domain: amd.com, ip: , mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cDhkC8tQpxXdpBCOjRS7mKT5HNA6wfmFir/keRPiTOcVo1ammQuPNPheqYO93sPz9vXwyi3YUVX9TzI4zdk0mefFDfqlF1GYKKF887tTm94F83bHu+Dr/QHHCLBENmXICVsHeEgN9kJlauiC4jIs1HKiqWYvlMm9xlrvEihjqjsBvF8/H033UL7BpsaJqFqGk6gPGOvZfpLAti9hU+OtdQmMmBt9slLCydA/ZwV9Mk0wHMAqdKdyVo7FOErzM+B4hrJ10gKfFgVbiIHL/kZXV8u1SZ2iUazrPAvATIGOgmhTOCJr3xhDVc7C8UOYjcmoAxTnNcH1YUWq/8DgQA6gMg== 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=/Q/IARb640jluCh3Y7hJ4n6OLb97VyWMlzE/OlHhlQU=; b=MTuPmGzZjLR026o+mkSZSlTPwtva8qOE2CZwF753NZ4AofaU4BgMWu3NCNI5TM6X4ErVCaXStsfWNLM/MxSRQvsQANuZWR0Z8aC6sSnqABrgRHtC007wEZ461w3JBuo/QkVsUQPhMYFSOA6qwLoJDHhl2pIj0wuwdFMJiam1a6A0S9cb7EdvUSin657QCuFtXH0gcKkaPJ4/5FJ6Aef3RM0REF6YfbeGV9Si8ngGPd28uIupNhCuXsLaUdN/dUF1rUJA/Z6XTpuQmvxCy/6H61/Rp6slypbopxLSM+ODoppft/0/f6uiEeGWQnKbYVNmYhbEWfOxOd2OCBaJpU7IJA== 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=/Q/IARb640jluCh3Y7hJ4n6OLb97VyWMlzE/OlHhlQU=; b=ZH0toAhkb1MQbI4PVvf+7gSLKncWKCPukTmAg/b6FuXVBHxNuKxi5r1LP9C7J5+L2W76MvuHLIBa6ARXa652LR+krEfSVFzE1lbHAaf+MReTr34fliG/eE1pT27EdSvJ1OVRrceZbjRv/FjzyCZTm3jLtHnuGZMXkQdL6D8Tx2U= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:15e::26) by DM6PR12MB4201.namprd12.prod.outlook.com (2603:10b6:5:216::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Mon, 2 Mar 2020 23:08:27 +0000 Received: from DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::f0f9:a88f:f840:2733]) by DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::f0f9:a88f:f840:2733%7]) with mapi id 15.20.2772.019; Mon, 2 Mar 2020 23:08:27 +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: [PATCH v5 32/42] OvmfPkg: Reserve a page in memory for the SEV-ES usage Date: Mon, 2 Mar 2020 17:07:03 -0600 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: DM5PR2001CA0013.namprd20.prod.outlook.com (2603:10b6:4:16::23) To DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:15e::26) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from tlendack-t1.amd.com (165.204.77.1) by DM5PR2001CA0013.namprd20.prod.outlook.com (2603:10b6:4:16::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.16 via Frontend Transport; Mon, 2 Mar 2020 23:07:58 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d560f523-f34b-48ae-9a00-08d7befe8c91 X-MS-TrafficTypeDiagnostic: DM6PR12MB4201:|DM6PR12MB4201: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 033054F29A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(199004)(189003)(66946007)(8936002)(54906003)(316002)(81156014)(81166006)(19627235002)(6486002)(6916009)(6666004)(66556008)(8676002)(4326008)(66476007)(52116002)(7696005)(2616005)(5660300002)(2906002)(36756003)(186003)(966005)(86362001)(478600001)(16526019)(26005)(956004);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB4201;H:DM6PR12MB3163.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JNfifCpozD00TwbPwqWsHhU1Jr7ik5wzFxIm6wOsJZ169CpfuyARPxwssI1kC0lQav7zvWs4aJ+T/dAa9AhdNUERe9RJw1h/t7VaLCe7DBQQqo0A0h4yLhL9LNAi4xuXQWZYnEZt4zZsqb0Zrr6ocO86HntVIuMB8CpzCpp1925y7X2DyhyjzPJsA2RQTQ9sM3IkvPRpmhwWU7Aej0Jj5WCziqIHM3CDgv0QQOqcCOurbYuGoPQuO3bcKXHv3uP00TOoATWPI/Arq2D7tuDLj8i/5q0seqnfzIMlnisBkOZvyuW2Qtv7vUz6r8AXQ1SPO4cI1qpqjKNsWPvubmck97tfwu2UIn+OyGTZEZu2ZSKHmlCWQMklrlQYzp7ZHEfzbxpoJxv2+zbryONJP1z9aOqpde9HfMecwn7agwAUD2yDWvP/96gOOVpLphzDKCUlRpT6I/UIiZ+JIa5wa51SD0esYQ7U0T2m5ax8VU2knPvY4uNNkHhcb/+4bmi0BDEsZn+A14HNlxS+17QWzpGAVg== X-MS-Exchange-AntiSpam-MessageData: 4rQn/53k08t21gHc/Fq2BpqWUE3l88TcDrQE0kUteanrhrDE180roI9T4gJ7rVBh/6O/Ln5RS9iyZ+t24Vxra5hPkxyk+Jofs3LQzzBMgrO+sbt2IqvlI0uY0HgEW3kJLOB7Z0R9Zz0F2nBo3P94nQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d560f523-f34b-48ae-9a00-08d7befe8c91 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2020 23:07:58.7366 (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: HOQvxd7b+wYO+Xt398I1T7ZEzXh6tmxhMfb8HRknvTItRAN2X0VCTnC6CcGkvsInfOBhCYRZMPukN1ptu4iT8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4201 Content-Type: text/plain BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Reserve a fixed area of memory for SEV-ES use and set a fixed PCD, PcdSevEsWorkAreaBase, to this value. This area will be used by SEV-ES support for two purposes: 1. Communicating the SEV-ES status during BSP boot to SEC: Using a byte of memory from the page, the BSP reset vector code can communicate the SEV-ES status to SEC for use before exception handling can be enabled in SEC. After SEC, this field is no longer valid and the standard way of determine if SEV-ES is active should be used. 2. Establishing an area of memory for AP boot support: A hypervisor is not allowed to update an SEV-ES guest's register state, so when booting an SEV-ES guest AP, the hypervisor is not allowed to set the RIP to the guest requested value. Instead an SEV-ES AP must be re-directed from within the guest to the actual requested staring location as specified in the INIT-SIPI-SIPI sequence. Use this memory for reset vector code that can be programmed to have the AP jump to the desired RIP location after starting the AP. This is required for only the very first AP reset. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Reviewed-by: Laszlo Ersek Signed-off-by: Tom Lendacky --- OvmfPkg/OvmfPkgX64.fdf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 39291f413f6d..0fc64075d048 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -82,6 +82,9 @@ [FD.MEMFD] 0x009000|0x002000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbSize +0x00B000|0x001000 +gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase|gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaSize + 0x010000|0x010000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize -- 2.17.1