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 [40.107.220.66]) by mx.groups.io with SMTP id smtpd.web09.446.1609968153990841320 for ; Wed, 06 Jan 2021 13:22:34 -0800 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=vF8WPXTh; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.220.66, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oYABHiCTZMooVUiCNQ9YESC4gJmOMBsO0fDls3M3BqNdBR3bs83+GXTX/kHsUoDwLNno1mD0vrMGLS4Q9oxUf+NM87eN2K4zHJH28KFph0MzkR8+nfCEksH9Rr0tlJB+sf+4zZYOT+bJfUBtcKq6HoFF1SJpy0e328Z9ZUL9MOGKmuA7VIgAWV2g7bSwWc673NvYmK4PGJf2GEOCDLlx4Ee9qQ0ZV3QdCX/8LHsNyKBGfqXwcmyb6rvnfD2uU1S7dh6/eFMJpPcrJlzSLqW1vONTjoiVVZJEs7LhAGNHPTtf787jWTKBYkA8Ydkw8rePFfmpysCBfPkM6/SbEjvKNw== 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=HGEREPRNXQk83pP8EiRBPA2oNXtsGdt9PxMVo5ZUkg0=; b=d8McZGFSwjEky7N5kAHlJlpxS1Lg4oB6RVQXHDzPRJzV3XqZLDqRCG+htGm7DRjBA13yy0Z6RKR5E3v8FTyFwDSx2/SXsoot80+lDL/bWardRfMdRvlpeltoUsVK+85vsjWtQIxzTdgqzNfGSLLUqtO5XsCZ4JKm5ct6Bfo+rO6aBn9b11u2hj2rUqDruaHM0aE1FBfJYpSvcAGP7MD3bPkgKfDDpwlO76RDvzoumM6+W3akBEP3Mi7f9Jb/OXV3cyOwxn9zPJwi7Vv8rXqWKOoeG98oEehB5pC7zILGCH7uvxX6qEbJxvbde7ipfctB3OTfTd3jpcQKX30n96fNjA== 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=HGEREPRNXQk83pP8EiRBPA2oNXtsGdt9PxMVo5ZUkg0=; b=vF8WPXThkeaQCjFMk4niWzUHWZyLcwM+RbezxgovGe1RmbPjIBJY0c6oSWVYdn0v2bzYa6tAYRMLwhJtZoxsw6Alkt5Tq4QSq61cFzO11lVekJ0QKsD5hXiGS57t9IGVHAf9ukH1S/0k3KvL/vxJSAQLAts64RVCknGbUX7HrF0= 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 DM6PR12MB3578.namprd12.prod.outlook.com (2603:10b6:5:3c::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.24; Wed, 6 Jan 2021 21:22:31 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::d95e:b9d:1d6a:e845]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::d95e:b9d:1d6a:e845%12]) with mapi id 15.20.3721.024; Wed, 6 Jan 2021 21:22:31 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , James Bottomley , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v2 02/15] OvmfPkg/Sec: Move SEV-ES SEC workarea definition to common header file Date: Wed, 6 Jan 2021 15:21:28 -0600 Message-ID: X-Mailer: git-send-email 2.30.0 In-Reply-To: References: X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SA0PR11CA0037.namprd11.prod.outlook.com (2603:10b6:806:d0::12) 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 SA0PR11CA0037.namprd11.prod.outlook.com (2603:10b6:806:d0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Wed, 6 Jan 2021 21:22:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fc5440c7-90d3-4d15-2514-08d8b2892d6f X-MS-TrafficTypeDiagnostic: DM6PR12MB3578: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Zu1a03u+knwUWEyTJW1AS0MUN6aqCEN0lFLR5Bm27jAsI+XCMKZtji5rQUZIPsweUdxMpp6GVlwZo3NSoLqGa6mQTAZfDRySbNCKWLJyIeBNXHcMSCU7aUwi7xlLgBWnOSjqG+1Jkpxem7wwMbCpQw59CvzE/vW/5Mxo0fPR6YuZINGxQ2sjVvs8kZP3fLW+HwCLgywVgnZ2R/K60veXvBF7T0ze1lPHIiFaAGncNHAg2T/aY+DxlZWjDEEH+/cXqs62Izk+ay10ywWbRquw2uHY5tLB62ffK8EVnh+S+XuVuCFbTc9kUQLRKvcFNob3utva1+kS26lruCiEv36ZWhUFAmhbl/1pchVYsQn/Rjs4soGaSXBBx1kyA9ridnec56Vm5etLcDOK2mO33EEfqiLIs914ySAgIRmD89BtKqWsapMGK0xVmLR2Y7NwRc41wXpd6D4lpBFJ34hDa7Rccg== 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;SFS:(4636009)(39860400002)(396003)(366004)(136003)(346002)(376002)(4326008)(36756003)(956004)(16526019)(83380400001)(186003)(66556008)(6486002)(66476007)(2616005)(7696005)(316002)(52116002)(2906002)(26005)(54906003)(66946007)(8676002)(86362001)(966005)(5660300002)(6916009)(8936002)(19627235002)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?1S9rT0HlzG8rm0+hUQCgUPW9d8plfgQRWsw/QZQ2YQ85AZ2Qde/hVfJrHWdu?= =?us-ascii?Q?bYzrv+2vEYyfrNDlaCpb2gmpWFbqviYo5Cuq6P9Depjwgqs8auzo3C5Y6Q2r?= =?us-ascii?Q?UR/lePBBnVW9fKxF2cDFVA6G+ClPZldZ1g4gn6BNcSZjrQKifVVCM4+1C+xO?= =?us-ascii?Q?J4pQs9OXFDyQbDlyvZ+iDr8L5zlF5Sw8/ZSQujPorMCbd+/CJKU5kElOimvt?= =?us-ascii?Q?aQODR3r5TTuun4OPaBfXTgrP/50in6wvR2Ct2XmZ2KdlwzpHI0f8rJgDDxNh?= =?us-ascii?Q?BJNm4yRdt1qraigesa876SphWmg98tjrCuv0lPbCYGLAgHZPs19MBYtWIWL1?= =?us-ascii?Q?jw9F8pctoWIfWbYXnTkIYLnuJp1jiYozC4avCCDjQ/RJVJR70FZtE3yMAocu?= =?us-ascii?Q?6D/D6KioeJ0euNpmr+Yq+bNCTqxAdy0QBXDTVTXBdbO8jDMnGaOeZRyzeSFe?= =?us-ascii?Q?7Ch3yNtnkmM86mti2d46BpqYuRbZyupzUJi1BaJHeg5a2hpO8DrR9qfNtR5G?= =?us-ascii?Q?DugpwtXY77pgB3tAtCbInnZm3JbKh5Du0PaI9gSXCSpy8vsDbB1kixjDFyQY?= =?us-ascii?Q?mmYbgSkhWpDS9mJ2GNH+Sfr1sDEcOXP9z56tDJASUM8UY9H9gi/dWK80leoy?= =?us-ascii?Q?2/zkHYo6BqYNkwhkbGQ28SPZtMURMz8VIez1GvHNzOfoiL0SUga9YuKweiR3?= =?us-ascii?Q?D6dshYrhOgi/q+7xcQKv/D9D5jRDq9Yq3e+esptKy8T6ATRKHg6Cj1xgcbQe?= =?us-ascii?Q?knSVOIDfhU0BIXEDtDjCtF5mEpbIJI1Q4kACvKI72829MgZGjVyT/n+NvWg+?= =?us-ascii?Q?nik8i8mts2q27JErRkYDNxVOGSffN1HVlRyxviokBy4K4IO/Qv/rctaA8wA9?= =?us-ascii?Q?kLeEq5V/walrEnjWAAR0l00Uik0q0v/dD7vklDvF3e2lzFVnC6BrXO2AHPbN?= =?us-ascii?Q?3/L2Zo4XPHpY0FGCW5z1YnK6xKjeOqodtD2m/wd+00BAjn1ZoWnHHKAjwxvW?= =?us-ascii?Q?9ksg?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2021 21:22:31.4527 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-Network-Message-Id: fc5440c7-90d3-4d15-2514-08d8b2892d6f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IcikafUAEX9QN/wKcXnIyf6c90LwastmvWvg1yfDMt9qiJT2qlc/GUh+tKmyogwGWwK2Lf7kkhaZkhQjc1DJ9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3578 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable From: Tom Lendacky BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3108 In order to allow for the SEV-ES workarea to be used for other purposes and by other files, move the definition into the BaseMemEncryptSevLib header file, MemEncryptSevLib.h. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Brijesh Singh Reviewed-by: Laszlo Ersek Signed-off-by: Tom Lendacky --- OvmfPkg/Include/Library/MemEncryptSevLib.h | 16 +++++++++++++++- OvmfPkg/Sec/SecMain.c | 6 ++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/Include/Library/MemEncryptSevLib.h b/OvmfPkg/Include/L= ibrary/MemEncryptSevLib.h index fc70b0114354..a6d82dac7fac 100644 --- a/OvmfPkg/Include/Library/MemEncryptSevLib.h +++ b/OvmfPkg/Include/Library/MemEncryptSevLib.h @@ -2,7 +2,7 @@ =20 Define Secure Encrypted Virtualization (SEV) base library helper functio= n =20 - Copyright (c) 2017, AMD Incorporated. All rights reserved.
+ Copyright (c) 2017 - 2020, AMD Incorporated. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -13,6 +13,20 @@ =20 #include =20 +// +// Internal structure for holding SEV-ES information needed during SEC pha= se +// and valid only during SEC phase and early PEI during platform +// initialization. +// +// This structure is also used by assembler files: +// OvmfPkg/ResetVector/ResetVector.nasmb +// OvmfPkg/ResetVector/Ia32/PageTables64.asm +// any changes must stay in sync with its usage. +// +typedef struct _SEC_SEV_ES_WORK_AREA { + UINT8 SevEsEnabled; +} SEC_SEV_ES_WORK_AREA; + /** Returns a boolean to indicate whether SEV-ES is enabled. =20 diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c index 63aca7020727..9db67e17b2aa 100644 --- a/OvmfPkg/Sec/SecMain.c +++ b/OvmfPkg/Sec/SecMain.c @@ -3,6 +3,7 @@ =20 Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2020, Advanced Micro Devices, Inc. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -25,6 +26,7 @@ #include #include #include +#include #include #include =20 @@ -37,10 +39,6 @@ typedef struct _SEC_IDT_TABLE { IA32_IDT_GATE_DESCRIPTOR IdtTable[SEC_IDT_ENTRY_COUNT]; } SEC_IDT_TABLE; =20 -typedef struct _SEC_SEV_ES_WORK_AREA { - UINT8 SevEsEnabled; -} SEC_SEV_ES_WORK_AREA; - VOID EFIAPI SecStartupPhase2 ( --=20 2.30.0