Support live migration for Hygon CSV1/2/3 guest, fix nesting #VC Exception #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The live migration for Hygon CSV1/2/3 guest depends on the KVM hypercall KVM_HC_MAP_GPA_RANGE, add
code to sync page enc/dec status to KVM. Then, KVM transfer these info to Qemu. During live migration, Qemu will check
whether request firmware APIs to assist migrate private pages of the guest.
In addition, OVMF will setup efi variable to express whether live migration is supported to guest's kernel. If live migration is
supported, the guest's kernel will invoke KVM_HC_MAP_GPA_RANGE to tell page enc/dec status changes when dynamic
change page enc/dec mappings.
The MMIO routine of VC handler will get memory encrypt status to validate MMIO address. MemEncryptSevGetEncryptionMask() will enable interrupt while interrupt must be disabled during VC. During DXE stage, VC routine as below:
CcExitHandleVc
-> MemEncryptSevGetAddressRangeState
-> MemEncryptSevGetEncryptionMask->PcdGet64(PcdPteMemoryEncryptionAddressOrMask)
[ hly: Fix the changelog of edk2 (2024.08-2deepin1). ]
How to Test
Code requirements
Generated binaries
Live migrate CSV guest to target machine