From nobody Mon Nov 25 12:33:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+69860+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+69860+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=amd.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1609968159827622.9296784266314; Wed, 6 Jan 2021 13:22:39 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id ofr2YY1788612xubdvNJFpES; Wed, 06 Jan 2021 13:22:39 -0800 X-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 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 X-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 X-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: [edk2-devel] [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: 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) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-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-Message-Info: Zu1a03u+knwUWEyTJW1AS0MUN6aqCEN0lFLR5Bm27jAsI+XCMKZtji5rQUZIPsweUdxMpp6GVlwZo3NSoLqGa6mQTAZfDRySbNCKWLJyIeBNXHcMSCU7aUwi7xlLgBWnOSjqG+1Jkpxem7wwMbCpQw59CvzE/vW/5Mxo0fPR6YuZINGxQ2sjVvs8kZP3fLW+HwCLgywVgnZ2R/K60veXvBF7T0ze1lPHIiFaAGncNHAg2T/aY+DxlZWjDEEH+/cXqs62Izk+ay10ywWbRquw2uHY5tLB62ffK8EVnh+S+XuVuCFbTc9kUQLRKvcFNob3utva1+kS26lruCiEv36ZWhUFAmhbl/1pchVYsQn/Rjs4soGaSXBBx1kyA9ridnec56Vm5etLcDOK2mO33EEfqiLIs914ySAgIRmD89BtKqWsapMGK0xVmLR2Y7NwRc41wXpd6D4lpBFJ34hDa7Rccg== X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?1S9rT0HlzG8rm0+hUQCgUPW9d8plfgQRWsw/QZQ2YQ85AZ2Qde/hVfJrHWdu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vklDvF3e2lzFVnC6BrXO2AHPbN?= =?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 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: FYSQu5yuueOqLuYiYId4nJ5sx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1609968159; bh=A7e+XA2j5qdG36EM82GrcKmDkskTo8f/h6UHk4UT0bg=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=q1LNhUY8AZqO19rdu8hcLaT4sxn4nbAcKVSi9wv8RTxAo/fCUauCthcchM4bfqCp8L+ TFnNoCbMZDq7n9MVAB3rC2rvbfildCdjW0UokChrDMbPNpW5M5lYeK6KocHmXw87rEgR+ CDGwuYebnrbOOnUNcsuuI6HZVI5iW9AEM+s= 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=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 function =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 -=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 (#69860): https://edk2.groups.io/g/devel/message/69860 Mute This Topic: https://groups.io/mt/79485043/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-