From: "Lendacky, Thomas" <thomas.lendacky@amd.com>
To: Laszlo Ersek <lersek@redhat.com>,
gaoliming <gaoliming@byosoft.com.cn>,
devel@edk2.groups.io
Cc: 'Brijesh Singh' <brijesh.singh@amd.com>,
'Michael D Kinney' <michael.d.kinney@intel.com>,
'Zhiguang Liu' <zhiguang.liu@intel.com>,
'Jordan Justen' <jordan.l.justen@intel.com>,
'Ard Biesheuvel' <ard.biesheuvel@arm.com>
Subject: Re: 回复: 回复: [PATCH v2 01/11] MdePkg, OvmfPkg: Clean up GHCB field offsets and save area
Date: Tue, 20 Oct 2020 08:10:01 -0500 [thread overview]
Message-ID: <8734b948-e36c-81f4-43ae-6c63fba1374b@amd.com> (raw)
In-Reply-To: <cbbbef09-2e81-3711-41b3-57d46647bf45@redhat.com>
On 10/20/20 3:31 AM, Laszlo Ersek wrote:
> On 10/20/20 03:08, gaoliming wrote:
>> Laszlo and Tom:
>>
>>> -----邮件原件-----
>>> 发件人: Laszlo Ersek <lersek@redhat.com>
>>> 发送时间: 2020年10月20日 4:42
>>> 收件人: Tom Lendacky <thomas.lendacky@amd.com>; gaoliming
>>> <gaoliming@byosoft.com.cn>; devel@edk2.groups.io
>>> 抄送: 'Brijesh Singh' <brijesh.singh@amd.com>; 'Michael D Kinney'
>>> <michael.d.kinney@intel.com>; 'Zhiguang Liu' <zhiguang.liu@intel.com>;
>>> 'Jordan Justen' <jordan.l.justen@intel.com>; 'Ard Biesheuvel'
>>> <ard.biesheuvel@arm.com>
>>> 主题: Re: 回复: [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. The 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.
Thanks,
Tom
>
> Thank you!
> Laszlo
>
>>
>> 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 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
>>
>>
>>
>
next prev parent reply other threads:[~2020-10-20 13:10 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-16 16:09 [PATCH v2 00/11] SEV-ES guest support fixes and cleanup Lendacky, Thomas
2020-10-16 16:09 ` [PATCH v2 01/11] MdePkg, OvmfPkg: Clean up GHCB field offsets and save area Lendacky, Thomas
2020-10-19 1:41 ` 回复: " gaoliming
2020-10-19 12:50 ` Lendacky, Thomas
2020-10-19 20:17 ` Laszlo Ersek
2020-10-19 20:48 ` Lendacky, Thomas
2020-10-19 20:42 ` Laszlo Ersek
2020-10-20 1:08 ` 回复: " gaoliming
2020-10-20 8:31 ` Laszlo Ersek
2020-10-20 13:10 ` Lendacky, Thomas [this message]
2020-10-21 0:54 ` 回复: " gaoliming
2020-10-21 21:54 ` Lendacky, Thomas
2020-10-22 1:25 ` 回复: [edk2-devel] " gaoliming
2020-10-22 13:12 ` Laszlo Ersek
2020-10-23 2:57 ` 回复: " gaoliming
2020-10-26 16:34 ` Lendacky, Thomas
2020-10-27 7:57 ` Dong, Eric
2020-10-28 17:42 ` Lendacky, Thomas
2020-10-21 12:29 ` Laszlo Ersek
2020-10-16 16:09 ` [PATCH v2 02/11] UefiCpuPkg/VmgExitLib: Add interfaces to set/read GHCB ValidBitmap bits Lendacky, Thomas
2020-10-19 20:46 ` [edk2-devel] " Laszlo Ersek
2020-10-16 16:09 ` [PATCH v2 03/11] OvmfPkg/VmgExitLib: Implement new VmgExitLib interfaces Lendacky, Thomas
2020-10-19 20:51 ` [edk2-devel] " Laszlo Ersek
2020-10-16 16:09 ` [PATCH v2 04/11] OvmfPkg/VmgExitLib: Set the SW exit fields when performing VMGEXIT Lendacky, Thomas
2020-10-19 20:53 ` [edk2-devel] " Laszlo Ersek
2020-10-16 16:09 ` [PATCH v2 05/11] OvmfPkg/VmgExitLib: Set the SwScratch valid bit for IOIO events Lendacky, Thomas
2020-10-19 20:54 ` [edk2-devel] " Laszlo Ersek
2020-10-16 16:09 ` [PATCH v2 06/11] OvmfPkg/VmgExitLib: Set the SwScratch valid bit for MMIO events Lendacky, Thomas
2020-10-16 16:09 ` [PATCH v2 07/11] UefiCpuPkg/MpInitLib: Set the SW exit fields when performing VMGEXIT Lendacky, Thomas
2020-10-16 16:09 ` [PATCH v2 08/11] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Set the SwScratch valid bit Lendacky, Thomas
2020-10-19 20:57 ` [edk2-devel] " Laszlo Ersek
2020-10-16 16:09 ` [PATCH v2 09/11] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Fix erase blocks for SEV-ES Lendacky, Thomas
2020-10-16 16:09 ` [PATCH v2 10/11] UefiCpuPkg, OvmfPkg: Disable interrupts when using the GHCB Lendacky, Thomas
2020-10-19 21:07 ` [edk2-devel] " Laszlo Ersek
2020-10-16 16:09 ` [PATCH v2 11/11] UefiCpuPkg/MpInitLib: For SEV-ES guest, set stack based on processor number Lendacky, Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8734b948-e36c-81f4-43ae-6c63fba1374b@amd.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox