confidential guest support: Rework the "memory-encryption" property
commite0292d7c62673546c01d5c6b245735fdfef81840
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 4 Dec 2020 01:51:51 +0000 (4 12:51 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 8 Feb 2021 05:57:38 +0000 (8 16:57 +1100)
tree299d7c5c221b67eede72de51c7c7ec6a83b90d08
parent6e6a6ca7d9097d1aa68089379cdaa7553dad7a25
confidential guest support: Rework the "memory-encryption" property

Currently the "memory-encryption" property is only looked at once we
get to kvm_init().  Although protection of guest memory from the
hypervisor isn't something that could really ever work with TCG, it's
not conceptually tied to the KVM accelerator.

In addition, the way the string property is resolved to an object is
almost identical to how a QOM link property is handled.

So, create a new "confidential-guest-support" link property which sets
this QOM interface link directly in the machine.  For compatibility we
keep the "memory-encryption" property, but now implemented in terms of
the new property.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
accel/kvm/kvm-all.c
accel/kvm/sev-stub.c
hw/core/machine.c
include/hw/boards.h
include/sysemu/sev.h
target/i386/sev.c