Skip to contentSkip to conversation

Misc fixes patches

GIT PULL Applied Daniel P. Berrangé 2 participants 14 messages Nov 2 – Nov 3

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The following changes since commit 56afd82bd4db9688f1c1c9d0e2ea163b8cde3283:

Merge tag 'qemu-sparc-20261101' of https://github.com/mcayland/qemu into staging (2026-11-01 08:37:48 -0800)

are available in the Git repository at:

https://gitlab.com/berrange/qemu tags/misc-fixes-pull-request

for you to fetch changes up to b95f1036d5f8b35d8d5b4c18d33bb6564fcbf2e5:

accel/nitro: mark 'nitro' accelerator as secure (2026-11-02 17:05:33 +0000)

----------------------------------------------------------------
* Mark virtualization related machine types as secure
* Mark KVM, Xen and Nitro accelerators as secure
* Use getexecpath on OpenBSD

----------------------------------------------------------------

Brad Smith (1):
util/cutils: Use getexecpath() on OpenBSD for qemu_init_exec_dir()

Daniel P. Berrangé (11):
hw/arm: mark 'virt' as a secure machine
hw/i386: mark 'microvm', 'i440fx', 'q35' as secure machines hw/loongarch: mark 'virt' as a secure machine hw/ppc: mark 'pseries' as a secure machine hw/riscv: mark 'virt' as a secure machine hw/s390x: mark 's390x-ccw-virtio' as a secure machine
hw: mark xenpv, xenpvh, xenfv as secure machines hw/nitro: mark 'nitro' machine as secure accel/kvm: mark kvm accelerator as secure accel/xen: mark xen accelerator as secure accel/nitro: mark 'nitro' accelerator as secure

 accel/kvm/kvm-all.c        | 1 +
 accel/nitro/nitro-accel.c  | 1 +
 accel/xen/xen-all.c        | 1 +
 hw/arm/virt.c              | 1 +
 hw/arm/xen-pvh.c           | 1 +
 hw/i386/microvm.c          | 1 +
 hw/i386/pc_piix.c          | 4 ++--
 hw/i386/xen/xen-pvh.c      | 1 +
 hw/loongarch/virt.c        | 1 +
 hw/nitro/machine.c         | 1 +
 hw/ppc/spapr.c             | 1 +
 hw/riscv/virt.c            | 1 +
 hw/s390x/s390-virtio-ccw.c | 1 +
 hw/xenpv/xen_machine_pv.c  | 2 +-
 include/hw/i386/pc.h       | 1 +
 meson.build                | 8 ++++++++
 util/cutils.c              | 6 ++++++
 17 files changed, 30 insertions(+), 3 deletions(-)
Signature · 1 line
2.56.0
#1 lore raw

[PULL 08/12] hw: mark xenpv, xenpvh, xenfv as secure machines

The Xen machines are already declared secure in docs/system/security.rst, due too their intended usage in virtualization scenarios.

---
 hw/arm/xen-pvh.c          | 1 +
 hw/i386/pc_piix.c         | 4 ++--
 hw/i386/xen/xen-pvh.c     | 1 +
 hw/xenpv/xen_machine_pv.c | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)
hw/arm/xen-pvh.c +1 -0
index f05956c1662..6b85eced1bb 100644
@@ -95,6 +95,7 @@ static const TypeInfo xen_arm_machine_type = {
     .class_init = xen_arm_machine_class_init,
     .instance_size = sizeof(XenPVHMachineState),
     .instance_init = xen_arm_instance_init,
+    .secure = true,
 };
 
 static void xen_arm_machine_register_types(void)
hw/i386/pc_piix.c +2 -2
index 63c4667ea37..e801325dd6e 100644
@@ -667,6 +667,6 @@ static void xenfv_machine_4_2_options(MachineClass *m)
     m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
 }
 
-DEFINE_PC_MACHINE(xenfv_4_2, "xenfv-4.2", pc_xen_hvm_init,
-                  xenfv_machine_4_2_options);
+DEFINE_SECURE_PC_MACHINE(xenfv_4_2, "xenfv-4.2", pc_xen_hvm_init,
+                         xenfv_machine_4_2_options);
 #endif
hw/i386/xen/xen-pvh.c +1 -0
index ab90c83a830..d81575b4c9b 100644
@@ -115,6 +115,7 @@ static const TypeInfo xen_pvh_x86_machine_type = {
     .class_init = xen_pvh_machine_class_init,
     .instance_init = xen_pvh_instance_init,
     .instance_size = sizeof(XenPVHx86State),
+    .secure = true,
 };
 
 static void xen_pvh_machine_register_types(void)
hw/xenpv/xen_machine_pv.c +1 -1
index c406821c34c..e0620a096ee 100644
@@ -69,4 +69,4 @@ static void xenpv_machine_init(MachineClass *mc)
     mc->default_machine_opts = "accel=xen";
 }
 
-DEFINE_MACHINE("xenpv", xenpv_machine_init)
+DEFINE_SECURE_MACHINE("xenpv", xenpv_machine_init)
Signature · 1 line
2.56.0
#2 lore raw

[PULL 02/12] hw/arm: mark 'virt' as a secure machine

In reply to Daniel P. Berrangé

The 'virt' arm machine is already declared secure in docs/system/security.rst, due too its intended usage in virtualization scenarios.

---
 hw/arm/virt.c | 1 +
 1 file changed, 1 insertion(+)
hw/arm/virt.c +1 -0
index 3ab3ad8c3b6..55531c7eecd 100644
@@ -132,6 +132,7 @@ static void arm_virt_compat_default_set(MachineClass *mc)
         .parent = TYPE_VIRT_MACHINE, \
         .class_init = MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \
         .is_available = target_base_arm, \
+        .secure = true, \
     }; \
     static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \
     { \
Signature · 1 line
2.56.0
#3 lore raw

[PULL 11/12] accel/xen: mark xen accelerator as secure

In reply to Daniel P. Berrangé

Xen is servicing virtualization use cases which must provide security and actively maintained.

---
 accel/xen/xen-all.c | 1 +
 1 file changed, 1 insertion(+)
accel/xen/xen-all.c +1 -0
index bb2d02cb221..94f20e1d29a 100644
@@ -147,6 +147,7 @@ static const TypeInfo xen_accel_type = {
     .name = TYPE_XEN_ACCEL,
     .parent = TYPE_ACCEL,
     .class_init = xen_accel_class_init,
+    .secure = true,
 };
 
 static void xen_accel_ops_class_init(ObjectClass *oc, const void *data)
Signature · 1 line
2.56.0
#4 lore raw

[PULL 12/12] accel/nitro: mark 'nitro' accelerator as secure

In reply to Daniel P. Berrangé

The 'nitro' accelerator is used with a real AWS deployment and thus is considered to be secure.

---
 accel/nitro/nitro-accel.c | 1 +
 1 file changed, 1 insertion(+)
accel/nitro/nitro-accel.c +1 -0
index a1e97a9162e..a1489b8019a 100644
@@ -251,6 +251,7 @@ static const TypeInfo nitro_accel_type = {
     .parent = TYPE_ACCEL,
     .instance_size = sizeof(NitroAccelState),
     .class_init = nitro_accel_class_init,
+    .secure = true,
 };
 module_obj(TYPE_NITRO_ACCEL);
 
Signature · 1 line
2.56.0
#5 lore raw

[PULL 07/12] hw/s390x: mark 's390x-ccw-virtio' as a secure machine

In reply to Daniel P. Berrangé

The 's390x-ccw-virtio' s390x machine is already declared secure in docs/system/security.rst, due too its intended usage in virtualization scenarios.

---
 hw/s390x/s390-virtio-ccw.c | 1 +
 1 file changed, 1 insertion(+)
hw/s390x/s390-virtio-ccw.c +1 -0
index fda5ecc9ad3..15b16ba99d0 100644
@@ -986,6 +986,7 @@ static const TypeInfo ccw_machine_info = {
         .name = MACHINE_VER_TYPE_NAME("s390-ccw-virtio", __VA_ARGS__),        \
         .parent = TYPE_S390_CCW_MACHINE,                                      \
         .class_init = MACHINE_VER_SYM(class_init, ccw, __VA_ARGS__),          \
+        .secure = true,                                                       \
     };                                                                        \
     static void MACHINE_VER_SYM(register, ccw, __VA_ARGS__)(void)             \
     {                                                                         \
Signature · 1 line
2.56.0
#6 lore raw

[PULL 05/12] hw/ppc: mark 'pseries' as a secure machine

In reply to Daniel P. Berrangé

The 'pseries' ppc machine is already declared secure in docs/system/security.rst, due too its intended usage in virtualization scenarios.

---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)
hw/ppc/spapr.c +1 -0
index 8a1b5b37b6f..54e3cc3cbe4 100644
@@ -4751,6 +4751,7 @@ static void spapr_machine_latest_class_options(MachineClass *mc)
         .name = MACHINE_VER_TYPE_NAME("pseries", __VA_ARGS__),       \
         .parent = TYPE_SPAPR_MACHINE,                                \
         .class_init = MACHINE_VER_SYM(class_init, spapr, __VA_ARGS__), \
+        .secure = true,                                              \
     };                                                               \
     static void MACHINE_VER_SYM(register, spapr, __VA_ARGS__)(void)  \
     {                                                                \
Signature · 1 line
2.56.0
#7 lore raw

[PULL 04/12] hw/loongarch: mark 'virt' as a secure machine

In reply to Daniel P. Berrangé

The 'virt' loongarch machine is already declared secure in docs/system/security.rst, due too its intended usage in virtualization scenarios.

---
 hw/loongarch/virt.c | 1 +
 1 file changed, 1 insertion(+)
hw/loongarch/virt.c +1 -0
index 9c5371af9de..c83c0b6cb19 100644
@@ -1553,6 +1553,7 @@ static void virt_class_init(ObjectClass *oc, const void *data)
         .name = MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \
         .parent = TYPE_LOONGARCH_VIRT_MACHINE, \
         .class_init = MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \
+        .secure = true, \
     }; \
     static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \
     { \
Signature · 1 line
2.56.0
#8 lore raw

[PULL 09/12] hw/nitro: mark 'nitro' machine as secure

In reply to Daniel P. Berrangé

Unlike the 'nitro-enclave' machine which provides emulation, the 'nitro' machine is used with a real AWS deployment and thus is considered to be secure.

---
 hw/nitro/machine.c | 1 +
 1 file changed, 1 insertion(+)
hw/nitro/machine.c +1 -0
index 88d01960a01..2e88e150c93 100644
@@ -261,6 +261,7 @@ static const TypeInfo nitro_machine_info = {
     .parent = TYPE_MACHINE,
     .instance_size = sizeof(NitroMachineState),
     .class_init = nitro_machine_class_init,
+    .secure = true,
 };
 
 static void nitro_machine_register(void)
Signature · 1 line
2.56.0
#9 lore raw

[PULL 01/12] util/cutils: Use getexecpath() on OpenBSD for qemu_init_exec_dir()

In reply to Daniel P. Berrangé

From: Brad Smith <[email protected]>

util/cutils: Use getexecpath() on OpenBSD for qemu_init_exec_dir()

OpenBSD has introduced a function getexecpath() to be able to retrieve the executable name and path.

---
 meson.build   | 8 ++++++++
 util/cutils.c | 6 ++++++
 2 files changed, 14 insertions(+)
meson.build +8 -0
index 71f135f0530..1b1523c5917 100644
@@ -3040,6 +3040,14 @@ config_host_data.set('CONFIG_ELF_AUX_INFO', cc.links(osdep_prefix + '''
     return hwcap;
   }'''))
 
+config_host_data.set('CONFIG_GETEXECPATH', cc.links(osdep_prefix + '''
+  #include <limits.h>
+  #include <unistd.h>
+  int main(void) {
+    char buf[PATH_MAX];
+    getexecpath(buf, sizeof(buf));
+  }'''))
+
 config_host_data.set('CONFIG_USBFS', have_linux_user and cc.compiles('''
   #include <linux/usbdevice_fs.h>
 
util/cutils.c +6 -0
index d8a04ead5a4..2996baa677c 100644
@@ -1097,6 +1097,12 @@ void qemu_init_exec_dir(const char *argv0)
             p = buf;
         }
     }
+#elif defined(__OpenBSD__) && defined(CONFIG_GETEXECPATH)
+    {
+        if (getexecpath(buf, sizeof(buf)) == 0) {
+            p = buf;
+        }
+    }
 #elif defined(__APPLE__)
     {
         char fpath[PATH_MAX];
Signature · 1 line
2.56.0
#10 lore raw

[PULL 06/12] hw/riscv: mark 'virt' as a secure machine

In reply to Daniel P. Berrangé

The 'virt' riscv machine is already declared secure in docs/system/security.rst, due too its intended usage in virtualization scenarios.

---
 hw/riscv/virt.c | 1 +
 1 file changed, 1 insertion(+)
hw/riscv/virt.c +1 -0
index de1c92463ad..ad77fe79d3d 100644
@@ -1201,6 +1201,7 @@ static const TypeInfo virt_machine_typeinfo = {
     .name       = MACHINE_TYPE_NAME("virt"),
     .parent     = TYPE_MACHINE,
     .class_init = virt_machine_class_init,
+    .secure     = true,
     .instance_init = virt_machine_instance_init,
     .instance_finalize = virt_machine_instance_finalize,
     .instance_size = sizeof(RISCVVirtState),
Signature · 1 line
2.56.0
#11 lore raw

[PULL 10/12] accel/kvm: mark kvm accelerator as secure

In reply to Daniel P. Berrangé

KVM is servicing virtualization use cases which must provide security and actively maintained.

---
 accel/kvm/kvm-all.c | 1 +
 1 file changed, 1 insertion(+)
accel/kvm/kvm-all.c +1 -0
index db8fba53f33..66bc7f3a83a 100644
@@ -4353,6 +4353,7 @@ static const TypeInfo kvm_accel_type = {
     .instance_finalize = kvm_accel_finalize,
     .class_init = kvm_accel_class_init,
     .instance_size = sizeof(KVMState),
+    .secure = true,
 };
 
 static void kvm_type_init(void)
Signature · 1 line
2.56.0
#12 lore raw

[PULL 03/12] hw/i386: mark 'microvm', 'i440fx', 'q35' as secure machines

In reply to Daniel P. Berrangé

The 'microvm', 'i440fx', 'q35' i386 machines are already declared secure in docs/system/security.rst, due too their intended usage in virtualization scenarios.

---
 hw/i386/microvm.c    | 1 +
 include/hw/i386/pc.h | 1 +
 2 files changed, 2 insertions(+)
hw/i386/microvm.c +1 -0
index a49de337497..342aa7a9dd0 100644
@@ -736,6 +736,7 @@ static const TypeInfo microvm_machine_info = {
     .instance_init = microvm_machine_initfn,
     .class_size    = sizeof(MicrovmMachineClass),
     .class_init    = microvm_class_init,
+    .secure        = true,
     .interfaces = (const InterfaceInfo[]) {
          { TYPE_HOTPLUG_HANDLER },
          { }
include/hw/i386/pc.h +1 -0
index 8edec62a1af..4ac489d2ffa 100644
@@ -330,6 +330,7 @@ extern const size_t pc_compat_4_1_len;
         .name       = MACHINE_VER_TYPE_NAME(namestr, __VA_ARGS__), \
         .parent     = TYPE_PC_MACHINE, \
         .class_init = MACHINE_VER_SYM(class_init, namesym, __VA_ARGS__), \
+        .secure     = true, \
     }; \
     static void MACHINE_VER_SYM(register, namesym, __VA_ARGS__)(void) \
     { \
Signature · 1 line
2.56.0
#13 lore raw
In reply to Daniel P. Berrangé
Quoted 8 lines · Daniel P. Berrangé

The following changes since commit 56afd82bd4db9688f1c1c9d0e2ea163b8cde3283:

   Merge tag 'qemu-sparc-20261101' ofhttps://github.com/mcayland/qemu into staging (2026-11-01 08:37:48 -0800)

are available in the Git repository at:

https://gitlab.com/berrange/qemu tags/misc-fixes-pull-request

Quoted 8 lines

for you to fetch changes up to b95f1036d5f8b35d8d5b4c18d33bb6564fcbf2e5:

   accel/nitro: mark 'nitro' accelerator as secure (2026-11-02 17:05:33 +0000)

----------------------------------------------------------------
* Mark virtualization related machine types as secure
* Mark KVM, Xen and Nitro accelerators as secure
* Use getexecpath on OpenBSD

Applied, thanks.

r~