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.71]) by mx.groups.io with SMTP id smtpd.web11.21010.1677774944424834066 for ; Thu, 02 Mar 2023 08:35:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=lIoPDYZF; 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.220.71, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Txf1TPnejy2sr8TFl8zz+p7Ab5Qh4ZFgzG5wBRs/RBWypmU/JV1jqGlfWwCvEOwifnqmLdNnRP6tSgSSnd82cpdzGqimxdIlDhQ6icPp1bjoR3XrJlUmeTbX1Fp1ND/SPEJqDrdv0+kodf7/cPM3MYg6t+c164KinV4OiNGebyvpZPIudWftRUmUb8C+fYu/p0Z5yaQkwjpLqNeXz1HtGWupCdWqo+dg/LlK2dVlYO9EhpSV+jkVSsc+SDH/VLLkwxUT4EQ4WXrfxY0rDNpArJUnBPM6/H2g64yhEcLgOp6PxNn833EJOFLT1FHUG73845CDTcEb7EtxhanYdtv0kA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1Wa1FpWfhGzj+GtIy4IXEfHJFI08F9myS4yeSbti2aU=; b=Nw61cWUEznoiTAmc1dzMi8NNo2xqUsqLr0hLhtOu5VfR2XdXGg2jn1KsIU8ajpN2aSlA4UTWrTew6+R117B1S3p9T0IxW0sdNUxVOOACzTDxvNJcGjNwxwQFBI1bnUpu7bCZ9ZLSOybLprZ+CNLgKkaq+Dc0S3bEjszZG+xtYSFqwGJsIapSlnWmkIwmTNEne0+VTyrZJA8XHiApgueglmcryWehxPvKCBwU+1QKGpba10axPNbtkSDTuz9cT0zJ3IYH7/MeXDb6hWW2hMG6XyDd7G0XWaMqL0i1iEiVOw0oCXy+8opQu8Clqnsk0CvSminIuu7Fjj8g5GbicP4CzA== 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=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1Wa1FpWfhGzj+GtIy4IXEfHJFI08F9myS4yeSbti2aU=; b=lIoPDYZFjKfs1evdHIJGmXNFK+oygek2AA+FJQ7l47wez86j6OT1e43sXKGnDpIM2MteeKcIRF5wSngJQMVXW4VqcL3kD47AgflemTC6t4NDBiUi6mwDF0gA/CCEt/ke3ttXd1WP8wgudLKsQ84FFB7VW/j23yuYDboOH75onrY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) by DM4PR12MB5295.namprd12.prod.outlook.com (2603:10b6:5:39f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.19; Thu, 2 Mar 2023 16:35:42 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::6cc0:9c7a:bd00:441c]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::6cc0:9c7a:bd00:441c%6]) with mapi id 15.20.6156.019; Thu, 2 Mar 2023 16:35:42 +0000 Message-ID: <989f2d59-b15b-54bf-3ef0-50576f42ecdb@amd.com> Date: Thu, 2 Mar 2023 10:35:39 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v3 0/2] OvmfPkg: Enable measured direct boot on AMD SEV-SNP To: Dov Murik , devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Erdem Aktas , James Bottomley , Min Xu , Michael Roth , Ashish Kalra , Mario Smarduch , Tobin Feldman-Fitzthum References: <20230302091532.1985238-1-dovmurik@linux.ibm.com> From: "Lendacky, Thomas" In-Reply-To: <20230302091532.1985238-1-dovmurik@linux.ibm.com> X-ClientProxiedBy: SA0PR11CA0088.namprd11.prod.outlook.com (2603:10b6:806:d2::33) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) Return-Path: Thomas.Lendacky@amd.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB5229:EE_|DM4PR12MB5295:EE_ X-MS-Office365-Filtering-Correlation-Id: 35e017df-def8-4c13-c767-08db1b3c29d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ewtWIy+xao0bCPUeS4xtMlK8bkmHhsMuiBNGaEthbG9WZmYSr+buK/q78IrX0afEbPtvfjz4D2GsegHZ63QHPlb3zdcQxH3CfCdUEnH4mkoqCdx0Ae84Qt6mTrm16c8pWPub4rADex3xRMjKHx1bSg2E3Ik25JGdo756z4UUReJQ4uGuvDYpKe5iQAt+YyzSY0X7c8AoLvrueMFejs4W6fxJZRl5V1rYwGHPHenIblYS8fjZWWI9ZdU7Ftdi0uk2UUfEdOGEt5QGj4/ouYCdU4B8/bTGKMRSCXzniRMA+3Xa/cxM3sjgfDzn6silWrPMCjaUA9ZzbFMo68tbq9uqBxq8wIvE9f4zGSlwMoUfh0IPco3d9ZJeRCypiA1l4co8csuSiWtVbRQtf6KtmapsnWXFfkf0O1L277WWWItfW+3jYUXClcdK7BGMBPER3sG3d+0g/sIVA/Wa7kIwa8PTGhC3Y0Pw51qhFZ3koDmY5ZtwCpR45Q1D1mf0yRDk1Z7D7OrtWFkhGKl/06xKrtkzSxppqHKfBoUbI69z7J/Na5vjjaAhx8Naq8SgSsRFdvjHrkeXAV/NpRD8d/BmgV5AKR1iuTItpvUAVED0HcHSmZMyChTROUwUf65lq/6y1FPdANay9ikNvDglNEUUNyb+Y4lxXalL9gv/XM6/jWbH5Iu/fHCTaIfgqFTVepHq23YjWAGRorwal0M+ykwGrETEwXg1DSNIeJYsukqgmvDm3MgOdHCI39yxRdHtSwHoi7Hc X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5229.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(396003)(136003)(346002)(366004)(39860400002)(451199018)(36756003)(6666004)(53546011)(966005)(6506007)(6486002)(6512007)(26005)(186003)(2616005)(316002)(41300700001)(54906003)(4326008)(8676002)(66946007)(66476007)(19627235002)(2906002)(66556008)(478600001)(8936002)(5660300002)(7416002)(38100700002)(86362001)(31696002)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S3MyTkpKeGg4UW9jNTRJN0tpa1d2cEE3MGhEeUlFeG5abmF1NDJXdXEvaG1q?= =?utf-8?B?NHRLU3A4dG92VG5PMGwrODJySlhtWTI2YmtiWTJiQ0xhZ0tYWldpeWlvcGtW?= =?utf-8?B?WHBwN21jNldzbEdJNVp3Zm96NEtudjhVVlYyYVRrUnFZQ0UzOWtkdWhtMkNz?= =?utf-8?B?UVp0YlhDY2h0SlIycnF2SEN2alVHZVEycEFyVVYxaEFud1FFY2tDakdOcFZM?= =?utf-8?B?UnRFSkk1TUQ1bmpnd29veWRaYkdoS256UkxsT29Eb1k3eEJGdD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?RDF6NVVRLzdpWWl2SnRLNEdRK2k0bE1DaG9sV24rOHE2TkNKeVJaMWlHUEtu?= =?utf-8?Q?SacDmlzg3dbhlqr2NxZmhJ0Fp?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35e017df-def8-4c13-c767-08db1b3c29d3 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2023 16:35:41.9288 (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: MwTYDQCvhqchmdSkRrO07LdI2eJmxYJB7Nn6Wrn5JozYH9dE1t20mo7ixwOl7Z1jcdCgertgvI06vyxdKN7xEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5295 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/2/23 03:15, Dov Murik wrote: > AMD SEV and SEV-ES support measured direct boot with > kernel/initrd/cmdline hashes injected by QEMU and verified by OVMF > during boot. > > To enable the same approach for AMD SEV-SNP, we declare the kernel > hashes page in the SNP metadata list as a new region type. When QEMU > encounters that region in the list, it will insert the hashes of > kernel/initrd/cmdline and encrypt the page (or, if the user turned off > kernel hashes, it will validate the page as a zero page). > > The first patch rearranges the pages in AmdSevX64's MEMFD so they are in > the same order both as in the main target (OvmfPkgX64), with the > exception of the SEV Launch Secret page which isn't defined in > OvmfPkgX64. > > The second patch modifies the SNP metadata structure such that on > AmdSev target the SEV Launch Secret page is explicitly defined in SNP > metadata list, and therefore it is not included in the ranges that are > pre-validated (zero pages) by the VMM; instead the VMM will insert > content into this page (the hashes table), or mark it explicitly as a > zero page if no hashes are added. > > This series is available at: > https://github.com/confidential-containers-demo/edk2/tree/snp-kernel-hashes-v3 > > A corresponding QEMU RFC series will be published soon in qemu-devel, or > use this tree: > https://github.com/confidential-containers-demo/qemu/tree/snp-kernel-hashes-v3 > > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd Hoffmann > Cc: Erdem Aktas > Cc: James Bottomley > Cc: Min Xu > Cc: Tom Lendacky > Cc: Michael Roth > Cc: Ashish Kalra > Cc: Mario Smarduch > Cc: Tobin Feldman-Fitzthum For the series: Acked-by: Tom Lendacky > > --- > > v3 changes: > * Define the kernel hashes page in the SNP metadata table (thanks Tom) > > v2: https://edk2.groups.io/g/devel/message/100362 > v2 changes: > * Rebased on master > * Updated AmdSev MEMFD size to match OvmfX64 > > v1: https://edk2.groups.io/g/devel/message/88137 > > Dov Murik (2): > OvmfPkg/AmdSev: Reorder MEMFD pages to match the order in > OvmfPkgX64.fdf > OvmfPkg/ResetVector: Define SNP metadata for kernel hashes > > OvmfPkg/AmdSev/AmdSevX64.fdf | 27 ++++++++++---------- > OvmfPkg/ResetVector/ResetVector.nasmb | 11 +++++++- > OvmfPkg/ResetVector/X64/OvmfSevMetadata.asm | 11 ++++++++ > 3 files changed, 35 insertions(+), 14 deletions(-) >