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.42]) by mx.groups.io with SMTP id smtpd.web08.1301.1603317258907048523 for ; Wed, 21 Oct 2020 14:54:19 -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=b1R9t6Np; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.94.42, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AwvSNdXCfZ4TEkv0KNwyqWi3C+Hi35A06PEq00q3DQeml+7YkrWTWZTC4aJ84mtcuC5rNAuYlpjcVcCo57pSey94/siau9pA+xvRRosEMBikiMEIg7I6cWR0qwh/q5cST0iIijfKIv8pGaP3sJsRuHmyjv9W/shoF15r16DRJmoTpyiZOcsLYHNShd+UHoyqiS7p0CaIsDr/vaVBHEHlPDnRzWz2V+6Zt2M1Lq1HlxdVX72QxVLFlzpl0Ok6iFVm0RB9hi5YgYq3vB6e+u5yeACysD8Dcz7k5/ivwK4vmBHimQgyKvfBuEkorVjsaXuDct3gPILXRhGZYYnQYYFS5g== 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=04LU4ubQxSYAzq7s9gtfepsIdb+x5UcH+vI00dzoWDA=; b=Au4hU1ogYa+yScaT+EUXz247WgBunl7i2u/1DFNKcUXJhZcRFCz9qHnDY18NedN9EqrGthAg+lKHkwcPW2Jq+Ld7cPGgzmlf2eewHWg247z4Xzfd06N5uO3HxucnSIhPKTuSwZCBJBNAtOwax51G4jtOuoGcu0ez+hmWq1Um2Z+RHTBFvSbQL9Czs7rL8IPrSItMc+ZBJ9tKblx2MrraRJbwvDLhwTaviBJLuVFTgwv8CPj+3oTUmUk6rygvqqOeWISKJMyKdW+3b3JFoqprI5iX+Medu6jXZ27G8h9Z1l/a3sePoXUIK8OSVYlxc3LVev2Oovx6s9xFaO2cs8Byhw== 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=04LU4ubQxSYAzq7s9gtfepsIdb+x5UcH+vI00dzoWDA=; b=b1R9t6NpL/ufMTjjqDnw/FEP7Qy5n1lfSa5CbAgfxexMzyoPIePLGT6BxgRuR2mAVkKyIZxN8EmDKKHh1O0C9HNvamdnME9OFBdHySGBi4y98qubP1dgMYG2haNmiqIxTp3Jqs5o5o2oB6h4G3z9UT46mRjXezWvVhSSZusyNEU= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM5PR12MB1771.namprd12.prod.outlook.com (2603:10b6:3:110::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.22; Wed, 21 Oct 2020 21:54:17 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::e442:c052:8a2c:5fba]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::e442:c052:8a2c:5fba%6]) with mapi id 15.20.3499.018; Wed, 21 Oct 2020 21:54:16 +0000 Subject: =?UTF-8?B?UmU6IOWbnuWkjTog5Zue5aSNOiDlm57lpI06IFtQQVRDSCB2MiAwMS8xMV0gTWRlUGtnLCBPdm1mUGtnOiBDbGVhbiB1cCBHSENCIGZpZWxkIG9mZnNldHMgYW5kIHNhdmUgYXJlYQ==?= To: gaoliming , 'Laszlo Ersek' , devel@edk2.groups.io CC: 'Brijesh Singh' , 'Michael D Kinney' , 'Zhiguang Liu' , 'Jordan Justen' , 'Ard Biesheuvel' References: <523f270e4e6f7a62cdbebc541b442bd766e7ab3a.1602864557.git.thomas.lendacky@amd.com> <000d01d6a5b9$03d14ef0$0b73ecd0$@byosoft.com.cn> <93c3b271-ccdb-6242-ce23-957eb73a66c0@amd.com> <006f01d6a67d$80b77d80$82267880$@byosoft.com.cn> <8734b948-e36c-81f4-43ae-6c63fba1374b@amd.com> <004401d6a744$b6208e90$2261abb0$@byosoft.com.cn> From: "Lendacky, Thomas" Message-ID: Date: Wed, 21 Oct 2020 16:54:14 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: <004401d6a744$b6208e90$2261abb0$@byosoft.com.cn> X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN6PR16CA0049.namprd16.prod.outlook.com (2603:10b6:805:ca::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 [10.236.30.118] (165.204.77.1) by SN6PR16CA0049.namprd16.prod.outlook.com (2603:10b6:805:ca::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Wed, 21 Oct 2020 21:54:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 37387f23-bd33-4de7-0c93-08d8760bdb03 X-MS-TrafficTypeDiagnostic: DM5PR12MB1771: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AnnUB3Gs3gX1519Ka/hnZDcuXrjGLqt7215Tnf/QDgeMQH+lSqHakj6E/51RijBiNlU/x7KCs6wdtqKt/1S3qzoWyweoKdl56iB3wgVBH01rrLXORazh75+ulsqaKHPZFUM64XW1aJOqdktG8xFpuYvaBbTzOsdzjqMF3b9ErDZi0xLr6T5P+pSwGeiRcIfiDcNu80Qi6G/+PB0RjRe00/uUrGNM9CpvNqLQvl0bBxSFaSCeYD4utTy7jrxS30a0FuhcG8YyE7s3IioIMwDD2Ni2NAubFOa+BORASD2IypCQKQNbFD6pXZUATTKOwe7lqgh88i4ZVZWPZ08E9lfm+R+t02rymsRFtdmeuezi0TRdVXTA7ydQ5ijLxzYnQRcn 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)(396003)(346002)(136003)(376002)(366004)(5660300002)(8936002)(478600001)(66556008)(66476007)(224303003)(31696002)(31686004)(86362001)(66946007)(83380400001)(53546011)(16526019)(26005)(186003)(54906003)(110136005)(52116002)(2616005)(6486002)(956004)(36756003)(16576012)(2906002)(4326008)(316002)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: f1cM5Nzof/sPEG3bEsxU6dDXb8KgJBGxkqzN7SVcDdlncVupFAczo3W3GNJuYAlTEWLRGk7J7GddkDTyNjsaNSOpcQJEDtt8hUp7NKbecMrVckD6k655yiEHIGHRD2bfOOPBAPXK5QXMIMWECyhkG7IIZ/xxkRpedDM9N/PmOpAQitj4VpJzd+iklm6RfISFUMPzmnZ1rWJRcX/PDo0QnwftqKne5lu2w6BGr7r/Fc6Xn/2r3/9Ghg7f2nu7DyC0tjjsZfhsWfNJi3YrrjJGuOl0eA6XuH2Of3gQmfWEhM05dC/mP8u3MELUHOmZjhB9zii7t3xx1Jvef/WIVMYfdsiez6SghS3lOBgJ93hmP5aJogbjxTbonFH2wpOaFbCKqnGqNqb3RoiJOMCCwX1vdpjq9vQnOdkNmRXZ9tsYabEa7/5T96jmht1Z5mf5HDQ7USpW7q8pyImNzhOtcZqigok/oT468n7D58aFuK0AE8Qg79QPlQ5LOQsIm7bcMorPUrKfpucPDj2EeT5nhX/IOTLwWtX7dHW/C3tiz/MdpiqnrGC3W7u3f2wuTGtLdGu7er9i3OfFlfA7Kzy+pRVHVeZBeXTdoPJM7+NcfmjImgF0z9ayZQ/nC94nFojQEwtyag3oRq20qkbe9iVVt6SQeQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37387f23-bd33-4de7-0c93-08d8760bdb03 X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2020 21:54:16.8071 (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: t2Nq9FEmU2FkaVE2kQEY9YcL2rcCPIt8J/mHreoIvZ6WPfQbKY2HwfFps+ydQO6rN6DksG5v5/18rpAb4Mm5ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1771 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 10/20/20 7:54 PM, gaoliming wrote: > Tom: Hi Liming, >=20 >> -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- >> =E5=8F=91=E4=BB=B6=E4=BA=BA: Tom Lendacky >> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2020=E5=B9=B410=E6=9C=8820=E6=97= =A5 21:10 >> =E6=94=B6=E4=BB=B6=E4=BA=BA: Laszlo Ersek ; gaoliming >> ; devel@edk2.groups.io >> =E6=8A=84=E9=80=81: 'Brijesh Singh' ; 'Michael D = Kinney' >> ; 'Zhiguang Liu' ; >> 'Jordan Justen' ; 'Ard Biesheuvel' >> >> =E4=B8=BB=E9=A2=98: Re: =E5=9B=9E=E5=A4=8D: =E5=9B=9E=E5=A4=8D: [PATCH v= 2 01/11] MdePkg, OvmfPkg: Clean up GHCB >> field offsets and save area >> >> On 10/20/20 3:31 AM, Laszlo Ersek wrote: >>> On 10/20/20 03:08, gaoliming wrote: >>>> Laszlo and Tom: >>>> >>>>> -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- >>>>> =E5=8F=91=E4=BB=B6=E4=BA=BA: Laszlo Ersek >>>>> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2020=E5=B9=B410=E6=9C=8820=E6= =97=A5 4:42 >>>>> =E6=94=B6=E4=BB=B6=E4=BA=BA: Tom Lendacky ; = gaoliming >>>>> ; devel@edk2.groups.io >>>>> =E6=8A=84=E9=80=81: 'Brijesh Singh' ; 'Michael= D Kinney' >>>>> ; 'Zhiguang Liu' = ; >>>>> 'Jordan Justen' ; 'Ard Biesheuvel' >>>>> >>>>> =E4=B8=BB=E9=A2=98: Re: =E5=9B=9E=E5=A4=8D: [PATCH v2 01/11] MdePkg, = OvmfPkg: Clean up GHCB >> field >>>>> offsets and save area >>>>> >>>>> On 10/19/20 14:50, Tom Lendacky wrote: >>>>>> On 10/18/20 8:41 PM, gaoliming wrote: >>>>> >>>>>>> Please separate the patch for the change in OvmfPkg. >>>>>>> One commit can't cross the different packages. >>>>>>> I understand this is the incompatible change. But, we still need to >> follow >>>>>>> this rule. >>>>> >>>>> I disagree. >>>>> >>>>> We should do whatever we can for avoiding cross-package patches, but = in >>>>> some cases, they are unavoidable. This is one of those cases. >>>> >>>> I suggest to define enum GHCB_QWORD_OFFSET, then use typedef >> GHCB_QWORD_OFFSET GHCB_REGISTER; in Ghcb.h >>>> The comments can be added here to describe it is for compatibility. Th= e old >> one is not recommend. >>>> >>>> Then, the change in MdePkg is compatible. Next patch is to update >> OvmfPkg VmgExit to consume GHCB_QWORD_OFFSET. >>> >>> Ah, I totally missed that we could use typedef to bridge the gap. That >>> indeed allows us to do the rename in three steps (only for the type >>> name, the enum constant identifiers can stay the same). After the >>> rename, the enum constant values can be cleaned up in a separate (4th) >>> patch. >> >> It seems like a lot of churn for just renaming. If there are no >> objections, I'll keep the GHCB_REGISTER name. The important piece is the >> change from hardcoding the offset values to using a calculated value. >> > I am fine to keep current GHCB_REGISTER name.=20 This raises a question about patch 10 of the series. Since that patch changes interfaces, I included both the UefiCpuPkg and OvmfPkg changes in that one patch. Will that be acceptable? Thanks, Tom >=20 > Thanks > Liming >=20 >> Thanks, >> Tom >> >>> >>> Thank you! >>> Laszlo >>> >>>> >>>> Thanks >>>> Liming >>>>> >>>>>> Ok, then I'll resubmit without the name change. To me, it's not wort= h >>>>>> doing 3 commits just to accomplish the rename from GHCB_REGISTER to >>>>>> GHCB_QWORD_OFFSET. >>>>> >>>>> When reviewing v1, I immediately thought of doing the rename in 3 >>>>> commits (introduce new type, rebase client sites, remove old type). I >>>>> didn't suggest it because it wouldn't work. >>>>> >>>>> I wrote: >>>>> >>>>> we are not changing the identifiers of the enumeration constants >>>>> (such as GhcbCpl). Because those identifiers are declared at file >>>>> scope, having both GHCB_REGISTER and GHCB_QWORD_OFFSET >>>>> declare >>>>> (e.g.) GhcbCpl would cause a compilation failure. Therefore we ca= n't >>>>> implement this in multiple stages (first introduce >>>>> GHCB_QWORD_OFFSET, then remove GHCB_REGISTER separately). >>>>> >>>>> In other words, if we attempted to do this in 3 stages, then the 2nd >>>>> patch (introducing the new type, in addition to the old type) would n= ot >>>>> compile. The new type could not reuse the old type's enum constants >>>>> (their identifiers). So we'd either have to change the enum constant >>>>> names of the old type (and then we'd be back to square 1 -- the clien= t >>>>> sites would have to be migrated in the same patch), or introduce the = new >>>>> type with new enum constant names as well. But then, the client sites >>>>> would have to be migrated to the new enum constant names as well, not >>>>> just the new enum type name. >>>>> >>>>> This is why I said that, IMO, in this case a cross-package patch was >>>>> acceptable. Because otherwise we could never rename an enum type >> without >>>>> also renaming the enum constants. >>>>> >>>>> Thanks >>>>> Laszlo >>>> >>>> >>>> >>> >=20 >=20