mirror of
https://github.com/qemu/qemu.git
synced 2025-07-22 18:27:05 +00:00

Adds an IGVM loader to QEMU which processes a given IGVM file and applies the directives within the file to the current guest configuration. The IGVM loader can be used to configure both confidential and non-confidential guests. For confidential guests, the ConfidentialGuestSupport object for the system is used to encrypt memory, apply the initial CPU state and perform other confidential guest operations. The loader is configured via a new IgvmCfg QOM object which allows the user to provide a path to the IGVM file to process. Signed-off-by: Roy Hopkins <roy.hopkins@randomman.co.uk> Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Gerd Hoffman <kraxel@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Link: https://lore.kernel.org/r/ae3a07d8f514d93845a9c16bb155c847cb567b0d.1751554099.git.roy.hopkins@randomman.co.uk Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
/*
|
|
* QEMU IGVM interface
|
|
*
|
|
* Copyright (C) 2023-2024 SUSE
|
|
*
|
|
* Authors:
|
|
* Roy Hopkins <roy.hopkins@randomman.co.uk>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
|
|
#include "system/igvm-cfg.h"
|
|
#include "igvm.h"
|
|
#include "qom/object_interfaces.h"
|
|
|
|
static char *get_igvm(Object *obj, Error **errp)
|
|
{
|
|
IgvmCfg *igvm = IGVM_CFG(obj);
|
|
return g_strdup(igvm->filename);
|
|
}
|
|
|
|
static void set_igvm(Object *obj, const char *value, Error **errp)
|
|
{
|
|
IgvmCfg *igvm = IGVM_CFG(obj);
|
|
g_free(igvm->filename);
|
|
igvm->filename = g_strdup(value);
|
|
}
|
|
|
|
OBJECT_DEFINE_TYPE_WITH_INTERFACES(IgvmCfg, igvm_cfg, IGVM_CFG, OBJECT,
|
|
{ TYPE_USER_CREATABLE }, { NULL })
|
|
|
|
static void igvm_cfg_class_init(ObjectClass *oc, const void *data)
|
|
{
|
|
IgvmCfgClass *igvmc = IGVM_CFG_CLASS(oc);
|
|
|
|
object_class_property_add_str(oc, "file", get_igvm, set_igvm);
|
|
object_class_property_set_description(oc, "file",
|
|
"Set the IGVM filename to use");
|
|
|
|
igvmc->process = qigvm_process_file;
|
|
}
|
|
|
|
static void igvm_cfg_init(Object *obj)
|
|
{
|
|
}
|
|
|
|
static void igvm_cfg_finalize(Object *obj)
|
|
{
|
|
}
|