Skip to content

RFC Add support for Mirror VM.

Ashish Kalra kvm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest13 patches 48 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13machine: Add mirrorvcpus=N suboption to -smphw/core/machine.c hw/i386/pc.c include/hw/boards.h +2 more+22 -11 reply
2/13hw/boards: Add mirror_vcpu flag to CPUArchIdinclude/hw/boards.h+2 -00 replies
3/13hw/i386: Mark mirror vcpus in possible_cpushw/i386/x86.c+2 -00 replies
4/13hw/acpi: Don't include mirror vcpus in ACPI tableshw/acpi/cpu.c hw/i386/acpi-build.c hw/i386/acpi-common.c+20 -00 replies
5/13cpu: Add boolean mirror_vcpu field to CPUStatehw/core/cpu-common.c include/hw/core/cpu.h+4 -00 replies
6/13hw/i386: Set CPUState.mirror_vcpu=true for mirror vcpushw/i386/x86.c include/hw/i386/x86.h+9 -30 replies
7/13kvm: Add Mirror VM ioctl and enable cap interfaces.accel/kvm/kvm-all.c include/sysemu/kvm.h+37 -00 replies
8/13kvm: Add Mirror VM support.accel/kvm/kvm-accel-ops.c accel/kvm/kvm-all.c accel/kvm/kvm-cpus.h +2 more+277 -40 replies
9/13kvm: create Mirror VM and share primary VM's encryption context.accel/kvm/kvm-all.c+30 -00 replies
10/13softmmu/cpu: Skip mirror vcpu's for pause, resume and synchronization.softmmu/cpus.c+27 -00 replies
11/13kvm/apic: Disable in-kernel APIC support for mirror vcpu's.hw/i386/kvm/apic.c+15 -00 replies
12/13hw/acpi: disable modern CPU hotplug interface for mirror vcpu'shw/acpi/cpu.c include/hw/acpi/cpu.h+11 -10 replies
13/13hw/i386/pc: reduce fw_cfg boot cpu count taking into account mirror vcpu's.hw/i386/pc.c+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/13] Add support for Mirror VM.

From: Ashish Kalra <[email protected]>

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(-)
Signature · 1 line
2.17.1