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.57]) by mx.groups.io with SMTP id smtpd.web12.12025.1602768366056702213 for ; Thu, 15 Oct 2020 06:26:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=Fp4aH7ek; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.220.57, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=grLAXNEBfTzv/iwuzz1DPAApwJkDDQ91z7z9AIoOPuufed7d4sLeohLRW/BmDJUZ0h83GTKTS5dDuu/K2Om/BzB0DVe2qjtFH7MrgNQoPUwzc+9B82c6Ouc7+3C7PHp5wiicMSO8xXN1C5uESptqAJm0VqLR+G/14u4RZRtfpIlQbaONwjhFEXUrsHiPetO/NA4ewJqBgemSh9TQTMNXvrYhz8XJUMvg9k6ts0Bb04EW4O5BnFcBBxwvJ48TZ4W551kgXiHDfCTIREpRKIOIBJgACO0ZiMMFNsfMBKr8HvEfg5/B9Pa9kiB1D1rC1UcjjlU9Xasa5zi/IUtE47jJEw== 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=bjZwOMTXRHXhfkgIrTMy1qeQJ9Rb225SR6dcDQhH2ns=; b=mHq+d6oFDAJnZlh4wVWv7x8HC1sKEN+gkGz72h4Z2Eb1Na+JW6u2x3SC6AzrvuoRTvlq+yKAqcPzAkAJD/YrYsBWLe3VezfLxqupHOVoxYW7RAacd6BtgIf2PTKfVZRsru7z7ycL6HSemt0Mb4D6eLNHaV5/2nE9Fzp+UXk2MBazWHUgSNcEQQpsG95cKYVclm+CURfKEBoyzDy9ZjzQ1Sv4lTtJ6oYwgd1jjHPwlqCQi1rVIUTagoIEqphJDLUnIjhf8uuQB1FJ4fx6+V1L2m785jqGf78wG6caJo+lJ2ED9VB0lc6cUqCWMWiIvGhYdZT6JlZ70WkaUpXrbnd1QA== 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=bjZwOMTXRHXhfkgIrTMy1qeQJ9Rb225SR6dcDQhH2ns=; b=Fp4aH7eklBKf46py+fLXdUlRJhABthQoB7rcpborbrFLhBc3UIYMP2BsKnBmih9jSjhkG090LIYqeWkF2OVKXkJ1LTiklVoslJQmmG6tpxwzkE7k9GeROnI6ypj4zTUxJigSM8ZWn1t5UWdLK16OikTT5FiGQ2IfZrS0hE9n9Jw= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM6PR12MB2826.namprd12.prod.outlook.com (2603:10b6:5:76::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.22; Thu, 15 Oct 2020 13:26:04 +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.030; Thu, 15 Oct 2020 13:26:04 +0000 Subject: Re: [PATCH 0/9] SEV-ES guest support fixes and cleanup To: Laszlo Ersek , devel@edk2.groups.io Cc: Brijesh Singh , Ard Biesheuvel , Eric Dong , Liming Gao , Jordan Justen , Michael D Kinney , Rahul Kumar , Zhiguang Liu , Ray Ni References: From: "Lendacky, Thomas" Message-ID: Date: Thu, 15 Oct 2020 08:26:02 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: X-Originating-IP: [67.79.209.213] X-ClientProxiedBy: SN6PR04CA0108.namprd04.prod.outlook.com (2603:10b6:805:f2::49) 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 office-linux.texastahm.com (67.79.209.213) by SN6PR04CA0108.namprd04.prod.outlook.com (2603:10b6:805:f2::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Thu, 15 Oct 2020 13:26:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 30a204d4-b053-4429-402e-08d8710dddd7 X-MS-TrafficTypeDiagnostic: DM6PR12MB2826: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nph63ohSQAaYKjxX5J16cOWkXdU6cYLWouCNimC8RnjqDfZFr1vhdsYbburwanTfj11xKagsGjvLmPu2isIbxaLFeBkVs1PJfBTlEGDI3D/EfYQvWCWFAJHpmuFo4rINWB4EVhmZZcYeh2zE6GrA0CKEch8SrblVasJs77KXoyWwwgNXB+3TA+lUMdVTl4wdhLLB4SDlpk2pcNwP9sbht8jStip00MHz8+h/vo5HFpOAzWagdA6u5hVxjZT/WKRgCJJQgbW8GQwwZ2ofC1Pui3s05/TPuMeHLN4bsOhYZ79dU99//JHjr5Ok7TXs/VAxm/moePGP/SZleGgPC7ZcY9dM8usELesrhr/g/0m5Uhh+Z3pcYK8PPBMA5bhZ+2cDC5PumbY63FmEKz9gV2P6hfHN+fZPyk+8TvJA5PwGH0Zx7NRRe9qdN9CwJvNIjpXCGQVgU8yypOd4RUd6yaoBQY2S4hl6FAeJfcXQDDInYh1rzI6+oiArHegGzPo4ddpd 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)(346002)(376002)(39860400002)(136003)(366004)(396003)(6506007)(26005)(53546011)(52116002)(478600001)(2906002)(36756003)(4326008)(34490700002)(66476007)(66556008)(66946007)(83080400001)(7416002)(83380400001)(31686004)(6512007)(86362001)(8676002)(8936002)(956004)(2616005)(31696002)(316002)(54906003)(5660300002)(6486002)(19627235002)(186003)(16526019)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: MDsM6m79GYooQuxMnlRzXggFhOxWYy22mT0+YJiiMiOH9+WoOAgbNW8C/+HwYbLIU9QEU06Qz+Lr7tAEZrDA48tpEuHLczeNap+22wkkYDO7b+b6MnIJSRfWD/f/24zUDw0kUK8vgJ/jEmJ8/KjvRipv5kyHfqfW46Wg6czGWqF4jY5//7rrxjs4oT9bHxN+WtcpTs5LSkUWll/ZcfS4HXlb8w3UAHdkQdUJ+hEHpATPSfL9f62/I4JoLTRePRAU0gLn0t6KaYM5nN7IlF/S1Fki38hjMztUPrZUowUipz/MwkuADCNLM7fyoQ4oyFtL5L/aZG8AISnX0kQGZo5tDK0SSKwqzT5zGy6VZWmMdLPdb+eINyoeCl9Ffj9AWjP0Z181IdqnOVIIx3Og6EFaaZvFo0hp7OKd78XogOq5pY25w2rQd2mime1OCWJ/0qBJcBJfLfSvoOV59b1Yr8E/tuYJlBo7YaNJ1v3UbmiHsOm0akb2NYBMoUY17sfK05QFC8gRUTKg0q95dFr/2KOYTS5N+3JgzooTAdVmO3YVVpSR65Ifdu6XrjUUJ4SBuo142SLQ+F6CrmIfpJb20Qu0Pl2Odewdrum5m22YfEmxtxyuQpRGk3jLrLaaVQssKe5H6alTBqV14aQQ4v9vQ5jZGw== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30a204d4-b053-4429-402e-08d8710dddd7 X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2020 13:26:04.6868 (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: bPLZ5dL1122QmsseHjOFCiHx0duQ/SzT8NxKAB2zpwAVhpRmJtHzBc0DVtSwDQaOb/J1WArrOmtOwd7ja4sTXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2826 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 10/15/20 2:43 AM, Laszlo Ersek wrote: > Hi Tom, > > On 10/10/20 18:06, Tom Lendacky wrote: >> 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()). > > please file a TianoCore BZ for this series, assign it to yourself, link > the v1 posting in a comment on the BZ, and update the commit messages to > reference that BZ. > > I find this relevant because edk2-stable202008 resolved TianoCore#2198. > If (in your opinion) downstreams that aim at supporting SEV-ES should > also have these patches (for example, if they should backport them on > top of edk2-stable202008), then having a TianoCore Bugzilla would be > quite helpful to them, for tracking purposes. Ok, done (https://bugzilla.tianocore.org/show_bug.cgi?id=3008). One thing I noticed in the bugzilla is that there is a way to specify the releases the issue was observed in and must be fixed in, but the edk2-stable202008 release isn't listed in it (yet). Thanks, Tom > > Thanks, > Laszlo > >> >> --- >> >> 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(-) >> >