From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (NAM04-SN1-obe.outbound.protection.outlook.com [40.107.70.76]) by mx.groups.io with SMTP id smtpd.web10.58392.1595863872067866343 for ; Mon, 27 Jul 2020 08:31:12 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=TDCBLZXG; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.70.76, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EY9wSnOZnM1gx0RdRSPUk0foa1U98+linKTSOLWeNVjetg/3EW9hUvoFFCMDchz4Fin5KvU2nUmlvYSvSlAuOJ09kgia0G8oVCXo4+BRpaJLfDZipAo8N8WeSxy3SI2cI/ddACJJcs6IgoveLTLAEbJSSihsguYM1MvUrDRi2Y0egwwTtqwbYPMdKC5jDAX+1CBbT9cj0zaleB6MBPZ7Bhf3ew9popmlMZcrM/CATeHGSQiJPAUSO8KxrpYzPdR4Ccuw2ilqTdu11nOjoBTd3b275y/TsivRPqNXPNRHKrpYBB9rC3k0Q8ySUxrk7ibTayrPotoLNLJ0HlsPIdEJHQ== 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=TjAY63iLn0C9S3DzH549SsJshW3SZE3x2r3RtZTyabw=; b=BEuT3owGiXnsVyonZOGZPaBRFyYnCZW/jf5qI7JHhmbFI+RmbtMvL0yFT12na5kzGqLBlVTVbnguiBjNQYRdmDdlWKVGwlBOpjGfDB4gg/oXcs41FP7dbDp5R5zt3F4Ov4oAKfs3nQcLGiiHvtZOq219FKjxhfMS+HHGVDxeUifF5MGTCzuQG54dJ0rkdmQtT6wmS1vc9HTaeYV9ZoHq+e51nxf7W0KdaPjTgKZi/IQJ//5MRpmmJtWFICNkJPlYLI58Ef+qN2SPIpBZZpVC65/hGSkhj/RCG//8fvv3kjh/b9SR1j6oynRXLUZTED3ama7soy5alOa5vse6w9TEgw== 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=TjAY63iLn0C9S3DzH549SsJshW3SZE3x2r3RtZTyabw=; b=TDCBLZXGxoV0GazD5ISo8S4kI0YphCATcRBpeabyGr4PIfPIeH5JRydv8XdjkYPfGOEB//+T6HsMitSjw1qPKXgwllCx0zVfFaXVT7goKT1WgfukK5ZVxBgGJPnaFWYJbDe8DZiUtgY+vvNyi1RyKepkpJPDu/usNe+CUVA1sxM= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM5PR12MB1163.namprd12.prod.outlook.com (2603:10b6:3:7a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.25; Mon, 27 Jul 2020 15:31:10 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::25ec:e6ba:197c:4eb0]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::25ec:e6ba:197c:4eb0%8]) with mapi id 15.20.3216.031; Mon, 27 Jul 2020 15:31:10 +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: [PATCH v12 34/46] OvmfPkg: Reserve a page in memory for the SEV-ES usage Date: Mon, 27 Jul 2020 10:26:15 -0500 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: X-ClientProxiedBy: SN4PR0201CA0054.namprd02.prod.outlook.com (2603:10b6:803:20::16) To DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) 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 SN4PR0201CA0054.namprd02.prod.outlook.com (2603:10b6:803:20::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.20 via Frontend Transport; Mon, 27 Jul 2020 15:31:10 +0000 X-Mailer: git-send-email 2.27.0 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 740f6af1-9730-4ef0-416c-08d8324216e2 X-MS-TrafficTypeDiagnostic: DM5PR12MB1163: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mCDyFpmlzOOLAX0Fm0mhHL8MntEUXuwzSGjLARxsnNkzoIvn+h4kiSfJPSiuhZikhf6cZpqEE34zb6iiWI7jrFhf7TI4LkNY38e3nLSXCkeD/+FL+flEA6hrxg00cy7LkSAcT7VDuFLrkbzYmMFAGYhnQWwS74QZfxwH2ZtwyvPLmCuLjSX6YRd32VnL6cfnKd/jZNh2rIsS6rdfl7YWzgvE5H/y83cYOwVeH4vXNSYC00Rhzxtjw803N/4ZFd14PTenDTaAczeFC2VFY5q/UKrO6eQpMntr/OkHEyc7OAw+eGCX76Q2QDf2WSqE6LhSJxtDI94M4FPxU2VrdK4p4EhJAZgK54hHTKUnZzgkScT2irlGU5TpicT5J7/fn2erhmNdKVNZfOFXz6CsHQktsvwQ9cO+tzYnKAJbvzC+KXn5mydK7U6GyaA/4/fp21hcVGOZ1UZ/8flGou7isDSOyQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR12MB1355.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(376002)(39860400002)(346002)(396003)(136003)(366004)(26005)(7696005)(16526019)(52116002)(186003)(66946007)(2616005)(66556008)(316002)(36756003)(956004)(19627235002)(966005)(5660300002)(66476007)(54906003)(478600001)(2906002)(4326008)(6486002)(8676002)(8936002)(6916009)(83380400001)(86362001)(136400200001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: WzJV2ZO1sm93BspP2qf08KoZaSuFI+Ob15anLs924v0+oNZTqaWvGG/B2qx7G7UTlZkvpG22FmNko6gzFr6xI74Fh4hLTpHvsEVKzu7AxvjVka07tScC6fkiUo82NiMMyP6LtLSRRhR36Rg4DGAbv5r5Wn495Y9YJ3Uf8NaKj60ioVHvOafVppbc1eqw5p3MNb1ofbs1MyHSiSqHIO7dBuQHzFo9zEx60Cpmz7rfUZN5HN6gVXT9ivXRqbC4j1e/dFK+0ujo/T1oofCZOlgR/yEoFSpJBiHDbYf1xqtJT6l7jqKnrRIndU4JVWt+jLjQVeATe+7UMuE1EnK/6t/v0Opb2e20XgDsL0cxPZLhrcv/FwR40SR+j2VHXYKHM22uuo5PQt04d9s7iXY780s07M9nifCSc8kxgK52JRbbUzjlkCD4KlSQqqcTzt+WXM6PeUyiqGdqIhOVsB5c7tT63pdTSRPyF0OgQFKdUUlQ7Ss= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 740f6af1-9730-4ef0-416c-08d8324216e2 X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2020 15:31:10.7561 (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: zD+sPHBAn9ksfXVAjCKryBFPks8U82F5as9I84Z/DwrUD5g4iuvxNJugwIN+hcoBR7LZr0z/RrJXNRBn693Y2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1163 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable From: Tom Lendacky BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2198 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 edb03b5464d4..8da59037e5f0 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -82,6 +82,9 @@ [FD.MEMFD] 0x009000|0x002000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBase|gUefiOvmfPkgTokenSpaceGuid.P= cdOvmfSecGhcbSize =20 +0x00B000|0x001000 +gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase|gUefiCpuPkgTokenSpaceGuid.P= cdSevEsWorkAreaSize + 0x010000|0x010000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpace= Guid.PcdOvmfSecPeiTempRamSize =20 --=20 2.27.0