qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [QEMU PATCH v4 0/10]: target/i386: kvm: Add support for save and restore of nested state
@ 2019-06-19 16:21 Liran Alon
  2019-06-19 16:21 ` [Qemu-devel] [QEMU PATCH v4 01/10] target/i386: kvm: Delete VMX migration blocker on vCPU init failure Liran Alon
                   ` (10 more replies)
  0 siblings, 11 replies; 20+ messages in thread
From: Liran Alon @ 2019-06-19 16:21 UTC (permalink / raw)
  To: qemu-devel
  Cc: ehabkost, kvm, maran.wilson, mtosatti, dgilbert, pbonzini, rth, jmattson

Hi,

This series aims to add support for QEMU to be able to migrate VMs that
are running nested hypervisors. In order to do so, it utilizes the new
IOCTLs introduced in KVM commit 8fcc4b5923af ("kvm: nVMX: Introduce
KVM_CAP_NESTED_STATE") which was created for this purpose.

1st patch add a missed cleanup for deleting VMX migration blocker in
case vCPU init fails.

2st patch introduce kvm_arch_destroy_vcpu() to perform per-vCPU
destruction logic that is arch-dependent.

3st patch is just refactoring to use symbolic constants instead of hard-coded
numbers.

4st patch fixes QEMU to update DR6 when QEMU re-inject #DB to guest after
it was intercepted by KVM when guest is debugged.

5th patch adds migration blocker for vCPU exposed with either Intel VMX
or AMD SVM. Until now it was blocked only for Intel VMX.

6rd patch updates linux-headers to have updated struct kvm_nested_state.
The updated struct now have explicit fields for the data portion.

7rd patch add vmstate support for saving/restoring kernel integer types (e.g. __u16).

8th patch adds support for saving and restoring nested state in order to migrate
guests which run a nested hypervisor.

9th patch add support for KVM_CAP_EXCEPTION_PAYLOAD. This new KVM capability
allows userspace to properly distingiush between pending and injecting exceptions.

10th patch changes the nested virtualization migration blocker to only
be added when kernel lack support for one of the capabilities required
for correct nested migration. i.e. Either KVM_CAP_NESTED_STATE or
KVM_CAP_EXCEPTION_PAYLOAD.

Regards,
-Liran

v1->v2 changes:
* Add patch to fix bug when re-inject #DB to guest.
* Add support for KVM_CAP_EXCEPTION_PAYLOAD.
* Use explicit fields for struct kvm_nested_state data portion.
* Use vmstate subsections to save/restore nested state in order to properly
* support forward & backwards migration compatability.
* Remove VMX migration blocker.

v2->v3 changes:
* Add kvm_arch_destroy_vcpu().
* Use DR6_BS where appropriate.
* Add cpu_pre_save() logic to convert pending exception to injected
  exception if guest is running L2.
* Converted max_nested_state_len to int instead of uint32_t.
* Use kvm_arch_destroy_vcpu() to free nested_state.
* Add migration blocker for vCPU exposed with AMD SVM.
* Don't rely on CR4 or MSR_EFER to know if it is required to
migrate new VMState subsections.
* Signal if vCPU is in guest-mode in hflags as original intention by Paolo.

v3->v4 changes:
* Add delete of nested migration blocker in case vCPU init fail.
* Change detection of VMX/SVM to not consider CPU vendor.
* Modify linux-headers to not have SVM stubs and use constant for vmcs12 size.
* Wrapped definition of kernel integer vmstate macros with #ifdef CONFIG_LINUX.
* Add migration blocker in case vCPU is exposed with VMX/SVM and kernel
  is lacking one of the KVM caps required to migrate nested workloads.



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2019-06-20 14:14 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19 16:21 [Qemu-devel] [QEMU PATCH v4 0/10]: target/i386: kvm: Add support for save and restore of nested state Liran Alon
2019-06-19 16:21 ` [Qemu-devel] [QEMU PATCH v4 01/10] target/i386: kvm: Delete VMX migration blocker on vCPU init failure Liran Alon
2019-06-19 20:30   ` Maran Wilson
2019-06-19 20:33     ` Liran Alon
2019-06-19 20:48       ` Maran Wilson
2019-06-19 16:21 ` [Qemu-devel] [QEMU PATCH v4 02/10] KVM: Introduce kvm_arch_destroy_vcpu() Liran Alon
2019-06-19 16:21 ` [Qemu-devel] [QEMU PATCH v4 03/10] target/i386: kvm: Use symbolic constant for #DB/#BP exception constants Liran Alon
2019-06-19 16:21 ` [Qemu-devel] [QEMU PATCH v4 04/10] target/i386: kvm: Re-inject #DB to guest with updated DR6 Liran Alon
2019-06-19 16:21 ` [Qemu-devel] [QEMU PATCH v4 05/10] target/i386: kvm: Block migration for vCPUs exposed with nested virtualization Liran Alon
2019-06-19 16:21 ` [Qemu-devel] [QEMU PATCH v4 06/10] linux-headers: i386: Modify struct kvm_nested_state to have explicit fields for data Liran Alon
2019-06-19 21:17   ` Maran Wilson
2019-06-19 16:21 ` [Qemu-devel] [QEMU PATCH v4 07/10] vmstate: Add support for kernel integer types Liran Alon
2019-06-19 17:37   ` Dr. David Alan Gilbert
2019-06-19 16:21 ` [Qemu-devel] [QEMU PATCH v4 08/10] target/i386: kvm: Add support for save and restore nested state Liran Alon
2019-06-19 16:21 ` [Qemu-devel] [QEMU PATCH v4 09/10] target/i386: kvm: Add support for KVM_CAP_EXCEPTION_PAYLOAD Liran Alon
2019-06-19 16:21 ` [Qemu-devel] [QEMU PATCH v4 10/10] target/i386: kvm: Add nested migration blocker only when kernel lacks required capabilities Liran Alon
2019-06-19 23:52   ` Maran Wilson
2019-06-20 12:38 ` [Qemu-devel] [QEMU PATCH v4 0/10]: target/i386: kvm: Add support for save and restore of nested state Paolo Bonzini
2019-06-20 13:28   ` Liran Alon
2019-06-20 13:40     ` Liran Alon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).