From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.47]) by mx.groups.io with SMTP id smtpd.web10.5879.1603199404939206858 for ; Tue, 20 Oct 2020 06:10:05 -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=AFOHCKK7; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.236.47, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ksemrYzz7SOKlDsggjKp+ODu82UdbuVGP0Wts/Uf/yfRlmOBCqI6AgxBwp7HFKrCYaKDAZblWai972+IhSQqG1V7pJX6KpYM8xbKMohHXOcyhTEu8iDtRuW+Slympup69KhYTNATYjCS8vc8MOpzXm++yIi0Ly7UbJ6kqSu1TutvoJ74Bi3C69onHDBxsgJQzO9ff/OapogP6fKH6YhIurjW8hCd0bt3yLtDPEa7TI2sI0dAcrBNR6Ew0hynbAVzEnXSH+KaXjaQyNIC0kzkkAj0zR7ohG9LUBeQlH9+m1eXLsGpdDYJCpKlMmhCARgQ4AMZmbB2OD0BywMcCgisvQ== 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=0Gvbsy7QE/4bKKkanRAS6EO2CEt0q0S2CqRd5RCZ2eA=; b=LRYSLhIM8dcXyaVLYQpcELGzLIHgSTEwsWucYFcUbsz+f8LeCCGAjsNZ+hmdVjf6R7HmkN3T+w745HuU5GDmIPU6Xjjety18z43wZ/mL5ZCm+l5KzR0m3NDr2IaDTNnpr16erlFkKyQEsXgGAEFocPu5c1cLScyKTVkmRpJnwHaBYNyPpwRCVAo8QA1hGCdtj0pEm+weDbrGGGYWI3hG+s0gE7gqo56UVtEncAbB0eZOfL1fztBfaCHhafoynC9uTHvW+mLP2yUL3GwjTRf7ip1FxoAl7323tVkBxHZyoPCn7xv+hPUccXCnBnLidZlLCbxFNNLp/BOuSc1vtZY6vA== 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=0Gvbsy7QE/4bKKkanRAS6EO2CEt0q0S2CqRd5RCZ2eA=; b=AFOHCKK7Igo+dYTKGL71oAiX8FlLHed8FdxRFOBq0iupkMfnvLj9Dw1o4YvF3hBY64rMMhqihnzXB+/a23p967m5jaQISxrolRD0gHm7v9nN5cmE1B6MHqjSqCiNCKqmb3xPOTeSEbPhCLOUd5xykgpn/ENHkxmTKTbK3QOWygQ= 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 DM6PR12MB4988.namprd12.prod.outlook.com (2603:10b6:5:16a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.23; Tue, 20 Oct 2020 13:10:03 +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.3477.028; Tue, 20 Oct 2020 13:10:03 +0000 Subject: =?UTF-8?B?UmU6IOWbnuWkjTog5Zue5aSNOiBbUEFUQ0ggdjIgMDEvMTFdIE1kZVBrZywgT3ZtZlBrZzogQ2xlYW4gdXAgR0hDQiBmaWVsZCBvZmZzZXRzIGFuZCBzYXZlIGFyZWE=?= To: Laszlo Ersek , gaoliming , 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> From: "Lendacky, Thomas" Message-ID: <8734b948-e36c-81f4-43ae-6c63fba1374b@amd.com> Date: Tue, 20 Oct 2020 08:10:01 -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: [165.204.77.1] X-ClientProxiedBy: SN4PR0701CA0017.namprd07.prod.outlook.com (2603:10b6:803:28::27) 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 SN4PR0701CA0017.namprd07.prod.outlook.com (2603:10b6:803:28::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Tue, 20 Oct 2020 13:10:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 98599f4d-a6f1-4be8-34a2-08d874f974e6 X-MS-TrafficTypeDiagnostic: DM6PR12MB4988: 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: +9cg7XiN9nD6D4KSP4LMd1S6ZHBJH1+TqOzwmK/BnobmmyUaNoeX0iqvN5tSbI0yAb//5mNkLu8BlxP1wqTEoZCQEaw8DKCoTDjZslkcPRPsT+hV49sfmzJTcbHz1yO5emNigjG8bxCqnI80S65M9aJrh4zW5Z1kFwEHc+bPRKI2wj86i4IoXxz7vC9C2rQ7XsIderXW1tbNAoHSR4Dm5QEk31/tllfd0r6LxG0LkAepG+5QeFtvSrenGYCaRzivITYgx020+2WUX5yuDulINSWE7DWDq0jcxsdWaa+RfsIvTC2dWPpGYdzuwJ+0zfS+ScL6RPPK06/Fn9GhT8DEkD/E2RzcTTZ7UVdRdDIADj/qlni8f7xJcqoK+BvzfqNO 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)(136003)(376002)(346002)(396003)(366004)(86362001)(2906002)(6486002)(110136005)(316002)(224303003)(956004)(31686004)(2616005)(16576012)(16526019)(53546011)(54906003)(31696002)(186003)(26005)(83380400001)(36756003)(52116002)(4326008)(66946007)(66476007)(66556008)(8936002)(5660300002)(478600001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: r/i5gXtrmYDLs7MR78oqOtVtZ5LCtdmgGaDJCqt8TAYjAmhk7AtOCmrAmqyozlKd8pHovT5xu7LQTC09Simy+J+n4n3ASAf+DKb4gsxBR14t4fTtcePeILZ86Ls30gQcgSrZa/hSTywKHKn73BUAmEuQOGeApEqwjxfK5odQkq7OauAC3epa569XdImroE0sBBmlv+B0VsNGN082weTqLghY/sgpDdVeiNqPlWYYkP9Tqy0VHkGz3IKHccffkxTq+Ied2snlZfUHfpbB06Ax10b5OmjhHF5UZUmLEy0l+c0fa6gDk7OC4+AKmjHT+Vdky1l8fp/bKygTdF56yWnvNpLMtGUGzt1GctEg3o+BRUG49hc/lukfgkVIdshZehDKprRk2EhsLmwzwf6Nic3JZ41MyIuigIgTUOkgg5suSaglH2vMXPYg39wH9Kdj2bOdd3uNDUuCmIQaOxrlljlzyVSfuXuQU0z8UP9rNBlc+0yoOStWRFTCVLRyW767SAQpN9dOgl+CzDHAIM9iiCh5zqiA9+gNAbapTbwh2nz6vos1nj0Udm6MAedZeSFJBodIY7a8Ez9o53+t2rfOPKeOeg4OrwVfGuRYS7jX9wCak+F0c9cvGWU1YzwRlV8h1RM6HSokfCde91ZHGxCq99+Qxw== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98599f4d-a6f1-4be8-34a2-08d874f974e6 X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2020 13:10:03.2826 (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: poA9VxHQAy/f82hVWV76XXeUia2iGAkrCfw7banJ1ZUfyXwYcUGJVgdDQs5xdUPXANX32Y28ZJpcjfvW+kSJcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4988 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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 ; ga= oliming >>> ; 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, Ov= mfPkg: 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 f= ollow >>>>> 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. The = old one is not recommend. >> >> Then, the change in MdePkg is compatible. Next patch is to update OvmfPk= g VmgExit to consume GHCB_QWORD_OFFSET.=20 >=20 > 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. Thanks, Tom >=20 > Thank you! > Laszlo >=20 >> >> Thanks >> Liming >>> >>>> Ok, then I'll resubmit without the name change. To me, it's not worth >>>> 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 can'= 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 not >>> 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 client >>> sites would have to be migrated in the same patch), or introduce the ne= w >>> 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 withou= t >>> also renaming the enum constants. >>> >>> Thanks >>> Laszlo >> >> >> >=20