From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.78]) by mx.groups.io with SMTP id smtpd.web11.148.1627385028808380294 for ; Tue, 27 Jul 2021 04:23:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=3M2X6m1B; 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.94.78, mailfrom: brijesh.singh@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=enrN2AS6D4hXhfwwcy7sZ9d969QjvIsqRRZO8sRO7dswmGosOIdqmh+jM0vPQJlbW8+6dPTNJRDumEPPP7jLogvWLik0SGufWa9rIRQp18SgFSBkuIYvq607Avs6EnfpBxPb4YJMHG3zeuFLaZjLmi2QgBEIiabfisgahHNKVY0iL7cgrUYRoNM2Pi3qxKk7XcHxsXf6sG4ept1z+/wqEPydxLL61ufEP//y4QbfEiI6PZpFh297sdabwh20LpfFLOkiPlWNkdM2efGwJan+Dwas86SOTwFT2pgBhbA8iXahJ5yMEuwgL+sGBH2UNS40pv6GQUnEqXjrYduJ6mC4JQ== 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=U4v3wrdgfP5lOiMiRYjajs2A0I5UcZpeyoeuSDczusU=; b=UfjLRme9XYshTWaSrCPS9JmrAMItnp453QObUVdG8986LFB3lNXr8XEdRC9b3MTLpPSsBmIwCOvdldKdf8unpCgJDCG7Xyo5YYDQq45uix2fBMtEswMClboCX3j/EhwDazTmzox5P9hrNnBUZp9izRk9/DdMdd4d00FQE7US8r23+8BlLncVkeZIikBQyGxI2GAzkJBeTOtcx0Y8tLd0uJvMoeqXJJ/MT5GzYtwQrqsDjd+2fOWTaE5HHEpuX6QYUJh8b4v2NwsGkjezc+Op41MwNFA9qVUCGe+afkZlaO0oMjsBTAISqbZKt/PMcSjen6NrCvhaqzWp15TfWSoEEw== 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=U4v3wrdgfP5lOiMiRYjajs2A0I5UcZpeyoeuSDczusU=; b=3M2X6m1BFVYICyxFohItx9DMxewNsfc5w+us5/GwTqqaTm2oYZYSgZLnKzWprXJkxB8SIHMn/aE35XqRJVhCsFGlCuO/XeGf1Jqt3AODs8ZDpVrT7bjLmIinncBp9HThRZymRK7lrC1v3qZxfD2uJnNLPbyogl5Ei4fYW2WQsIg= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) by SA0PR12MB4430.namprd12.prod.outlook.com (2603:10b6:806:70::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Tue, 27 Jul 2021 11:23:46 +0000 Received: from SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::a8a9:2aac:4fd1:88fa]) by SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::a8a9:2aac:4fd1:88fa%3]) with mapi id 15.20.4352.031; Tue, 27 Jul 2021 11:23:46 +0000 Cc: brijesh.singh@amd.com, Ard Biesheuvel , "Justen, Jordan L" , Erdem Aktas , James Bottomley , Tom Lendacky Subject: Re: [edk2-devel] [PATCH V3 00/10] Add Intel TDX support in OvmfPkg/ResetVector To: "Yao, Jiewen" , "devel@edk2.groups.io" , "Xu, Min M" References: From: "Brijesh Singh" Message-ID: Date: Tue, 27 Jul 2021 06:23:42 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 In-Reply-To: X-ClientProxiedBy: SA9P221CA0016.NAMP221.PROD.OUTLOOK.COM (2603:10b6:806:25::21) To SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) Return-Path: brijesh.singh@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from Brijeshs-MacBook-Pro.local (165.204.77.11) by SA9P221CA0016.NAMP221.PROD.OUTLOOK.COM (2603:10b6:806:25::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.26 via Frontend Transport; Tue, 27 Jul 2021 11:23:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1ba46649-3c61-4c65-8465-08d950f0ffba X-MS-TrafficTypeDiagnostic: SA0PR12MB4430: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BLeP+IZh3NIVJ78yQwAf3T5IjqoaOqW2xXz+WZY8yquCNSVFbKm3lYAVnf2CtsZvKGucvs7Mx19GV43bm7fc7EY1zs3L8CwedyLjMHBoL1q9GaBwv4nultPBiUV7JB+94FRthaon6ytlKkej9nE/akD9PV16D9k6BeG7RYefl1IKGL7MvNXFICNgDQq+Iak0OS/Ax1/K9X8+1qlSuSHnKonNAQYb5X8KdhfuQcVPcrAM61gr/oGwMHpsPT3Jp73/iVOI6Ntrgjd9yZliUVJS1yPnOnDNROXRrqT5/QsRefbYqRWkcwKRidhSqMhVvvb+9JZHfBF0ISa+RUAFlytRHty8o3qL2T0G1YMJQnySgFKklwvwpTq0fVXZ8qiL9vvOFCSkrb2xFIPjonDC430FlGiTjDCKubfCVHtgnnJxyF10LV+5+tpWxiO1nZtM2BSb/2aui8OQWGCgzkRN9PfVVztiU6He5Fh65TlfMJTq9FQlz4u6PE50lOUL0Rn4eIUMeGAiUWpcUhoLO1CWeUDeq3qt9moW7MXDc/DT1/yyjRxYwTkewfY5TacEDOoojOKh9P5m5rcgal2wFfJxLrl7al8sBmoj2OoW3f/ZEQG7avKQm65yqJYbnd/lM/2ITlt3KSN1hRkXQfXvm1/+M/q700KoUC6lmw/vimHSQOWyLTm/IPgOzlz2Y0o6UZQhClRsKVAzDLTQO5IIX5RHJ5TkKqBPCBfKuZ1nP6lC+SeQurXCG4t5wo8IVzW0Q5WISStXDJyFhVzmicx8X1V4dhuTrHkcb5A3wIrfB1GZMZixSHFfs3OR9IhMF/IjqRt4pwLTRiAOs/EforYoUGCeanvOpoX57vAsDgRMtb0H+5Na1fT9RBAe0960OZfjHQooCH/k X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2718.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(346002)(376002)(396003)(136003)(366004)(2906002)(478600001)(2616005)(31686004)(36756003)(6506007)(53546011)(19627235002)(38350700002)(52116002)(44832011)(66946007)(45080400002)(966005)(956004)(6512007)(8936002)(30864003)(38100700002)(8676002)(54906003)(86362001)(186003)(5660300002)(4326008)(110136005)(26005)(6486002)(316002)(31696002)(83380400001)(66476007)(66556008)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QmdvVWFqZ3pSY0FHM21QQWdEOStmQXpFK0wzUEx4bDFBeEdvaGgyM3FHZksv?= =?utf-8?B?YVJaOXhPV2FabHJ2Nnk5dXV5RVBTQVU0K0RESDh3cmhmbnQvWUxHVllhb2Jt?= =?utf-8?B?YVlnSHpMOGNpRWtVUG1BK2hTT2Q3cGkrZVE5VW14RmZ3WnFhbHJrYnhXZm9V?= =?utf-8?B?WFFxd0pZSlNCWm1QUC9LMzlLTklvSFJhWUx6YTFHb3crT2UrK3NqMEhTaVYv?= =?utf-8?B?ejVKRm1mck1lTTRxRGRvSi83MXNqTDVHNE1IdnhRZWVZMjFjUkpna0VHeFRC?= =?utf-8?B?T3p5VmNpTk1EOEZHbkNtaGxSWTdIbTUzOGxSOXQySHBPK3dQTmtaOG8yd3o5?= =?utf-8?B?NDZrRFhwc3hOalUwb1crRlBzcmZ6VTNzOWJHOU8zZ1dLZVFSd2lCZ2s2TmVV?= =?utf-8?B?aXE1TERTRnMzdmxwc2ZhdzU3eUtWTmdKMG90ZlpYVGJNMjRqenBSRHJiZktO?= =?utf-8?B?UGNLWGxCdTdseUsrZ2ZkOU1tNm1NVE90R2w4SXZwMjlQazBmRE9oL1gzL2Ju?= =?utf-8?B?UEtOUVI3WE9KZ093Y0JIUG1QcjlyV2FXWXRZenVvcHJCYnRWa0pQSlY0eDZC?= =?utf-8?B?RFc3c0ZHSUxiQUlKN1lRTVI2cDZ6T2N5TnV2b3hoTCtDN1FEYUw0dys4eWU0?= =?utf-8?B?S0Y4b1Z6eVdwYUJVUXpNT1EybFZUMGc1ZmFxK05peFZJMDRpSU45NUwrNGVJ?= =?utf-8?B?U3JmeXAya0tsNklZVUdTNW1aVi8xV0tCTmhmR1VCMFNGa0JIaTZBODdKdkdE?= =?utf-8?B?STZkTTJMUTUvK0d1V28zZ0dCN3loVXRKT0hoKzZPcWc5S25yZGlndjgwTEUw?= =?utf-8?B?aWdOS0xBeVQrL0g3SDJackZScFhtWkdSWDB2NVc4SmpKcWIvaDVWYk55ckR6?= =?utf-8?B?Z3dnRlE2YVFBeU1GU3kxazNTb2ptL3pVdGlzcU9CdEFzeERaSDhMKzJIRFBN?= =?utf-8?B?VmVYUUwva3RBYlFEOWZzb0gzUzU1OGl4d21lWkp5QWZ0d0ZOdUF3bnl5YTdo?= =?utf-8?B?MzduS01XbTNFVFdOM1lla3M3T1ltajkrSkc5V1FNbWNMVjJ1V3hlS3JQWXhu?= =?utf-8?B?OGJZdEh0enBsbVRIQTRCU0pIZzZzMytuNUc3WkNuOEErTDRxRjBQQW8vVnZF?= =?utf-8?B?SVREQnI4QzdqWmJoNXM3TzdTNFVPdm9RUWtYN2wwNnVvNHdNUERaRVlucEx1?= =?utf-8?B?eEZqUWQ1R0hYRGJjcFByTVFnaG9tcUMvODF6UDRnWlY1WjIvd0NnaWpXQUZU?= =?utf-8?B?Unp0cGdCbnVTSzV5QzFkUEtHSUZtbkRtL2ZxUXZEeDFsWm9GMFVMWHExWVBq?= =?utf-8?B?QTB3SzNOSWwvc252Mkd5N3NNQmpaengyN1Urcm5OajRSQUQ1ejQ3d0NJdjFK?= =?utf-8?B?eEozQ2x5VlI5bERwUE4xQUZobnlocG1nVWlScEQrRzRHMkRhc0ZQa3pDYWlW?= =?utf-8?B?S1pKTnY1bGVpY0JObmx0NFkxVThKazZLR0h1VThoR3U1SndoMElDUWZJZUVs?= =?utf-8?B?M2ZQQTYrQlpZTjQzUTBoU1YyUUVVU1hjeldzUkdLblJkdkNUTjFycmlwV3N5?= =?utf-8?B?WjB4NkFOOTFGQWtEcXZsdnIzQ0JpNStlbUtSRWFFczUzUEZ2b0JGM0xlSm9u?= =?utf-8?B?bmlPb0tETFVzZnkrQXZCWXRHSWMyTi91SzVoWk4vblBjSXZtcytXTTFTaGZB?= =?utf-8?B?WGNseWRnaWhDM25VTzdxNkx1WTBEUDVsa0xBZlpqYWJ0VGRCTzFRbG5wN1I2?= =?utf-8?Q?wBOggBUEWRCRbZltbfOBwAvldHptJzrhp2nXYpJ?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ba46649-3c61-4c65-8465-08d950f0ffba X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2718.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 11:23:46.3382 (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: 1tBMkLrfzOr02wgasOaxB8Dtw7wCY47nw+s5qNjjcXb0FpHyjrdx3EGf3YYubSqMhIcRUBfgOJ/xSQp1URpi8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4430 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Hi, On 7/27/21 2:16 AM, Yao, Jiewen wrote: > Thanks Min. > Many thanks for splitting SEV stuff to a standalone file. That is very good start. I am not sure if you noticed but the SEV refactoring was already included in the SNP series, I extracted those patches from SNP series and posted now directly for the acceptance. This will give a well tested SEV refactor logic which Min can build upon. The refactor series is tested on non-SEV and SEV guest. thanks > > Some other comments for your consideration: > > 1) There is no need to create a standalone Init32.asm and ReloadFlat32.asm. They are only needed in TDX so far. Please keep it in TDX. > > 2) I do not see the absolute need to create multiple patches for ResetVector.nasm/ResetVectorVtf0.asm to add TDX stuff one by one. That always makes me feel you miss something in the beginning. Since all the patches are adding TDX support, I think we can add them one time. > > 3) The strategy I take to review the patch is to compare the ResetVector in UefiCpuPkg and OvmfPkg. > If they are similar, I am at ease. If they are different, I would ask why. > > For example, OVMF version Flat32ToFlat64.asm missing the CR4/CR0/EFER_MSR handling in normal mode. I am not sure why. A potential bug? We had better make them consistent. > > 4) I can understand difference in PageTables64.asm. UefiCpuPkg uses ROM page table, while OVMF uses runtime crated page table. That is OK. > > However, it is hard for me to understand how SEV/TDX hack the build page table. > > I still recommend we move SEV hook to SEV file, and TDX hook to TDX file. > If we can use below patter, that can help me a lot to understand the logic. > =============== > SetCr3ForPageTables64: > > xor edx, edx > > PreBuildPageTableHookSev > PreBuildPageTableHookTdx > > BuildPageTables: > > XXXXXX > > PostBuildPageTableHookSev > PostBuildPageTableHookTdx > > SetCr3: > =============== > > 5) There are too many noise in ResetVectorVtf0.asm. > Can we move SEV and TDX related GUID definition to a standalone SevVtf0.asm and TdxVtf0.asm? > > > Thank you > Yao Jiewen > > >> -----Original Message----- >> From: devel@edk2.groups.io On Behalf Of Min Xu >> Sent: Tuesday, July 27, 2021 1:42 PM >> To: devel@edk2.groups.io >> Cc: Xu, Min M ; Ard Biesheuvel >> ; Justen, Jordan L ; >> Brijesh Singh ; Erdem Aktas >> ; James Bottomley ; Yao, >> Jiewen ; Tom Lendacky >> Subject: [edk2-devel] [PATCH V3 00/10] Add Intel TDX support in >> OvmfPkg/ResetVector >> >> REF: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3429&data=04%7C01%7Cbrijesh.singh%40amd.com%7C845afb67ce2d47b1309308d950ce8012%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637629670106503221%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=5JPmffFHuQiLiG954z68vNLT2h1nwuURTRpfsczCm%2F0%3D&reserved=0 >> >> Intel's Trust Domain Extensions (Intel TDX) refers to an Intel technology >> that extends Virtual Machines Extensions (VMX) and Multi-Key Total Memory >> Encryption (MKTME) with a new kind of virutal machines guest called a >> Trust Domain (TD). A TD is desinged to run in a CPU mode that protects the >> confidentiality of TD memory contents and the TD's CPU state from other >> software, including the hosting Virtual-Machine Monitor (VMM), unless >> explicitly shared by the TD itself. >> >> The patch-sets to support Intel TDX in OvmfPkg is split into several >> waves. This is wave1 which adds Intel TDX support in OvmfPkg/ResetVector. >> Note: TDX only works in X64. >> >> According to the comments in https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F78152&data=04%7C01%7Cbrijesh.singh%40amd.com%7C845afb67ce2d47b1309308d950ce8012%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637629670106503221%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=LKpyRRcngy4H71bVhCbvZMOxy4QMMr%2BbE7lGmEgLIHA%3D&reserved=0 >> and https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F78151&data=04%7C01%7Cbrijesh.singh%40amd.com%7C845afb67ce2d47b1309308d950ce8012%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637629670106503221%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2B7S7%2BsNkHC8LWl5zWNbNt0QF8RY5ICUVYobUrYklYTM%3D&reserved=0, PageTables64.asm and >> Flat32ToFlat64.asm are refined. SEV and TDX related routines are separated >> to AmdSev.asm and IntelTdx.asm. >> >> Patch 1 add the PCDs of BFV/CFV. BFV is the code part of the image. CFV is >> the configuration part. BFV is measured by VMM and CFV is measured by TDVF >> itself. >> >> Patch 2 add TdxMetadata in OvmfPkg/ResetVector. It describes the >> information about the image so that VMM can do the initialization and >> measurement based on these information. >> >> Patch 3 set the initial value of Td mailbox and its related macros used in >> ResetVector. >> >> Patch 4 define macro of TDX_PT_ADDR which indicates the Tdx extra page >> tables. >> >> Patch 5 is IntelTdx.asm which includes below routines used in ResetVector. >> - IsTdx >> - InitTdx >> - PostSetCr3PageTables64Tdx >> >> Patch 6 is AmdSev.asm which includes SEV routines. These routines are >> extracted from the previous PageTables64.asm/Flat32ToFlat64.asm. >> >> Patch 7 load the GDT and set CR0, then jump to Flat32 protected mode. This >> is because GDT is not set in the initial stage of ResetVector. >> >> Patch 8 is Init32.asm. It is the entry point of doing the 32-bit protected >> mode initialization. ReloadFlat32 and InitTdx are called. In the future if >> SEV has something to initialize, InitSev (for example) can be called in >> turn. >> >> Patch 9 create Main.asm in OvmfPkg/ResetVector. It is based on the >> suggestion in https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F78152&data=04%7C01%7Cbrijesh.singh%40amd.com%7C845afb67ce2d47b1309308d950ce8012%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637629670106513208%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=J7naeEX7mJhoMD4f0LDWEUNEjiYD7DHSJICQFxqf8v8%3D&reserved=0. In this commit >> it is simply copied from UefiCpuPkg. In the next commit this Main.asm is >> updated to add a new Entry (Main32) to support Tdx. >> >> In Patch 10, all above are put together. Init32.asm call ReloadFlat32 >> to jump to 32-bit protected mode, then InitTdx initialize TDX_WORK_AREA >> to record 'TDXG' flags. After that page tables are built and set, then >> jump to SecEntry. >> >> [TDX]: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsoftware.intel.com%2Fcontent%2Fdam%2Fdevelop%2Fexternal%2Fus%2Fen%2F&data=04%7C01%7Cbrijesh.singh%40amd.com%7C845afb67ce2d47b1309308d950ce8012%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637629670106513208%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=OXsNermcOOWzwl%2BtznnK3fGtH3HD4bmvqXVNR8SAPPI%3D&reserved=0 >> documents/tdx-whitepaper-final9-17.pdf >> >> [TDVF]: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsoftware.intel.com%2Fcontent%2Fdam%2Fdevelop%2Fexternal%2Fus%2Fen%2F&data=04%7C01%7Cbrijesh.singh%40amd.com%7C845afb67ce2d47b1309308d950ce8012%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637629670106513208%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=OXsNermcOOWzwl%2BtznnK3fGtH3HD4bmvqXVNR8SAPPI%3D&reserved=0 >> documents/tdx-virtual-firmware-design-guide-rev-1.pdf >> >> [ReviewComment-1]: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F78151&data=04%7C01%7Cbrijesh.singh%40amd.com%7C845afb67ce2d47b1309308d950ce8012%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637629670106513208%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=CjaSzffSZ1wEMFJ09uqZiHR%2FNcCefJ%2Bi4g2iplKxIiw%3D&reserved=0 >> >> [ReviewComment-2]: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F78152&data=04%7C01%7Cbrijesh.singh%40amd.com%7C845afb67ce2d47b1309308d950ce8012%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637629670106513208%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=J7naeEX7mJhoMD4f0LDWEUNEjiYD7DHSJICQFxqf8v8%3D&reserved=0 >> >> Code is at https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmxu9%2Fedk2%2Ftree%2Ftdvf_wave1.v3&data=04%7C01%7Cbrijesh.singh%40amd.com%7C845afb67ce2d47b1309308d950ce8012%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637629670106513208%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9ly05aaxRWbNLBR8PrNncQL%2B%2BrzhnKlk3kthNVs9kIU%3D&reserved=0 >> >> v3 changes: >> - Refine PageTables64.asm and Flat32ToFlat64.asm based on the review >> comments in [ReviewComment-1] and [ReviewComment-2]. >> - SEV codes are in AmdSev.asm >> - TDX codes are in IntelTdx.asm >> - Main.asm is created in OvmfPkg/ResetVector. The one in >> UefiCpuPkg/ResetVector/Vtf0 is not used. >> - Init32.asm/ReloadFlat32.asm in UefiCpuPkg/ResetVector/Vtf0/Ia32 are >> deleted. They're moved to OvmfPkg/ResetVector/Ia32. >> - InitTdx.asm is renamed to InteTdx.asm >> >> v2 changes: >> - Move InitTdx.asm and ReloadFlat32.asm from UefiCpuPkg/ResetVector/Vtf0 >> to OvmfPkg/ResetVector. Init32.asm is created which is a null stub of >> 32-bit initialization. In Main32 just simply call Init32. It makes >> the Main.asm in UefiCpuPkg/ResetVector clean and clear. >> - Init32.asm/InitTdx.asm/ReloadFlat32.asm are created under >> OvmfPkg/ResetVector/Ia32. >> - Update some descriptions of the patch-sets. >> - Update the REF link in cover letter. >> - Add Ard Biesheuvel in Cc list. >> >> v1: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F77675&data=04%7C01%7Cbrijesh.singh%40amd.com%7C845afb67ce2d47b1309308d950ce8012%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637629670106513208%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=osU4QOWl3FWRZ94VyD%2B0VHse7%2BCxUSbiVBtWf7WmbcQ%3D&reserved=0 >> >> Cc: Ard Biesheuvel >> Cc: Jordan Justen >> Cc: Brijesh Singh >> Cc: Erdem Aktas >> Cc: James Bottomley >> Cc: Jiewen Yao >> Cc: Tom Lendacky >> Signed-off-by: Min Xu >> >> Min Xu (10): >> OvmfPkg: Add Tdx BFV/CFV PCDs and PcdOvmfImageSizeInKb >> OvmfPkg: Add Tdx metadata >> OvmfPkg: Set TdMailbox initial value and macros >> OvmfPkg: Add TDX_PT_ADDR defition in ResetVector.nasmb >> OvmfPkg: Add IntelTdx.asm in ResetVector >> OvmfPkg: Add AmdSev.asm in ResetVector >> OvmfPkg: Add ReloadFlat32 >> OvmfPkg: Add Init32 >> OvmfPkg: Create Main.asm in ResetVector >> OvmfPkg: Update ResetVector to support Tdx >> >> OvmfPkg/OvmfPkg.dec | 13 + >> OvmfPkg/OvmfPkgDefines.fdf.inc | 12 +- >> OvmfPkg/OvmfPkgX64.fdf | 6 + >> OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm | 38 ++ >> OvmfPkg/ResetVector/Ia32/AmdSev.asm | 526 +++++++++++++++++++ >> OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm | 110 +--- >> OvmfPkg/ResetVector/Ia32/Init32.asm | 32 ++ >> OvmfPkg/ResetVector/Ia32/IntelTdx.asm | 172 ++++++ >> OvmfPkg/ResetVector/Ia32/PageTables64.asm | 478 +++-------------- >> OvmfPkg/ResetVector/Ia32/ReloadFlat32.asm | 44 ++ >> OvmfPkg/ResetVector/Main.asm | 119 +++++ >> OvmfPkg/ResetVector/ResetVector.inf | 11 +- >> OvmfPkg/ResetVector/ResetVector.nasmb | 66 ++- >> OvmfPkg/ResetVector/X64/TdxMetadata.asm | 97 ++++ >> 14 files changed, 1224 insertions(+), 500 deletions(-) >> create mode 100644 OvmfPkg/ResetVector/Ia32/AmdSev.asm >> create mode 100644 OvmfPkg/ResetVector/Ia32/Init32.asm >> create mode 100644 OvmfPkg/ResetVector/Ia32/IntelTdx.asm >> create mode 100644 OvmfPkg/ResetVector/Ia32/ReloadFlat32.asm >> create mode 100644 OvmfPkg/ResetVector/Main.asm >> create mode 100644 OvmfPkg/ResetVector/X64/TdxMetadata.asm >> >> -- >> 2.29.2.windows.2 >> >> >> >> >>