From: Ashish Kalra <ashish.kalra@xxxxxxx> This is an RFC series for Mirror VM support that are essentially secondary VMs sharing the encryption context (ASID) with a primary VM. The patch-set creates a new VM and shares the primary VM's encryption context with it using the KVM_CAP_VM_COPY_ENC_CONTEXT_FROM capability. The mirror VM uses a separate pair of VM + vCPU file descriptors and also uses a simplified KVM run loop, for example, it does not support any interrupt vmexit's. etc. Currently the mirror VM shares the address space of the primary VM. The mirror VM can be used for running an in-guest migration helper (MH). It also might have future uses for other in-guest operations. The mirror VM support is enabled by adding a mirrorvcpus=N suboption to -smp, which also designates a few vcpus (normally 1) to the mirror VM. Example usage for starting a 4-vcpu guest, of which 1 vcpu is marked as mirror vcpu. qemu-system-x86_64 -smp 4,mirrorvcpus=1 ... Ashish Kalra (7): kvm: Add Mirror VM ioctl and enable cap interfaces. kvm: Add Mirror VM support. kvm: create Mirror VM and share primary VM's encryption context. softmmu/cpu: Skip mirror vcpu's for pause, resume and synchronization. kvm/apic: Disable in-kernel APIC support for mirror vcpu's. hw/acpi: disable modern CPU hotplug interface for mirror vcpu's hw/i386/pc: reduce fw_cfg boot cpu count taking into account mirror vcpu's. Dov Murik (5): machine: Add mirrorvcpus=N suboption to -smp hw/boards: Add mirror_vcpu flag to CPUArchId hw/i386: Mark mirror vcpus in possible_cpus cpu: Add boolean mirror_vcpu field to CPUState hw/i386: Set CPUState.mirror_vcpu=true for mirror vcpus Tobin Feldman-Fitzthum (1): hw/acpi: Don't include mirror vcpus in ACPI tables accel/kvm/kvm-accel-ops.c | 45 ++++++- accel/kvm/kvm-all.c | 244 +++++++++++++++++++++++++++++++++++++- accel/kvm/kvm-cpus.h | 2 + hw/acpi/cpu.c | 21 +++- hw/core/cpu-common.c | 1 + hw/core/machine.c | 7 ++ hw/i386/acpi-build.c | 5 + hw/i386/acpi-common.c | 5 + hw/i386/kvm/apic.c | 15 +++ hw/i386/pc.c | 10 ++ hw/i386/x86.c | 11 +- include/hw/acpi/cpu.h | 1 + include/hw/boards.h | 3 + include/hw/core/cpu.h | 3 + include/hw/i386/x86.h | 3 +- include/sysemu/kvm.h | 15 +++ qapi/machine.json | 5 +- softmmu/cpus.c | 27 +++++ softmmu/vl.c | 3 + target/i386/kvm/kvm.c | 42 +++++++ 20 files changed, 459 insertions(+), 9 deletions(-) -- 2.17.1