@@ -944,6 +944,7 @@
'if': 'CONFIG_SECRET_KEYRING' },
'sev-guest',
'thread-context',
+ 'sw-protected-vm',
's390-pv-guest',
'throttle-group',
'tls-creds-anon',
@@ -5,6 +5,7 @@ i386_softmmu_kvm_ss = ss.source_set()
i386_softmmu_kvm_ss.add(files(
'kvm.c',
'kvm-cpu.c',
+ 'sw-protected-vm.c',
))
i386_softmmu_kvm_ss.add(when: 'CONFIG_XEN_EMU', if_true: files('xen-emu.c'))
new file mode 100644
@@ -0,0 +1,35 @@
+/*
+ * QEMU X86_SW_PROTECTED_VM SUPPORT
+ *
+ * Author:
+ * Xiaoyao Li <xiaoyao.li@intel.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "qom/object_interfaces.h"
+
+#include "sw-protected-vm.h"
+
+/* x86-sw-protected-vm */
+OBJECT_DEFINE_TYPE_WITH_INTERFACES(SwProtectedVm,
+ sw_protected_vm,
+ SW_PROTECTED_VM,
+ CONFIDENTIAL_GUEST_SUPPORT,
+ { TYPE_USER_CREATABLE },
+ { NULL })
+
+static void sw_protected_vm_init(Object *obj)
+{
+}
+
+static void sw_protected_vm_finalize(Object *obj)
+{
+}
+
+static void sw_protected_vm_class_init(ObjectClass *oc, void *data)
+{
+}
new file mode 100644
@@ -0,0 +1,17 @@
+#ifndef QEMU_I386_SW_PROTECTED_VM_H
+#define QEMU_I386_SW_PROTECTED_VM_H
+
+#include "exec/confidential-guest-support.h"
+
+#define TYPE_SW_PROTECTED_VM "sw-protected-vm"
+#define SW_PROTECTED_VM(obj) OBJECT_CHECK(SwProtectedVm, (obj), TYPE_SW_PROTECTED_VM)
+
+typedef struct SwProtectedVmClass {
+ ConfidentialGuestSupportClass parent_class;
+} SwProtectedVmClass;
+
+typedef struct SwProtectedVm {
+ ConfidentialGuestSupport parent_obj;
+} SwProtectedVm;
+
+#endif /* QEMU_I386_SW_PROTECTED_VM_H */
Introduce sw-protected-vm object which implements the interface of CONFIDENTIAL_GUEST_SUPPORT, and will be used to create X86_SW_PROTECTED_VM via $qemu -machine ...,confidential-guest-support=sp-vm0 \ -object sw-protected-vm,id=sp-vm0 Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> --- qapi/qom.json | 1 + target/i386/kvm/meson.build | 1 + target/i386/kvm/sw-protected-vm.c | 35 +++++++++++++++++++++++++++++++ target/i386/kvm/sw-protected-vm.h | 17 +++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 target/i386/kvm/sw-protected-vm.c create mode 100644 target/i386/kvm/sw-protected-vm.h