Bug 8572 - Support live migration for CSV/CSV2 guest, and support rebooting CSV/CSV2 guest
Summary: Support live migration for CSV/CSV2 guest, and support rebooting CSV/CSV2 guest
Status: NEW
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: X86 (show other bugs) X86
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: Guanjun
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-19 19:22 UTC by wojiaohanliyang
Modified: 2024-03-19 20:53 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wojiaohanliyang hygon_group 2024-03-19 19:22:14 UTC
Description of problem:

1. support CSV/CSV2 migration:
a) The link https://bugzilla.openanolis.cn/show_bug.cgi?id=5885 is about support
for AMD SEV guest live migration. The migration of this solution is very slow because API communication between x86 and PSP is time-consuming. In order to accelerate the migration speed, we proposed ring buffer mode to handle the migration API. [Reference: https://bugzilla.openanolis.cn/show_bug.cgi?id=5938]
b) The register states of CSV2 guest are protected by encrypted VMSA. When live migrate a CSV2 guest, we need invoke SEND_UPDATE_VMSA to prepare for transfer VMSA at the source side, and invoke RECEIVE_UPDATE_VMSA to restore VMSA at the receipt side. GHCB registers are important component to support communication between KVM and CSV2 guest. The GHCB register supports two modes: msr negotiation, or shared memory page. When migrate a CSV2 guest, the GHCB register states also should be migrated. The VCPU mode is crucial for the operation of a VM, KVM will track VCPU mode in auxiliary register values (see struct kvm_vcpu_arch) and determine the guest context. In order to support CSV2 guest run under correct VCPU mode, the auxiliary register values should be migrated when migrating CSV2 guest. [Reference: https://bugzilla.openanolis.cn/show_bug.cgi?id=5950]

2. support CSV/CSV2 reboot:
a) Currently, when reboot a memory encrypted guest, it'is possible that the virtual machine may crash due to cache consistency issues. But KVM doesn't know whether the guest is rebooting, we introduce ioctl interfaces to support notifying KVM that the guest is rebooting so that flush the cache at appropriate time. KVM use guest_state_protected to indicate the VMSA is encrypted and should not update the related vCPU states anymore. In order to support rebooting a CSV2 guest, we use the ioctl interfaces dictated above to notify KVM that the vCPU states can be initailized during rebooting. [Reference: https://bugzilla.openanolis.cn/show_bug.cgi?id=6135]

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 小龙 admin 2024-03-19 20:53:55 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2913