Mark user creatable devices for secure for virt use case
cover Mark user creatable devices for secure for virt use case
This (largish) series undertakes the task of marking devices secure, if they are intended to be used a virtualization use case.
NB, the maintainer CC list was way too huge to include every individual, so I've trimmed to just the mailing list CCs.
The approach taken was iterative as follows
* Machines listed in
https://www.qemu.org/docs/master/system/security.html#virtualization-use-case
* All virtio/vhost/vfio/xen related devices
* Most PCI related devices/controllers/bridges
I then used the RHEL builds of QEMU as an approximation for what should be considered "virtualization use case", since they cut out a huge pile of devices from the build. IOW, more or less everything that RHEL builds for x86_64, ppc64, aarch64, s390x gets included. Notably since RHEL does not yet ship riscv or loongarch, I've possibly missed some devices that ought to be in scope.
Devices are marked secure *regardless* of their maintainer status, if they are relevant to virt. Notably all the USB stuff is included despite USB being orphaned. An exception is CXL which is arguably relevant to virt, but maintainers agreed it is too immature to include so far.
IOW, the "secure" flag as set in this series mostly avoids saying anything about the support status of the object types.
Over the long term, IMHO, the set of devices we declare as providing a security boundary needs to be stable. We should not declare a device out of scope for the virt use case simply because a maintainer steps aside. The device doesn't become instantly less secure. It does mean bug fixes may not be timely enough, and rely on the goodwill of other contributors or maintainers to step up and fix.
Or to put it another way. "secure = true" does not guarantee that the device is secure, but it states our intent that we *want* it to be secure, as opposed to "secure = false" which indicates we just don't care either way.
The intersection of (secure, orphaned) highlights to QEMU contributors or corporate sponsors, where they might step up their effort / investment.
Finally this is just user creatable devices. Use of these devices implies use of many more non-user creatable devices.
I don't have a good way to enumerate those yet, and while the end user doesn't care at runtime, as maintainers we want to be clear if all devices are in scope for CVE handling or not.
Based-on: <[email protected]>
Daniel P. Berrangé (28):
hw: mark secure machines for x86, s390, ppc, arm, loonarch, riscv
accel: mark kvm and xen accelerators as secure
hw: mark all virtio PCI devices as secure
hw: mark all virtio CCW devices as secure
hw: mark all vhost devices a secure
hw: mark all remaining virtio object types as secure hw/vfio: mark all VFIO object classes as secure
hw/xen: mark all Xen related object types as being secure hw/net: mark e1000, e1000e, IGB, rtl8139 & sPAPR VLAN as secure hw/usb: mark commonly used USB devices/hosts as secure hw/watchdog: mark some watchdog devices as secure hw/scsi: mark spapr and vmware SCSI controllers as secure hw/scsi: mark SCSI disk endpoint devices as secure hw/ide: mark ICH9 and ide-hd/ide-cd as secure
hw: define most common PCI types as secure
hw/pci-host: mark common x86, ppc, arm and s390 PCI hosts as secure hw/display: mark bochs, cirrus, qxl, VGA, ramfb as secure hw/tpm: mark all TPM implementations as secure
hw/misc: mark pvpanic, vmcoreinfo as secure
hw/audio: mark Intel HDA devices & codecs as secure hw/char: mark common serial / console devicess a secure hw/mem: mark nvdimm, pc-dimm & spapr-nvdimm devices as secure hw/uefi: mark the EFI vars service as secure
hw/acpi: mark erst, vmclock and vmgenid devices as secure
hw: mark KVM clock and RTC devices as secure
hw: device AMD, Intel and ARM IOMMUs as secure
hw/input: mark PS/2 and PC Keyboard devices as secure hw/i386: mark vmmouse / vmport as secure
accel/accel-common.c | 2 ++ accel/accel-system.c | 1 + accel/kvm/kvm-accel-ops.c | 1 + accel/kvm/kvm-all.c | 1 + accel/xen/xen-all.c | 2 ++ hw/9pfs/virtio-9p-device.c | 1 + hw/acpi/erst.c | 1 + hw/acpi/vmclock.c | 1 + hw/acpi/vmgenid.c | 1 + hw/arm/smmu-common.c | 1 + hw/arm/smmuv3.c | 2 ++ hw/arm/virt.c | 1 + hw/arm/xen-pvh.c | 1 + hw/audio/hda-codec.c | 4 ++++ hw/audio/intel-hda.c | 5 +++++ hw/audio/virtio-snd.c | 1 + hw/block/vhost-user-blk.c | 1 + hw/block/virtio-blk.c | 1 + hw/block/xen-block.c | 3 +++ hw/char/debugcon.c | 1 + hw/char/sclpconsole-lm.c | 1 + hw/char/sclpconsole.c | 1 + hw/char/serial-isa.c | 1 + hw/char/serial-pci.c | 1 + hw/char/serial.c | 1 + hw/char/spapr_vty.c | 1 + hw/char/virtio-console.c | 2 ++ hw/char/virtio-serial-bus.c | 3 +++ hw/char/xen_console.c | 1 + hw/display/bochs-display.c | 1 + hw/display/cirrus_vga.c | 1 + hw/display/qxl.c | 3 +++ hw/display/ramfb-standalone.c | 1 + hw/display/vga-mmio.c | 1 + hw/display/vga-pci.c | 3 +++ hw/display/vhost-user-gpu.c | 1 + hw/display/virtio-gpu-base.c | 3 ++- hw/display/virtio-gpu-gl.c | 1 + hw/display/virtio-gpu-pci-rutabaga.c | 1 + hw/display/virtio-gpu-pci.c | 3 ++- hw/display/virtio-gpu-rutabaga.c | 1 + hw/display/virtio-gpu.c | 1 + hw/i386/amd_iommu.c | 4 +++- hw/i386/intel_iommu.c | 1 + hw/i386/kvm/clock.c | 1 + hw/i386/microvm.c | 1 + hw/i386/pc_piix.c | 4 ++-- hw/i386/vmmouse.c | 1 + hw/i386/vmport.c | 1 + hw/i386/xen/xen-pvh.c | 1 + hw/i386/xen/xen_platform.c | 1 + hw/i386/xen/xen_pvdevice.c | 1 + hw/ide/ich.c | 1 + hw/ide/ide-dev.c | 3 +++ hw/ide/piix.c | 2 ++ hw/input/pckbd.c | 3 ++- hw/input/ps2.c | 9 ++++++--- hw/input/virtio-input-hid.c | 5 +++++ hw/input/virtio-input-host.c | 1 + hw/input/virtio-input.c | 1 + hw/loongarch/virt.c | 2 ++ hw/mem/nvdimm.c | 1 + hw/mem/pc-dimm.c | 1 + hw/misc/pvpanic-isa.c | 1 + hw/misc/pvpanic-mmio.c | 1 + hw/misc/pvpanic-pci.c | 1 + hw/misc/vmcoreinfo.c | 1 + hw/net/e1000.c | 1 + hw/net/e1000e.c | 1 + hw/net/igb.c | 1 + hw/net/rtl8139.c | 1 + hw/net/spapr_llan.c | 1 + hw/net/virtio-net.c | 1 + hw/net/xen_nic.c | 1 + hw/pci-bridge/gen_pcie_root_port.c | 1 + hw/pci-bridge/i82801b11.c | 1 + hw/pci-bridge/ioh3420.c | 1 + hw/pci-bridge/pci_bridge_dev.c | 2 ++ hw/pci-bridge/pci_expander_bridge.c | 8 ++++++++ hw/pci-bridge/pcie_pci_bridge.c | 1 + hw/pci-bridge/pcie_root_port.c | 1 + hw/pci-bridge/xio3130_downstream.c | 1 + hw/pci-bridge/xio3130_upstream.c | 1 + hw/pci-host/gpex.c | 2 ++ hw/pci-host/i440fx.c | 2 ++ hw/pci-host/pnv_phb.c | 2 ++ hw/pci-host/pnv_phb3.c | 3 +++ hw/pci-host/pnv_phb3_msi.c | 1 + hw/pci-host/pnv_phb3_pbcq.c | 1 + hw/pci-host/pnv_phb4.c | 4 +++- hw/pci-host/pnv_phb4_pec.c | 1 + hw/pci-host/q35.c | 2 ++ hw/pci-host/remote.c | 1 + hw/pci-host/xen_igd_pt.c | 1 + hw/pci/pci.c | 7 +++++++ hw/pci/pci_bridge.c | 1 + hw/pci/pci_host.c | 1 + hw/pci/pcie_host.c | 1 + hw/pci/pcie_port.c | 1 + hw/ppc/spapr.c | 1 + hw/ppc/spapr_nvdimm.c | 1 + hw/ppc/spapr_pci.c | 1 + hw/ppc/spapr_tpm_proxy.c | 1 + hw/riscv/virt.c | 1 + hw/rtc/mc146818rtc.c | 1 + hw/s390x/s390-pci-bus.c | 4 ++++ hw/s390x/s390-virtio-ccw.c | 1 + hw/s390x/vhost-scsi-ccw.c | 1 + hw/s390x/vhost-user-fs-ccw.c | 1 + hw/s390x/vhost-vsock-ccw.c | 1 + hw/s390x/virtio-ccw-9p.c | 1 + hw/s390x/virtio-ccw-balloon.c | 1 + hw/s390x/virtio-ccw-blk.c | 1 + hw/s390x/virtio-ccw-crypto.c | 1 + hw/s390x/virtio-ccw-gpu.c | 1 + hw/s390x/virtio-ccw-input.c | 5 +++++ hw/s390x/virtio-ccw-md.c | 1 + hw/s390x/virtio-ccw-mem.c | 1 + hw/s390x/virtio-ccw-net.c | 1 + hw/s390x/virtio-ccw-rng.c | 1 + hw/s390x/virtio-ccw-scsi.c | 1 + hw/s390x/virtio-ccw-serial.c | 1 + hw/s390x/virtio-ccw.c | 1 + hw/scsi/scsi-disk.c | 4 ++++ hw/scsi/scsi-generic.c | 1 + hw/scsi/spapr_vscsi.c | 1 + hw/scsi/vhost-scsi-common.c | 1 + hw/scsi/vhost-scsi.c | 1 + hw/scsi/vhost-user-scsi.c | 1 + hw/scsi/virtio-scsi.c | 2 ++ hw/scsi/vmw_pvscsi.c | 1 + hw/tpm/tpm_crb.c | 1 + hw/tpm/tpm_spapr.c | 1 + hw/tpm/tpm_tis_i2c.c | 1 + hw/tpm/tpm_tis_isa.c | 1 + hw/tpm/tpm_tis_sysbus.c | 1 + hw/uefi/var-service-sysbus.c | 2 ++ hw/usb/ccid-card-emulated.c | 1 + hw/usb/ccid-card-passthru.c | 1 + hw/usb/dev-hid.c | 4 ++++ hw/usb/dev-hub.c | 1 + hw/usb/dev-smartcard-reader.c | 3 +++ hw/usb/dev-storage-bot.c | 1 + hw/usb/dev-storage-classic.c | 1 + hw/usb/dev-storage.c | 1 + hw/usb/hcd-ehci-pci.c | 2 ++ hw/usb/hcd-ehci-sysbus.c | 8 ++++++++ hw/usb/hcd-ohci-pci.c | 1 + hw/usb/hcd-ohci-sysbus.c | 1 + hw/usb/hcd-uhci.c | 2 ++ hw/usb/hcd-xhci-nec.c | 1 + hw/usb/hcd-xhci-pci.c | 2 ++ hw/usb/hcd-xhci-sysbus.c | 3 ++- hw/usb/hcd-xhci.c | 1 + hw/usb/host-libusb.c | 1 + hw/usb/redirect.c | 1 + hw/vfio-user/pci.c | 1 + hw/vfio/ap.c | 1 + hw/vfio/ccw.c | 1 + hw/vfio/container.c | 1 + hw/vfio/igd.c | 1 + hw/vfio/iommufd.c | 2 ++ hw/vfio/pci.c | 3 +++ hw/vfio/spapr.c | 1 + hw/virtio/vdpa-dev.c | 1 + hw/virtio/vhost-user-base.c | 3 ++- hw/virtio/vhost-user-fs.c | 1 + hw/virtio/vhost-user-gpio.c | 1 + hw/virtio/vhost-user-i2c.c | 1 + hw/virtio/vhost-user-input.c | 1 + hw/virtio/vhost-user-rng.c | 1 + hw/virtio/vhost-user-rtc.c | 1 + hw/virtio/vhost-user-scmi.c | 1 + hw/virtio/vhost-user-snd.c | 1 + hw/virtio/vhost-user-spi.c | 1 + hw/virtio/vhost-user-test-device.c | 1 + hw/virtio/vhost-user-vsock.c | 1 + hw/virtio/vhost-vsock-common.c | 1 + hw/virtio/vhost-vsock.c | 1 + hw/virtio/virtio-balloon.c | 1 + hw/virtio/virtio-bus.c | 1 + hw/virtio/virtio-crypto.c | 1 + hw/virtio/virtio-input-pci.c | 2 ++ hw/virtio/virtio-iommu.c | 2 ++ hw/virtio/virtio-md-pci.c | 1 + hw/virtio/virtio-mem.c | 1 + hw/virtio/virtio-mmio.c | 2 ++ hw/virtio/virtio-nsm.c | 1 + hw/virtio/virtio-pci.c | 3 +++ hw/virtio/virtio-pmem.c | 1 + hw/virtio/virtio-rng.c | 1 + hw/virtio/virtio-rtc.c | 1 + hw/watchdog/sbsa_gwdt.c | 1 + hw/watchdog/spapr_watchdog.c | 1 + hw/watchdog/wdt_diag288.c | 1 + hw/watchdog/wdt_i6300esb.c | 1 + hw/watchdog/wdt_ib700.c | 1 + hw/xen/xen-bus.c | 3 +++ hw/xen/xen-legacy-backend.c | 3 +++ hw/xen/xen-pvh-common.c | 1 + hw/xen/xen_pt.c | 1 + hw/xenpv/xen_machine_pv.c | 2 +- include/hw/i386/pc.h | 1 + 203 files changed, 304 insertions(+), 13 deletions(-)
Signature · 1 line
2.55.0
PATCH 1/28 hw: mark secure machines for x86, s390, ppc, arm, loonarch, riscv
The versioned machine types are typically present for use in virtualization use cases and can be expected to provide a security barrier. The only exceptions are the m68k versioned machine types which are only used with TCG. There are also a handful of other machines declared secure in docs/system/security.rst, notably the Xen machine variants and microvm.
--- 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 | 2 ++ hw/ppc/spapr.c | 1 + hw/riscv/virt.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + hw/xen/xen-pvh-common.c | 1 + hw/xenpv/xen_machine_pv.c | 2 +- include/hw/i386/pc.h | 1 + 12 files changed, 14 insertions(+), 3 deletions(-)
hw/arm/virt.c +1 -0
@@ -132,6 +132,7 @@ static void arm_virt_compat_default_set(MachineClass *mc) .name = MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ .parent = TYPE_VIRT_MACHINE, \ .class_init = MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \ + .secure = true, \ }; \ static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ { \
hw/arm/xen-pvh.c +1 -0
@@ -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/microvm.c +1 -0
@@ -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 }, { }
hw/i386/pc_piix.c +2 -2
@@ -672,6 +672,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
@@ -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/loongarch/virt.c +2 -0
@@ -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) \ { \
@@ -1583,6 +1584,7 @@ static const TypeInfo virt_machine_info = { .name = TYPE_LOONGARCH_VIRT_MACHINE, .parent = TYPE_MACHINE, .abstract = true, + .secure = true, .instance_size = sizeof(LoongArchVirtMachineState), .class_init = virt_class_init, .instance_init = virt_initfn,
hw/ppc/spapr.c +1 -0
@@ -4750,6 +4750,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) \ { \
hw/riscv/virt.c +1 -0
@@ -1200,6 +1200,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),
hw/s390x/s390-virtio-ccw.c +1 -0
@@ -973,6 +973,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) \ { \
hw/xen/xen-pvh-common.c +1 -0
@@ -504,6 +504,7 @@ static const TypeInfo xen_pvh_info = { .name = TYPE_XEN_PVH_MACHINE, .parent = TYPE_MACHINE, .abstract = true, + .secure = true, .instance_size = sizeof(XenPVHMachineState), .instance_init = xen_pvh_instance_init, .class_size = sizeof(XenPVHMachineClass),
hw/xenpv/xen_machine_pv.c +1 -1
@@ -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)
include/hw/i386/pc.h +1 -0
@@ -325,6 +325,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.55.0
PATCH 2/28 accel: mark kvm and xen accelerators as secure
In reply to Daniel P. BerrangéTCG is too complex to be considered to provide a security boundary for malicious guest workloads. QTest is only used for functional testing and thus is not relevant to mark secure.
KVM and Xen are servicing virtualization use cases which must provide security and actively maintained.
While HVF would be in scope conceptually, it is not sufficiently mature or maintained to claim a security boundary at this time.
--- accel/accel-common.c | 2 ++ accel/accel-system.c | 1 + accel/kvm/kvm-accel-ops.c | 1 + accel/kvm/kvm-all.c | 1 + accel/xen/xen-all.c | 2 ++ 5 files changed, 7 insertions(+)
accel/accel-common.c +2 -0
@@ -125,6 +125,7 @@ static const TypeInfo accel_types[] = { .class_size = sizeof(AccelClass), .instance_size = sizeof(AccelState), .abstract = true, + .secure = true, }, };
@@ -137,6 +138,7 @@ static void register_accel_target_type(void) .name = name, .parent = TYPE_OBJECT, .abstract = true, + .secure = true, .class_size = sizeof(AccelCPUClass), };
accel/accel-system.c +1 -0
@@ -118,6 +118,7 @@ static const TypeInfo accel_ops_type_info = { .name = TYPE_ACCEL_OPS, .parent = TYPE_OBJECT, .abstract = true, + .secure = true, .class_size = sizeof(AccelOpsClass), .class_init = accel_ops_class_init, };
accel/kvm/kvm-accel-ops.c +1 -0
@@ -119,6 +119,7 @@ static const TypeInfo kvm_accel_ops_type = { .parent = TYPE_ACCEL_OPS, .class_init = kvm_accel_ops_class_init, .abstract = true, + .secure = true, };static void kvm_accel_ops_register_types (void )
accel/kvm/kvm-all.c +1 -0
@@ -4328,6 +4328,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 )
accel/xen/xen-all.c +2 -0
@@ -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)
@@ -163,6 +164,7 @@ static const TypeInfo xen_accel_ops_type = { .parent = TYPE_ACCEL_OPS, .class_init = xen_accel_ops_class_init, .abstract = true, + .secure = true, };static void xen_type_init (void )
Signature · 1 line
2.55.0
PATCH 3/28 hw: mark all virtio PCI devices as secure
In reply to Daniel P. BerrangéThese are all intended for use in a virtualization scenario and must provide a security boundary. This can be done for almost all virtio PCI devices by modifying the common type register helper.
The virtio-gpu devices are unusual in not using the common virtio_pci_types_register() method, so need marking directly.
--- hw/display/virtio-gpu-pci-rutabaga.c | 1 + hw/display/virtio-gpu-pci.c | 3 ++- hw/virtio/virtio-pci.c | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-)
hw/display/virtio-gpu-pci-rutabaga.c +1 -0
@@ -34,6 +34,7 @@ static const TypeInfo virtio_gpu_rutabaga_pci_info[] = { .parent = TYPE_VIRTIO_GPU_PCI_BASE, .instance_size = sizeof(VirtIOGPURutabagaPCI), .instance_init = virtio_gpu_rutabaga_initfn, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/display/virtio-gpu-pci.c +2 -1
@@ -75,7 +75,8 @@ static const TypeInfo virtio_gpu_pci_base_info = { .parent = TYPE_VIRTIO_PCI, .instance_size = sizeof(VirtIOGPUPCIBase), .class_init = virtio_gpu_pci_base_class_init, - .abstract = true + .abstract = true, + .secure = true, };module_obj (TYPE_VIRTIO_GPU_PCI_BASE );module_kconfig (VIRTIO_PCI );
hw/virtio/virtio-pci.c +3 -0
@@ -2520,6 +2520,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .name = t->generic_name, .parent = base_type_info.name, .class_init = virtio_pci_generic_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, {INTERFACE_CONVENTIONAL_PCI_DEVICE },
@@ -2555,6 +2556,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .name = t->non_transitional_name, .parent = base_type_info.name, .instance_init = virtio_pci_non_transitional_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, {INTERFACE_CONVENTIONAL_PCI_DEVICE },
@@ -2569,6 +2571,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .name = t->transitional_name, .parent = base_type_info.name, .instance_init = virtio_pci_transitional_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) {/* * Transitional virtio devices work only as Conventional PCI
Signature · 1 line
2.55.0
PATCH 5/28 hw: mark all vhost devices a secure
In reply to Daniel P. BerrangéThese are all intended for use in a virtualization scenario and must provide a security boundary.
--- hw/block/vhost-user-blk.c | 1 + hw/display/vhost-user-gpu.c | 1 + hw/scsi/vhost-scsi-common.c | 1 + hw/scsi/vhost-scsi.c | 1 + hw/scsi/vhost-user-scsi.c | 1 + hw/virtio/vhost-user-base.c | 3 ++- hw/virtio/vhost-user-fs.c | 1 + hw/virtio/vhost-user-gpio.c | 1 + hw/virtio/vhost-user-i2c.c | 1 + hw/virtio/vhost-user-input.c | 1 + hw/virtio/vhost-user-rng.c | 1 + hw/virtio/vhost-user-rtc.c | 1 + hw/virtio/vhost-user-scmi.c | 1 + hw/virtio/vhost-user-snd.c | 1 + hw/virtio/vhost-user-spi.c | 1 + hw/virtio/vhost-user-test-device.c | 1 + hw/virtio/vhost-user-vsock.c | 1 + hw/virtio/vhost-vsock-common.c | 1 + hw/virtio/vhost-vsock.c | 1 + 19 files changed, 20 insertions(+), 1 deletion(-)
hw/block/vhost-user-blk.c +1 -0
@@ -673,6 +673,7 @@ static const TypeInfo vhost_user_blk_info = { .instance_size = sizeof(VHostUserBlk), .instance_init = vhost_user_blk_instance_init, .class_init = vhost_user_blk_class_init, + .secure = true, };static void virtio_register_types (void )
hw/display/vhost-user-gpu.c +1 -0
@@ -727,6 +727,7 @@ static const TypeInfo vhost_user_gpu_info = { .instance_init = vhost_user_gpu_instance_init, .instance_finalize = vhost_user_gpu_instance_finalize, .class_init = vhost_user_gpu_class_init, + .secure = true, };module_obj (TYPE_VHOST_USER_GPU );module_kconfig (VHOST_USER_GPU );
hw/scsi/vhost-scsi-common.c +1 -0
@@ -164,6 +164,7 @@ static const TypeInfo vhost_scsi_common_info = { .parent = TYPE_VIRTIO_SCSI_COMMON, .instance_size = sizeof(VHostSCSICommon), .abstract = true, + .secure = true, };static void virtio_register_types (void )
hw/scsi/vhost-scsi.c +1 -0
@@ -400,6 +400,7 @@ static const TypeInfo vhost_scsi_info = { .instance_size = sizeof(VHostSCSI), .class_init = vhost_scsi_class_init, .instance_init = vhost_scsi_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_FW_PATH_PROVIDER }, { }
hw/scsi/vhost-user-scsi.c +1 -0
@@ -425,6 +425,7 @@ static const TypeInfo vhost_user_scsi_info = { .instance_size = sizeof(VHostUserSCSI), .class_init = vhost_user_scsi_class_init, .instance_init = vhost_user_scsi_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_FW_PATH_PROVIDER }, { }
hw/virtio/vhost-user-base.c +2 -1
@@ -426,7 +426,8 @@ static const TypeInfo vub_types[] = { .instance_size = sizeof(VHostUserBase), .class_init = vub_class_init, .class_size = sizeof(VHostUserBaseClass), - .abstract = true + .abstract = true, + .secure = true, } };
hw/virtio/vhost-user-fs.c +1 -0
@@ -448,6 +448,7 @@ static const TypeInfo vuf_info = { .instance_size = sizeof(VHostUserFS), .instance_init = vuf_instance_init, .class_init = vuf_class_init, + .secure = true, };static void vuf_register_types (void )
hw/virtio/vhost-user-gpio.c +1 -0
@@ -53,6 +53,7 @@ static const TypeInfo vu_gpio_info = { .parent = TYPE_VHOST_USER_BASE, .instance_size = sizeof(VHostUserGPIO), .class_init = vu_gpio_class_init, + .secure = true, };static void vu_gpio_register_types (void )
hw/virtio/vhost-user-i2c.c +1 -0
@@ -53,6 +53,7 @@ static const TypeInfo vu_i2c_info = { .parent = TYPE_VHOST_USER_BASE, .instance_size = sizeof(VHostUserI2C), .class_init = vu_i2c_class_init, + .secure = true, };static void vu_i2c_register_types (void )
hw/virtio/vhost-user-input.c +1 -0
@@ -47,6 +47,7 @@ static const TypeInfo vhost_input_info = { .parent = TYPE_VHOST_USER_BASE, .instance_size = sizeof(VHostUserInput), .class_init = vhost_input_class_init, + .secure = true, };static void vhost_input_register_types (void )
hw/virtio/vhost-user-rng.c +1 -0
@@ -55,6 +55,7 @@ static const TypeInfo vu_rng_info = { .parent = TYPE_VHOST_USER_BASE, .instance_size = sizeof(VHostUserRNG), .class_init = vu_rng_class_init, + .secure = true, };static void vu_rng_register_types (void )
hw/virtio/vhost-user-rtc.c +1 -0
@@ -54,6 +54,7 @@ static const TypeInfo vu_rtc_info = { .parent = TYPE_VHOST_USER_BASE, .instance_size = sizeof(VHostUserRTC), .class_init = vu_rtc_class_init, + .secure = true, };static void vu_rtc_register_types (void )
hw/virtio/vhost-user-scmi.c +1 -0
@@ -310,6 +310,7 @@ static const TypeInfo vu_scmi_info = { .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VHostUserSCMI), .class_init = vu_scmi_class_init, + .secure = true, };static void vu_scmi_register_types (void )
hw/virtio/vhost-user-snd.c +1 -0
@@ -72,6 +72,7 @@ static const TypeInfo vu_snd_info = { .parent = TYPE_VHOST_USER_BASE, .instance_size = sizeof(VHostUserSound), .class_init = vu_snd_class_init, + .secure = true, };static void vu_snd_register_types (void )
hw/virtio/vhost-user-spi.c +1 -0
@@ -55,6 +55,7 @@ static const TypeInfo vu_spi_info = { .parent = TYPE_VHOST_USER_BASE, .instance_size = sizeof(VHostUserSPI), .class_init = vu_spi_class_init, + .secure = true, };static void vu_spi_register_types (void )
hw/virtio/vhost-user-test-device.c +1 -0
@@ -50,6 +50,7 @@ static const TypeInfo vud_info = { .name = TYPE_VHOST_USER_TEST_DEVICE, .parent = TYPE_VHOST_USER_BASE, .class_init = vud_class_init, + .secure = true, };static void vu_register_types (void )
hw/virtio/vhost-user-vsock.c +1 -0
@@ -175,6 +175,7 @@ static const TypeInfo vuv_info = { .parent = TYPE_VHOST_VSOCK_COMMON, .instance_size = sizeof(VHostUserVSock), .class_init = vuv_class_init, + .secure = true, };static void vuv_register_types (void )
hw/virtio/vhost-vsock-common.c +1 -0
@@ -309,6 +309,7 @@ static const TypeInfo vhost_vsock_common_info = { .instance_size = sizeof(VHostVSockCommon), .class_init = vhost_vsock_common_class_init, .abstract = true, + .secure = true, };static void vhost_vsock_common_register_types (void )
hw/virtio/vhost-vsock.c +1 -0
@@ -225,6 +225,7 @@ static const TypeInfo vhost_vsock_info = { .parent = TYPE_VHOST_VSOCK_COMMON, .instance_size = sizeof(VHostVSock), .class_init = vhost_vsock_class_init, + .secure = true, };static void vhost_vsock_register_types (void )
Signature · 1 line
2.55.0
PATCH 4/28 hw: mark all virtio CCW devices as secure
In reply to Daniel P. BerrangéThese are all intended for use in a virtualization scenario and must provide a security boundary.
--- hw/s390x/vhost-scsi-ccw.c | 1 + hw/s390x/vhost-user-fs-ccw.c | 1 + hw/s390x/vhost-vsock-ccw.c | 1 + hw/s390x/virtio-ccw-9p.c | 1 + hw/s390x/virtio-ccw-balloon.c | 1 + hw/s390x/virtio-ccw-blk.c | 1 + hw/s390x/virtio-ccw-crypto.c | 1 + hw/s390x/virtio-ccw-gpu.c | 1 + hw/s390x/virtio-ccw-input.c | 5 +++++ hw/s390x/virtio-ccw-md.c | 1 + hw/s390x/virtio-ccw-mem.c | 1 + hw/s390x/virtio-ccw-net.c | 1 + hw/s390x/virtio-ccw-rng.c | 1 + hw/s390x/virtio-ccw-scsi.c | 1 + hw/s390x/virtio-ccw-serial.c | 1 + hw/s390x/virtio-ccw.c | 1 + 16 files changed, 20 insertions(+)
hw/s390x/vhost-scsi-ccw.c +1 -0
@@ -62,6 +62,7 @@ static const TypeInfo vhost_ccw_scsi = { .instance_size = sizeof(VHostSCSICcw), .instance_init = vhost_ccw_scsi_instance_init, .class_init = vhost_ccw_scsi_class_init, + .secure = true, };static void virtio_ccw_scsi_register (void )
hw/s390x/vhost-user-fs-ccw.c +1 -0
@@ -64,6 +64,7 @@ static const TypeInfo vhost_user_fs_ccw = { .instance_size = sizeof(VHostUserFSCcw), .instance_init = vhost_user_fs_ccw_instance_init, .class_init = vhost_user_fs_ccw_class_init, + .secure = true, };static void vhost_user_fs_ccw_register (void )
hw/s390x/vhost-vsock-ccw.c +1 -0
@@ -71,6 +71,7 @@ static const TypeInfo vhost_vsock_ccw_info = { .instance_size = sizeof(VHostVSockCCWState), .instance_init = vhost_vsock_ccw_instance_init, .class_init = vhost_vsock_ccw_class_init, + .secure = true, };static void vhost_vsock_ccw_register (void )
hw/s390x/virtio-ccw-9p.c +1 -0
@@ -64,6 +64,7 @@ static const TypeInfo virtio_ccw_9p_info = { .instance_size = sizeof(V9fsCCWState), .instance_init = virtio_ccw_9p_instance_init, .class_init = virtio_ccw_9p_class_init, + .secure = true, };static void virtio_ccw_9p_register (void )
hw/s390x/virtio-ccw-balloon.c +1 -0
@@ -69,6 +69,7 @@ static const TypeInfo virtio_ccw_balloon = { .instance_size = sizeof(VirtIOBalloonCcw), .instance_init = virtio_ccw_balloon_instance_init, .class_init = virtio_ccw_balloon_class_init, + .secure = true, };static void virtio_ccw_balloon_register (void )
hw/s390x/virtio-ccw-blk.c +1 -0
@@ -67,6 +67,7 @@ static const TypeInfo virtio_ccw_blk = { .instance_size = sizeof(VirtIOBlkCcw), .instance_init = virtio_ccw_blk_instance_init, .class_init = virtio_ccw_blk_class_init, + .secure = true, };static void virtio_ccw_blk_register (void )
hw/s390x/virtio-ccw-crypto.c +1 -0
@@ -67,6 +67,7 @@ static const TypeInfo virtio_ccw_crypto = { .instance_size = sizeof(VirtIOCryptoCcw), .instance_init = virtio_ccw_crypto_instance_init, .class_init = virtio_ccw_crypto_class_init, + .secure = true, };static void virtio_ccw_crypto_register (void )
hw/s390x/virtio-ccw-gpu.c +1 -0
@@ -66,6 +66,7 @@ static const TypeInfo virtio_ccw_gpu = { .instance_size = sizeof(VirtIOGPUCcw), .instance_init = virtio_ccw_gpu_instance_init, .class_init = virtio_ccw_gpu_class_init, + .secure = true, };module_obj (TYPE_VIRTIO_GPU_CCW );module_kconfig (VIRTIO_CCW );
hw/s390x/virtio-ccw-input.c +5 -0
@@ -96,6 +96,7 @@ static const TypeInfo virtio_ccw_input = { .instance_size = sizeof(VirtIOInputCcw), .class_init = virtio_ccw_input_class_init, .abstract = true, + .secure = true, };static const TypeInfo virtio_ccw_input_hid = {
@@ -103,6 +104,7 @@ static const TypeInfo virtio_ccw_input_hid = { .parent = TYPE_VIRTIO_INPUT_CCW, .instance_size = sizeof(VirtIOInputHIDCcw), .abstract = true, + .secure = true, };static const TypeInfo virtio_ccw_keyboard = {
@@ -110,6 +112,7 @@ static const TypeInfo virtio_ccw_keyboard = { .parent = TYPE_VIRTIO_INPUT_HID_CCW, .instance_size = sizeof(VirtIOInputHIDCcw), .instance_init = virtio_ccw_keyboard_instance_init, + .secure = true, };static const TypeInfo virtio_ccw_mouse = {
@@ -117,6 +120,7 @@ static const TypeInfo virtio_ccw_mouse = { .parent = TYPE_VIRTIO_INPUT_HID_CCW, .instance_size = sizeof(VirtIOInputHIDCcw), .instance_init = virtio_ccw_mouse_instance_init, + .secure = true, };static const TypeInfo virtio_ccw_tablet = {
@@ -124,6 +128,7 @@ static const TypeInfo virtio_ccw_tablet = { .parent = TYPE_VIRTIO_INPUT_HID_CCW, .instance_size = sizeof(VirtIOInputHIDCcw), .instance_init = virtio_ccw_tablet_instance_init, + .secure = true, };static void virtio_ccw_input_register (void )
hw/s390x/virtio-ccw-md.c +1 -0
@@ -140,6 +140,7 @@ static const TypeInfo virtio_ccw_md_info = { .instance_size = sizeof(VirtIOMDCcw), .class_size = sizeof(VirtIOMDCcwClass), .abstract = true, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_MEMORY_DEVICE }, { }
hw/s390x/virtio-ccw-mem.c +1 -0
@@ -216,6 +216,7 @@ static const TypeInfo virtio_ccw_mem = { .instance_size = sizeof(VirtIOMEMCcw), .instance_init = virtio_ccw_mem_instance_init, .class_init = virtio_ccw_mem_class_init, + .secure = true, };static void virtio_ccw_mem_register_types (void )
hw/s390x/virtio-ccw-net.c +1 -0
@@ -70,6 +70,7 @@ static const TypeInfo virtio_ccw_net = { .instance_size = sizeof(VirtIONetCcw), .instance_init = virtio_ccw_net_instance_init, .class_init = virtio_ccw_net_class_init, + .secure = true, };static void virtio_ccw_net_register (void )
hw/s390x/virtio-ccw-rng.c +1 -0
@@ -66,6 +66,7 @@ static const TypeInfo virtio_ccw_rng = { .instance_size = sizeof(VirtIORNGCcw), .instance_init = virtio_ccw_rng_instance_init, .class_init = virtio_ccw_rng_class_init, + .secure = true, };static void virtio_ccw_rng_register (void )
hw/s390x/virtio-ccw-scsi.c +1 -0
@@ -76,6 +76,7 @@ static const TypeInfo virtio_ccw_scsi = { .instance_size = sizeof(VirtIOSCSICcw), .instance_init = virtio_ccw_scsi_instance_init, .class_init = virtio_ccw_scsi_class_init, + .secure = true, };static void virtio_ccw_scsi_register (void )
hw/s390x/virtio-ccw-serial.c +1 -0
@@ -76,6 +76,7 @@ static const TypeInfo virtio_ccw_serial = { .instance_size = sizeof(VirtioSerialCcw), .instance_init = virtio_ccw_serial_instance_init, .class_init = virtio_ccw_serial_class_init, + .secure = true, };static void virtio_ccw_serial_register (void )
hw/s390x/virtio-ccw.c +1 -0
@@ -1264,6 +1264,7 @@ static const TypeInfo virtio_ccw_device_info = { .class_init = virtio_ccw_device_class_init, .class_size = sizeof(VirtIOCCWDeviceClass), .abstract = true, + .secure = true, };/* virtio-ccw-bus */
Signature · 1 line
2.55.0
PATCH 7/28 hw/vfio: mark all VFIO object classes as secure
In reply to Daniel P. BerrangéThe VFIO subsystem is about securely passing host PCI devices to a guest, so all the classes should be presumed to be offering a security boundary.
--- hw/vfio-user/pci.c | 1 + hw/vfio/ap.c | 1 + hw/vfio/ccw.c | 1 + hw/vfio/container.c | 1 + hw/vfio/igd.c | 1 + hw/vfio/iommufd.c | 2 ++ hw/vfio/pci.c | 3 +++ hw/vfio/spapr.c | 1 + 8 files changed, 11 insertions(+)
hw/vfio-user/pci.c +1 -0
@@ -482,6 +482,7 @@ static const TypeInfo vfio_user_pci_info = { .class_init = vfio_user_pci_class_init, .instance_init = vfio_user_pci_init, .instance_finalize = vfio_user_pci_finalize, + .secure = true, };static void register_vfio_user_dev_type (void )
hw/vfio/ap.c +1 -0
@@ -352,6 +352,7 @@ static const TypeInfo vfio_ap_info = { .instance_size = sizeof(VFIOAPDevice), .instance_init = vfio_ap_instance_init, .class_init = vfio_ap_class_init, + .secure = true, };static void vfio_ap_type_init (void )
hw/vfio/ccw.c +1 -0
@@ -721,6 +721,7 @@ static const TypeInfo vfio_ccw_info = { .instance_size = sizeof(VFIOCCWDevice), .instance_init = vfio_ccw_instance_init, .class_init = vfio_ccw_class_init, + .secure = true, };static void register_vfio_ccw_type (void )
hw/vfio/container.c +1 -0
@@ -336,6 +336,7 @@ static const TypeInfo types[] = { .instance_size = sizeof(VFIOContainer), .class_size = sizeof(VFIOIOMMUClass), .abstract = true, + .secure = true, }, };
hw/vfio/igd.c +1 -0
@@ -311,6 +311,7 @@ static const TypeInfo vfio_pci_igd_lpc_bridge_info = { .name = "vfio-pci-igd-lpc-bridge", .parent = TYPE_PCI_DEVICE, .class_init = vfio_pci_igd_lpc_bridge_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/vfio/iommufd.c +2 -0
@@ -1051,10 +1051,12 @@ static const TypeInfo types[] = { .parent = TYPE_VFIO_IOMMU, .instance_size = sizeof(VFIOIOMMUFDContainer), .class_init = vfio_iommu_iommufd_class_init, + .secure = true, }, { .name = TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO, .parent = TYPE_HOST_IOMMU_DEVICE_IOMMUFD, .class_init = hiod_iommufd_vfio_class_init, + .secure = true, } };
hw/vfio/pci.c +3 -0
@@ -3854,6 +3854,7 @@ static const TypeInfo vfio_pci_device_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(VFIOPCIDevice), .abstract = true, + .secure = true, .class_init = vfio_pci_device_class_init, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE },
@@ -4110,6 +4111,7 @@ static const TypeInfo vfio_pci_info = { .class_init = vfio_pci_class_init, .instance_init = vfio_pci_init, .instance_finalize = vfio_pci_finalize, + .secure = true, };static const Property vfio_pci_nohotplug_properties[] = {
@@ -4146,6 +4148,7 @@ static const TypeInfo vfio_pci_nohotplug_info = { .parent = TYPE_VFIO_PCI, .instance_size = sizeof(VFIOPCIDevice), .class_init = vfio_pci_nohotplug_class_init, + .secure = true, };static void register_vfio_pci_dev_type (void )
hw/vfio/spapr.c +1 -0
@@ -544,6 +544,7 @@ static const TypeInfo types[] = { .parent = TYPE_VFIO_IOMMU_LEGACY, .instance_size = sizeof(VFIOSpaprContainer), .class_init = vfio_iommu_spapr_class_init, + .secure = true, }, };
Signature · 1 line
2.55.0
PATCH 6/28 hw: mark all remaining virtio object types as secure
In reply to Daniel P. BerrangéThese are all intended for use in a virtualization scenario and must provide a security boundary.
--- hw/9pfs/virtio-9p-device.c | 1 + hw/audio/virtio-snd.c | 1 + hw/block/virtio-blk.c | 1 + hw/char/virtio-console.c | 2 ++ hw/char/virtio-serial-bus.c | 3 +++ hw/display/virtio-gpu-base.c | 3 ++- hw/display/virtio-gpu-gl.c | 1 + hw/display/virtio-gpu-rutabaga.c | 1 + hw/display/virtio-gpu.c | 1 + hw/input/virtio-input-hid.c | 5 +++++ hw/input/virtio-input-host.c | 1 + hw/input/virtio-input.c | 1 + hw/net/virtio-net.c | 1 + hw/scsi/virtio-scsi.c | 2 ++ hw/virtio/vdpa-dev.c | 1 + hw/virtio/virtio-balloon.c | 1 + hw/virtio/virtio-bus.c | 1 + hw/virtio/virtio-crypto.c | 1 + hw/virtio/virtio-input-pci.c | 2 ++ hw/virtio/virtio-iommu.c | 2 ++ hw/virtio/virtio-md-pci.c | 1 + hw/virtio/virtio-mem.c | 1 + hw/virtio/virtio-mmio.c | 2 ++ hw/virtio/virtio-nsm.c | 1 + hw/virtio/virtio-pmem.c | 1 + hw/virtio/virtio-rng.c | 1 + hw/virtio/virtio-rtc.c | 1 + 27 files changed, 39 insertions(+), 1 deletion(-)
hw/9pfs/virtio-9p-device.c +1 -0
@@ -288,6 +288,7 @@ static const TypeInfo virtio_device_info = { .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(V9fsVirtioState), .class_init = virtio_9p_class_init, + .secure = true, };static void virtio_9p_register_types (void )
hw/audio/virtio-snd.c +1 -0
@@ -1410,6 +1410,7 @@ static const TypeInfo virtio_snd_types[] = { .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VirtIOSound), .class_init = virtio_snd_class_init, + .secure = true, } };
hw/block/virtio-blk.c +1 -0
@@ -1951,6 +1951,7 @@ static const TypeInfo virtio_blk_info = { .instance_init = virtio_blk_instance_init, .class_init = virtio_blk_class_init, .class_size = sizeof(VirtIOBlkClass), + .secure = true, };static void virtio_register_types (void )
hw/char/virtio-console.c +2 -0
@@ -266,6 +266,7 @@ static const TypeInfo virtconsole_info = { .name = "virtconsole", .parent = TYPE_VIRTIO_CONSOLE_SERIAL_PORT, .class_init = virtconsole_class_init, + .secure = true, };static const Property virtserialport_properties[] = {
@@ -291,6 +292,7 @@ static const TypeInfo virtserialport_info = { .parent = TYPE_VIRTIO_SERIAL_PORT, .instance_size = sizeof(VirtConsole), .class_init = virtserialport_class_init, + .secure = true, };static void virtconsole_register_types (void )
hw/char/virtio-serial-bus.c +3 -0
@@ -836,6 +836,7 @@ static const TypeInfo virtser_bus_info = { .parent = TYPE_BUS, .instance_size = sizeof(VirtIOSerialBus), .class_init = virtser_bus_class_init, + .secure = true, };#ifdef CONFIG_HMP
@@ -1091,6 +1092,7 @@ static const TypeInfo virtio_serial_port_type_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(VirtIOSerialPort), .abstract = true, + .secure = true, .class_size = sizeof(VirtIOSerialPortClass), .class_init = virtio_serial_port_class_init, };
@@ -1169,6 +1171,7 @@ static const TypeInfo virtio_device_info = { .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VirtIOSerial), .class_init = virtio_serial_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, { }
hw/display/virtio-gpu-base.c +2 -1
@@ -320,7 +320,8 @@ static const TypeInfo virtio_gpu_base_info = { .instance_size = sizeof(VirtIOGPUBase), .class_size = sizeof(VirtIOGPUBaseClass), .class_init = virtio_gpu_base_class_init, - .abstract = true + .abstract = true, + .secure = true, };module_obj (TYPE_VIRTIO_GPU_BASE );module_kconfig (VIRTIO_GPU );
hw/display/virtio-gpu-gl.c +1 -0
@@ -233,6 +233,7 @@ static const TypeInfo virtio_gpu_gl_info = { .parent = TYPE_VIRTIO_GPU, .instance_size = sizeof(VirtIOGPUGL), .class_init = virtio_gpu_gl_class_init, + .secure = true, };module_obj (TYPE_VIRTIO_GPU_GL );module_kconfig (VIRTIO_GPU );
hw/display/virtio-gpu-rutabaga.c +1 -0
@@ -1170,6 +1170,7 @@ static const TypeInfo virtio_gpu_rutabaga_info[] = { .parent = TYPE_VIRTIO_GPU, .instance_size = sizeof(VirtIOGPURutabaga), .class_init = virtio_gpu_rutabaga_class_init, + .secure = true, }, };
hw/display/virtio-gpu.c +1 -0
@@ -1915,6 +1915,7 @@ static const TypeInfo virtio_gpu_info = { .instance_size = sizeof(VirtIOGPU), .class_size = sizeof(VirtIOGPUClass), .class_init = virtio_gpu_class_init, + .secure = true, };module_obj (TYPE_VIRTIO_GPU );module_kconfig (VIRTIO_GPU );
hw/input/virtio-input-hid.c +5 -0
@@ -242,6 +242,7 @@ static const TypeInfo virtio_input_hid_info = { .instance_size = sizeof(VirtIOInputHID), .class_init = virtio_input_hid_class_init, .abstract = true, + .secure = true, };/* ----------------------------------------------------------------- */
@@ -315,6 +316,7 @@ static const TypeInfo virtio_keyboard_info = { .parent = TYPE_VIRTIO_INPUT_HID, .instance_size = sizeof(VirtIOInputHID), .instance_init = virtio_keyboard_init, + .secure = true, };/* ----------------------------------------------------------------- */
@@ -369,6 +371,7 @@ static const TypeInfo virtio_mouse_info = { .parent = TYPE_VIRTIO_INPUT_HID, .instance_size = sizeof(VirtIOInputHID), .instance_init = virtio_mouse_init, + .secure = true, };/* ----------------------------------------------------------------- */
@@ -442,6 +445,7 @@ static const TypeInfo virtio_tablet_info = { .parent = TYPE_VIRTIO_INPUT_HID, .instance_size = sizeof(VirtIOInputHID), .instance_init = virtio_tablet_init, + .secure = true, };/* ----------------------------------------------------------------- */
@@ -527,6 +531,7 @@ static const TypeInfo virtio_multitouch_info = { .parent = TYPE_VIRTIO_INPUT_HID, .instance_size = sizeof(VirtIOInputHID), .instance_init = virtio_multitouch_init, + .secure = true, };/* ----------------------------------------------------------------- */
hw/input/virtio-input-host.c +1 -0
@@ -248,6 +248,7 @@ static const TypeInfo virtio_input_host_info = { .instance_size = sizeof(VirtIOInputHost), .instance_init = virtio_input_host_init, .class_init = virtio_input_host_class_init, + .secure = true, };/* ----------------------------------------------------------------- */
hw/input/virtio-input.c +1 -0
@@ -329,6 +329,7 @@ static const TypeInfo virtio_input_info = { .class_size = sizeof(VirtIOInputClass), .class_init = virtio_input_class_init, .abstract = true, + .secure = true, .instance_finalize = virtio_input_finalize, };
hw/net/virtio-net.c +1 -0
@@ -4374,6 +4374,7 @@ static const TypeInfo virtio_net_info = { .instance_size = sizeof(VirtIONet), .instance_init = virtio_net_instance_init, .class_init = virtio_net_class_init, + .secure = true, };static void virtio_register_types (void )
hw/scsi/virtio-scsi.c +2 -0
@@ -1444,6 +1444,7 @@ static const TypeInfo virtio_scsi_common_info = { .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VirtIOSCSICommon), .abstract = true, + .secure = true, .class_init = virtio_scsi_common_class_init, };
@@ -1452,6 +1453,7 @@ static const TypeInfo virtio_scsi_info = { .parent = TYPE_VIRTIO_SCSI_COMMON, .instance_size = sizeof(VirtIOSCSI), .class_init = virtio_scsi_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, { }
hw/virtio/vdpa-dev.c +1 -0
@@ -392,6 +392,7 @@ static const TypeInfo vhost_vdpa_device_info = { .instance_size = sizeof(VhostVdpaDevice), .class_init = vhost_vdpa_device_class_init, .instance_init = vhost_vdpa_device_instance_init, + .secure = true, };static void register_vhost_vdpa_device_type (void )
hw/virtio/virtio-balloon.c +1 -0
@@ -1083,6 +1083,7 @@ static const TypeInfo virtio_balloon_info = { .instance_size = sizeof(VirtIOBalloon), .instance_init = virtio_balloon_instance_init, .class_init = virtio_balloon_class_init, + .secure = true, };static void virtio_register_types (void )
hw/virtio/virtio-bus.c +1 -0
@@ -363,6 +363,7 @@ static const TypeInfo virtio_bus_info = { .parent = TYPE_BUS, .instance_size = sizeof(VirtioBusState), .abstract = true, + .secure = true, .class_size = sizeof(VirtioBusClass), .class_init = virtio_bus_class_init };
hw/virtio/virtio-crypto.c +1 -0
@@ -1314,6 +1314,7 @@ static const TypeInfo virtio_crypto_info = { .instance_size = sizeof(VirtIOCrypto), .instance_init = virtio_crypto_instance_init, .class_init = virtio_crypto_class_init, + .secure = true, };static void virtio_register_types (void )
hw/virtio/virtio-input-pci.c +2 -0
@@ -117,6 +117,7 @@ static const TypeInfo virtio_input_pci_info = { .instance_size = sizeof(VirtIOInputPCI), .class_init = virtio_input_pci_class_init, .abstract = true, + .secure = true, };static const TypeInfo virtio_input_hid_pci_info = {
@@ -124,6 +125,7 @@ static const TypeInfo virtio_input_hid_pci_info = { .parent = TYPE_VIRTIO_INPUT_PCI, .instance_size = sizeof(VirtIOInputHIDPCI), .abstract = true, + .secure = true, };static const VirtioPCIDeviceTypeInfo virtio_keyboard_pci_info = {
hw/virtio/virtio-iommu.c +2 -0
@@ -1734,12 +1734,14 @@ static const TypeInfo virtio_iommu_info = { .instance_size = sizeof(VirtIOIOMMU), .instance_init = virtio_iommu_instance_init, .class_init = virtio_iommu_class_init, + .secure = true, };static const TypeInfo virtio_iommu_memory_region_info = { .parent =TYPE_IOMMU_MEMORY_REGION , .name =TYPE_VIRTIO_IOMMU_MEMORY_REGION , .class_init = virtio_iommu_memory_region_class_init, + .secure = true, };static void virtio_register_types (void )
hw/virtio/virtio-md-pci.c +1 -0
@@ -138,6 +138,7 @@ static const TypeInfo virtio_md_pci_info = { .instance_size = sizeof(VirtIOMDPCI), .class_size = sizeof(VirtIOMDPCIClass), .abstract = true, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_MEMORY_DEVICE }, { }
hw/virtio/virtio-mem.c +1 -0
@@ -1668,6 +1668,7 @@ static const TypeInfo virtio_mem_info = { .instance_finalize = virtio_mem_instance_finalize, .class_init = virtio_mem_class_init, .class_size = sizeof(VirtIOMEMClass), + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_RAM_DISCARD_SOURCE }, { }
hw/virtio/virtio-mmio.c +2 -0
@@ -779,6 +779,7 @@ static const TypeInfo virtio_mmio_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(VirtIOMMIOProxy), .class_init = virtio_mmio_class_init, + .secure = true, };/* virtio-mmio-bus. */
@@ -848,6 +849,7 @@ static const TypeInfo virtio_mmio_bus_info = { .parent = TYPE_VIRTIO_BUS, .instance_size = sizeof(VirtioBusState), .class_init = virtio_mmio_bus_class_init, + .secure = true, };static void virtio_mmio_register_types (void )
hw/virtio/virtio-nsm.c +1 -0
@@ -1727,6 +1727,7 @@ static const TypeInfo virtio_nsm_info = { .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VirtIONSM), .class_init = virtio_nsm_class_init, + .secure = true, };static void virtio_register_types (void )
hw/virtio/virtio-pmem.c +1 -0
@@ -196,6 +196,7 @@ static const TypeInfo virtio_pmem_info = { .class_size = sizeof(VirtIOPMEMClass), .class_init = virtio_pmem_class_init, .instance_size = sizeof(VirtIOPMEM), + .secure = true, };static void virtio_register_types (void )
hw/virtio/virtio-rng.c +1 -0
@@ -282,6 +282,7 @@ static const TypeInfo virtio_rng_info = { .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VirtIORNG), .class_init = virtio_rng_class_init, + .secure = true, };static void virtio_register_types (void )
hw/virtio/virtio-rtc.c +1 -0
@@ -180,6 +180,7 @@ static const TypeInfo virtio_rtc_info = { .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VirtIORtc), .class_init = virtio_rtc_class_init, + .secure = true, };static void virtio_rtc_register_types (void )
Signature · 1 line
2.55.0
PATCH 10/28 hw/usb: mark commonly used USB devices/hosts as secure
In reply to Daniel P. BerrangéMost of the standardized USB1/2/3 host controllers are relevant for virtualization use cases, so should be declared secure. The "NEC" XHCI variant is slightly non-standard, but since it is a trivial sub-class of the generic XHCI, there's no reason to exclude it.
The set of devices that are expected to be used is HID (mouse, tablet, keyboard), host passthrough, CCID (smartcard), hub, storage and the redirect tunnelling.
--- hw/usb/ccid-card-emulated.c | 1 + hw/usb/ccid-card-passthru.c | 1 + hw/usb/dev-hid.c | 4 ++++ hw/usb/dev-hub.c | 1 + hw/usb/dev-smartcard-reader.c | 3 +++ hw/usb/dev-storage-bot.c | 1 + hw/usb/dev-storage-classic.c | 1 + hw/usb/dev-storage.c | 1 + hw/usb/hcd-ehci-pci.c | 2 ++ hw/usb/hcd-ehci-sysbus.c | 8 ++++++++ hw/usb/hcd-ohci-pci.c | 1 + hw/usb/hcd-ohci-sysbus.c | 1 + hw/usb/hcd-uhci.c | 2 ++ hw/usb/hcd-xhci-nec.c | 1 + hw/usb/hcd-xhci-pci.c | 2 ++ hw/usb/hcd-xhci-sysbus.c | 3 ++- hw/usb/hcd-xhci.c | 1 + hw/usb/host-libusb.c | 1 + hw/usb/redirect.c | 1 + 19 files changed, 35 insertions(+), 1 deletion(-)
hw/usb/ccid-card-emulated.c +1 -0
@@ -610,6 +610,7 @@ static const TypeInfo emulated_card_info = { .parent = TYPE_CCID_CARD, .instance_size = sizeof(EmulatedState), .class_init = emulated_class_initfn, + .secure = true, };module_obj (TYPE_EMULATED_CCID );module_kconfig (USB );
hw/usb/ccid-card-passthru.c +1 -0
@@ -412,6 +412,7 @@ static const TypeInfo passthru_card_info = { .parent = TYPE_CCID_CARD, .instance_size = sizeof(PassthruState), .class_init = passthru_class_initfn, + .secure = true, };module_obj (TYPE_CCID_PASSTHRU );module_kconfig (USB );
hw/usb/dev-hid.c +4 -0
@@ -790,6 +790,7 @@ static const TypeInfo usb_hid_type_info = { .parent = TYPE_USB_DEVICE, .instance_size = sizeof(USBHIDState), .abstract = true, + .secure = true, .class_init = usb_hid_class_initfn, };
@@ -815,6 +816,7 @@ static const TypeInfo usb_tablet_info = { .name = "usb-tablet", .parent = TYPE_USB_HID, .class_init = usb_tablet_class_initfn, + .secure = true, };static const Property usb_mouse_properties[] = {
@@ -837,6 +839,7 @@ static const TypeInfo usb_mouse_info = { .name = "usb-mouse", .parent = TYPE_USB_HID, .class_init = usb_mouse_class_initfn, + .secure = true, };static const Property usb_keyboard_properties[] = {
@@ -860,6 +863,7 @@ static const TypeInfo usb_keyboard_info = { .name = "usb-kbd", .parent = TYPE_USB_HID, .class_init = usb_keyboard_class_initfn, + .secure = true, };static void usb_hid_register_types (void )
hw/usb/dev-hub.c +1 -0
@@ -694,6 +694,7 @@ static const TypeInfo hub_info = { .parent = TYPE_USB_DEVICE, .instance_size = sizeof(USBHubState), .class_init = usb_hub_class_initfn, + .secure = true, };static void usb_hub_register_types (void )
hw/usb/dev-smartcard-reader.c +3 -0
@@ -1178,6 +1178,7 @@ static const TypeInfo ccid_bus_info = { .name = TYPE_CCID_BUS, .parent = TYPE_BUS, .instance_size = sizeof(CCIDBus), + .secure = true, }; void ccid_card_send_apdu_to_guest(CCIDCardState *card,
@@ -1458,6 +1459,7 @@ static const TypeInfo ccid_info = { .parent = TYPE_USB_DEVICE, .instance_size = sizeof(USBCCIDState), .class_init = ccid_class_initfn, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, { }
@@ -1478,6 +1480,7 @@ static const TypeInfo ccid_card_type_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(CCIDCardState), .abstract = true, + .secure = true, .class_size = sizeof(CCIDCardClass), .class_init = ccid_card_class_init, };
hw/usb/dev-storage-bot.c +1 -0
@@ -52,6 +52,7 @@ static const TypeInfo bot_info = { .name = "usb-bot", .parent = TYPE_USB_STORAGE, .class_init = usb_msd_class_bot_initfn, + .secure = true, };static void register_types (void )
hw/usb/dev-storage-classic.c +1 -0
@@ -133,6 +133,7 @@ static const TypeInfo msd_info = { .parent = TYPE_USB_STORAGE, .class_init = usb_msd_class_storage_initfn, .instance_init = usb_msd_instance_init, + .secure = true, };static void register_types (void )
hw/usb/dev-storage.c +1 -0
@@ -608,6 +608,7 @@ static const TypeInfo usb_storage_dev_type_info = { .instance_size = sizeof(MSDState), .abstract = true, .class_init = usb_msd_class_initfn_common, + .secure = true, };static void usb_msd_register_types (void )
hw/usb/hcd-ehci-pci.c +2 -0
@@ -171,6 +171,7 @@ static const TypeInfo ehci_pci_type_info = { .instance_init = usb_ehci_pci_init, .instance_finalize = usb_ehci_pci_finalize, .abstract = true, + .secure = true, .class_init = ehci_class_init, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE },
@@ -219,6 +220,7 @@ static void ehci_pci_register_types(void)TypeInfo ehci_type_info = { .parent =TYPE_PCI_EHCI , .class_init = ehci_data_class_init, + .secure = true, };int i;
hw/usb/hcd-ehci-sysbus.c +8 -0
@@ -240,6 +240,7 @@ static const TypeInfo ehci_sysbus_types[] = { .instance_init = ehci_sysbus_init, .instance_finalize = ehci_sysbus_finalize, .abstract = true, + .secure = true, .class_init = ehci_sysbus_class_init, .class_size = sizeof(SysBusEHCIClass), },
@@ -247,32 +248,38 @@ static const TypeInfo ehci_sysbus_types[] = { .name = TYPE_PLATFORM_EHCI, .parent = TYPE_SYS_BUS_EHCI, .class_init = ehci_platform_class_init, + .secure = true, }, { .name = TYPE_EXYNOS4210_EHCI, .parent = TYPE_SYS_BUS_EHCI, .class_init = ehci_exynos4210_class_init, + .secure = true, }, { .name = TYPE_AW_H3_EHCI, .parent = TYPE_SYS_BUS_EHCI, .class_init = ehci_aw_h3_class_init, + .secure = true, }, { .name = TYPE_NPCM7XX_EHCI, .parent = TYPE_SYS_BUS_EHCI, .class_init = ehci_npcm7xx_class_init, + .secure = true, }, { .name = TYPE_TEGRA2_EHCI, .parent = TYPE_SYS_BUS_EHCI, .class_init = ehci_tegra2_class_init, + .secure = true, }, { .name = TYPE_PPC4xx_EHCI, .parent = TYPE_SYS_BUS_EHCI, .class_init = ehci_ppc4xx_class_init, .instance_init = ehci_ppc4xx_init, + .secure = true, }, { .name = TYPE_FUSBH200_EHCI,
@@ -280,6 +287,7 @@ static const TypeInfo ehci_sysbus_types[] = { .instance_size = sizeof(FUSBH200EHCIState), .instance_init = fusbh200_ehci_init, .class_init = fusbh200_ehci_class_init, + .secure = true, }, };
hw/usb/hcd-ohci-pci.c +1 -0
@@ -148,6 +148,7 @@ static const TypeInfo ohci_pci_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(OHCIPCIState), .class_init = ohci_pci_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/usb/hcd-ohci-sysbus.c +1 -0
@@ -80,6 +80,7 @@ static const TypeInfo ohci_sysbus_types[] = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(OHCISysBusState), .class_init = ohci_sysbus_class_init, + .secure = true, }, };
hw/usb/hcd-uhci.c +2 -0
@@ -1283,6 +1283,7 @@ static const TypeInfo uhci_pci_type_info = { .instance_size = sizeof(UHCIState), .class_size = sizeof(UHCIPCIDeviceClass), .abstract = true, + .secure = true, .class_init = uhci_class_init, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE },
@@ -1380,6 +1381,7 @@ static void uhci_register_types(void)TypeInfo uhci_type_info = { .parent =TYPE_UHCI , .class_init = uhci_data_class_init, + .secure = true, };int i;
hw/usb/hcd-xhci-nec.c +1 -0
@@ -67,6 +67,7 @@ static const TypeInfo nec_xhci_info = { .instance_size = sizeof(XHCINecState), .instance_init = nec_xhci_instance_init, .class_init = nec_xhci_class_init, + .secure = true, };static void nec_xhci_register_types (void )
hw/usb/hcd-xhci-pci.c +2 -0
@@ -266,6 +266,7 @@ static const TypeInfo xhci_pci_info = { .class_init = xhci_class_init, .instance_init = xhci_instance_init, .abstract = true, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, {INTERFACE_CONVENTIONAL_PCI_DEVICE },
@@ -298,6 +299,7 @@ static const TypeInfo qemu_xhci_info = { .parent = TYPE_XHCI_PCI, .class_init = qemu_xhci_class_init, .instance_init = qemu_xhci_instance_init, + .secure = true, };static void xhci_register_types (void )
hw/usb/hcd-xhci-sysbus.c +2 -1
@@ -112,7 +112,8 @@ static const TypeInfo xhci_sysbus_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(XHCISysbusState), .class_init = xhci_sysbus_class_init, - .instance_init = xhci_sysbus_instance_init + .instance_init = xhci_sysbus_instance_init, + .secure = true, };static void xhci_sysbus_register_types (void )
hw/usb/hcd-xhci.c +1 -0
@@ -3676,6 +3676,7 @@ static const TypeInfo xhci_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(XHCIState), .class_init = xhci_class_init, + .secure = true, };static void xhci_register_types (void )
hw/usb/host-libusb.c +1 -0
@@ -1810,6 +1810,7 @@ static const TypeInfo usb_host_dev_info = { .instance_size = sizeof(USBHostDevice), .class_init = usb_host_class_initfn, .instance_init = usb_host_instance_init, + .secure = true, };module_obj (TYPE_USB_HOST_DEVICE );module_kconfig (USB );
hw/usb/redirect.c +1 -0
@@ -2654,6 +2654,7 @@ static const TypeInfo usbredir_dev_info = { .instance_size = sizeof(USBRedirDevice), .class_init = usbredir_class_initfn, .instance_init = usbredir_instance_init, + .secure = true, };module_obj (TYPE_USB_REDIR );module_kconfig (USB );
Signature · 1 line
2.55.0
PATCH 9/28 hw/net: mark e1000, e1000e, IGB, rtl8139 & sPAPR VLAN as secure
In reply to Daniel P. BerrangéHistorically most NICs are only interesting for non-virtualization use cases and have not been written with malicious guests in mind.
As a general rule either virtio-net or xen-net should be used in all virtualized guests requiring a security boundary.
There are a handful of exceptions resulting from historical usage in the x86 world, to support virtualized guests lacking virtio support.
Thus the rtl8139, e1000, e1000e & IGB NICs are declared to provide a security boundary.
The PPC sPAPR Virutal LAN device is also marked secure.
--- hw/net/e1000.c | 1 + hw/net/e1000e.c | 1 + hw/net/igb.c | 1 + hw/net/rtl8139.c | 1 + hw/net/spapr_llan.c | 1 + 5 files changed, 5 insertions(+)
hw/net/e1000.c +1 -0
@@ -1759,6 +1759,7 @@ static void e1000_register_types(void) type_info.parent =TYPE_E1000_BASE ; type_info.class_data = info; type_info.class_init = e1000_class_init; + type_info.secure = true,type_register_static (&type_info); }
hw/net/e1000e.c +1 -0
@@ -721,6 +721,7 @@ static const TypeInfo e1000e_info = { .instance_size = sizeof(E1000EState), .class_init = e1000e_class_init, .instance_init = e1000e_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, { }
hw/net/igb.c +1 -0
@@ -635,6 +635,7 @@ static const TypeInfo igb_info = { .instance_size = sizeof(IGBState), .class_init = igb_class_init, .instance_init = igb_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, { }
hw/net/rtl8139.c +1 -0
@@ -3450,6 +3450,7 @@ static const TypeInfo rtl8139_info = { .instance_size = sizeof(RTL8139State), .class_init = rtl8139_class_init, .instance_init = rtl8139_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/net/spapr_llan.c +1 -0
@@ -873,6 +873,7 @@ static const TypeInfo spapr_vlan_info = { .class_init = spapr_vlan_class_init, .instance_init = spapr_vlan_instance_init, .instance_finalize = spapr_vlan_instance_finalize, + .secure = true, };static void spapr_vlan_register_types (void )
Signature · 1 line
2.55.0
PATCH 11/28 hw/watchdog: mark some watchdog devices as secure
In reply to Daniel P. BerrangéThe ib700, i6300esb, gwdt, spapr and diag288 watchdog devices are marked as secure since they have traditionally been, or are intended to be, used in virtualization use cases on x86, arm, ppc and s390x architectures respectively. Other watchdogs are primarily for emulation.
--- hw/watchdog/sbsa_gwdt.c | 1 + hw/watchdog/spapr_watchdog.c | 1 + hw/watchdog/wdt_diag288.c | 1 + hw/watchdog/wdt_i6300esb.c | 1 + hw/watchdog/wdt_ib700.c | 1 + 5 files changed, 5 insertions(+)
hw/watchdog/sbsa_gwdt.c +1 -0
@@ -307,6 +307,7 @@ static const TypeInfo wdt_sbsa_gwdt_info = { .parent = TYPE_SYS_BUS_DEVICE, .name = TYPE_WDT_SBSA, .instance_size = sizeof(SBSA_GWDTState), + .secure = true, };static void wdt_sbsa_gwdt_register_types (void )
hw/watchdog/spapr_watchdog.c +1 -0
@@ -269,6 +269,7 @@ static const TypeInfo spapr_wdt_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(SpaprWatchdog), .class_init = spapr_wdt_class_init, + .secure = true, };static void spapr_watchdog_register_types (void )
hw/watchdog/wdt_diag288.c +1 -0
@@ -129,6 +129,7 @@ static const TypeInfo wdt_diag288_info = { .name = TYPE_WDT_DIAG288, .instance_size = sizeof(DIAG288State), .class_size = sizeof(DIAG288Class), + .secure = true, };static void wdt_diag288_register_types (void )
hw/watchdog/wdt_i6300esb.c +1 -0
@@ -480,6 +480,7 @@ static const TypeInfo i6300esb_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(I6300State), .class_init = i6300esb_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/watchdog/wdt_ib700.c +1 -0
@@ -144,6 +144,7 @@ static const TypeInfo wdt_ib700_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(IB700State), .class_init = wdt_ib700_class_init, + .secure = true, };static void wdt_ib700_register_types (void )
Signature · 1 line
2.55.0
PATCH 8/28 hw/xen: mark all Xen related object types as being secure
In reply to Daniel P. BerrangéAll Xen paravirtualized devices are intended to provide a host / guest security barrier, so mark all Xen object types as scure.
--- hw/block/xen-block.c | 3 +++ hw/char/xen_console.c | 1 + hw/i386/xen/xen_platform.c | 1 + hw/i386/xen/xen_pvdevice.c | 1 + hw/net/xen_nic.c | 1 + hw/xen/xen-bus.c | 3 +++ hw/xen/xen-legacy-backend.c | 3 +++ hw/xen/xen_pt.c | 1 + 8 files changed, 14 insertions(+)
hw/block/xen-block.c +3 -0
@@ -699,6 +699,7 @@ static const TypeInfo xen_block_type_info = { .parent = TYPE_XEN_DEVICE, .instance_size = sizeof(XenBlockDevice), .abstract = true, + .secure = true, .class_size = sizeof(XenBlockDeviceClass), .class_init = xen_block_class_init, };
@@ -740,6 +741,7 @@ static const TypeInfo xen_disk_type_info = { .parent = TYPE_XEN_BLOCK_DEVICE, .instance_size = sizeof(XenDiskDevice), .class_init = xen_disk_class_init, + .secure = true, };static void xen_cdrom_unrealize (XenBlockDevice *blockdev)
@@ -787,6 +789,7 @@ static const TypeInfo xen_cdrom_type_info = { .parent = TYPE_XEN_BLOCK_DEVICE, .instance_size = sizeof(XenCDRomDevice), .class_init = xen_cdrom_class_init, + .secure = true, };static void xen_block_register_types (void )
hw/char/xen_console.c +1 -0
@@ -513,6 +513,7 @@ static const TypeInfo xen_console_type_info = { .parent = TYPE_XEN_DEVICE, .instance_size = sizeof(XenConsole), .class_init = xen_console_class_init, + .secure = true, };static void xen_console_register_types (void )
hw/i386/xen/xen_platform.c +1 -0
@@ -604,6 +604,7 @@ static const TypeInfo xen_platform_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIXenPlatformState), .class_init = xen_platform_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/i386/xen/xen_pvdevice.c +1 -0
@@ -139,6 +139,7 @@ static const TypeInfo xen_pv_type_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(XenPVDevice), .class_init = xen_pv_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/net/xen_nic.c +1 -0
@@ -579,6 +579,7 @@ static const TypeInfo xen_net_type_info = { .parent = TYPE_XEN_DEVICE, .instance_size = sizeof(XenNetDev), .class_init = xen_netdev_class_init, + .secure = true, };static void xen_net_register_types (void )
hw/xen/xen-bus.c +3 -0
@@ -404,6 +404,7 @@ static const TypeInfo xen_bus_type_info = { .instance_size = sizeof(XenBus), .class_size = sizeof(XenBusClass), .class_init = xen_bus_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, { }
@@ -1127,6 +1128,7 @@ static const TypeInfo xen_device_type_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(XenDevice), .abstract = true, + .secure = true, .class_size = sizeof(XenDeviceClass), .class_init = xen_device_class_init, };
@@ -1141,6 +1143,7 @@ static const TypeInfo xen_bridge_type_info = { .name = TYPE_XEN_BRIDGE, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(XenBridge), + .secure = true, };static void xen_register_types (void )
hw/xen/xen-legacy-backend.c +3 -0
@@ -648,6 +648,7 @@ static const TypeInfo xendev_type_info = { .parent = TYPE_DYNAMIC_SYS_BUS_DEVICE, .class_init = xendev_class_init, .instance_size = sizeof(XenLegacyDevice), + .secure = true, };static void xen_sysbus_class_init (ObjectClass *klass,const void *data)
@@ -661,6 +662,7 @@ static const TypeInfo xensysbus_info = { .name = TYPE_XENSYSBUS, .parent = TYPE_BUS, .class_init = xen_sysbus_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, { }
@@ -670,6 +672,7 @@ static const TypeInfo xensysbus_info = {static const TypeInfo xensysdev_info = { .name =TYPE_XENSYSDEV , .parent =TYPE_SYS_BUS_DEVICE , + .secure = true, };static void xenbe_register_types (void )
hw/xen/xen_pt.c +1 -0
@@ -1079,6 +1079,7 @@ static const TypeInfo xen_pci_passthrough_info = { .instance_finalize = xen_pci_passthrough_finalize, .class_init = xen_pci_passthrough_class_init, .class_size = sizeof(XenPTDeviceClass), + .secure = true, .instance_init = xen_pci_passthrough_instance_init, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE },
Signature · 1 line
2.55.0
PATCH 12/28 hw/scsi: mark spapr and vmware SCSI controllers as secure
In reply to Daniel P. BerrangéThe spapr vscsi controller is used by default with spapr machines in a virtualization use case. The vmware SCSI controller supports a virtualization use case.
--- hw/scsi/spapr_vscsi.c | 1 + hw/scsi/vmw_pvscsi.c | 1 + 2 files changed, 2 insertions(+)
hw/scsi/spapr_vscsi.c +1 -0
@@ -1298,6 +1298,7 @@ static const TypeInfo spapr_vscsi_info = { .parent = TYPE_VIO_SPAPR_DEVICE, .instance_size = sizeof(VSCSIState), .class_init = spapr_vscsi_class_init, + .secure = true, };static void spapr_vscsi_register_types (void )
hw/scsi/vmw_pvscsi.c +1 -0
@@ -1355,6 +1355,7 @@ static const TypeInfo pvscsi_info = { .instance_size = sizeof(PVSCSIState), .class_init = pvscsi_class_init, .instance_init = pvscsi_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, {INTERFACE_PCIE_DEVICE },
Signature · 1 line
2.55.0
PATCH 14/28 hw/ide: mark ICH9 and ide-hd/ide-cd as secure
In reply to Daniel P. BerrangéThese have a long history of usage in virtualization scenarios on x86, for OS which lack modern virtio drivers for storage, and thus must be considered secure.
--- hw/ide/ich.c | 1 + hw/ide/ide-dev.c | 3 +++ hw/ide/piix.c | 2 ++ 3 files changed, 6 insertions(+)
hw/ide/ich.c +1 -0
@@ -198,6 +198,7 @@ static const TypeInfo ich_ahci_info = { .instance_size = sizeof(AHCIPCIState), .instance_init = pci_ich9_ahci_init, .class_init = ich_ahci_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/ide/ide-dev.c +3 -0
@@ -214,6 +214,7 @@ static const TypeInfo ide_hd_info = { .parent = TYPE_IDE_DEVICE, .instance_size = sizeof(IDEDrive), .class_init = ide_hd_class_init, + .secure = true, };static const Property ide_cd_properties[] = {
@@ -236,6 +237,7 @@ static const TypeInfo ide_cd_info = { .parent = TYPE_IDE_DEVICE, .instance_size = sizeof(IDEDrive), .class_init = ide_cd_class_init, + .secure = true, };static void ide_device_class_init (ObjectClass *klass,const void *data)
@@ -252,6 +254,7 @@ static const TypeInfo ide_device_type_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(IDEDevice), .abstract = true, + .secure = true, .class_size = sizeof(IDEDeviceClass), .class_init = ide_device_class_init, .instance_init = ide_dev_instance_init,
hw/ide/piix.c +2 -0
@@ -198,6 +198,7 @@ static const TypeInfo piix3_ide_info = { .name = TYPE_PIIX3_IDE, .parent = TYPE_PCI_IDE, .class_init = piix3_ide_class_init, + .secure = true, };/* NOTE: for the PIIX4, the IRQs and IOports are hardcoded */
@@ -221,6 +222,7 @@ static const TypeInfo piix4_ide_info = { .name = TYPE_PIIX4_IDE, .parent = TYPE_PCI_IDE, .class_init = piix4_ide_class_init, + .secure = true, };static void piix_ide_register_types (void )
Signature · 1 line
2.55.0
PATCH 16/28 hw/pci-host: mark common x86, ppc, arm and s390 PCI hosts as secure
In reply to Daniel P. BerrangéMark the PCI hosts secure if they are used from machine types that are considered for the virtualization use case.
There is also a special case for the 'remote' type and the Xen passthrough type.
--- hw/pci-host/gpex.c | 2 ++ hw/pci-host/i440fx.c | 2 ++ hw/pci-host/pnv_phb.c | 2 ++ hw/pci-host/pnv_phb3.c | 3 +++ hw/pci-host/pnv_phb3_msi.c | 1 + hw/pci-host/pnv_phb3_pbcq.c | 1 + hw/pci-host/pnv_phb4.c | 4 +++- hw/pci-host/pnv_phb4_pec.c | 1 + hw/pci-host/q35.c | 2 ++ hw/pci-host/remote.c | 1 + hw/pci-host/xen_igd_pt.c | 1 + hw/ppc/spapr_pci.c | 1 + hw/s390x/s390-pci-bus.c | 4 ++++ 13 files changed, 24 insertions(+), 1 deletion(-)
hw/pci-host/gpex.c +2 -0
@@ -220,6 +220,7 @@ static const TypeInfo gpex_host_info = { .instance_size = sizeof(GPEXHost), .instance_init = gpex_host_initfn, .class_init = gpex_host_class_init, + .secure = true, };/****************************************************************************
@@ -259,6 +260,7 @@ static const TypeInfo gpex_root_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(GPEXRootState), .class_init = gpex_root_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/pci-host/i440fx.c +2 -0
@@ -352,6 +352,7 @@ static const TypeInfo i440fx_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCII440FXState), .class_init = i440fx_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
@@ -410,6 +411,7 @@ static const TypeInfo i440fx_pcihost_info = { .instance_size = sizeof(I440FXState), .instance_init = i440fx_pcihost_initfn, .class_init = i440fx_pcihost_class_init, + .secure = true, };static void i440fx_register_types (void )
hw/pci-host/pnv_phb.c +2 -0
@@ -333,6 +333,7 @@ static const TypeInfo pnv_phb_type_info = { .parent = TYPE_PCIE_HOST_BRIDGE, .instance_size = sizeof(PnvPHB), .class_init = pnv_phb_class_init, + .secure = true, };static const TypeInfo pnv_phb_root_port_info = {
@@ -340,6 +341,7 @@ static const TypeInfo pnv_phb_root_port_info = { .parent = TYPE_PCIE_ROOT_PORT, .instance_size = sizeof(PnvPHBRootPort), .class_init = pnv_phb_root_port_class_init, + .secure = true, };static void pnv_phb_register_types (void )
hw/pci-host/pnv_phb3.c +3 -0
@@ -910,6 +910,7 @@ static const TypeInfo pnv_phb3_iommu_memory_region_info = { .parent = TYPE_IOMMU_MEMORY_REGION, .name = TYPE_PNV_PHB3_IOMMU_MEMORY_REGION, .class_init = pnv_phb3_iommu_memory_region_class_init, + .secure = true, };/*
@@ -1123,6 +1124,7 @@ static const TypeInfo pnv_phb3_type_info = { .instance_size = sizeof(PnvPHB3), .class_init = pnv_phb3_class_init, .instance_init = pnv_phb3_instance_init, + .secure = true, }; static void pnv_phb3_root_bus_get_prop(Object *obj, Visitor *v,
@@ -1186,6 +1188,7 @@ static const TypeInfo pnv_phb3_root_bus_info = { .parent = TYPE_PCIE_BUS, .instance_size = sizeof(PnvPHB3RootBus), .class_init = pnv_phb3_root_bus_class_init, + .secure = true, };static void pnv_phb3_register_types (void )
hw/pci-host/pnv_phb3_msi.c +1 -0
@@ -306,6 +306,7 @@ static const TypeInfo phb3_msi_info = { .class_init = phb3_msi_class_init, .class_size = sizeof(ICSStateClass), .instance_init = phb3_msi_instance_init, + .secure = true, };static void pnv_phb3_msi_register_types (void )
hw/pci-host/pnv_phb3_pbcq.c +1 -0
@@ -354,6 +354,7 @@ static const TypeInfo pnv_pbcq_type_info = { .instance_size = sizeof(PnvPBCQState), .instance_init = phb3_pbcq_instance_init, .class_init = pnv_pbcq_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_PNV_XSCOM_INTERFACE }, { }
hw/pci-host/pnv_phb4.c +3 -1
@@ -1374,6 +1374,7 @@ static const TypeInfo pnv_phb4_iommu_memory_region_info = { .parent = TYPE_IOMMU_MEMORY_REGION, .name = TYPE_PNV_PHB4_IOMMU_MEMORY_REGION, .class_init = pnv_phb4_iommu_memory_region_class_init, + .secure = true, };/*
@@ -1715,13 +1716,13 @@ static const TypeInfo pnv_phb4_type_info = { .instance_init = pnv_phb4_instance_init, .instance_size = sizeof(PnvPHB4), .class_init = pnv_phb4_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_XIVE_NOTIFIER }, { }, } }; -static void pnv_phb4_root_bus_get_prop (Object *obj,Visitor *v,const char *name,void *opaque,Error **errp)
@@ -1783,6 +1784,7 @@ static const TypeInfo pnv_phb4_root_bus_info = { .parent = TYPE_PCIE_BUS, .instance_size = sizeof(PnvPHB4RootBus), .class_init = pnv_phb4_root_bus_class_init, + .secure = true, };static void pnv_phb4_register_types (void )
hw/pci-host/pnv_phb4_pec.c +1 -0
@@ -388,6 +388,7 @@ static const TypeInfo pnv_pec_type_info = { .instance_size = sizeof(PnvPhb4PecState), .class_init = pnv_pec_class_init, .class_size = sizeof(PnvPhb4PecClass), + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_PNV_XSCOM_INTERFACE }, { }
hw/pci-host/q35.c +2 -0
@@ -268,6 +268,7 @@ static const TypeInfo q35_host_info = { .instance_size = sizeof(Q35PCIHost), .instance_init = q35_host_initfn, .class_init = q35_host_class_init, + .secure = true, };/****************************************************************************
@@ -718,6 +719,7 @@ static const TypeInfo mch_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(MCHPCIState), .class_init = mch_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/pci-host/remote.c +1 -0
@@ -63,6 +63,7 @@ static const TypeInfo remote_pcihost_info = { .parent = TYPE_PCIE_HOST_BRIDGE, .instance_size = sizeof(RemotePCIHost), .class_init = remote_pcihost_class_init, + .secure = true, };static void remote_pcihost_register (void )
hw/pci-host/xen_igd_pt.c +1 -0
@@ -110,6 +110,7 @@ static const TypeInfo igd_passthrough_i440fx_info = { .parent = TYPE_I440FX_PCI_DEVICE, .instance_size = sizeof(PCII440FXState), .class_init = igd_passthrough_i440fx_class_init, + .secure = true, };static void igd_pt_i440fx_register_types (void )
hw/ppc/spapr_pci.c +1 -0
@@ -2174,6 +2174,7 @@ static const TypeInfo spapr_phb_info = { .instance_size = sizeof(SpaprPhbState), .instance_finalize = spapr_phb_finalizefn, .class_init = spapr_phb_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, { }
hw/s390x/s390-pci-bus.c +4 -0
@@ -1406,6 +1406,7 @@ static const TypeInfo s390_pcihost_info = { .parent = TYPE_PCI_HOST_BRIDGE, .instance_size = sizeof(S390pciState), .class_init = s390_pcihost_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, { }
@@ -1416,6 +1417,7 @@ static const TypeInfo s390_pcibus_info = { .name = TYPE_S390_PCI_BUS, .parent = TYPE_BUS, .instance_size = sizeof(S390PCIBus), + .secure = true, };static uint16_t s390_pci_generate_uid (S390pciState *s)
@@ -1588,12 +1590,14 @@ static const TypeInfo s390_pci_device_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(S390PCIBusDevice), .class_init = s390_pci_device_class_init, + .secure = true, };static const TypeInfo s390_pci_iommu_info = { .name =TYPE_S390_PCI_IOMMU , .parent =TYPE_OBJECT , .instance_size =sizeof (S390PCIIOMMU ), + .secure = true, }; static void s390_iommu_memory_region_class_init(ObjectClass *klass,
Signature · 1 line
2.55.0
PATCH 13/28 hw/scsi: mark SCSI disk endpoint devices as secure
In reply to Daniel P. BerrangéAll these devices can be used together with supported SCSI controllers in a virtualization use case, so must be treated as secure.
--- hw/scsi/scsi-disk.c | 4 ++++ hw/scsi/scsi-generic.c | 1 + 2 files changed, 5 insertions(+)
hw/scsi/scsi-disk.c +4 -0
@@ -3218,6 +3218,7 @@ static const TypeInfo scsi_disk_base_info = { .instance_size = sizeof(SCSIDiskState), .class_size = sizeof(SCSIDiskClass), .abstract = true, + .secure = true, };#define DEFINE_SCSI_DISK_PROPERTIES () \
@@ -3338,6 +3339,7 @@ static const TypeInfo scsi_hd_info = { .name = "scsi-hd", .parent = TYPE_SCSI_DISK_BASE, .class_init = scsi_hd_class_initfn, + .secure = true, };static const Property scsi_cd_properties[] = {
@@ -3381,6 +3383,7 @@ static const TypeInfo scsi_cd_info = { .name = "scsi-cd", .parent = TYPE_SCSI_DISK_BASE, .class_init = scsi_cd_class_initfn, + .secure = true, };#ifdef __linux__
@@ -3423,6 +3426,7 @@ static const TypeInfo scsi_block_info = { .name = "scsi-block", .parent = TYPE_SCSI_DISK_BASE, .class_init = scsi_block_class_initfn, + .secure = true, };#endif
hw/scsi/scsi-generic.c +1 -0
@@ -1225,6 +1225,7 @@ static const TypeInfo scsi_generic_info = { .parent = TYPE_SCSI_DEVICE, .instance_size = sizeof(SCSIDevice), .class_init = scsi_generic_class_initfn, + .secure = true, };static void scsi_generic_register_types (void )
Signature · 1 line
2.55.0
PATCH 17/28 hw/display: mark bochs, cirrus, qxl, VGA, ramfb as secure
In reply to Daniel P. BerrangéMost of the display adapters are emulating old hardware which is not relevant to virtualization use cases.
The exceptions that should be considered secure are Cirrus (PCI, not ISA), Bochs, QXL, RAMFB, VGA (PCI, MMIO, not ISA) and VMWare VGA.
The Cirrus PCI decision is borderline. It has been heavily used with virtualization in the past, but these days VGA / RAMFB are strongly recommended instead. Due to its historical usage though, we should likely retain it in the set we aim to class as secure.
--- hw/display/bochs-display.c | 1 + hw/display/cirrus_vga.c | 1 + hw/display/qxl.c | 3 +++ hw/display/ramfb-standalone.c | 1 + hw/display/vga-mmio.c | 1 + hw/display/vga-pci.c | 3 +++ 6 files changed, 10 insertions(+)
hw/display/bochs-display.c +1 -0
@@ -374,6 +374,7 @@ static const TypeInfo bochs_display_type_info = { .instance_size = sizeof(BochsDisplayState), .instance_init = bochs_display_init, .class_init = bochs_display_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, {INTERFACE_CONVENTIONAL_PCI_DEVICE },
hw/display/cirrus_vga.c +1 -0
@@ -3013,6 +3013,7 @@ static const TypeInfo cirrus_vga_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCICirrusVGAState), .class_init = cirrus_vga_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/display/qxl.c +3 -0
@@ -2566,6 +2566,7 @@ static const TypeInfo qxl_pci_type_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIQXLDevice), .abstract = true, + .secure = true, .class_init = qxl_pci_class_init, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE },
@@ -2589,6 +2590,7 @@ static const TypeInfo qxl_primary_info = { .name = "qxl-vga", .parent = TYPE_PCI_QXL, .class_init = qxl_primary_class_init, + .secure = true, };module_obj ("qxl-vga" );module_kconfig (QXL );
@@ -2607,6 +2609,7 @@ static const TypeInfo qxl_secondary_info = { .name = "qxl", .parent = TYPE_PCI_QXL, .class_init = qxl_secondary_class_init, + .secure = true, };module_obj ("qxl" );
hw/display/ramfb-standalone.c +1 -0
@@ -85,6 +85,7 @@ static const TypeInfo ramfb_info = { .parent = TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size = sizeof(RAMFBStandaloneState), .class_init = ramfb_class_initfn, + .secure = true, };static void ramfb_register_types (void )
hw/display/vga-mmio.c +1 -0
@@ -132,6 +132,7 @@ static const TypeInfo vga_mmio_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(VGAMmioState), .class_init = vga_mmio_class_initfn, + .secure = true, };static void vga_mmio_register_types (void )
hw/display/vga-pci.c +3 -0
@@ -367,6 +367,7 @@ static const TypeInfo vga_pci_type_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIVGAState), .abstract = true, + .secure = true, .class_init = vga_pci_class_init, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE },
@@ -407,6 +408,7 @@ static const TypeInfo vga_info = { .name = "VGA", .parent = TYPE_PCI_VGA, .class_init = vga_class_init, + .secure = true, };static const TypeInfo secondary_info = {
@@ -414,6 +416,7 @@ static const TypeInfo secondary_info = { .parent = TYPE_PCI_VGA, .instance_init = pci_secondary_vga_init, .class_init = secondary_class_init, + .secure = true, };static void vga_register_types (void )
Signature · 1 line
2.55.0
PATCH 18/28 hw/tpm: mark all TPM implementations as secure
In reply to Daniel P. BerrangéAll of the TPM implementations are in scope of virtualization usage, so mark them all as secure.
--- hw/ppc/spapr_tpm_proxy.c | 1 + hw/tpm/tpm_crb.c | 1 + hw/tpm/tpm_spapr.c | 1 + hw/tpm/tpm_tis_i2c.c | 1 + hw/tpm/tpm_tis_isa.c | 1 + hw/tpm/tpm_tis_sysbus.c | 1 + 6 files changed, 6 insertions(+)
hw/ppc/spapr_tpm_proxy.c +1 -0
@@ -166,6 +166,7 @@ static const TypeInfo spapr_tpm_proxy_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(SpaprTpmProxy), .class_init = spapr_tpm_proxy_class_init, + .secure = true, };static void spapr_tpm_proxy_register_types (void )
hw/tpm/tpm_crb.c +1 -0
@@ -547,6 +547,7 @@ static const TypeInfo tpm_crb_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(CRBState), .class_init = tpm_crb_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_TPM_IF }, { }
hw/tpm/tpm_spapr.c +1 -0
@@ -414,6 +414,7 @@ static const TypeInfo tpm_spapr_info = { .parent = TYPE_VIO_SPAPR_DEVICE, .instance_size = sizeof(SpaprTpmState), .class_init = tpm_spapr_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_TPM_IF }, { }
hw/tpm/tpm_tis_i2c.c +1 -0
@@ -551,6 +551,7 @@ static const TypeInfo tpm_tis_i2c_info = { .name = TYPE_TPM_TIS_I2C, .parent = TYPE_I2C_SLAVE, .instance_size = sizeof(TPMStateI2C), + .secure = true, .class_init = tpm_tis_i2c_class_init, .interfaces = (const InterfaceInfo []) { {TYPE_TPM_IF },
hw/tpm/tpm_tis_isa.c +1 -0
@@ -187,6 +187,7 @@ static const TypeInfo tpm_tis_isa_info = { .instance_size = sizeof(TPMStateISA), .instance_init = tpm_tis_isa_initfn, .class_init = tpm_tis_isa_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_TPM_IF }, {TYPE_ACPI_DEV_AML_IF },
hw/tpm/tpm_tis_sysbus.c +1 -0
@@ -167,6 +167,7 @@ static const TypeInfo tpm_tis_sysbus_info = { .instance_init = tpm_tis_sysbus_initfn, .instance_finalize = tpm_tis_sysbus_finalize, .class_init = tpm_tis_sysbus_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_TPM_IF }, { }
Signature · 1 line
2.55.0
PATCH 19/28 hw/misc: mark pvpanic, vmcoreinfo as secure
In reply to Daniel P. BerrangéThe first two devices are common debug aids for virtualized guests so must be marked secure.
--- hw/misc/pvpanic-isa.c | 1 + hw/misc/pvpanic-mmio.c | 1 + hw/misc/pvpanic-pci.c | 1 + hw/misc/vmcoreinfo.c | 1 + 4 files changed, 4 insertions(+)
hw/misc/pvpanic-isa.c +1 -0
@@ -121,6 +121,7 @@ static const TypeInfo pvpanic_isa_info = { .instance_size = sizeof(PVPanicISAState), .instance_init = pvpanic_isa_initfn, .class_init = pvpanic_isa_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_ACPI_DEV_AML_IF }, { },
hw/misc/pvpanic-mmio.c +1 -0
@@ -50,6 +50,7 @@ static const TypeInfo pvpanic_mmio_info = { .instance_size = sizeof(PVPanicMMIOState), .instance_init = pvpanic_mmio_initfn, .class_init = pvpanic_mmio_class_init, + .secure = true, };static void pvpanic_register_types (void )
hw/misc/pvpanic-pci.c +1 -0
@@ -80,6 +80,7 @@ static const TypeInfo pvpanic_pci_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PVPanicPCIState), .class_init = pvpanic_pci_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }
hw/misc/vmcoreinfo.c +1 -0
@@ -101,6 +101,7 @@ static const TypeInfo vmcoreinfo_types[] = { .parent = TYPE_DEVICE, .instance_size = sizeof(VMCoreInfoState), .class_init = vmcoreinfo_device_class_init, + .secure = true, } };
Signature · 1 line
2.55.0
PATCH 15/28 hw: define most common PCI types as secure
In reply to Daniel P. BerrangéEssentially all PCI infrastructure is in scope for the virtualization use case, aside from the niche simba bridge.
--- hw/pci-bridge/gen_pcie_root_port.c | 1 + hw/pci-bridge/i82801b11.c | 1 + hw/pci-bridge/ioh3420.c | 1 + hw/pci-bridge/pci_bridge_dev.c | 2 ++ hw/pci-bridge/pci_expander_bridge.c | 8 ++++++++ hw/pci-bridge/pcie_pci_bridge.c | 1 + hw/pci-bridge/pcie_root_port.c | 1 + hw/pci-bridge/xio3130_downstream.c | 1 + hw/pci-bridge/xio3130_upstream.c | 1 + hw/pci/pci.c | 7 +++++++ hw/pci/pci_bridge.c | 1 + hw/pci/pci_host.c | 1 + hw/pci/pcie_host.c | 1 + hw/pci/pcie_port.c | 1 + 14 files changed, 28 insertions(+)
hw/pci-bridge/gen_pcie_root_port.c +1 -0
@@ -161,6 +161,7 @@ static const TypeInfo gen_rp_dev_info = { .parent = TYPE_PCIE_ROOT_PORT, .instance_size = sizeof(GenPCIERootPort), .class_init = gen_rp_dev_class_init, + .secure = true, };static void gen_rp_register_types (void )
hw/pci-bridge/i82801b11.c +1 -0
@@ -107,6 +107,7 @@ static const TypeInfo i82801b11_bridge_info = { .parent = TYPE_PCI_BRIDGE, .instance_size = sizeof(I82801b11Bridge), .class_init = i82801b11_bridge_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/pci-bridge/ioh3420.c +1 -0
@@ -120,6 +120,7 @@ static const TypeInfo ioh3420_info = { .name = "ioh3420", .parent = TYPE_PCIE_ROOT_PORT, .class_init = ioh3420_class_init, + .secure = true, };static void ioh3420_register_types (void )
hw/pci-bridge/pci_bridge_dev.c +2 -0
@@ -268,6 +268,7 @@ static const TypeInfo pci_bridge_dev_info = { .instance_size = sizeof(PCIBridgeDev), .class_init = pci_bridge_dev_class_init, .instance_finalize = pci_bridge_dev_instance_finalize, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, {INTERFACE_CONVENTIONAL_PCI_DEVICE },
@@ -294,6 +295,7 @@ static const TypeInfo pci_bridge_dev_seat_info = { .parent = TYPE_PCI_BRIDGE_DEV, .instance_size = sizeof(PCIBridgeDev), .class_init = pci_bridge_dev_seat_class_init, + .secure = true, };static void pci_bridge_dev_register (void )
hw/pci-bridge/pci_expander_bridge.c +8 -0
@@ -114,6 +114,7 @@ static const TypeInfo pxb_bus_info = { .parent = TYPE_PCI_BUS, .instance_size = sizeof(PXBBus), .class_init = pxb_bus_class_init, + .secure = true, };static const TypeInfo pxb_pcie_bus_info = {
@@ -121,6 +122,7 @@ static const TypeInfo pxb_pcie_bus_info = { .parent = TYPE_PCIE_BUS, .instance_size = sizeof(PXBBus), .class_init = pxb_bus_class_init, + .secure = true, };static const TypeInfo pxb_cxl_bus_info = {
@@ -128,6 +130,7 @@ static const TypeInfo pxb_cxl_bus_info = { .parent = TYPE_CXL_BUS, .instance_size = sizeof(PXBBus), .class_init = pxb_bus_class_init, + .secure = true, }; static const char *pxb_host_root_bus_path(PCIHostState *host_bridge,
@@ -190,6 +193,7 @@ static const TypeInfo pxb_host_info = { .name = TYPE_PXB_HOST, .parent = TYPE_PCI_HOST_BRIDGE, .class_init = pxb_host_class_init, + .secure = true, };static void pxb_cxl_realize (DeviceState *dev,Error **errp)
@@ -249,6 +253,7 @@ static const TypeInfo cxl_host_info = { .parent = TYPE_PCI_HOST_BRIDGE, .instance_size = sizeof(CXLHost), .class_init = pxb_cxl_host_class_init, + .secure = true, };/*
@@ -453,6 +458,7 @@ static const TypeInfo pxb_dev_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PXBDev), .class_init = pxb_dev_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
@@ -490,6 +496,7 @@ static const TypeInfo pxb_pcie_dev_info = { .parent = TYPE_PXB_DEV, .instance_size = sizeof(PXBPCIEDev), .class_init = pxb_pcie_dev_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
@@ -540,6 +547,7 @@ static const TypeInfo pxb_cxl_dev_info = { .parent = TYPE_PXB_PCIE_DEV, .instance_size = sizeof(PXBCXLDev), .class_init = pxb_cxl_dev_class_init, + .secure = true, .interfaces = (const InterfaceInfo []){ {INTERFACE_CONVENTIONAL_PCI_DEVICE },
hw/pci-bridge/pcie_pci_bridge.c +1 -0
@@ -162,6 +162,7 @@ static const TypeInfo pcie_pci_bridge_info = { .parent = TYPE_PCI_BRIDGE, .instance_size = sizeof(PCIEPCIBridge), .class_init = pcie_pci_bridge_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_HOTPLUG_HANDLER }, {INTERFACE_PCIE_DEVICE },
hw/pci-bridge/pcie_root_port.c +1 -0
@@ -186,6 +186,7 @@ static const TypeInfo rp_info = { .instance_post_init = rp_instance_post_init, .class_init = rp_class_init, .abstract = true, + .secure = true, .class_size = sizeof(PCIERootPortClass), .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE },
hw/pci-bridge/xio3130_downstream.c +1 -0
@@ -175,6 +175,7 @@ static const TypeInfo xio3130_downstream_info = { .name = TYPE_XIO3130_DOWNSTREAM, .parent = TYPE_PCIE_SLOT, .class_init = xio3130_downstream_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, { }
hw/pci-bridge/xio3130_upstream.c +1 -0
@@ -144,6 +144,7 @@ static const TypeInfo xio3130_upstream_info = { .name = "x3130-upstream", .parent = TYPE_PCIE_PORT, .class_init = xio3130_upstream_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, { }
hw/pci/pci.c +7 -0
@@ -319,6 +319,7 @@ static const TypeInfo pci_bus_info = { .instance_size = sizeof(PCIBus), .class_size = sizeof(PCIBusClass), .class_init = pci_bus_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_FW_CFG_DATA_GENERATOR_INTERFACE }, { }
@@ -328,16 +329,19 @@ static const TypeInfo pci_bus_info = {static const TypeInfo cxl_interface_info = { .name =INTERFACE_CXL_DEVICE , .parent =TYPE_INTERFACE , + .secure = true, };static const TypeInfo pcie_interface_info = { .name =INTERFACE_PCIE_DEVICE , .parent =TYPE_INTERFACE , + .secure = true, };static const TypeInfo conventional_pci_interface_info = { .name =INTERFACE_CONVENTIONAL_PCI_DEVICE , .parent =TYPE_INTERFACE , + .secure = true, };static void pcie_bus_class_init (ObjectClass *klass,const void *data)
@@ -351,12 +355,14 @@ static const TypeInfo pcie_bus_info = { .name = TYPE_PCIE_BUS, .parent = TYPE_PCI_BUS, .class_init = pcie_bus_class_init, + .secure = true, };static const TypeInfo cxl_bus_info = { .name =TYPE_CXL_BUS , .parent =TYPE_PCIE_BUS , .class_init = pcie_bus_class_init, + .secure = true, };static void pci_update_mappings (PCIDevice *d);
@@ -3468,6 +3474,7 @@ static const TypeInfo pci_device_type_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(PCIDevice), .abstract = true, + .secure = true, .class_size = sizeof(PCIDeviceClass), .class_init = pci_device_class_init, .class_base_init = pci_device_class_base_init,
hw/pci/pci_bridge.c +1 -0
@@ -497,6 +497,7 @@ static const TypeInfo pci_bridge_type_info = { .instance_size = sizeof(PCIBridge), .class_init = pci_bridge_class_init, .abstract = true, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_ACPI_DEV_AML_IF }, { },
hw/pci/pci_host.c +1 -0
@@ -262,6 +262,7 @@ static const TypeInfo pci_host_type_info = { .name = TYPE_PCI_HOST_BRIDGE, .parent = TYPE_SYS_BUS_DEVICE, .abstract = true, + .secure = true, .class_size = sizeof(PCIHostBridgeClass), .instance_size = sizeof(PCIHostState), .class_init = pci_host_class_init,
hw/pci/pcie_host.c +1 -0
@@ -124,6 +124,7 @@ static const TypeInfo pcie_host_type_info = { .name = TYPE_PCIE_HOST_BRIDGE, .parent = TYPE_PCI_HOST_BRIDGE, .abstract = true, + .secure = true, .instance_size = sizeof(PCIExpressHost), .instance_init = pcie_host_init, };
hw/pci/pcie_port.c +1 -0
@@ -200,6 +200,7 @@ static const TypeInfo pcie_port_type_info = { .parent = TYPE_PCI_BRIDGE, .instance_size = sizeof(PCIEPort), .abstract = true, + .secure = true, .class_init = pcie_port_class_init, };
Signature · 1 line
2.55.0
PATCH 21/28 hw/char: mark common serial / console devicess a secure
In reply to Daniel P. BerrangéThese are needed as a baseline feature for many virtualization use cases on x86, PPC64 and s390x.
--- hw/char/debugcon.c | 1 + hw/char/sclpconsole-lm.c | 1 + hw/char/sclpconsole.c | 1 + hw/char/serial-isa.c | 1 + hw/char/serial-pci.c | 1 + hw/char/serial.c | 1 + hw/char/spapr_vty.c | 1 + 7 files changed, 7 insertions(+)
hw/char/debugcon.c +1 -0
@@ -134,6 +134,7 @@ static const TypeInfo debugcon_isa_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(ISADebugconState), .class_init = debugcon_isa_class_initfn, + .secure = true, };static void debugcon_register_types (void )
hw/char/sclpconsole-lm.c +1 -0
@@ -363,6 +363,7 @@ static const TypeInfo sclp_console_info = { .instance_size = sizeof(SCLPConsoleLM), .class_init = console_class_init, .class_size = sizeof(SCLPEventClass), + .secure = true, };static void register_types (void )
hw/char/sclpconsole.c +1 -0
@@ -278,6 +278,7 @@ static const TypeInfo sclp_console_info = { .instance_size = sizeof(SCLPConsole), .class_init = console_class_init, .class_size = sizeof(SCLPEventClass), + .secure = true, };static void register_types (void )
hw/char/serial-isa.c +1 -0
@@ -147,6 +147,7 @@ static const TypeInfo serial_isa_info = { .instance_size = sizeof(ISASerialState), .instance_init = serial_isa_initfn, .class_init = serial_isa_class_initfn, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_ACPI_DEV_AML_IF }, { },
hw/char/serial-pci.c +1 -0
@@ -109,6 +109,7 @@ static const TypeInfo serial_pci_info = { .instance_size = sizeof(PCISerialState), .instance_init = serial_pci_init, .class_init = serial_pci_class_initfn, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/char/serial.c +1 -0
@@ -984,6 +984,7 @@ static const TypeInfo serial_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(SerialState), .class_init = serial_class_init, + .secure = true, };static void serial_register_types (void )
hw/char/spapr_vty.c +1 -0
@@ -201,6 +201,7 @@ static const TypeInfo spapr_vty_info = { .parent = TYPE_VIO_SPAPR_DEVICE, .instance_size = sizeof(SpaprVioVty), .class_init = spapr_vty_class_init, + .secure = true, };SpaprVioDevice *spapr_vty_get_default (SpaprVioBus *bus)
Signature · 1 line
2.55.0
PATCH 20/28 hw/audio: mark Intel HDA devices & codecs as secure
In reply to Daniel P. BerrangéThis is traditionally the primary audio backend for x86 as virtio-snd is a relatively new invention.
--- hw/audio/hda-codec.c | 4 ++++ hw/audio/intel-hda.c | 5 +++++ 2 files changed, 9 insertions(+)
hw/audio/hda-codec.c +4 -0
@@ -858,6 +858,7 @@ static const TypeInfo hda_audio_info = { .instance_size = sizeof(HDAAudioState), .class_init = hda_audio_base_class_init, .abstract = true, + .secure = true, };static void hda_audio_output_class_init (ObjectClass *klass,const void *data)
@@ -873,6 +874,7 @@ static const TypeInfo hda_audio_output_info = { .name = "hda-output", .parent = TYPE_HDA_AUDIO, .class_init = hda_audio_output_class_init, + .secure = true, };static void hda_audio_duplex_class_init (ObjectClass *klass,const void *data)
@@ -888,6 +890,7 @@ static const TypeInfo hda_audio_duplex_info = { .name = "hda-duplex", .parent = TYPE_HDA_AUDIO, .class_init = hda_audio_duplex_class_init, + .secure = true, };static void hda_audio_micro_class_init (ObjectClass *klass,const void *data)
@@ -903,6 +906,7 @@ static const TypeInfo hda_audio_micro_info = { .name = "hda-micro", .parent = TYPE_HDA_AUDIO, .class_init = hda_audio_micro_class_init, + .secure = true, };static void hda_audio_register_types (void )
hw/audio/intel-hda.c +5 -0
@@ -45,6 +45,7 @@ static const TypeInfo hda_codec_bus_info = { .name = TYPE_HDA_BUS, .parent = TYPE_BUS, .instance_size = sizeof(HDACodecBus), + .secure = true, }; void hda_codec_bus_init(DeviceState *dev, HDACodecBus *bus, size_t bus_size,
@@ -1265,6 +1266,7 @@ static const TypeInfo intel_hda_info = { .instance_size = sizeof(IntelHDAState), .class_init = intel_hda_class_init, .abstract = true, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
@@ -1275,12 +1277,14 @@ static const TypeInfo intel_hda_info_ich6 = { .name = "intel-hda", .parent = TYPE_INTEL_HDA_GENERIC, .class_init = intel_hda_class_init_ich6, + .secure = true, };static const TypeInfo intel_hda_info_ich9 = { .name ="ich9-intel-hda" , .parent =TYPE_INTEL_HDA_GENERIC , .class_init = intel_hda_class_init_ich9, + .secure = true, };static void hda_codec_device_class_init (ObjectClass *klass,const void *data)
@@ -1298,6 +1302,7 @@ static const TypeInfo hda_codec_device_type_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(HDACodecDevice), .abstract = true, + .secure = true, .class_size = sizeof(HDACodecDeviceClass), .class_init = hda_codec_device_class_init, };
Signature · 1 line
2.55.0
PATCH 25/28 hw: mark KVM clock and RTC devices as secure
In reply to Daniel P. BerrangéThese are core infrastructure in virtualization cases so must provide a security boundary.
--- hw/i386/kvm/clock.c | 1 + hw/rtc/mc146818rtc.c | 1 + 2 files changed, 2 insertions(+)
hw/i386/kvm/clock.c +1 -0
@@ -366,6 +366,7 @@ static const TypeInfo kvmclock_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(KVMClockState), .class_init = kvmclock_class_init, + .secure = true, };/* Note: Must be called after VCPU initialization. */
hw/rtc/mc146818rtc.c +1 -0
@@ -1027,6 +1027,7 @@ static const TypeInfo mc146818rtc_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(MC146818RtcState), .class_init = rtc_class_initfn, + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_ACPI_DEV_AML_IF }, { },
Signature · 1 line
2.55.0
PATCH 24/28 hw/acpi: mark erst, vmclock and vmgenid devices as secure
In reply to Daniel P. BerrangéThese are all used in virtualization scenarios so must be declare to provide a security boundary
--- hw/acpi/erst.c | 1 + hw/acpi/vmclock.c | 1 + hw/acpi/vmgenid.c | 1 + 3 files changed, 3 insertions(+)
hw/acpi/erst.c +1 -0
@@ -1044,6 +1044,7 @@ static const TypeInfo erst_type_info = { .parent = TYPE_PCI_DEVICE, .class_init = erst_class_init, .instance_size = sizeof(ERSTDeviceState), + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }
hw/acpi/vmclock.c +1 -0
@@ -169,6 +169,7 @@ static const TypeInfo vmclock_device_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(VmclockState), .class_init = vmclock_device_class_init, + .secure = true, };static void vmclock_register_types (void )
hw/acpi/vmgenid.c +1 -0
@@ -236,6 +236,7 @@ static const TypeInfo vmgenid_device_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(VmGenIdState), .class_init = vmgenid_device_class_init, + .secure = true, };static void vmgenid_register_types (void )
Signature · 1 line
2.55.0
PATCH 23/28 hw/uefi: mark the EFI vars service as secure
In reply to Daniel P. BerrangéThis is used to persist EFI variables when NVRAM is not available or undesirable.
--- hw/uefi/var-service-sysbus.c | 2 ++ 1 file changed, 2 insertions(+)
hw/uefi/var-service-sysbus.c +2 -0
@@ -84,6 +84,7 @@ static const TypeInfo uefi_vars_sysbus_info = { .instance_size = sizeof(uefi_vars_sysbus_state), .instance_init = uefi_vars_sysbus_init, .class_init = uefi_vars_sysbus_class_init, + .secure = true, };module_obj (TYPE_UEFI_VARS_SYSBUS );
@@ -113,6 +114,7 @@ static const TypeInfo uefi_vars_x64_info = { .name = TYPE_UEFI_VARS_X64, .parent = TYPE_UEFI_VARS_SYSBUS, .class_init = uefi_vars_x64_class_init, + .secure = true, };module_obj (TYPE_UEFI_VARS_X64 );
Signature · 1 line
2.55.0
PATCH 22/28 hw/mem: mark nvdimm, pc-dimm & spapr-nvdimm devices as secure
In reply to Daniel P. BerrangéThese devices are used in virutalization scenarios to support memory hotplug and other uses cases.
--- hw/mem/nvdimm.c | 1 + hw/mem/pc-dimm.c | 1 + hw/ppc/spapr_nvdimm.c | 1 + 3 files changed, 3 insertions(+)
hw/mem/nvdimm.c +1 -0
@@ -275,6 +275,7 @@ static const TypeInfo nvdimm_info = { .instance_size = sizeof(NVDIMMDevice), .instance_init = nvdimm_init, .instance_finalize = nvdimm_finalize, + .secure = true, };static void nvdimm_register_types (void )
hw/mem/pc-dimm.c +1 -0
@@ -301,6 +301,7 @@ static const TypeInfo pc_dimm_info = { .instance_init = pc_dimm_init, .class_init = pc_dimm_class_init, .class_size = sizeof(PCDIMMDeviceClass), + .secure = true, .interfaces = (const InterfaceInfo []) { {TYPE_MEMORY_DEVICE }, { }
hw/ppc/spapr_nvdimm.c +1 -0
@@ -916,6 +916,7 @@ static TypeInfo spapr_nvdimm_info = { .class_size = sizeof(SPAPRNVDIMMClass), .instance_size = sizeof(SpaprNVDIMMDevice), .instance_init = spapr_nvdimm_init, + .secure = true, };static void spapr_nvdimm_register_types (void )
Signature · 1 line
2.55.0
PATCH 26/28 hw: device AMD, Intel and ARM IOMMUs as secure
In reply to Daniel P. BerrangéThese are needed in virtualization use cases to support PCI device assignment use cases so must provide a security boundary.
--- hw/arm/smmu-common.c | 1 + hw/arm/smmuv3.c | 2 ++ hw/i386/amd_iommu.c | 4 +++- hw/i386/intel_iommu.c | 1 + 4 files changed, 7 insertions(+), 1 deletion(-)
hw/arm/smmu-common.c +1 -0
@@ -1040,6 +1040,7 @@ static const TypeInfo smmu_base_info = { .class_size = sizeof(SMMUBaseClass), .class_init = smmu_base_class_init, .abstract = true, + .secure = true, };static void smmu_base_register_types (void )
hw/arm/smmuv3.c +2 -0
@@ -2272,12 +2272,14 @@ static const TypeInfo smmuv3_type_info = { .instance_init = smmuv3_instance_init, .class_size = sizeof(SMMUv3Class), .class_init = smmuv3_class_init, + .secure = true, };static const TypeInfo smmuv3_iommu_memory_region_info = { .parent =TYPE_IOMMU_MEMORY_REGION , .name =TYPE_SMMUV3_IOMMU_MEMORY_REGION , .class_init = smmuv3_iommu_memory_region_class_init, + .secure = true, };static void smmuv3_register_types (void )
hw/i386/amd_iommu.c +3 -1
@@ -2783,7 +2783,8 @@ static const TypeInfo amdvi_sysbus = { .name = TYPE_AMD_IOMMU_DEVICE, .parent = TYPE_X86_IOMMU_DEVICE, .instance_size = sizeof(AMDVIState), - .class_init = amdvi_sysbus_class_init + .class_init = amdvi_sysbus_class_init, + .secure = true, };static void amdvi_pci_class_init (ObjectClass *klass,const void *data)
@@ -2805,6 +2806,7 @@ static const TypeInfo amdvi_pci = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(AMDVIPCIState), .class_init = amdvi_pci_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },
hw/i386/intel_iommu.c +1 -0
@@ -5687,6 +5687,7 @@ static const TypeInfo vtd_info = { .parent = TYPE_X86_IOMMU_DEVICE, .instance_size = sizeof(IntelIOMMUState), .class_init = vtd_class_init, + .secure = true, };static int vtd_attrs_to_index (IOMMUMemoryRegion *iommu_mr,MemTxAttrs attrs)
Signature · 1 line
2.55.0
PATCH 27/28 hw/input: mark PS/2 and PC Keyboard devices as secure
In reply to Daniel P. BerrangéThese are part of the baseline x86 featureset so required for virtualization use cases.
--- hw/input/pckbd.c | 3 ++- hw/input/ps2.c | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-)
hw/input/pckbd.c +2 -1
@@ -766,7 +766,8 @@ static const TypeInfo i8042_mmio_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_init = i8042_mmio_init, .instance_size = sizeof(MMIOKBDState), - .class_init = i8042_mmio_class_init + .class_init = i8042_mmio_class_init, + .secure = true, };void i8042_isa_mouse_fake_event (ISAKBDState *isa)
hw/input/ps2.c +6 -3
@@ -1293,7 +1293,8 @@ static const TypeInfo ps2_kbd_info = { .name = TYPE_PS2_KBD_DEVICE, .parent = TYPE_PS2_DEVICE, .instance_size = sizeof(PS2KbdState), - .class_init = ps2_kbd_class_init + .class_init = ps2_kbd_class_init, + .secure = true, };static void ps2_mouse_class_init (ObjectClass *klass,const void *data)
@@ -1313,7 +1314,8 @@ static const TypeInfo ps2_mouse_info = { .name = TYPE_PS2_MOUSE_DEVICE, .parent = TYPE_PS2_DEVICE, .instance_size = sizeof(PS2MouseState), - .class_init = ps2_mouse_class_init + .class_init = ps2_mouse_class_init, + .secure = true, };static void ps2_init (Object *obj)
@@ -1340,7 +1342,8 @@ static const TypeInfo ps2_info = { .instance_size = sizeof(PS2State), .class_init = ps2_class_init, .class_size = sizeof(PS2DeviceClass), - .abstract = true + .abstract = true, + .secure = true, };static void ps2_register_types (void )
Signature · 1 line
2.55.0
PATCH 28/28 hw/i386: mark vmmouse / vmport as secure
In reply to Daniel P. BerrangéThese paravirtualized devices are relevant to virtualization use cases.
--- hw/i386/vmmouse.c | 1 + hw/i386/vmport.c | 1 + 2 files changed, 2 insertions(+)
hw/i386/vmmouse.c +1 -0
@@ -390,6 +390,7 @@ static const TypeInfo vmmouse_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(VMMouseState), .class_init = vmmouse_class_initfn, + .secure = true, };static void vmmouse_register_types (void )
hw/i386/vmport.c +1 -0
@@ -301,6 +301,7 @@ static const TypeInfo vmport_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(VMPortState), .class_init = vmport_class_initfn, + .secure = true, };static void vmport_register_types (void )
Signature · 1 line
2.55.0
Re: [PATCH 15/28] hw: define most common PCI types as secure
In reply to Daniel P. BerrangéQuoted 26 lines · Daniel P. Berrangé
Essentially all PCI infrastructure is in scope for the virtualization use case, aside from the niche simba bridge.
Signed-off-by Daniel P. Berrangé <[email protected]>--- hw/pci-bridge/gen_pcie_root_port.c | 1 + hw/pci-bridge/i82801b11.c | 1 + hw/pci-bridge/ioh3420.c | 1 + hw/pci-bridge/pci_bridge_dev.c | 2 ++ hw/pci-bridge/pci_expander_bridge.c | 8 ++++++++ hw/pci-bridge/pcie_pci_bridge.c | 1 + hw/pci-bridge/pcie_root_port.c | 1 + hw/pci-bridge/xio3130_downstream.c | 1 + hw/pci-bridge/xio3130_upstream.c | 1 + hw/pci/pci.c | 7 +++++++ hw/pci/pci_bridge.c | 1 + hw/pci/pci_host.c | 1 + hw/pci/pcie_host.c | 1 + hw/pci/pcie_port.c | 1 + 14 files changed, 28 insertions(+)hw/pci-bridge/pci_expander_bridge.c +0
-0
snip
Quoted 7 lines
hw/pci-bridge/pci_expander_bridge.c +1
-0@@ -128,6 +130,7 @@ static const TypeInfo pxb_cxl_bus_info = { .parent = TYPE_CXL_BUS, .instance_size = sizeof(PXBBus), .class_init = pxb_bus_class_init, + .secure = true, };
snip
Quoted 9 lines
static void
pxb_cxl_realize(DeviceState *dev, Error **errp)hw/pci-bridge/pci_expander_bridge.c +1
-0@@ -249,6 +253,7 @@ static const TypeInfo cxl_host_info = { .parent = TYPE_PCI_HOST_BRIDGE, .instance_size = sizeof(CXLHost), .class_init = pxb_cxl_host_class_init, + .secure = true, };/*
snip
hw/pci-bridge/pci_expander_bridge.c static const TypeInfo pxb_cxl_dev_info = { · line 553
Quoted 8 lines
hw/pci-bridge/pci_expander_bridge.c +1
-0@@ -540,6 +547,7 @@ static const TypeInfo pxb_cxl_dev_info = { .parent = TYPE_PXB_PCIE_DEV, .instance_size = sizeof(PXBCXLDev), .class_init = pxb_cxl_dev_class_init, + .secure = true, .interfaces = (const InterfaceInfo []){ {INTERFACE_CONVENTIONAL_PCI_DEVICE },
These three were a mistake. No CXL code is intended to be classed as secure at this time.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Ping, any maintainers have thoughts on this proposal ?
Quoted 287 lines · Daniel P. Berrangé
This (largish) series undertakes the task of marking devices secure, if they are intended to be used a virtualization use case.
NB, the maintainer CC list was way too huge to include every individual, so I've trimmed to just the mailing list CCs.
The approach taken was iterative as follows
* Machines listed in
https://www.qemu.org/docs/master/system/security.html#virtualization-use-case
* All virtio/vhost/vfio/xen related devices
* Most PCI related devices/controllers/bridges
I then used the RHEL builds of QEMU as an approximation for what should be considered "virtualization use case", since they cut out a huge pile of devices from the build. IOW, more or less everything that RHEL builds for
x86_64, ppc64, aarch64, s390x gets included. Notably since RHEL does not yet ship riscv or loongarch, I've possibly missed some devices that ought to be in scope.Devices are marked secure *regardless* of their maintainer status, if they are relevant to virt. Notably all the USB stuff is included despite USB being orphaned. An exception is CXL which is arguably relevant to virt, but maintainers agreed it is too immature to include so far.
IOW, the "secure" flag as set in this series mostly avoids saying anything about the support status of the object types.
Over the long term, IMHO, the set of devices we declare as providing a security boundary needs to be stable. We should not declare a device out of scope for the virt use case simply because a maintainer steps aside. The device doesn't become instantly less secure. It does mean bug fixes may not be timely enough, and rely on the goodwill of other contributors or maintainers to step up and fix.
Or to put it another way. "secure = true" does not guarantee that the device is secure, but it states our intent that we *want* it to be secure, as opposed to "secure = false" which indicates we just don't care either way.
The intersection of (secure, orphaned) highlights to QEMU contributors or corporate sponsors, where they might step up their effort / investment.
Finally this is just user creatable devices. Use of these devices implies use of many more non-user creatable devices.
I don't have a good way to enumerate those yet, and while the end user doesn't care at runtime, as maintainers we want to be clear if all devices are in scope for CVE handling or not.
Based-on: <[email protected]>
Daniel P. Berrangé (28):
hw: mark secure machines for x86, s390, ppc, arm, loonarch, riscv
accel: mark kvm and xen accelerators as secure
hw: mark all virtio PCI devices as secure
hw: mark all virtio CCW devices as secure
hw: mark all vhost devices a secure
hw: mark all remaining virtio object types as secure hw/vfio: mark all VFIO object classes as secure
hw/xen: mark all Xen related object types as being secure hw/net: mark e1000, e1000e, IGB, rtl8139 & sPAPR VLAN as secure hw/usb: mark commonly used USB devices/hosts as secure hw/watchdog: mark some watchdog devices as secure hw/scsi: mark spapr and vmware SCSI controllers as secure hw/scsi: mark SCSI disk endpoint devices as secure hw/ide: mark ICH9 and ide-hd/ide-cd as secure
hw: define most common PCI types as secure
hw/pci-host: mark common x86, ppc, arm and s390 PCI hosts as secure hw/display: mark bochs, cirrus, qxl, VGA, ramfb as secure hw/tpm: mark all TPM implementations as secure
hw/misc: mark pvpanic, vmcoreinfo as secure
hw/audio: mark Intel HDA devices & codecs as secure hw/char: mark common serial / console devicess a secure hw/mem: mark nvdimm, pc-dimm & spapr-nvdimm devices as secure hw/uefi: mark the EFI vars service as secure
hw/acpi: mark erst, vmclock and vmgenid devices as secure
hw: mark KVM clock and RTC devices as secure
hw: device AMD, Intel and ARM IOMMUs as secure
hw/input: mark PS/2 and PC Keyboard devices as secure hw/i386: mark vmmouse / vmport as secureaccel/accel-common.c | 2 ++ accel/accel-system.c | 1 + accel/kvm/kvm-accel-ops.c | 1 + accel/kvm/kvm-all.c | 1 + accel/xen/xen-all.c | 2 ++ hw/9pfs/virtio-9p-device.c | 1 + hw/acpi/erst.c | 1 + hw/acpi/vmclock.c | 1 + hw/acpi/vmgenid.c | 1 + hw/arm/smmu-common.c | 1 + hw/arm/smmuv3.c | 2 ++ hw/arm/virt.c | 1 + hw/arm/xen-pvh.c | 1 + hw/audio/hda-codec.c | 4 ++++ hw/audio/intel-hda.c | 5 +++++ hw/audio/virtio-snd.c | 1 + hw/block/vhost-user-blk.c | 1 + hw/block/virtio-blk.c | 1 + hw/block/xen-block.c | 3 +++ hw/char/debugcon.c | 1 + hw/char/sclpconsole-lm.c | 1 + hw/char/sclpconsole.c | 1 + hw/char/serial-isa.c | 1 + hw/char/serial-pci.c | 1 + hw/char/serial.c | 1 + hw/char/spapr_vty.c | 1 + hw/char/virtio-console.c | 2 ++ hw/char/virtio-serial-bus.c | 3 +++ hw/char/xen_console.c | 1 + hw/display/bochs-display.c | 1 + hw/display/cirrus_vga.c | 1 + hw/display/qxl.c | 3 +++ hw/display/ramfb-standalone.c | 1 + hw/display/vga-mmio.c | 1 + hw/display/vga-pci.c | 3 +++ hw/display/vhost-user-gpu.c | 1 + hw/display/virtio-gpu-base.c | 3 ++- hw/display/virtio-gpu-gl.c | 1 + hw/display/virtio-gpu-pci-rutabaga.c | 1 + hw/display/virtio-gpu-pci.c | 3 ++- hw/display/virtio-gpu-rutabaga.c | 1 + hw/display/virtio-gpu.c | 1 + hw/i386/amd_iommu.c | 4 +++- hw/i386/intel_iommu.c | 1 + hw/i386/kvm/clock.c | 1 + hw/i386/microvm.c | 1 + hw/i386/pc_piix.c | 4 ++-- hw/i386/vmmouse.c | 1 + hw/i386/vmport.c | 1 + hw/i386/xen/xen-pvh.c | 1 + hw/i386/xen/xen_platform.c | 1 + hw/i386/xen/xen_pvdevice.c | 1 + hw/ide/ich.c | 1 + hw/ide/ide-dev.c | 3 +++ hw/ide/piix.c | 2 ++ hw/input/pckbd.c | 3 ++- hw/input/ps2.c | 9 ++++++--- hw/input/virtio-input-hid.c | 5 +++++ hw/input/virtio-input-host.c | 1 + hw/input/virtio-input.c | 1 + hw/loongarch/virt.c | 2 ++ hw/mem/nvdimm.c | 1 + hw/mem/pc-dimm.c | 1 + hw/misc/pvpanic-isa.c | 1 + hw/misc/pvpanic-mmio.c | 1 + hw/misc/pvpanic-pci.c | 1 + hw/misc/vmcoreinfo.c | 1 + hw/net/e1000.c | 1 + hw/net/e1000e.c | 1 + hw/net/igb.c | 1 + hw/net/rtl8139.c | 1 + hw/net/spapr_llan.c | 1 + hw/net/virtio-net.c | 1 + hw/net/xen_nic.c | 1 + hw/pci-bridge/gen_pcie_root_port.c | 1 + hw/pci-bridge/i82801b11.c | 1 + hw/pci-bridge/ioh3420.c | 1 + hw/pci-bridge/pci_bridge_dev.c | 2 ++ hw/pci-bridge/pci_expander_bridge.c | 8 ++++++++ hw/pci-bridge/pcie_pci_bridge.c | 1 + hw/pci-bridge/pcie_root_port.c | 1 + hw/pci-bridge/xio3130_downstream.c | 1 + hw/pci-bridge/xio3130_upstream.c | 1 + hw/pci-host/gpex.c | 2 ++ hw/pci-host/i440fx.c | 2 ++ hw/pci-host/pnv_phb.c | 2 ++ hw/pci-host/pnv_phb3.c | 3 +++ hw/pci-host/pnv_phb3_msi.c | 1 + hw/pci-host/pnv_phb3_pbcq.c | 1 + hw/pci-host/pnv_phb4.c | 4 +++- hw/pci-host/pnv_phb4_pec.c | 1 + hw/pci-host/q35.c | 2 ++ hw/pci-host/remote.c | 1 + hw/pci-host/xen_igd_pt.c | 1 + hw/pci/pci.c | 7 +++++++ hw/pci/pci_bridge.c | 1 + hw/pci/pci_host.c | 1 + hw/pci/pcie_host.c | 1 + hw/pci/pcie_port.c | 1 + hw/ppc/spapr.c | 1 + hw/ppc/spapr_nvdimm.c | 1 + hw/ppc/spapr_pci.c | 1 + hw/ppc/spapr_tpm_proxy.c | 1 + hw/riscv/virt.c | 1 + hw/rtc/mc146818rtc.c | 1 + hw/s390x/s390-pci-bus.c | 4 ++++ hw/s390x/s390-virtio-ccw.c | 1 + hw/s390x/vhost-scsi-ccw.c | 1 + hw/s390x/vhost-user-fs-ccw.c | 1 + hw/s390x/vhost-vsock-ccw.c | 1 + hw/s390x/virtio-ccw-9p.c | 1 + hw/s390x/virtio-ccw-balloon.c | 1 + hw/s390x/virtio-ccw-blk.c | 1 + hw/s390x/virtio-ccw-crypto.c | 1 + hw/s390x/virtio-ccw-gpu.c | 1 + hw/s390x/virtio-ccw-input.c | 5 +++++ hw/s390x/virtio-ccw-md.c | 1 + hw/s390x/virtio-ccw-mem.c | 1 + hw/s390x/virtio-ccw-net.c | 1 + hw/s390x/virtio-ccw-rng.c | 1 + hw/s390x/virtio-ccw-scsi.c | 1 + hw/s390x/virtio-ccw-serial.c | 1 + hw/s390x/virtio-ccw.c | 1 + hw/scsi/scsi-disk.c | 4 ++++ hw/scsi/scsi-generic.c | 1 + hw/scsi/spapr_vscsi.c | 1 + hw/scsi/vhost-scsi-common.c | 1 + hw/scsi/vhost-scsi.c | 1 + hw/scsi/vhost-user-scsi.c | 1 + hw/scsi/virtio-scsi.c | 2 ++ hw/scsi/vmw_pvscsi.c | 1 + hw/tpm/tpm_crb.c | 1 + hw/tpm/tpm_spapr.c | 1 + hw/tpm/tpm_tis_i2c.c | 1 + hw/tpm/tpm_tis_isa.c | 1 + hw/tpm/tpm_tis_sysbus.c | 1 + hw/uefi/var-service-sysbus.c | 2 ++ hw/usb/ccid-card-emulated.c | 1 + hw/usb/ccid-card-passthru.c | 1 + hw/usb/dev-hid.c | 4 ++++ hw/usb/dev-hub.c | 1 + hw/usb/dev-smartcard-reader.c | 3 +++ hw/usb/dev-storage-bot.c | 1 + hw/usb/dev-storage-classic.c | 1 + hw/usb/dev-storage.c | 1 + hw/usb/hcd-ehci-pci.c | 2 ++ hw/usb/hcd-ehci-sysbus.c | 8 ++++++++ hw/usb/hcd-ohci-pci.c | 1 + hw/usb/hcd-ohci-sysbus.c | 1 + hw/usb/hcd-uhci.c | 2 ++ hw/usb/hcd-xhci-nec.c | 1 + hw/usb/hcd-xhci-pci.c | 2 ++ hw/usb/hcd-xhci-sysbus.c | 3 ++- hw/usb/hcd-xhci.c | 1 + hw/usb/host-libusb.c | 1 + hw/usb/redirect.c | 1 + hw/vfio-user/pci.c | 1 + hw/vfio/ap.c | 1 + hw/vfio/ccw.c | 1 + hw/vfio/container.c | 1 + hw/vfio/igd.c | 1 + hw/vfio/iommufd.c | 2 ++ hw/vfio/pci.c | 3 +++ hw/vfio/spapr.c | 1 + hw/virtio/vdpa-dev.c | 1 + hw/virtio/vhost-user-base.c | 3 ++- hw/virtio/vhost-user-fs.c | 1 + hw/virtio/vhost-user-gpio.c | 1 + hw/virtio/vhost-user-i2c.c | 1 + hw/virtio/vhost-user-input.c | 1 + hw/virtio/vhost-user-rng.c | 1 + hw/virtio/vhost-user-rtc.c | 1 + hw/virtio/vhost-user-scmi.c | 1 + hw/virtio/vhost-user-snd.c | 1 + hw/virtio/vhost-user-spi.c | 1 + hw/virtio/vhost-user-test-device.c | 1 + hw/virtio/vhost-user-vsock.c | 1 + hw/virtio/vhost-vsock-common.c | 1 + hw/virtio/vhost-vsock.c | 1 + hw/virtio/virtio-balloon.c | 1 + hw/virtio/virtio-bus.c | 1 + hw/virtio/virtio-crypto.c | 1 + hw/virtio/virtio-input-pci.c | 2 ++ hw/virtio/virtio-iommu.c | 2 ++ hw/virtio/virtio-md-pci.c | 1 + hw/virtio/virtio-mem.c | 1 + hw/virtio/virtio-mmio.c | 2 ++ hw/virtio/virtio-nsm.c | 1 + hw/virtio/virtio-pci.c | 3 +++ hw/virtio/virtio-pmem.c | 1 + hw/virtio/virtio-rng.c | 1 + hw/virtio/virtio-rtc.c | 1 + hw/watchdog/sbsa_gwdt.c | 1 + hw/watchdog/spapr_watchdog.c | 1 + hw/watchdog/wdt_diag288.c | 1 + hw/watchdog/wdt_i6300esb.c | 1 +
Quoted 12 lines
hw/watchdog/wdt_ib700.c | 1 + hw/xen/xen-bus.c | 3 +++ hw/xen/xen-legacy-backend.c | 3 +++ hw/xen/xen-pvh-common.c | 1 + hw/xen/xen_pt.c | 1 + hw/xenpv/xen_machine_pv.c | 2 +- include/hw/i386/pc.h | 1 + 203 files changed, 304 insertions(+), 13 deletions(-)Signature · 1 line
2.55.0
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Hi
Quoted 17 lines
This (largish) series undertakes the task of marking devices secure, if they are intended to be used a virtualization use case.
NB, the maintainer CC list was way too huge to include every individual, so I've trimmed to just the mailing list CCs.
The approach taken was iterative as follows
* Machines listed in
https://www.qemu.org/docs/master/system/security.html#virtualization-use-case
* All virtio/vhost/vfio/xen related devices
* Most PCI related devices/controllers/bridges
Quoted 7 lines
I then used the RHEL builds of QEMU as an approximation for what should be considered "virtualization use case", since they cut out a huge pile of devices from the build. IOW, more or less everything that RHEL builds for
x86_64, ppc64, aarch64, s390x gets included. Notably since RHEL does not yet ship riscv or loongarch, I've possibly missed some devices that ought to be in scope.
I don't see many maintainers against your proposal. I guess we can assume they agree? I think this will really help us deal with bug triaging and priorities, so I wish it would land already..
Quoted 22 lines
Devices are marked secure *regardless* of their maintainer status, if they are relevant to virt. Notably all the USB stuff is included despite USB being orphaned. An exception is CXL which is arguably relevant to virt, but maintainers agreed it is too immature to include so far.
IOW, the "secure" flag as set in this series mostly avoids saying anything about the support status of the object types.
Over the long term, IMHO, the set of devices we declare as providing a security boundary needs to be stable. We should not declare a device out of scope for the virt use case simply because a maintainer steps aside. The device doesn't become instantly less secure. It does mean bug fixes may not be timely enough, and rely on the goodwill of other contributors or maintainers to step up and fix.
Or to put it another way. "secure = true" does not guarantee that the device is secure, but it states our intent that we *want* it to be secure, as opposed to "secure = false" which indicates we just don't care either way.
Quoted 6 lines
The intersection of (secure, orphaned) highlights to QEMU contributors or corporate sponsors, where they might step up their effort / investment.
Finally this is just user creatable devices. Use of these devices implies use of many more non-user creatable devices.
Right, and I also figured out while reviewing this that CLI -vga/-nic/-drive creation paths are not being checked yet. I can look at it if it helps
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 02/28] accel: mark kvm and xen accelerators as secure
In reply to Daniel P. BerrangéQuoted 8 lines · Daniel P. Berrangé
TCG is too complex to be considered to provide a security boundary for malicious guest workloads. QTest is only used for functional testing and thus is not relevant to mark secure.
KVM and Xen are servicing virtualization use cases which must provide security and actively maintained.
[...]
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 04/28] hw: mark all virtio CCW devices as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
These are all intended for use in a virtualization scenario and must provide a security boundary.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 03/28] hw: mark all virtio PCI devices as secure
In reply to Daniel P. BerrangéQuoted 15 lines
These are all intended for use in a virtualization scenario and must provide a security boundary. This can be done for almost all virtio PCI devices by modifying the common type register helper.
The virtio-gpu devices are unusual in not using the common
virtio_pci_types_register()method, so need marking directly.Signed-off-by Daniel P. Berrangé <[email protected]>Message-ID: <[email protected]>
hw/display/virtio-gpu-pci-rutabaga.c +0
-0
hw/display/virtio-gpu-pci-rutabaga.c static const TypeInfo virtio_gpu_rutabaga_pci_info[] = { · line 37
Quoted 4 lines
hw/display/virtio-gpu-pci-rutabaga.c +1
-0@@ -34,6 +34,7 @@ static const TypeInfo virtio_gpu_rutabaga_pci_info[] = { .parent = TYPE_VIRTIO_GPU_PCI_BASE, .instance_size = sizeof(VirtIOGPURutabagaPCI), .instance_init = virtio_gpu_rutabaga_initfn, + .secure = true,
This is unusual, I wonder why it's not using the VirtioPCIDeviceTypeInfo
Quoted 8 lines
hw/display/virtio-gpu-pci-rutabaga.c +0
-0.interfaces = (const InterfaceInfo[]) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },hw/display/virtio-gpu-pci.c +0
-0
hw/display/virtio-gpu-pci.c static const TypeInfo virtio_gpu_pci_base_info = { · line 79
Quoted 6 lines
hw/display/virtio-gpu-pci.c +2
-1@@ -75,7 +75,8 @@ static const TypeInfo virtio_gpu_pci_base_info = { .parent = TYPE_VIRTIO_PCI, .instance_size = sizeof(VirtIOGPUPCIBase), .class_init = virtio_gpu_pci_base_class_init, - .abstract = true + .abstract = true, + .secure = true,
This is a base class, probably doesn't need marking.
Quoted 24 lines
hw/display/virtio-gpu-pci.c +0
-0};module_obj (TYPE_VIRTIO_GPU_PCI_BASE );module_kconfig (VIRTIO_PCI );hw/virtio/virtio-pci.c +2
-0@@ -2520,6 +2520,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .name = t->generic_name, .parent = base_type_info.name, .class_init = virtio_pci_generic_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, {INTERFACE_CONVENTIONAL_PCI_DEVICE },@@ -2555,6 +2556,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .name = t->non_transitional_name, .parent = base_type_info.name, .instance_init = virtio_pci_non_transitional_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, {INTERFACE_CONVENTIONAL_PCI_DEVICE },
hw/virtio/virtio-pci.c void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) · line 2577
Quoted 7 lines
hw/virtio/virtio-pci.c +1
-0@@ -2569,6 +2571,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t) .name = t->transitional_name, .parent = base_type_info.name, .instance_init = virtio_pci_transitional_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) {/* * Transitional virtio devices work only as Conventional PCI
otherwise lgtm
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 01/28] hw: mark secure machines for x86, s390, ppc, arm, loonarch, riscv
In reply to Daniel P. BerrangéQuoted 8 lines · Daniel P. Berrangé
The versioned machine types are typically present for use in virtualization use cases and can be expected to provide a security barrier. The only exceptions are the m68k versioned machine types which are only used with TCG. There are also a handful of other machines declared secure in
docs/system/security.rst, notably the Xen machine variants and microvm.[...]
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 05/28] hw: mark all vhost devices a secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
These are all intended for use in a virtualization scenario and must provide a security boundary.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 06/28] hw: mark all remaining virtio object types as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
These are all intended for use in a virtualization scenario and must provide a security boundary.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 07/28] hw/vfio: mark all VFIO object classes as secure
In reply to Daniel P. BerrangéQuoted 3 lines · Daniel P. Berrangé
The VFIO subsystem is about securely passing host PCI devices to a guest, so all the classes should be presumed to be offering a security boundary.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 08/28] hw/xen: mark all Xen related object types as being secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
All Xen paravirtualized devices are intended to provide a host / guest security barrier, so mark all Xen object types as scure.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 10/28] hw/usb: mark commonly used USB devices/hosts as secure
In reply to Daniel P. BerrangéQuoted 9 lines
Most of the standardized USB1/2/3 host controllers are relevant for virtualization use cases, so should be declared secure. The "NEC" XHCI variant is slightly non-standard, but since it is a trivial sub-class of the generic XHCI, there's no reason to exclude it.
The set of devices that are expected to be used is HID (mouse, tablet, keyboard), host passthrough, CCID (smartcard), hub, storage and the redirect tunnelling.
Can't we exclude uhci/ehci nowadays?
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 09/28] hw/net: mark e1000, e1000e, IGB, rtl8139 & sPAPR VLAN as secure
In reply to Daniel P. BerrangéQuoted 6 lines
Historically most NICs are only interesting for non-virtualization use cases and have not been written with malicious guests in mind.
As a general rule either virtio-net or xen-net should be used in all virtualized guests requiring a security boundary.
Quoted 8 lines
There are a handful of exceptions resulting from historical usage in the x86 world, to support virtualized guests lacking virtio support.
Thus the rtl8139, e1000, e1000e & IGB NICs are declared to provide a security boundary.
The PPC sPAPR Virutal LAN device is also marked secure.
Virtual
hw/net/e1000.c static void e1000_register_types(void) · line 1762
Quoted 13 lines
Signed-off-by Daniel P. Berrangé <[email protected]>Message-ID: <[email protected]>
hw/net/e1000.c +1
-0@@ -1759,6 +1759,7 @@ static void e1000_register_types(void) type_info.parent =TYPE_E1000_BASE ; type_info.class_data = info; type_info.class_init = e1000_class_init; + type_info.secure = true,
type_info.secure = true;
Quoted 44 lines
hw/net/e1000.c +0
-0type_register_static (&type_info); }hw/net/e1000e.c +1
-0@@ -721,6 +721,7 @@ static const TypeInfo e1000e_info = { .instance_size = sizeof(E1000EState), .class_init = e1000e_class_init, .instance_init = e1000e_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, { }hw/net/igb.c +1
-0@@ -635,6 +635,7 @@ static const TypeInfo igb_info = { .instance_size = sizeof(IGBState), .class_init = igb_class_init, .instance_init = igb_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE }, { }hw/net/rtl8139.c +1
-0@@ -3450,6 +3450,7 @@ static const TypeInfo rtl8139_info = { .instance_size = sizeof(RTL8139State), .class_init = rtl8139_class_init, .instance_init = rtl8139_instance_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },hw/net/spapr_llan.c +0
-0
hw/net/spapr_llan.c static const TypeInfo spapr_vlan_info = { · line 879
Quoted 7 lines
hw/net/spapr_llan.c +1
-0@@ -873,6 +873,7 @@ static const TypeInfo spapr_vlan_info = { .class_init = spapr_vlan_class_init, .instance_init = spapr_vlan_instance_init, .instance_finalize = spapr_vlan_instance_finalize, + .secure = true, };static void spapr_vlan_register_types (void )
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 11/28] hw/watchdog: mark some watchdog devices as secure
In reply to Daniel P. BerrangéQuoted 4 lines · Daniel P. Berrangé
The ib700, i6300esb, gwdt, spapr and diag288 watchdog devices are marked as secure since they have traditionally been, or are intended to be, used in virtualization use cases on x86, arm, ppc and s390x architectures respectively. Other watchdogs are primarily for emulation.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 14/28] hw/ide: mark ICH9 and ide-hd/ide-cd as secure
In reply to Daniel P. BerrangéQuoted 3 lines · Daniel P. Berrangé
These have a long history of usage in virtualization scenarios on x86, for OS which lack modern virtio drivers for storage, and thus must be considered secure.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 17/28] hw/display: mark bochs, cirrus, qxl, VGA, ramfb as secure
In reply to Daniel P. BerrangéQuoted 5 lines
Most of the display adapters are emulating old hardware which is not relevant to virtualization use cases.
The exceptions that should be considered secure are Cirrus (PCI, not ISA), Bochs, QXL, RAMFB, VGA (PCI, MMIO, not ISA) and VMWare VGA.
I don't think we should support all those display devices as security boundaries.
I would shorten the list to: bochs, ramfb, vga, and virtio-gpu* (excluding virgl & rutabaga). Anything else has been known to have various risks and is much higher complexity..
Gerd, based on your expertize, I think your opinion matters here.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 16/28] hw/pci-host: mark common x86, ppc, arm and s390 PCI hosts as secure
In reply to Daniel P. BerrangéQuoted 8 lines · Daniel P. Berrangé
Mark the PCI hosts secure if they are used from machine types that are considered for the virtualization use case.
There is also a special case for the 'remote' type and the Xen passthrough type.
[...]
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 19/28] hw/misc: mark pvpanic, vmcoreinfo as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
The first two devices are common debug aids for virtualized guests so must be marked secure.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 20/28] hw/audio: mark Intel HDA devices & codecs as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
This is traditionally the primary audio backend for x86 as virtio-snd is a relatively new invention.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 18/28] hw/tpm: mark all TPM implementations as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
All of the TPM implementations are in scope of virtualization usage, so mark them all as secure.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 21/28] hw/char: mark common serial / console devicess a secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
These are needed as a baseline feature for many virtualization use cases on x86, PPC64 and s390x.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 23/28] hw/uefi: mark the EFI vars service as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
This is used to persist EFI variables when NVRAM is not available or undesirable.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 24/28] hw/acpi: mark erst, vmclock and vmgenid devices as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
These are all used in virtualization scenarios so must be declare to provide a security boundary
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 22/28] hw/mem: mark nvdimm, pc-dimm & spapr-nvdimm devices as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
These devices are used in virutalization scenarios to support memory hotplug and other uses cases.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 25/28] hw: mark KVM clock and RTC devices as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
These are core infrastructure in virtualization cases so must provide a security boundary.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 26/28] hw: device AMD, Intel and ARM IOMMUs as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
These are needed in virtualization use cases to support PCI device assignment use cases so must provide a security boundary.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 27/28] hw/input: mark PS/2 and PC Keyboard devices as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
These are part of the baseline x86 featureset so required for virtualization use cases.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 28/28] hw/i386: mark vmmouse / vmport as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
These paravirtualized devices are relevant to virtualization use cases.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 12/28] hw/scsi: mark spapr and vmware SCSI controllers as secure
In reply to Daniel P. BerrangéQuoted 3 lines · Daniel P. Berrangé
The spapr vscsi controller is used by default with spapr machines in a virtualization use case. The vmware SCSI controller supports a virtualization use case.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 13/28] hw/scsi: mark SCSI disk endpoint devices as secure
In reply to Daniel P. BerrangéQuoted 2 lines · Daniel P. Berrangé
All these devices can be used together with supported SCSI controllers in a virtualization use case, so must be treated as secure.
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 15/28] hw: define most common PCI types as secure
In reply to Daniel P. BerrangéQuoted 3 lines
Essentially all PCI infrastructure is in scope for the virtualization use case, aside from the niche simba bridge.
You should exclude the CXL bits though, as stated on cover letter.
Also questionable perhaps: xio3130, pcie_pci, pxb
Signature · 1 line
Marc-André Lureau <[email protected]>
Re: [PATCH 15/28] hw: define most common PCI types as secure
Quoted 5 lines · On Fri, Oct 02, 2026 at 09:21:01PM +0400, [email protected] wrote:
Quoted 3 lines
Essentially all PCI infrastructure is in scope for the virtualization use case, aside from the niche simba bridge.
You should exclude the CXL bits though, as stated on cover letter.
Yes.
Quoted 1 line
Also questionable perhaps: xio3130,
pcie_pci, pxb
The latter two are both reasonable as long as i440fx is around, and xio3130 is a core documented part of QEMU's PCI-Express support, though I've never understood why one would want it over pcie-pxb. Overall, I think all the generic PCI/PCI-E infra is in scope.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Re: [PATCH 03/28] hw: mark all virtio PCI devices as secure
In reply to [email protected]Quoted 10 lines · On Fri, Oct 02, 2026 at 09:21:01PM +0400, [email protected] wrote:
Quoted 10 lines
These are all intended for use in a virtualization scenario and must provide a security boundary. This can be done for almost all virtio PCI devices by modifying the common type register helper.
The virtio-gpu devices are unusual in not using the common
virtio_pci_types_register()method, so need marking directly.Signed-off-by Daniel P. Berrangé <[email protected]>Message-ID: <[email protected]>
Quoted 11 lines
hw/display/virtio-gpu-pci-rutabaga.c static const TypeInfo virtio_gpu_rutabaga_pci_info[] = { · line 37
Quoted 9 lines
hw/display/virtio-gpu-pci-rutabaga.c +1
-0@@ -34,6 +34,7 @@ static const TypeInfo virtio_gpu_rutabaga_pci_info[] = { .parent = TYPE_VIRTIO_GPU_PCI_BASE, .instance_size = sizeof(VirtIOGPURutabagaPCI), .instance_init = virtio_gpu_rutabaga_initfn, + .secure = true,This is unusual, I wonder why it's not using the VirtioPCIDeviceTypeInfo
Yeah, I don't know the reason for that choice.
Quoted 17 lines
Quoted 9 lines
hw/display/virtio-gpu-pci-rutabaga.c +0
-0.interfaces = (const InterfaceInfo[]) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },hw/display/virtio-gpu-pci.c +0
-0hw/display/virtio-gpu-pci.c static const TypeInfo virtio_gpu_pci_base_info = { · line 79
Quoted 6 lines
hw/display/virtio-gpu-pci.c +2
-1@@ -75,7 +75,8 @@ static const TypeInfo virtio_gpu_pci_base_info = { .parent = TYPE_VIRTIO_PCI, .instance_size = sizeof(VirtIOGPUPCIBase), .class_init = virtio_gpu_pci_base_class_init, - .abstract = true + .abstract = true, + .secure = true,This is a base class, probably doesn't need marking.
Not /yet/. I have a follow on series to this, not yet posted, which will enforce that all parent classes are marked secure, when any leaf is marked secure. There will be many more base classes to add besides this one, which crept in here.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Re: [PATCH 17/28] hw/display: mark bochs, cirrus, qxl, VGA, ramfb as secure
In reply to [email protected]Quoted 7 lines · On Fri, Oct 02, 2026 at 09:21:01PM +0400, [email protected] wrote:
Quoted 5 lines
Most of the display adapters are emulating old hardware which is not relevant to virtualization use cases.
The exceptions that should be considered secure are Cirrus (PCI, not ISA), Bochs, QXL, RAMFB, VGA (PCI, MMIO, not ISA) and VMWare VGA.
I don't think we should support all those display devices as security boundaries.
Opps, this bit of the commit message was not quite right, as I did NOT in fact include VMWare VGA.
The Cirrus & QXL is an area where my downstream wishlist conflicts with my upstream wishlist, because both were widely used for a long time in virt scenarios, and they still exist in supported RHEL versions, even if gone from the latest releases.
Quoted 3 lines
I would shorten the list to: bochs, ramfb, vga, and virtio-gpu* (excluding virgl & rutabaga). Anything else has been known to have various risks and is much higher complexity..
NB, anything virtio related is handled elsewhere in this series.a
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Re: [PATCH 10/28] hw/usb: mark commonly used USB devices/hosts as secure
In reply to [email protected]Quoted 11 lines · On Fri, Oct 02, 2026 at 09:21:01PM +0400, [email protected] wrote:
Quoted 9 lines
Most of the standardized USB1/2/3 host controllers are relevant for virtualization use cases, so should be declared secure. The "NEC" XHCI variant is slightly non-standard, but since it is a trivial sub-class of the generic XHCI, there's no reason to exclude it.
The set of devices that are expected to be used is HID (mouse, tablet, keyboard), host passthrough, CCID (smartcard), hub, storage and the redirect tunnelling.
Can't we exclude uhci/ehci nowadays?
RHEL-10 still ships both, so there's still a demand from a downstream POV, but USB is in an awkward place with its lack of maintainership, and arguably these should be considered obsolete.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Re: [PATCH 01/28] hw: mark secure machines for x86, s390, ppc, arm, loonarch, riscv
In reply to Daniel P. BerrangéHi,
Quoted 8 lines · Daniel P. Berrangé
The versioned machine types are typically present for use in virtualization use cases and can be expected to provide a security barrier. The only exceptions are the m68k versioned machine types which are only used with TCG. There are also a handful of other machines declared secure in
docs/system/security.rst, notably the Xen machine variants and microvm.Signed-off-by Daniel P. Berrangé <[email protected]>
Quoted 14 lines
--- 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 | 2 ++ hw/ppc/spapr.c | 1 + hw/riscv/virt.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + hw/xen/xen-pvh-common.c | 1 + hw/xenpv/xen_machine_pv.c | 2 +- include/hw/i386/pc.h | 1 + 12 files changed, 14 insertions(+), 3 deletions(-)
This patch should be split per machine / area of maintenance, so maintainers can officially Ack their commitment to security boundary for their machine.
I'm not sure LoongArch / RISCV / PPC are. If this was previously discussed, then pointer to the public discussions should be listed in the patch description.
Regards,
Phil.
Re: [PATCH 04/28] hw: mark all virtio CCW devices as secure
In reply to Daniel P. BerrangéQuoted 14 lines · Daniel P. Berrangé
These are all intended for use in a virtualization scenario and must provide a security boundary.
Signed-off-by Daniel P. Berrangé <[email protected]>--- hw/s390x/vhost-scsi-ccw.c | 1 + hw/s390x/vhost-user-fs-ccw.c | 1 + hw/s390x/vhost-vsock-ccw.c | 1 + hw/s390x/virtio-ccw-9p.c | 1 + hw/s390x/virtio-ccw-balloon.c | 1 + hw/s390x/virtio-ccw-blk.c | 1 + hw/s390x/virtio-ccw-crypto.c | 1 + hw/s390x/virtio-ccw-gpu.c | 1 + hw/s390x/virtio-ccw-input.c | 5 +++++
Quoted 8 lines
hw/s390x/virtio-ccw-md.c | 1 + hw/s390x/virtio-ccw-mem.c | 1 + hw/s390x/virtio-ccw-net.c | 1 + hw/s390x/virtio-ccw-rng.c | 1 + hw/s390x/virtio-ccw-scsi.c | 1 + hw/s390x/virtio-ccw-serial.c | 1 + hw/s390x/virtio-ccw.c | 1 + 16 files changed, 20 insertions(+)
Re: [PATCH 01/28] hw: mark secure machines for x86, s390, ppc, arm, loonarch, riscv
In reply to Philippe Mathieu-DaudéQuoted 26 lines · Philippe Mathieu-Daudé
Hi,
Quoted 8 lines · Daniel P. Berrangé
The versioned machine types are typically present for use in virtualization use cases and can be expected to provide a security barrier. The only exceptions are the m68k versioned machine types which are only used with TCG. There are also a handful of other machines declared secure in
docs/system/security.rst, notably the Xen machine variants and microvm.Signed-off-by Daniel P. Berrangé <[email protected]>Quoted 14 lines
--- 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 | 2 ++ hw/ppc/spapr.c | 1 + hw/riscv/virt.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + hw/xen/xen-pvh-common.c | 1 + hw/xenpv/xen_machine_pv.c | 2 +- include/hw/i386/pc.h | 1 + 12 files changed, 14 insertions(+), 3 deletions(-)
Quoted 7 lines
This patch should be split per machine / area of maintenance, so maintainers can officially Ack their commitment to security boundary for their machine.
I'm not sure LoongArch / RISCV / PPC are. If this was previously discussed, then pointer to the public discussions should be listed in the patch description.
Those are explicitly documented here:
https://www.qemu.org/docs/master/system/security.html#virtualization-use-case
so this patch is just encoding what has already been defined.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Re: [PATCH 02/28] accel: mark kvm and xen accelerators as secure
In reply to Daniel P. BerrangéQuoted 10 lines · Daniel P. Berrangé
TCG is too complex to be considered to provide a security boundary for malicious guest workloads. QTest is only used for functional testing and thus is not relevant to mark secure.
KVM and Xen are servicing virtualization use cases which must provide security and actively maintained.
While HVF would be in scope conceptually, it is not sufficiently mature or maintained to claim a security boundary at this time.
Quoted 6 lines
Signed-off-by Daniel P. Berrangé <[email protected]>--- accel/accel-common.c | 2 ++ accel/accel-system.c | 1 + accel/kvm/kvm-accel-ops.c | 1 + accel/kvm/kvm-all.c | 1 +
Maybe split so maintainers can Ack separately?
Quoted 2 lines
accel/xen/xen-all.c | 2 ++ 5 files changed, 7 insertions(+)
I think accel/nitro/ is also meant to be secure (in patch 6 you mark hw/virtio/virtio-nsm.c as secure).
Re: [PATCH 14/28] hw/ide: mark ICH9 and ide-hd/ide-cd as secure
In reply to Daniel P. BerrangéQuoted 13 lines · Daniel P. Berrangé
These have a long history of usage in virtualization scenarios on x86, for OS which lack modern virtio drivers for storage, and thus must be considered secure.
Signed-off-by Daniel P. Berrangé <[email protected]>--- hw/ide/ich.c | 1 + hw/ide/ide-dev.c | 3 +++ hw/ide/piix.c | 2 ++ 3 files changed, 6 insertions(+)
hw/ide/ide-dev.c static const TypeInfo ide_device_type_info = { · line 257
Quoted 4 lines
hw/ide/ide-dev.c +1
-0@@ -252,6 +254,7 @@ static const TypeInfo ide_device_type_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(IDEDevice), .abstract = true, + .secure = true,
We shouldn't accept abstract secure device class IMO because it will be to easy to merge new devices that ended secure and we do not want to consider them. I'd go a step further and assert both can not be set together.
Quoted 3 lines
hw/ide/ide-dev.c +0
-0.class_size = sizeof(IDEDeviceClass), .class_init = ide_device_class_init, .instance_init = ide_dev_instance_init,
Re: [PATCH 01/28] hw: mark secure machines for x86, s390, ppc, arm, loonarch, riscv
In reply to Daniel P. BerrangéQuoted 35 lines · Daniel P. Berrangé
Quoted 26 lines · Philippe Mathieu-Daudé
Hi,
Quoted 8 lines · Daniel P. Berrangé
The versioned machine types are typically present for use in virtualization use cases and can be expected to provide a security barrier. The only exceptions are the m68k versioned machine types which are only used with TCG. There are also a handful of other machines declared secure in
docs/system/security.rst, notably the Xen machine variants and microvm.Signed-off-by Daniel P. Berrangé <[email protected]>Quoted 14 lines
--- 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 | 2 ++ hw/ppc/spapr.c | 1 + hw/riscv/virt.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + hw/xen/xen-pvh-common.c | 1 + hw/xenpv/xen_machine_pv.c | 2 +- include/hw/i386/pc.h | 1 + 12 files changed, 14 insertions(+), 3 deletions(-)Quoted 7 lines
This patch should be split per machine / area of maintenance, so maintainers can officially Ack their commitment to security boundary for their machine.
I'm not sure LoongArch / RISCV / PPC are. If this was previously discussed, then pointer to the public discussions should be listed in the patch description.
Quoted 5 lines
Those are explicitly documented here:
https://www.qemu.org/docs/master/system/security.html#virtualization-use-case
so this patch is just encoding what has already been defined.
I probably missed when this was accepted, we are good then!
That said, 1/ Nitro Enclave are missing and 2/ this series organization is not easy to follow to me: I'd rather a per-machine approach, with a 'info qom-tree' output justifying the devices, then finish the series with busses-based devices expected to be secure. I dont quite follow this approach. I'm not asking to redo the series since it is already reviewed.
Re: [PATCH 14/28] hw/ide: mark ICH9 and ide-hd/ide-cd as secure
In reply to Philippe Mathieu-DaudéQuoted 13 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Daniel P. Berrangé
These have a long history of usage in virtualization scenarios on x86, for OS which lack modern virtio drivers for storage, and thus must be considered secure.
Signed-off-by Daniel P. Berrangé <[email protected]>--- hw/ide/ich.c | 1 + hw/ide/ide-dev.c | 3 +++ hw/ide/piix.c | 2 ++ 3 files changed, 6 insertions(+)
Quoted 10 lines
hw/ide/ide-dev.c static const TypeInfo ide_device_type_info = { · line 257
Quoted 5 lines
hw/ide/ide-dev.c +1
-0@@ -252,6 +254,7 @@ static const TypeInfo ide_device_type_info = { .parent = TYPE_DEVICE, .instance_size = sizeof(IDEDevice), .abstract = true, + .secure = true,We shouldn't accept abstract secure device class IMO because it will be to easy to merge new devices that ended secure and we do not want to consider them. I'd go a step further and assert both can not be set together.
Setting 'secure' in a parent device does NOT imply that all children have the same, only the reverse. ie, if a leaf device is secure, then by definition all its parents must be secure.
This series only intended to mark leaf devices as secure, but a followup series will explicitly mark the whole parent chain as secure too, and also validate that chain in tests.
Another followup is to require non-user creatable implied devices as secure. ie if a machine creates devices X, Y & Z, then if that machine is secure, then X, Y & Z must be considered secure too.
Note, this would be just for those implied when "-nodefaults" is given.
Quoted 5 lines
hw/ide/ide-dev.c static const TypeInfo ide_device_type_info = { · line 260
Quoted 4 lines
hw/ide/ide-dev.c +0
-0.class_size = sizeof(IDEDeviceClass), .class_init = ide_device_class_init, .instance_init = ide_dev_instance_init,
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Re: [PATCH 01/28] hw: mark secure machines for x86, s390, ppc, arm, loonarch, riscv
In reply to Philippe Mathieu-DaudéQuoted 42 lines · Philippe Mathieu-Daudé
Quoted 35 lines · Daniel P. Berrangé
Quoted 26 lines · Philippe Mathieu-Daudé
Hi,
Quoted 8 lines · Daniel P. Berrangé
The versioned machine types are typically present for use in virtualization use cases and can be expected to provide a security barrier. The only exceptions are the m68k versioned machine types which are only used with TCG. There are also a handful of other machines declared secure in
docs/system/security.rst, notably the Xen machine variants and microvm.Signed-off-by Daniel P. Berrangé <[email protected]>Quoted 14 lines
--- 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 | 2 ++ hw/ppc/spapr.c | 1 + hw/riscv/virt.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + hw/xen/xen-pvh-common.c | 1 + hw/xenpv/xen_machine_pv.c | 2 +- include/hw/i386/pc.h | 1 + 12 files changed, 14 insertions(+), 3 deletions(-)Quoted 7 lines
This patch should be split per machine / area of maintenance, so maintainers can officially Ack their commitment to security boundary for their machine.
I'm not sure LoongArch / RISCV / PPC are. If this was previously discussed, then pointer to the public discussions should be listed in the patch description.
Quoted 5 lines
Those are explicitly documented here:
https://www.qemu.org/docs/master/system/security.html#virtualization-use-case
so this patch is just encoding what has already been defined.
Quoted 8 lines
I probably missed when this was accepted, we are good then!
That said, 1/ Nitro Enclave are missing and 2/ this series organization is not easy to follow to me: I'd rather a per-machine approach, with a 'info qom-tree' output justifying the devices, then finish the series with busses-based devices expected to be secure. I dont quite follow this approach. I'm not asking to redo the series since it is already reviewed.
The structure is essentially, the machines listed in the docs, the hardware accelerators, the paravirtualized devices, and then per subsystem devices for the rest.
A per-machine approach would end up with 90% of the series added in the first patch, as most devices are common to all machines or targets.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Re: [PATCH 01/28] hw: mark secure machines for x86, s390, ppc, arm, loonarch, riscv
In reply to Daniel P. BerrangéQuoted 8 lines · Daniel P. Berrangé
The versioned machine types are typically present for use in virtualization use cases and can be expected to provide a security barrier. The only exceptions are the m68k versioned machine types which are only used with TCG. There are also a handful of other machines declared secure in
docs/system/security.rst, notably the Xen machine variants and microvm.Signed-off-by Daniel P. Berrangé <[email protected]>
Quoted 14 lines
--- 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 | 2 ++ hw/ppc/spapr.c | 1 + hw/riscv/virt.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + hw/xen/xen-pvh-common.c | 1 + hw/xenpv/xen_machine_pv.c | 2 +- include/hw/i386/pc.h | 1 + 12 files changed, 14 insertions(+), 3 deletions(-)
Re: [PATCH 04/28] hw: mark all virtio CCW devices as secure
In reply to Daniel P. BerrangéQuoted 14 lines · Daniel P. Berrangé
These are all intended for use in a virtualization scenario and must provide a security boundary.
Signed-off-by Daniel P. Berrangé <[email protected]>--- hw/s390x/vhost-scsi-ccw.c | 1 + hw/s390x/vhost-user-fs-ccw.c | 1 + hw/s390x/vhost-vsock-ccw.c | 1 + hw/s390x/virtio-ccw-9p.c | 1 + hw/s390x/virtio-ccw-balloon.c | 1 + hw/s390x/virtio-ccw-blk.c | 1 + hw/s390x/virtio-ccw-crypto.c | 1 + hw/s390x/virtio-ccw-gpu.c | 1 + hw/s390x/virtio-ccw-input.c | 5 +++++
Quoted 8 lines
hw/s390x/virtio-ccw-md.c | 1 + hw/s390x/virtio-ccw-mem.c | 1 + hw/s390x/virtio-ccw-net.c | 1 + hw/s390x/virtio-ccw-rng.c | 1 + hw/s390x/virtio-ccw-scsi.c | 1 + hw/s390x/virtio-ccw-serial.c | 1 + hw/s390x/virtio-ccw.c | 1 + 16 files changed, 20 insertions(+)
Re: [PATCH 07/28] hw/vfio: mark all VFIO object classes as secure
In reply to Daniel P. BerrangéQuoted 5 lines · Daniel P. Berrangé
The VFIO subsystem is about securely passing host PCI devices to a guest, so all the classes should be presumed to be offering a security boundary.
Signed-off-by Daniel P. Berrangé <[email protected]>
Quoted 11 lines
--- hw/vfio-user/pci.c | 1 + hw/vfio/ap.c | 1 + hw/vfio/ccw.c | 1 + hw/vfio/container.c | 1 + hw/vfio/igd.c | 1 + hw/vfio/iommufd.c | 2 ++ hw/vfio/pci.c | 3 +++ hw/vfio/spapr.c | 1 + 8 files changed, 11 insertions(+)
Re: [PATCH 11/28] hw/watchdog: mark some watchdog devices as secure
In reply to Daniel P. BerrangéQuoted 5 lines · Daniel P. Berrangé
The ib700, i6300esb, gwdt, spapr and diag288 watchdog devices are marked as secure since they have traditionally been, or are intended to be, used in virtualization use cases on x86, arm, ppc and s390x architectures respectively. Other watchdogs are primarily for emulation.
Quoted 8 lines
Signed-off-by Daniel P. Berrangé <[email protected]>--- hw/watchdog/sbsa_gwdt.c | 1 + hw/watchdog/spapr_watchdog.c | 1 + hw/watchdog/wdt_diag288.c | 1 + hw/watchdog/wdt_i6300esb.c | 1 + hw/watchdog/wdt_ib700.c | 1 + 5 files changed, 5 insertions(+)
Re: [PATCH 16/28] hw/pci-host: mark common x86, ppc, arm and s390 PCI hosts as secure
In reply to Daniel P. BerrangéQuoted 7 lines · Daniel P. Berrangé
Mark the PCI hosts secure if they are used from machine types that are considered for the virtualization use case.
There is also a special case for the 'remote' type and the Xen passthrough type.
Signed-off-by Daniel P. Berrangé <[email protected]>
Quoted 15 lines
--- hw/pci-host/gpex.c | 2 ++ hw/pci-host/i440fx.c | 2 ++ hw/pci-host/pnv_phb.c | 2 ++ hw/pci-host/pnv_phb3.c | 3 +++ hw/pci-host/pnv_phb3_msi.c | 1 + hw/pci-host/pnv_phb3_pbcq.c | 1 + hw/pci-host/pnv_phb4.c | 4 +++- hw/pci-host/pnv_phb4_pec.c | 1 + hw/pci-host/q35.c | 2 ++ hw/pci-host/remote.c | 1 + hw/pci-host/xen_igd_pt.c | 1 + hw/ppc/spapr_pci.c | 1 + hw/s390x/s390-pci-bus.c | 4 ++++ 13 files changed, 24 insertions(+), 1 deletion(-)
Re: [PATCH 21/28] hw/char: mark common serial / console devicess a secure
In reply to Daniel P. BerrangéQuoted 4 lines · Daniel P. Berrangé
These are needed as a baseline feature for many virtualization use cases on x86, PPC64 and s390x.
Signed-off-by Daniel P. Berrangé <[email protected]>
Quoted 9 lines
--- hw/char/debugcon.c | 1 + hw/char/sclpconsole-lm.c | 1 + hw/char/sclpconsole.c | 1 + hw/char/serial-isa.c | 1 + hw/char/serial-pci.c | 1 + hw/char/serial.c | 1 + hw/char/spapr_vty.c | 1 + 7 files changed, 7 insertions(+)
Re: [PATCH 09/28] hw/net: mark e1000, e1000e, IGB, rtl8139 & sPAPR VLAN as secure
In reply to Daniel P. BerrangéQuoted 7 lines · Daniel P. Berrangé
Historically most NICs are only interesting for non-virtualization use cases and have not been written with malicious guests in mind.
As a general rule either virtio-net or xen-net should be used in all virtualized guests requiring a security boundary.
Quoted 6 lines
There are a handful of exceptions resulting from historical usage in the x86 world, to support virtualized guests lacking virtio support.
Thus the rtl8139, e1000, e1000e & IGB NICs are declared to provide a security boundary.
You've said in several bugs (e.g.
https://gitlab.com/qemu-project/qemu/-/work_items/3872 ) that igb wasn't covered by the virtualization use case.
I don't care either way, but I wanted to check since I've been marking igb bugs as non-confidential when triaging on the basis of that...
thanks
-- PMM
Re: [PATCH 09/28] hw/net: mark e1000, e1000e, IGB, rtl8139 & sPAPR VLAN as secure
Quoted 12 lines · Peter Maydell
Quoted 11 lines · Daniel P. Berrangé
Historically most NICs are only interesting for non-virtualization use cases and have not been written with malicious guests in mind.
As a general rule either virtio-net or xen-net should be used in all virtualized guests requiring a security boundary.
There are a handful of exceptions resulting from historical usage in the x86 world, to support virtualized guests lacking virtio support.
Quoted 6 lines
Quoted 2 lines
Thus the rtl8139, e1000, e1000e & IGB NICs are declared to provide a security boundary.
You've said in several bugs (e.g.
https://gitlab.com/qemu-project/qemu/-/work_items/3872 ) that igb wasn't covered by the virtualization use case.
Hmm, yes, I forgot I had said that, which I guess shows the value of this series long term.
Quoted 3 lines
I don't care either way, but I wanted to check since I've been marking igb bugs as non-confidential when triaging on the basis of that...
I added it in this series because I forgot what I previously said and then found our RHEL shipped it. I've since checked that the RHEL inclusion was only for ease of SRIOV testing, not intended for production deployment.
So consider 'igb' dropped from this patch. We'll continue to treat it as insecure, unless a maintainer steps up to request otherwise and fix historical issues we've had disclosed this year.
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Re: [PATCH 07/28] hw/vfio: mark all VFIO object classes as secure
In reply to Daniel P. BerrangéQuoted 7 lines · Daniel P. Berrangé
The VFIO subsystem is about securely passing host PCI devices to a guest, so all the classes should be presumed to be offering a security boundary.
Signed-off-by Daniel P. Berrangé <[email protected]>--- hw/vfio-user/pci.c | 1 +
vfio-user too ?
Quoted 8 lines
hw/vfio/ap.c | 1 + hw/vfio/ccw.c | 1 + hw/vfio/container.c | 1 + hw/vfio/igd.c | 1 + hw/vfio/iommufd.c | 2 ++ hw/vfio/pci.c | 3 +++ hw/vfio/spapr.c | 1 + 8 files changed, 11 insertions(+)
Thanks,
C.
Quoted 118 lines
hw/vfio-user/pci.c +1
-0@@ -482,6 +482,7 @@ static const TypeInfo vfio_user_pci_info = { .class_init = vfio_user_pci_class_init, .instance_init = vfio_user_pci_init, .instance_finalize = vfio_user_pci_finalize, + .secure = true, };static void register_vfio_user_dev_type (void )hw/vfio/ap.c +1
-0@@ -352,6 +352,7 @@ static const TypeInfo vfio_ap_info = { .instance_size = sizeof(VFIOAPDevice), .instance_init = vfio_ap_instance_init, .class_init = vfio_ap_class_init, + .secure = true, };static void vfio_ap_type_init (void )hw/vfio/ccw.c +1
-0@@ -721,6 +721,7 @@ static const TypeInfo vfio_ccw_info = { .instance_size = sizeof(VFIOCCWDevice), .instance_init = vfio_ccw_instance_init, .class_init = vfio_ccw_class_init, + .secure = true, };static void register_vfio_ccw_type (void )hw/vfio/container.c +1
-0@@ -336,6 +336,7 @@ static const TypeInfo types[] = { .instance_size = sizeof(VFIOContainer), .class_size = sizeof(VFIOIOMMUClass), .abstract = true, + .secure = true, }, };hw/vfio/igd.c +1
-0@@ -311,6 +311,7 @@ static const TypeInfo vfio_pci_igd_lpc_bridge_info = { .name = "vfio-pci-igd-lpc-bridge", .parent = TYPE_PCI_DEVICE, .class_init = vfio_pci_igd_lpc_bridge_class_init, + .secure = true, .interfaces = (const InterfaceInfo []) { {INTERFACE_CONVENTIONAL_PCI_DEVICE }, { },hw/vfio/iommufd.c +2
-0@@ -1051,10 +1051,12 @@ static const TypeInfo types[] = { .parent = TYPE_VFIO_IOMMU, .instance_size = sizeof(VFIOIOMMUFDContainer), .class_init = vfio_iommu_iommufd_class_init, + .secure = true, }, { .name = TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO, .parent = TYPE_HOST_IOMMU_DEVICE_IOMMUFD, .class_init = hiod_iommufd_vfio_class_init, + .secure = true, } };hw/vfio/pci.c +3
-0@@ -3854,6 +3854,7 @@ static const TypeInfo vfio_pci_device_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(VFIOPCIDevice), .abstract = true, + .secure = true, .class_init = vfio_pci_device_class_init, .interfaces = (const InterfaceInfo []) { {INTERFACE_PCIE_DEVICE },@@ -4110,6 +4111,7 @@ static const TypeInfo vfio_pci_info = { .class_init = vfio_pci_class_init, .instance_init = vfio_pci_init, .instance_finalize = vfio_pci_finalize, + .secure = true, };static const Property vfio_pci_nohotplug_properties[] = {@@ -4146,6 +4148,7 @@ static const TypeInfo vfio_pci_nohotplug_info = { .parent = TYPE_VFIO_PCI, .instance_size = sizeof(VFIOPCIDevice), .class_init = vfio_pci_nohotplug_class_init, + .secure = true, };static void register_vfio_pci_dev_type (void )hw/vfio/spapr.c +1
-0@@ -544,6 +544,7 @@ static const TypeInfo types[] = { .parent = TYPE_VFIO_IOMMU_LEGACY, .instance_size = sizeof(VFIOSpaprContainer), .class_init = vfio_iommu_spapr_class_init, + .secure = true, }, };