diff options
author | Brijesh Singh <brijesh.singh@amd.com> | 2018-03-08 06:48:44 -0600 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-03-13 17:35:16 +0100 |
commit | d8575c6c0242bb1457589111e879f46348704534 (patch) | |
tree | 2b360573a58ed3ee94714080371a2b45586868e4 /target/i386/monitor.c | |
parent | 9d8ad11429fed6c54dcc7e0018dcb494927e3440 (diff) |
sev/i386: add command to initialize the memory encryption context
When memory encryption is enabled, KVM_SEV_INIT command is used to
initialize the platform. The command loads the SEV related persistent
data from non-volatile storage and initializes the platform context.
This command should be first issued before invoking any other guest
commands provided by the SEV firmware.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/monitor.c')
-rw-r--r-- | target/i386/monitor.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 0d1556f545..4eae0a6b92 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -31,6 +31,7 @@ #include "sysemu/kvm.h" #include "hmp.h" #include "qapi/error.h" +#include "sev_i386.h" #include "qapi/qapi-commands-misc.h" @@ -666,6 +667,13 @@ void hmp_info_io_apic(Monitor *mon, const QDict *qdict) SevInfo *qmp_query_sev(Error **errp) { - error_setg(errp, "SEV feature is not available"); - return NULL; + SevInfo *info; + + info = sev_get_info(); + if (!info) { + error_setg(errp, "SEV feature is not available"); + return NULL; + } + + return info; } |