Re: [PATCH v2 6/8] KVM: SEV: Add SNP vCPU state get and set commands

From: Tony Lindgren

Date: Fri Sep 18 2026 - 01:38:40 EST


On Thu, Sep 17, 2026 at 04:59:37PM +0200, Jörg Rödel wrote:
> Hi Tony,
>
> On Thu, Sep 17, 2026 at 09:27:47AM +0300, Tony Lindgren wrote:
> > Oh OK, so calling for both hypervisor and confidential VCPU state would be
> > needed. The difference could be specified in the struct kvm_vcpu_transfer
> > flags?
>
> Or hypervisor state is migrated outside of the CVM live migration interface? From QEMUs
> perspective it is not different to other state like for emulated devices and
> such. Does TDX also have per-cpu hypervisor state that needs to be migrated?
>
> In any case, for SNP this state must be settable from QEMU to correctly support
> IGVM loading, so an interface outside of live migration is needed :)

Oh OK so the per-cpu hypervisor state is part of the IGVM loading.

Yes the per-vcpu migration is a bit different for TDX. No two separate
steps like you're describing for vCPU migration (per-cpu for vCPU
registers and per-cpu for hypervisor state).

After stopping the TDX source, the VM state is migrated. And then the
per-cpu state. The per-vcpu state is just a QEMU VMState for TDX too,
and it needs the help of KVM to export the state into an encrypted blob.