From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (NAM04-BN8-obe.outbound.protection.outlook.com [40.107.100.50]) by mx.groups.io with SMTP id smtpd.web10.1119.1610045382021677844 for ; Thu, 07 Jan 2021 10:49:42 -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=ZK422zBw; 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.100.50, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O1ydxNw6q6oUz0PQ6jWynBPos2100spusw37Lho7ah1DrO2gKh67rvy40fD6aExstQFkLMrKyhvs455NNQXRvbO1xJ9+/Z0NvkNJmi8Gfvyh6U8eYXKp4ntJHYJq2ByQZkjvo9mSwlu3SuktfRFGUI+KqYptYsm56Cu1BiBuDN+CbUqTmo1YHNfSYPzNpAsnX3Phq/+gEsGmSzpTaEgXtEYvFR0FDZkAk7UgPdSpsbsuCCn9uf8IRx9B0Nns6DB9eZZGGTRMOdVDcW/ulNUodEYEb0xrS3H5AVfZ+gCzPsQuf/8KOTXg331s/1MD6PJMdC6QDo51r3U6GIUjpTWN1A== 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=Vm1O7J18eNIYhG3/6Xtl1fQK/H2yZVNUukG3+OlOsMebvqZzNDTAxlveHLev6BH3S2/zphiIrIMC0yzJfi/3TF5P6igNmgsolXSQSHwgVU6+V868FmBxVQCV+fSK6hHYtav2LzNtO5z2u1Q5zlEv6+gVS6vvP9ZkMMvLTD17kREy+PQtK2a4k0M+n00x6KzkIPlvpmXJVk58JcV6OYzlva/+PcsjIyzhLYj/HsiRz6W9E8OXcuqzyXiF5RtMcbBxvUupOEboShzE/0NfYItHUYe1vVWIqkBp7g4TIX8aemvTbkT8TnadLdV2MYUcM5uTZLk8QAPILMkys0dskN8vuQ== 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=ZK422zBwQszreGsGplMnG/Jgbg6qJjYCPcWfw5tHUMwC+cXChQLD71bprLeFaKRXwH/QzwfcxXCfgH1jPI//eyUAbr8CljfEOC+6n6vcXbwBmFd4DMcqiM9Ea+ukk7uTDMdC68DnvFIMY7d2v3GLLdqU7qA8Qf0IDYsv/Uz56o0= 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 DM5PR1201MB0121.namprd12.prod.outlook.com (2603:10b6:4:56::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.23; Thu, 7 Jan 2021 18:49:39 +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; Thu, 7 Jan 2021 18:49:39 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , James Bottomley , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v3 02/15] OvmfPkg/Sec: Move SEV-ES SEC workarea definition to common header file Date: Thu, 7 Jan 2021 12:48:12 -0600 Message-ID: <07d66f3384bd54da97d540e89b9f3473a6d17231.1610045305.git.thomas.lendacky@amd.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: References: X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN6PR16CA0038.namprd16.prod.outlook.com (2603:10b6:805:ca::15) 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 SN6PR16CA0038.namprd16.prod.outlook.com (2603:10b6:805:ca::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Thu, 7 Jan 2021 18:49:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fb4dca70-5685-40fd-5488-08d8b33cfcf0 X-MS-TrafficTypeDiagnostic: DM5PR1201MB0121: 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: knjkx5oxS0LLqoWE4ylJ/ayyCf9AZizFuYx5w35rVVb//ydyNJJLcR0SzYegZtWZX47m/kLXaoUS9QBr6jbqxDVd5NKH4AKbRDw04SJ0JbGOMxLjcLqu/we1FyMygZviz3sk6zvQhzfzw5mm5hQiclOvmkhnTGBhMZ0HbeZtEVHnCbNsLJsLyRwDH9DQTMTwTfh2JXM8oIQcjswddsdhRX8vN151l2cimjn/kWwJiL1uTcEzE5X6NKrDkIZ1L29Vl9r3aR/PFTtF6GE3DfaPjG6e+hKATwYQJGxliVQsCGHylrQV/eCj2nWC7CeBgM4qAEyFUSv6VlV8O6hQZ+s5OKYAJtu9xmB/GtCc8cY4tAQOKI2xqa07WTbV3o3AH7qy7R4UHfjqQVWoJP5JuHpv2FBNdk/0PjzazjTGpr7k04qhbRiCXdR4Ouri5PD8RkQ9MDwjTmBeksvE/7rVNgAUNg== 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)(136003)(366004)(346002)(376002)(396003)(54906003)(36756003)(316002)(52116002)(16526019)(186003)(6666004)(7696005)(4326008)(83380400001)(66556008)(66946007)(6916009)(956004)(2906002)(8936002)(5660300002)(6486002)(66476007)(8676002)(86362001)(478600001)(966005)(2616005)(26005)(19627235002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?q+317ZiEdmxwdjsSGzeqkMqcqjoETXl6hJ7A5UiHC4WSYLHqjD3OsAor4XZd?= =?us-ascii?Q?MNISUXqaCUMwnBT6NS3OfiqwrtwqjXIl1lARFyhMcpGwC0TI/djWNWQ+yRfE?= =?us-ascii?Q?KKSvORNd1kn+5FKRAQ9h5c79zzsnr+aDUc8bbXQsm3A5Qrs/fq+xU2HLgB48?= =?us-ascii?Q?tSGEY5USGi4c0819l1iNbGZR/igz5gm+9dDU6srDznDF9i9NWRbyAB9m241m?= =?us-ascii?Q?3MJenAA96/nKtYL/Vrv9hJ5MRJxD7zH0jwGHVaFCWS7BRIIcSOaTqTT0sAAG?= =?us-ascii?Q?ppEziKVdc0/5K4I1SFZRWztx15Dpxg6LWUYQaTi0Ov05Use8eD1xhycZ+7YW?= =?us-ascii?Q?KxsK0uKAhRFGDX74L0OQWxl0qmYu0mu9AskDSsMm5Ul9uJmPpmvCNP14lqhW?= =?us-ascii?Q?NU3vKTacCxdIqjTczTkeon2fQ5FVVLZMZfaNpg0sCULRKxxLZJaqkfWUt0qH?= =?us-ascii?Q?KoSyTaj5iUxlBBR+RYqYb1FnoeCD8LkBSCLX7oZRuGWwNvsXp9noJ7iQwk4M?= =?us-ascii?Q?jMPF50tZlfbDChR38rs/ow+HzczdVLU6t7IJmPXnEI/GgR1cu1F4o2wMSddM?= =?us-ascii?Q?/EGmC8oAJCOT+0JZNqyPQ0FEqSITk7n93KjXggOAJ3YHvOzzO6bxssP0nYbU?= =?us-ascii?Q?aiJ30aQFg6zXpoj0FRBJtoF103ACbnFu8zPdIAoGguN99zCL/hx7JplL5nKR?= =?us-ascii?Q?qYxcSQKYZgOWQ471NzJLlYuOA2RJ8v4AtPh+pfv5Jvs6mcGiRFqEYmlpHR2+?= =?us-ascii?Q?LS9qastk7Hp27QwrfcxUW6W8E1t0irgXuLEacM3P7rNT9zdv1ROy2x6MrgjO?= =?us-ascii?Q?TKidRKzres6oMHj0VwP6mhOYKt8q6laM45lvaucLR78kvwCyN5E52fvRXG6u?= =?us-ascii?Q?RotggIHDKho4T9hmBh6VYqndI5ac7Wpf2Cgo5XdoLC5pOPyygTgSaPgBu+VV?= =?us-ascii?Q?CUUSmYlUOwXr21qwx2iVxxcPEFaIEsw1MGQltUUKJ8Uh+xZthWQiurU0gHky?= =?us-ascii?Q?O4kq?= 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: 07 Jan 2021 18:49:39.5023 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-Network-Message-Id: fb4dca70-5685-40fd-5488-08d8b33cfcf0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xippP+l5B5rfKpVRw6Na7uMpr2nInqA/V/wWq6HcYBFqBGlhn7W916Kpuf22RVvCw86ErGLEVCTVStTvi45ZUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0121 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