lkml.org 
[lkml]   [2021]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC] KVM: x86: Support KVM VMs sharing SEV context
Date
On 11/03/21 16:30, Tobin Feldman-Fitzthum wrote:
> I am not sure how the mirror VM will be supported in QEMU. Usually there
> is one QEMU process per-vm. Now we would need to run a second VM and
> communicate with it during migration. Is there a way to do this without
> adding significant complexity?

I can answer this part. I think this will actually be simpler than with
auxiliary vCPUs. There will be a separate pair of VM+vCPU file
descriptors within the same QEMU process, and some code to set up the
memory map using KVM_SET_USER_MEMORY_REGION.

However, the code to run this VM will be very small as the VM does not
have to do MMIO, interrupts, live migration (of itself), etc. It just
starts up and communicates with QEMU using a mailbox at a predetermined
address.

I also think (but I'm not 100% sure) that the auxiliary VM does not have
to watch changes in the primary VM's memory map (e.g. mapping and
unmapping of BARs). In QEMU terms, the auxiliary VM's memory map tracks
RAMBlocks, not MemoryRegions, which makes things much simpler.

There are already many examples of mini VMMs running special purpose VMs
in the kernel's tools/testing/selftests/kvm directory, and I don't think
the QEMU code would be any more complex than that.

Paolo

\
 
 \ /
  Last update: 2021-03-11 17:31    [W:1.421 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site