From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.63]) by mx.groups.io with SMTP id smtpd.web10.9721.1602346041606236075 for ; Sat, 10 Oct 2020 09:07:21 -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=xEjg4Vo1; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.244.63, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hmKAkTNrfvCSqUtq+FrYwVUkrr0TRZ9xC+VnUNEG3fuUmOI6raflFpRRatKC3kYWcQ3rjIkUMDcBW8ErlO0/H62wTx5CRBrSAKbPRvflE3TCOyr+CA/2vDomFNxHAmnEdYC9jqhK0iuWF2nqRiRy/NEj5EGrqJewQXbY+IOl7OaobjKk5GHA/PoDiM/Ep7AI1FtH4tNCzQvC05uaurvuViOJKYmdpwcI8L9Lt1YmiHCrcSLpd4w3bpKZpBU4xThiOEw5PPdrhKLNt/rlo3r/jwGnpK11hzeMJ8Vatmrl0clQ+d/d0cW0QkgZKuOnrSxLU37Z1+ZnRxobxmefRqBpgw== 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=AodXxGRDBL4h4qiCH1gxJTvC9EAaSLT3lRqvW+2BXfQ=; b=d/gWMG/S8nfsgaIG8aUiEGQuXbILcQN1ohVTIk5whrN9YA/EaxIUEaSYrxN6toALhRLUuXYBuBJ4EG/YFhZT89+Qe3NuTAzmcNYvdfy2/yqa6bTL8EL1Iem8hqd+k6q6iNg3F4lkw+duelCbgYD5HN5CXOkh/I9Cns5iQ3AdeL5mYf0S5nEk7W5ZjCJRGdDzPZyfGbPEzP7d98VWJv1MC3ZsH4O+VYQHBPIn6W5Yr1u4YrJWQ9CAUpedt+7yqvfYe0MTUsWdZsRqX5Pdx62Xb6+g0eFLAbseClgeuvu+frHtODvljS6E5Qj4eDgLAnGnP2EPdOZaMWMbwmsyCGqOKw== 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=AodXxGRDBL4h4qiCH1gxJTvC9EAaSLT3lRqvW+2BXfQ=; b=xEjg4Vo1eaELiqqcjiZa+Y/dulzm2i8vqdfTzNh/QsbpCJrW4jXOF9E5gIVoTtXlll82OWGoxQX7P9o/inNVZGG1D9ghnpVchKD6kmG/PZjDUlwZP4KwXawf9lKjg4fMJ5GFxB+ucISb/o5+lufbvbYYcUcvXVXGLyQx6XwnKJU= 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 DM5PR1201MB0122.namprd12.prod.outlook.com (2603:10b6:4:57::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.28; Sat, 10 Oct 2020 16:07:19 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4d88:9239:2419:7348]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4d88:9239:2419:7348%2]) with mapi id 15.20.3455.026; Sat, 10 Oct 2020 16:07:19 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , Ard Biesheuvel , Eric Dong , Laszlo Ersek , Liming Gao , Jordan Justen , Michael D Kinney , Rahul Kumar , Zhiguang Liu , Ray Ni Subject: [PATCH 0/9] SEV-ES guest support fixes and cleanup Date: Sat, 10 Oct 2020 11:06:58 -0500 Message-ID: X-Mailer: git-send-email 2.28.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN4PR0201CA0016.namprd02.prod.outlook.com (2603:10b6:803:2b::26) 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 SN4PR0201CA0016.namprd02.prod.outlook.com (2603:10b6:803:2b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.23 via Frontend Transport; Sat, 10 Oct 2020 16:07:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ed8b28e1-68fc-4052-3849-08d86d36903a X-MS-TrafficTypeDiagnostic: DM5PR1201MB0122: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:590; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P7aUz5wBx4Xpc9E442nw+Gi8n1RKr+LGBjUfwUexDWUEIx/ky/4T7HeHdwhyAwHBK3Zi8QanAUjcZqeXSfdZrLI4dwV7hA8E6iurOTURMg8dWW5y1lamZvsvvEoclalfJmQ02dswOXBoxtFvoOdpWF5iffyRAx9X8QSrXcV+m3is7EA4+K+p15kHv1zDSfU76egkHgxSavg2RwRLbjvOUHMAwJchcXt9/q15IFyi/WKz1/sqRahMRj5nU/y26Com7P5LQx/2vmcdwoWWrdCAeiLM98nEz6hPJNmFEYIn0jyN+xMDB085GqWvxsqRMueGtCkMN2d8z7uVS0XwKWimSA== 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)(136003)(39860400002)(396003)(346002)(366004)(376002)(478600001)(4326008)(6916009)(2616005)(956004)(86362001)(26005)(54906003)(66476007)(316002)(8676002)(66946007)(6666004)(66556008)(52116002)(5660300002)(19627235002)(2906002)(83380400001)(7416002)(36756003)(6486002)(7696005)(16526019)(186003)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: PcjqfUE1ia7VdISAq/8RmY+egVLywWlsyeS1D9uHuxUjkD1kmLbzE/BXusT7xsIfVBE3hlJwDGQ3QYLQDR2G5dW7jZlOzVXUU9UlRsR4cTFGcwnSd1k29Bcnsyc9EKWMKUPYHO6yrVw0cb9y4aBHF1EMJrQcJ4jW0lTcv5NxTs/hIlc0VlOaeXv7lW26ePqaFo90naZVqPQVF1syBbpSPNzeyPygSamporGzVrfn48JnlZf3tqbcd8WsjJtb1SWpqsTH6wUmso2QoBa15b4gWwBMiHfB3iPpFJuFEkPcnKBUTdMvqNaigjo4VlVUrm+NdP9u9bQAoKgNdp8UjltfBjPxFOtkNJX+vBO7eQZbIIHpnsjPIhDZkKKdvPS7KwB8bpJfMjNv+cIK08HmKjVhZ4sanPAOXBddWkR1Y9F4CGN9c1X8NZXGMGwziu36eGHkP+HVNIv0UimvIXNQ+TIxSUdc701Q30Dg1PExiz3f/pmYwScMInz4yNARGdU0jVFnolRLXJGUuzxrgRd/aIhxxStgnbumPgmz+UKMV21b9W2z65FGGklpttR4dCTWFZ0jYniW4BQ9uNh7u15TzvYl8MHpI4yEfrzLtRnE64vy1ZArhmhVTy+Zoy87LJRWbGT0p1Rv1VT2J49jvUeqMAZ3jg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed8b28e1-68fc-4052-3849-08d86d36903a X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2020 16:07:19.1499 (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: T0NBJjRW4sqS84aN9aIR01NzSdZvP3XIB3JTJXBvZ0TSr+ZSZDLu59mzZJI1SGbCFyCLsZwEkzTizko37U2hDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0122 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable From: Tom Lendacky This patch series provides some fixes, updates and cleanup to the SEV-ES guest support: The first patch updates the calculation of the qword offset of fields within the GHCB. Specifically, it removes the hardcoding of the offsets and uses the OFFSET_OF () and sizeof () functions to calculate the values, removes unused values and add values that will be used in later patches. The next five patches set the SwExitCode/SwExitInfo1/SwExitInfo2/SwScratch valid bits in the GHCB ValidBitmap area when these fields are set at VMGEXIT. The next two patches update the Qemu flash drive services support to add SEV-ES support to erasing blocks and to disable interrupts when using the GHCB. Finally, the last patch uses the processor number for setting the AP stack pointer instead of the APIC ID (using GetProcessorNumber()). --- These patches are based on commit: ae511331e0fb ("BaseTools Build_Rule: Add the missing ASM16_FLAGS for ASM16 = source file") Cc: Ard Biesheuvel Cc: Eric Dong Cc: Laszlo Ersek Cc: Liming Gao Cc: Jordan Justen Cc: Michael D Kinney Cc: Rahul Kumar Cc: Zhiguang Liu Cc: Ray Ni Cc: Tom Lendacky Cc: Brijesh Singh Tom Lendacky (9): OvmfPkg/VmgExitLib: Update ValidBitmap settings OvmfPkg/VmgExitLib: Set the SW exit fields when performing VMGEXIT OvmfPkg/VmgExitLib: Set the SwScratch valid bit for IOIO events OvmfPkg/VmgExitLib: Set the SwScratch valid bit for MMIO events UefiCpuPkg/MpInitLib: Set the SW exit fields when performing VMGEXIT OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Set the SwScratch valid bit OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Fix erase blocks for SEV-ES OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Disable interrupts when using GHCB UefiCpuPkg/MpInitLib: For SEV-ES guest set stack based on processor number MdePkg/Include/Register/Amd/Ghcb.h | 48 ++++++++-------= ----- OvmfPkg/Library/VmgExitLib/VmgExitLib.c | 30 ++++++++++++ OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c | 10 +++- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c | 4 +- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c | 21 +++++++++ UefiCpuPkg/Library/MpInitLib/MpLib.c | 7 ++- UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 6 +++ 7 files changed, 91 insertions(+), 35 deletions(-) --=20 2.28.0