aboutsummaryrefslogtreecommitdiff
path: root/target/i386/sev.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2020-10-20 17:01:19 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2021-02-08 16:57:38 +1100
commitabc27d4241f99bfaebb0b843b9a967d557ac10e8 (patch)
treeda384090a8bcbcd5476b1f2bc58f11dc0033f0f9 /target/i386/sev.c
parentc9f5aaa6bce819c1863c2a56b187cb9eb521fc92 (diff)
confidential guest support: Introduce cgs "ready" flag
The platform specific details of mechanisms for implementing confidential guest support may require setup at various points during initialization. Thus, it's not really feasible to have a single cgs initialization hook, but instead each mechanism needs its own initialization calls in arch or machine specific code. However, to make it harder to have a bug where a mechanism isn't properly initialized under some circumstances, we want to have a common place, late in boot, where we verify that cgs has been initialized if it was requested. This patch introduces a ready flag to the ConfidentialGuestSupport base type to accomplish this, which we verify in qemu_machine_creation_done(). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org>
Diffstat (limited to 'target/i386/sev.c')
-rw-r--r--target/i386/sev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 590cb31fa8..f9e9b5d8ae 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -737,6 +737,8 @@ int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
qemu_add_machine_init_done_notifier(&sev_machine_done_notify);
qemu_add_vm_change_state_handler(sev_vm_state_change, sev);
+ cgs->ready = true;
+
return 0;
err:
sev_guest = NULL;