From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.54]) by mx.groups.io with SMTP id smtpd.web12.2788.1608065505100001666 for ; Tue, 15 Dec 2020 12:51:45 -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=yZOQIvEV; 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.237.54, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U+T6CNjxr+6e5SJ7J5jf4FOxaX3cLmNTCuhSEFiIBIZDRDb4NkS9aq1LlLajKHYO4i1U+1Tm94lZRzkH2JIjJ2nD6DeiIqAbgxtuVkuueGqGCvWZ+GpqQwvqMDWwYmTdRbFosSy00aEvJNEoqMX1zKb69JyVh4Ev4yxD0bn8lAIlYGzllQaZiBBp30tlImMdBzKj1/kv/x/Ah+bKEgILtT3V6IGOCqW6r2dpwSvhddSyGOD1VbjhRkZOrcdQs9+CJNZ+gmCOCek1FLcjSF5JH0OlXBRmOgh5HMHPfiVZUzh/c/cDDH63Q59svPBYEc94+Ba7nk3jbI43W9BfXRWXZw== 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=DcpBXNGiPRcrpvYVcooYfi6LgsRHex4vK40Y8s11Xsw=; b=ktrtMFWqkOeDQ+K0/38qk5ux2VowV6R7YuBNhjGY6ur4bX00Ry7YggVMgCiM3hCTkK7wb8RtdsaBDek8CT/Ir7p6sJsADAJhXuglvqdhV10WIBtRRmD0pwAFnpXkctmEfDOO/a6dlyNqo405TH4KruSYwx8eolwO47QMYp9mHiF+qFpyqGQCMnqVb9AZTNh3ZK0Kfi7TBwz4iBdNKRTfCfITHL6q/p3s/2fLOM/6PyGWgIsBAgDxHk7YvCXJbr+EWa+WgAv+uvo7ndeUtd/ZLMam6/XJFsQoKgGXKqQQrs9vgR5ylsO64FwASlW4vQ6AWfh/ubcWyojANTlKt/6xcg== 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=DcpBXNGiPRcrpvYVcooYfi6LgsRHex4vK40Y8s11Xsw=; b=yZOQIvEV34i9LSCOXDZ4tYq0LRGCZJBNv8AZhEzlfGUhMH/zSjfuHKTr/FzKnFXQPuwNUI8iprcr9yjLYssNIjITgL4zYv4n6A4e00bN0zuOHBU6UTn97yvfS3s24Bq77+RIF+s8YzPE0cfdiNNgrAaXuiN/FRPdslcuA43xB5I= 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 (10.168.234.7) by DM6PR12MB4155.namprd12.prod.outlook.com (10.141.8.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.15; Tue, 15 Dec 2020 20:51:42 +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.3654.025; Tue, 15 Dec 2020 20:51:42 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , James Bottomley , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH 02/12] OvmfPkg/Sec: Move SEV-ES SEC workarea definition to common header file Date: Tue, 15 Dec 2020 14:51:01 -0600 Message-ID: X-Mailer: git-send-email 2.28.0 In-Reply-To: References: X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CH2PR10CA0024.namprd10.prod.outlook.com (2603:10b6:610:4c::34) 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 CH2PR10CA0024.namprd10.prod.outlook.com (2603:10b6:610:4c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Tue, 15 Dec 2020 20:51:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ee96ea67-8fe4-4bc6-da83-08d8a13b3a40 X-MS-TrafficTypeDiagnostic: DM6PR12MB4155: 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: nCQcnoL1Bhkcp8Kv7L0db+EFfKGzKfvD8f72XA7LCMedvHk/jhUhpWLjtC2N6kTnDNUgo2zD7WqV+lozNwGuk0FsjYrjK2abIByXaeOcai/N/9vUAiI9w4Rw3zPoJDK85Oe3HXwf6V01cgMRKDJ8KDwFmtnG1gb6IPgr6b6r7nVj6DwHg6BU5XSi8we4dyrr1Xknu143jlv1TKpaacqQEvlwNBb2+BpdpfKDy5U9b1CTY/Nvl0dHUa9RvkV6SCPsDuCUO5aAsTtj34vBzeXgPIkdJm6rmYKWg9ka8G8x//+ZhIAR009lk/BwsaNuIrWri6PxntVAqC2ywLPpAcjKMquBEogc9z13UpisF7vGIjg5F/6uSs++8c6RTwpN0Sw7yYbwLpqTJxwfZG4BcRpBdrG5OyJg2G9hN8d81iNHQsF1L+twk1g88ygiRH3i0d0Oq3bw4cxTVBTpacSU4z1grg== 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)(376002)(366004)(136003)(346002)(66946007)(26005)(4326008)(19627235002)(16526019)(6916009)(8676002)(36756003)(508600001)(52116002)(6666004)(83380400001)(5660300002)(8936002)(966005)(186003)(54906003)(956004)(2616005)(66476007)(2906002)(86362001)(34490700003)(6486002)(66556008)(7696005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?v1yu7B41exwaWFkRr0PSGfoi+VvL2LMgKW4R79fPZRC4s+d7iTwWaF9G3cv0?= =?us-ascii?Q?61KK6GZP/icSH3+1wevHokieMEwTj7cGZeFYommpjiYgFK1xjis/kfZQnqnH?= =?us-ascii?Q?V1EylPmIRvXH+/Ksg3Yt4eAzfyEKcAPQ4a7krRm/1Pu7Qnx2bRX2ctn/4GOF?= =?us-ascii?Q?HJ6HhPd99LuB1Hz6DW4VMcV4/gwtO7Xqs3O2M+oEvcNLyzipm2YZBn2aPelZ?= =?us-ascii?Q?MS36o/fBrbv4LcI1pcwk7+130LOFfdm3hzy76jM6bO7QJXdDP935UmKTQyDA?= =?us-ascii?Q?zJ4zoWyIE9aCxUHrccUQHLJGrVEMz2IpPyUEZjwDX7yWok7nrZcNNo7iPR/J?= =?us-ascii?Q?w3taqyLCkVCU88x6dYSTFC6ekqpuqYCF291KK7TQQQDdDFF0u018vXmlfHEy?= =?us-ascii?Q?GmSjNf6tzTo6hsDEqe2EMr+56Qq2m3mAZqUFlvzJR/6xB6dNRo56xJYCIM/g?= =?us-ascii?Q?NA/rStd2Flg1mvT4y1lnKyosARhqjZeH9i4DKrbVFrqe23xDZzIfYPWO5v8f?= =?us-ascii?Q?0963Qvl7Ldhw4dKdDVo9AkJm10qN4E6Yr2lfUfdWtp5nzt3z0GKpHkH/mZQS?= =?us-ascii?Q?9T2yezuYtEXgPJjWUe+1VNERmPN3ljh2RldOcyMiq42uFdbXTCkDsgRaLQhy?= =?us-ascii?Q?7hEMFbgfbJ8VrJ2Cz7FMJEx5FzBVkckHSriqdSqYUo55B/hyKK0pyis/p2iI?= =?us-ascii?Q?q4zEzPr4mNUlCY/EFRWf3YQqPKDfGlkH9eh1ZAgaXeTAwxOUP+Je/hSNiEZ1?= =?us-ascii?Q?J9eZ5AhpBbLoVpPyC4qraq1Xby09CGAkDOdYgBUFvH17HQopTEXPY1QnckNT?= =?us-ascii?Q?HR4EtHEF9zSUGZzdZFyYlup40t++Fo4LeopQ8g1gsT5rfDcWWFjUtsMfiVD3?= =?us-ascii?Q?bL7EpweO8dMj+M4O8giYowyb/qfMxpFyy4OsG3t8+ReJZoSL0xjojKYDiHfU?= =?us-ascii?Q?8clmpsYx7gho/F8mGPYzEyvHdL3kG8qJG9rXpSQLha+nJ+LY11/fV+xpDGAK?= =?us-ascii?Q?/Ore?= 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: 15 Dec 2020 20:51:42.4416 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-Network-Message-Id: ee96ea67-8fe4-4bc6-da83-08d8a13b3a40 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: n185/ESYeK5ubKwgk4luNCrS82wJe5RyBfYAxGYOsZEx7h9At+TFmvVA1YH7UFUn6xggXxdJQPUH1ae3xGZSDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4155 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 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.28.0