mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-30 13:31:52 -06:00
target/i386/sev: Move qmp_query_sev_launch_measure() to sev.c
Move qmp_query_sev_launch_measure() from monitor.c to sev.c and make sev_get_launch_measurement() static. We don't need the stub anymore, remove it. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20211007161716.453984-21-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
8371df2902
commit
0875a7038b
4 changed files with 20 additions and 21 deletions
|
@ -710,23 +710,6 @@ void hmp_info_sev(Monitor *mon, const QDict *qdict)
|
||||||
qapi_free_SevInfo(info);
|
qapi_free_SevInfo(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp)
|
|
||||||
{
|
|
||||||
char *data;
|
|
||||||
SevLaunchMeasureInfo *info;
|
|
||||||
|
|
||||||
data = sev_get_launch_measurement();
|
|
||||||
if (!data) {
|
|
||||||
error_setg(errp, "SEV launch measurement is not available");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
info = g_malloc0(sizeof(*info));
|
|
||||||
info->data = data;
|
|
||||||
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
SGXInfo *qmp_query_sgx(Error **errp)
|
SGXInfo *qmp_query_sgx(Error **errp)
|
||||||
{
|
{
|
||||||
return sgx_get_info(errp);
|
return sgx_get_info(errp);
|
||||||
|
|
|
@ -22,8 +22,9 @@ SevInfo *sev_get_info(void)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *sev_get_launch_measurement(void)
|
SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp)
|
||||||
{
|
{
|
||||||
|
error_setg(errp, "SEV is not available in this QEMU");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -742,8 +742,7 @@ sev_launch_get_measure(Notifier *notifier, void *unused)
|
||||||
trace_kvm_sev_launch_measurement(sev->measurement);
|
trace_kvm_sev_launch_measurement(sev->measurement);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
static char *sev_get_launch_measurement(void)
|
||||||
sev_get_launch_measurement(void)
|
|
||||||
{
|
{
|
||||||
if (sev_guest &&
|
if (sev_guest &&
|
||||||
sev_guest->state >= SEV_STATE_LAUNCH_SECRET) {
|
sev_guest->state >= SEV_STATE_LAUNCH_SECRET) {
|
||||||
|
@ -753,6 +752,23 @@ sev_get_launch_measurement(void)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp)
|
||||||
|
{
|
||||||
|
char *data;
|
||||||
|
SevLaunchMeasureInfo *info;
|
||||||
|
|
||||||
|
data = sev_get_launch_measurement();
|
||||||
|
if (!data) {
|
||||||
|
error_setg(errp, "SEV launch measurement is not available");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
info = g_malloc0(sizeof(*info));
|
||||||
|
info->data = data;
|
||||||
|
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
static Notifier sev_machine_done_notify = {
|
static Notifier sev_machine_done_notify = {
|
||||||
.notify = sev_launch_get_measure,
|
.notify = sev_launch_get_measure,
|
||||||
};
|
};
|
||||||
|
|
|
@ -50,7 +50,6 @@ bool sev_es_enabled(void);
|
||||||
extern SevInfo *sev_get_info(void);
|
extern SevInfo *sev_get_info(void);
|
||||||
extern uint32_t sev_get_cbit_position(void);
|
extern uint32_t sev_get_cbit_position(void);
|
||||||
extern uint32_t sev_get_reduced_phys_bits(void);
|
extern uint32_t sev_get_reduced_phys_bits(void);
|
||||||
extern char *sev_get_launch_measurement(void);
|
|
||||||
extern bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Error **errp);
|
extern bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Error **errp);
|
||||||
|
|
||||||
int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp);
|
int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue