From 581d808e17682026d5540249cc9bcc35034e7a8b Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Fri, 25 Oct 2024 18:58:07 +0300 Subject: [PATCH] import qemu-kvm-9.1.0-2.el10 --- .gitignore | 1 + .qemu-kvm.metadata | 1 + SOURCES/0004-Initial-redhat-build.patch | 146 ++ ...0005-Enable-disable-devices-for-RHEL.patch | 782 +++++++++ ...Machine-type-related-general-changes.patch | 691 ++++++++ ...temporarily-disable-Wunused-function.patch | 36 + ...machine-types-for-aarch64-s390x-and-.patch | 101 ++ ...rsioned-machine-type-macros-for-RHEL.patch | 197 +++ ...ease-deletion-schedule-to-4-releases.patch | 37 + ...aarch64-versioned-virt-machine-types.patch | 301 ++++ ...390x-versioned-s390-ccw-virtio-machi.patch | 208 +++ ...86_64-versioned-pc-q35-machine-types.patch | 695 ++++++++ ...temporarily-disable-Wunused-function.patch | 32 + SOURCES/0015-Enable-make-check.patch | 252 +++ ...mber-of-devices-that-can-be-assigned.patch | 98 ++ ...Add-support-statement-to-help-output.patch | 46 + ...documentation-instead-of-qemu-system.patch | 52 + ...on-warning-when-opening-v2-images-rw.patch | 58 + ...0021-Add-upstream-compatibility-bits.patch | 109 ++ ...9.1-compat-handling-to-the-s390x-mac.patch | 37 + ...el9.6.0-and-rhel10.0.0-machine-types.patch | 66 + ...ensure-compatibility-of-pc-q35-rhel9.patch | 28 + ...m-ensure-compatibility-of-virt-rhel9.patch | 27 + SOURCES/95-kvm-memlock.conf | 10 + SOURCES/99-qemu-guest-agent.rules | 2 + SOURCES/README.tests | 39 + SOURCES/bridge.conf | 1 + ...or-Shaoqin-Huang-shahuang-redhat.com.patch | 76 + ...e-new-virt-machine-type-for-rhel-9.6.patch | 49 + ...-create-virt-machine-type-for-rhel10.patch | 45 + ...-Update-the-logfile-path-of-qga-fsfr.patch | 39 + .../kvm-remove-stale-compat-definitions.patch | 425 +++++ SOURCES/kvm-s390x.conf | 19 + ...new-pc-q35-machine-type-for-rhel-9.6.patch | 50 + ...te-pc-i440fx-machine-type-for-rhel10.patch | 79 + ...reate-pc-q35-machine-type-for-rhel10.patch | 59 + ...remove-deprecated-rhel-machine-types.patch | 274 ++++ SOURCES/kvm-x86.conf | 12 + SOURCES/kvm.conf | 3 + SOURCES/modules-load.conf | 4 + SOURCES/qemu-ga.sysconfig | 27 + SOURCES/qemu-guest-agent.service | 19 + SOURCES/vhost.conf | 3 + SPECS/qemu-kvm.spec | 1436 +++++++++++++++++ 44 files changed, 6672 insertions(+) create mode 100644 .gitignore create mode 100644 .qemu-kvm.metadata create mode 100644 SOURCES/0004-Initial-redhat-build.patch create mode 100644 SOURCES/0005-Enable-disable-devices-for-RHEL.patch create mode 100644 SOURCES/0006-Machine-type-related-general-changes.patch create mode 100644 SOURCES/0007-meson-temporarily-disable-Wunused-function.patch create mode 100644 SOURCES/0008-Remove-upstream-machine-types-for-aarch64-s390x-and-.patch create mode 100644 SOURCES/0009-Adapt-versioned-machine-type-macros-for-RHEL.patch create mode 100644 SOURCES/0010-Increase-deletion-schedule-to-4-releases.patch create mode 100644 SOURCES/0011-Add-downstream-aarch64-versioned-virt-machine-types.patch create mode 100644 SOURCES/0012-Add-downstream-s390x-versioned-s390-ccw-virtio-machi.patch create mode 100644 SOURCES/0013-Add-downstream-x86_64-versioned-pc-q35-machine-types.patch create mode 100644 SOURCES/0014-Revert-meson-temporarily-disable-Wunused-function.patch create mode 100644 SOURCES/0015-Enable-make-check.patch create mode 100644 SOURCES/0016-vfio-cap-number-of-devices-that-can-be-assigned.patch create mode 100644 SOURCES/0017-Add-support-statement-to-help-output.patch create mode 100644 SOURCES/0018-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch create mode 100644 SOURCES/0019-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch create mode 100644 SOURCES/0021-Add-upstream-compatibility-bits.patch create mode 100644 SOURCES/0022-redhat-Add-QEMU-9.1-compat-handling-to-the-s390x-mac.patch create mode 100644 SOURCES/0023-redhat-Add-rhel9.6.0-and-rhel10.0.0-machine-types.patch create mode 100644 SOURCES/0024-x86-ensure-compatibility-of-pc-q35-rhel9.patch create mode 100644 SOURCES/0025-arm-ensure-compatibility-of-virt-rhel9.patch create mode 100644 SOURCES/95-kvm-memlock.conf create mode 100644 SOURCES/99-qemu-guest-agent.rules create mode 100644 SOURCES/README.tests create mode 100644 SOURCES/bridge.conf create mode 100644 SOURCES/kvm-RH-Author-Shaoqin-Huang-shahuang-redhat.com.patch create mode 100644 SOURCES/kvm-arm-create-new-virt-machine-type-for-rhel-9.6.patch create mode 100644 SOURCES/kvm-arm-create-virt-machine-type-for-rhel10.patch create mode 100644 SOURCES/kvm-qemu-guest-agent-Update-the-logfile-path-of-qga-fsfr.patch create mode 100644 SOURCES/kvm-remove-stale-compat-definitions.patch create mode 100644 SOURCES/kvm-s390x.conf create mode 100644 SOURCES/kvm-x86-create-new-pc-q35-machine-type-for-rhel-9.6.patch create mode 100644 SOURCES/kvm-x86-create-pc-i440fx-machine-type-for-rhel10.patch create mode 100644 SOURCES/kvm-x86-create-pc-q35-machine-type-for-rhel10.patch create mode 100644 SOURCES/kvm-x86-remove-deprecated-rhel-machine-types.patch create mode 100644 SOURCES/kvm-x86.conf create mode 100644 SOURCES/kvm.conf create mode 100644 SOURCES/modules-load.conf create mode 100644 SOURCES/qemu-ga.sysconfig create mode 100644 SOURCES/qemu-guest-agent.service create mode 100644 SOURCES/vhost.conf create mode 100644 SPECS/qemu-kvm.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..74aea26 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/qemu-9.1.0.tar.xz diff --git a/.qemu-kvm.metadata b/.qemu-kvm.metadata new file mode 100644 index 0000000..e075286 --- /dev/null +++ b/.qemu-kvm.metadata @@ -0,0 +1 @@ +d5bcdca53341c29470ef323191a3388fdb0571ed SOURCES/qemu-9.1.0.tar.xz diff --git a/SOURCES/0004-Initial-redhat-build.patch b/SOURCES/0004-Initial-redhat-build.patch new file mode 100644 index 0000000..fa0e5f7 --- /dev/null +++ b/SOURCES/0004-Initial-redhat-build.patch @@ -0,0 +1,146 @@ +From 7e57931a524e1e805ba8d68e75828e98c591e975 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 26 May 2021 10:56:02 +0200 +Subject: Initial redhat build + +This patch introduces redhat build structure in redhat subdirectory. In addition, +several issues are fixed in QEMU tree: + +- Change of app name for sasl_server_init in VNC code from qemu to qemu-kvm + - As we use qemu-kvm as name in all places, this is updated to be consistent +- Man page renamed from qemu to qemu-kvm + - man page is installed using make install so we have to fix it in qemu tree + +We disable make check due to issues with some of the tests. + +We are rebasing from qemu-kvm-9.0.0-8.el10. + +Signed-off-by: Miroslav Rezanina + +--- +Rebase notes (9.1.0 rc0): +- Remove --disable-block-migration and --disable-pvrdma configure options (upstream) +- Removed --disable-avx512f configure option +- Removed qemu-vsmr-helper (changed upstream) +--- + .distro/Makefile | 101 ++ + .distro/Makefile.common | 42 + + .distro/README.tests | 39 + + .distro/modules-load.conf | 4 + + .distro/qemu-guest-agent.service | 1 - + .distro/qemu-kvm.spec.template | 1332 +++++++++++++++++++++++ + .distro/rpminspect.yaml | 6 +- + .distro/scripts/extract_build_cmd.py | 12 + + .distro/scripts/frh.py | 4 +- + .distro/scripts/process-patches.sh | 6 +- + .gitignore | 1 + + README.systemtap | 43 + + scripts/qemu-guest-agent/fsfreeze-hook | 2 +- + scripts/systemtap/conf.d/qemu_kvm.conf | 4 + + scripts/systemtap/script.d/qemu_kvm.stp | 1 + + ui/vnc-auth-sasl.c | 2 +- + 16 files changed, 1593 insertions(+), 7 deletions(-) + create mode 100644 .distro/Makefile + create mode 100644 .distro/Makefile.common + create mode 100644 .distro/README.tests + create mode 100644 .distro/modules-load.conf + create mode 100644 .distro/qemu-kvm.spec.template + create mode 100644 README.systemtap + create mode 100644 scripts/systemtap/conf.d/qemu_kvm.conf + create mode 100644 scripts/systemtap/script.d/qemu_kvm.stp + +diff --git a/README.systemtap b/README.systemtap +new file mode 100644 +index 0000000000..ad913fc990 +--- /dev/null ++++ b/README.systemtap +@@ -0,0 +1,43 @@ ++QEMU tracing using systemtap-initscript ++--------------------------------------- ++ ++You can capture QEMU trace data all the time using systemtap-initscript. This ++uses SystemTap's flight recorder mode to trace all running guests to a ++fixed-size buffer on the host. Old trace entries are overwritten by new ++entries when the buffer size wraps. ++ ++1. Install the systemtap-initscript package: ++ # yum install systemtap-initscript ++ ++2. Install the systemtap scripts and the conf file: ++ # cp /usr/share/qemu-kvm/systemtap/script.d/qemu_kvm.stp /etc/systemtap/script.d/ ++ # cp /usr/share/qemu-kvm/systemtap/conf.d/qemu_kvm.conf /etc/systemtap/conf.d/ ++ ++The set of trace events to enable is given in qemu_kvm.stp. This SystemTap ++script can be customized to add or remove trace events provided in ++/usr/share/systemtap/tapset/qemu-kvm-simpletrace.stp. ++ ++SystemTap customizations can be made to qemu_kvm.conf to control the flight ++recorder buffer size and whether to store traces in memory only or disk too. ++See stap(1) for option documentation. ++ ++3. Start the systemtap service. ++ # service systemtap start qemu_kvm ++ ++4. Make the service start at boot time. ++ # chkconfig systemtap on ++ ++5. Confirm that the service works. ++ # service systemtap status qemu_kvm ++ qemu_kvm is running... ++ ++When you want to inspect the trace buffer, perform the following steps: ++ ++1. Dump the trace buffer. ++ # staprun -A qemu_kvm >/tmp/trace.log ++ ++2. Start the systemtap service because the preceding step stops the service. ++ # service systemtap start qemu_kvm ++ ++3. Translate the trace record to readable format. ++ # /usr/share/qemu-kvm/simpletrace.py --no-header /usr/share/qemu-kvm/trace-events /tmp/trace.log +diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook +index 13aafd4845..e9b84ec028 100755 +--- a/scripts/qemu-guest-agent/fsfreeze-hook ++++ b/scripts/qemu-guest-agent/fsfreeze-hook +@@ -8,7 +8,7 @@ + # request, it is issued with "thaw" argument after filesystem is thawed. + + LOGFILE=/var/log/qga-fsfreeze-hook.log +-FSFREEZE_D=$(dirname -- "$0")/fsfreeze-hook.d ++FSFREEZE_D=$(dirname -- "$(realpath $0)")/fsfreeze-hook.d + + # Check whether file $1 is a backup or rpm-generated file and should be ignored + is_ignored_file() { +diff --git a/scripts/systemtap/conf.d/qemu_kvm.conf b/scripts/systemtap/conf.d/qemu_kvm.conf +new file mode 100644 +index 0000000000..372d8160a4 +--- /dev/null ++++ b/scripts/systemtap/conf.d/qemu_kvm.conf +@@ -0,0 +1,4 @@ ++# Force load uprobes (see BZ#1118352) ++stap -e 'probe process("/usr/libexec/qemu-kvm").function("main") { printf("") }' -c true ++ ++qemu_kvm_OPT="-s4" # per-CPU buffer size, in megabytes +diff --git a/scripts/systemtap/script.d/qemu_kvm.stp b/scripts/systemtap/script.d/qemu_kvm.stp +new file mode 100644 +index 0000000000..c04abf9449 +--- /dev/null ++++ b/scripts/systemtap/script.d/qemu_kvm.stp +@@ -0,0 +1 @@ ++probe qemu.kvm.simpletrace.handle_qmp_command,qemu.kvm.simpletrace.monitor_protocol_*,qemu.kvm.simpletrace.migrate_set_state {} +diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c +index 47fdae5b21..2a950caa2a 100644 +--- a/ui/vnc-auth-sasl.c ++++ b/ui/vnc-auth-sasl.c +@@ -42,7 +42,7 @@ + + bool vnc_sasl_server_init(Error **errp) + { +- int saslErr = sasl_server_init(NULL, "qemu"); ++ int saslErr = sasl_server_init(NULL, "qemu-kvm"); + + if (saslErr != SASL_OK) { + error_setg(errp, "Failed to initialize SASL auth: %s", +-- +2.39.3 + diff --git a/SOURCES/0005-Enable-disable-devices-for-RHEL.patch b/SOURCES/0005-Enable-disable-devices-for-RHEL.patch new file mode 100644 index 0000000..459ce3b --- /dev/null +++ b/SOURCES/0005-Enable-disable-devices-for-RHEL.patch @@ -0,0 +1,782 @@ +From 003f37e17fb03b8977effd968426a0aeb5855028 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 7 Dec 2022 03:05:48 -0500 +Subject: Enable/disable devices for RHEL + +This commit adds all changes related to changes in supported devices. + +Signed-off-by: Miroslav Rezanina + +--- +Rebase notes (9.1.0 rc0): +- Return value added for kvm_s390_apply_cpu_model +- Added new USB_HID and USB_HUB options + +Rebase notes (9.1.0 rc1): +- Fixing valid_cpu_types preprocessing + +Rebase notes (9.1.0 rc4): +- Moved x86 cpu deprecation from x86 machine type patch +- Removed unnecessary chunk in cirrus_vga.c +- Not needed hack removal of cpu-v7m.c from build + +Rebase notes (9.1.0): +- Remove ppc64 device configuration +- Remove unnecessary chunks +- Removed CONFIG_VHOST_USER_SCMI and CONFIG_VHOST_USER_SND from some archs + +Merged commits (9.1.0 rc0): +- f24c7a1fee Disable FDC devices +- fe8c6cb1ce Disable vga-cirrus device +- fccd117a12 Enable vhost-user-snd-pci device +- c0b40cc648 target/cpu-models/x86: Remove the existing deprecated CPU models on c10s +- ce42b3da0e x86/cpu: deprecate cpu models that do not support x86-64-v3 +- 01ffa96c3b target/s390x/cpu_models: Disable everything up to the z12 CPU model +- cd57d17e3c target/s390x: Revert the old s390x CPU model disablement code +- 42af7b3ad5 Enable vhost-user-scmi devices + +Merged commits (9.1.0 rc4): +- aa374ce5ea x86/cpu: update deprecation string to match lowest undeprecated model +--- + .distro/qemu-kvm.spec.template | 20 +-- + .../aarch64-softmmu/aarch64-rh-devices.mak | 46 +++++++ + configs/devices/rh-virtio.mak | 10 ++ + .../s390x-softmmu/s390x-rh-devices.mak | 19 +++ + .../x86_64-softmmu/x86_64-rh-devices.mak | 114 ++++++++++++++++++ + hw/arm/virt.c | 4 + + hw/cxl/meson.build | 3 +- + hw/ide/piix.c | 5 +- + hw/input/pckbd.c | 2 + + hw/net/e1000.c | 2 + + hw/usb/meson.build | 2 +- + hw/virtio/meson.build | 6 +- + target/arm/arm-qmp-cmds.c | 2 + + target/arm/cpu.c | 4 + + target/arm/cpu.h | 3 + + target/arm/cpu64.c | 12 +- + target/arm/tcg/cpu32.c | 2 + + target/arm/tcg/cpu64.c | 8 ++ + target/arm/tcg/meson.build | 2 +- + target/i386/cpu.c | 19 +++ + target/s390x/cpu_models.c | 2 +- + tests/qtest/arm-cpu-features.c | 4 + + 22 files changed, 275 insertions(+), 16 deletions(-) + create mode 100644 configs/devices/aarch64-softmmu/aarch64-rh-devices.mak + create mode 100644 configs/devices/rh-virtio.mak + create mode 100644 configs/devices/s390x-softmmu/s390x-rh-devices.mak + create mode 100644 configs/devices/x86_64-softmmu/x86_64-rh-devices.mak + +diff --git a/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak b/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak +new file mode 100644 +index 0000000000..58075e2812 +--- /dev/null ++++ b/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak +@@ -0,0 +1,46 @@ ++include ../rh-virtio.mak ++ ++CONFIG_ARM_GIC_KVM=y ++CONFIG_ARM_GICV3_TCG=y ++CONFIG_ARM_GIC=y ++CONFIG_ARM_SMMUV3=y ++CONFIG_ARM_VIRT=y ++CONFIG_CXL=y ++CONFIG_CXL_MEM_DEVICE=y ++CONFIG_EDID=y ++CONFIG_PCIE_PORT=y ++CONFIG_PCIE_PCI_BRIDGE=y ++CONFIG_PCI_DEVICES=y ++CONFIG_PCI_TESTDEV=y ++CONFIG_PFLASH_CFI01=y ++CONFIG_SCSI=y ++CONFIG_SEMIHOSTING=y ++CONFIG_USB=y ++CONFIG_USB_XHCI=y ++CONFIG_USB_XHCI_PCI=y ++CONFIG_USB_STORAGE_CORE=y ++CONFIG_USB_STORAGE_CLASSIC=y ++CONFIG_USB_HUB=y ++CONFIG_USB_HID=y ++CONFIG_VFIO=y ++CONFIG_VFIO_PCI=y ++CONFIG_VIRTIO_MMIO=y ++CONFIG_VIRTIO_PCI=y ++CONFIG_VIRTIO_MEM=y ++CONFIG_VIRTIO_IOMMU=y ++CONFIG_XIO3130=y ++CONFIG_NVDIMM=y ++CONFIG_ACPI_APEI=y ++CONFIG_TPM=y ++CONFIG_TPM_EMULATOR=y ++CONFIG_TPM_TIS_SYSBUS=y ++CONFIG_PTIMER=y ++CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y ++CONFIG_PVPANIC_PCI=y ++CONFIG_PXB=y ++CONFIG_VHOST_VSOCK=y ++CONFIG_VHOST_USER_VSOCK=y ++CONFIG_VHOST_USER_FS=y ++CONFIG_IOMMUFD=y ++CONFIG_VHOST_USER_SND=y ++CONFIG_VHOST_USER_SCMI=y +diff --git a/configs/devices/rh-virtio.mak b/configs/devices/rh-virtio.mak +new file mode 100644 +index 0000000000..94ede1b5f6 +--- /dev/null ++++ b/configs/devices/rh-virtio.mak +@@ -0,0 +1,10 @@ ++CONFIG_VIRTIO=y ++CONFIG_VIRTIO_BALLOON=y ++CONFIG_VIRTIO_BLK=y ++CONFIG_VIRTIO_GPU=y ++CONFIG_VIRTIO_INPUT=y ++CONFIG_VIRTIO_INPUT_HOST=y ++CONFIG_VIRTIO_NET=y ++CONFIG_VIRTIO_RNG=y ++CONFIG_VIRTIO_SCSI=y ++CONFIG_VIRTIO_SERIAL=y +diff --git a/configs/devices/s390x-softmmu/s390x-rh-devices.mak b/configs/devices/s390x-softmmu/s390x-rh-devices.mak +new file mode 100644 +index 0000000000..24cf6dbd03 +--- /dev/null ++++ b/configs/devices/s390x-softmmu/s390x-rh-devices.mak +@@ -0,0 +1,19 @@ ++include ../rh-virtio.mak ++ ++CONFIG_PCI=y ++CONFIG_S390_CCW_VIRTIO=y ++CONFIG_S390_FLIC=y ++CONFIG_S390_FLIC_KVM=y ++CONFIG_SCLPCONSOLE=y ++CONFIG_SCSI=y ++CONFIG_VFIO=y ++CONFIG_VFIO_AP=y ++CONFIG_VFIO_CCW=y ++CONFIG_VFIO_PCI=y ++CONFIG_VHOST_USER=y ++CONFIG_VIRTIO_CCW=y ++CONFIG_WDT_DIAG288=y ++CONFIG_VHOST_VSOCK=y ++CONFIG_VHOST_USER_VSOCK=y ++CONFIG_VHOST_USER_FS=y ++CONFIG_IOMMUFD=y +diff --git a/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak +new file mode 100644 +index 0000000000..45a8a15291 +--- /dev/null ++++ b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak +@@ -0,0 +1,114 @@ ++include ../rh-virtio.mak ++ ++CONFIG_ACPI=y ++CONFIG_ACPI_PCI=y ++CONFIG_ACPI_CPU_HOTPLUG=y ++CONFIG_ACPI_MEMORY_HOTPLUG=y ++CONFIG_ACPI_NVDIMM=y ++CONFIG_ACPI_SMBUS=y ++CONFIG_ACPI_VMGENID=y ++CONFIG_ACPI_X86=y ++CONFIG_ACPI_ICH9=y ++CONFIG_AHCI=y ++CONFIG_APIC=y ++CONFIG_APM=y ++CONFIG_BOCHS_DISPLAY=y ++CONFIG_CXL=y ++CONFIG_CXL_MEM_DEVICE=y ++CONFIG_DIMM=y ++CONFIG_E1000E_PCI_EXPRESS=y ++CONFIG_E1000_PCI=y ++CONFIG_EDU=y ++#CONFIG_FDC=y ++#CONFIG_FDC_SYSBUS=y ++#CONFIG_FDC_ISA=y ++CONFIG_FW_CFG_DMA=y ++CONFIG_HDA=y ++CONFIG_HYPERV=y ++CONFIG_HYPERV_TESTDEV=y ++CONFIG_I2C=y ++CONFIG_I440FX=y ++CONFIG_I8254=y ++CONFIG_I8257=y ++CONFIG_I8259=y ++CONFIG_I82801B11=y ++CONFIG_IDE_CORE=y ++CONFIG_IDE_PCI=y ++CONFIG_IDE_PIIX=y ++CONFIG_IDE_DEV=y ++CONFIG_IDE_BUS=y ++CONFIG_IGB_PCI_EXPRESS=y ++CONFIG_IOAPIC=y ++CONFIG_IOH3420=y ++CONFIG_ISA_BUS=y ++CONFIG_ISA_DEBUG=y ++CONFIG_ISA_TESTDEV=y ++CONFIG_LPC_ICH9=y ++CONFIG_MC146818RTC=y ++CONFIG_MEM_DEVICE=y ++CONFIG_NVDIMM=y ++CONFIG_PAM=y ++CONFIG_PC=y ++CONFIG_PCI=y ++CONFIG_PCIE_PORT=y ++CONFIG_PCI_DEVICES=y ++CONFIG_PCI_EXPRESS=y ++CONFIG_PCI_EXPRESS_Q35=y ++CONFIG_PCI_I440FX=y ++CONFIG_PCI_TESTDEV=y ++CONFIG_PCKBD=y ++CONFIG_PCSPK=y ++CONFIG_PC_ACPI=y ++CONFIG_PC_PCI=y ++CONFIG_PCIE_PCI_BRIDGE=y ++CONFIG_PFLASH_CFI01=y ++CONFIG_PVPANIC_ISA=y ++CONFIG_PXB=y ++CONFIG_Q35=y ++CONFIG_RTL8139_PCI=y ++CONFIG_SCSI=y ++CONFIG_SERIAL=y ++CONFIG_SERIAL_ISA=y ++CONFIG_SERIAL_PCI=y ++CONFIG_SEV=y ++CONFIG_SMBIOS=y ++CONFIG_SMBUS_EEPROM=y ++CONFIG_TEST_DEVICES=y ++CONFIG_USB=y ++CONFIG_USB_EHCI=y ++CONFIG_USB_EHCI_PCI=y ++CONFIG_USB_SMARTCARD=y ++CONFIG_USB_STORAGE_CORE=y ++CONFIG_USB_STORAGE_CLASSIC=y ++CONFIG_USB_UHCI=y ++CONFIG_USB_XHCI=y ++CONFIG_USB_XHCI_NEC=y ++CONFIG_USB_XHCI_PCI=y ++CONFIG_USB_HUB=y ++CONFIG_USB_HID=y ++CONFIG_VFIO=y ++CONFIG_VFIO_PCI=y ++CONFIG_VGA=y ++CONFIG_VGA_PCI=y ++CONFIG_VHOST_USER=y ++CONFIG_VHOST_USER_BLK=y ++CONFIG_VIRTIO_MEM=y ++CONFIG_VIRTIO_PCI=y ++CONFIG_VIRTIO_VGA=y ++CONFIG_VIRTIO_IOMMU=y ++CONFIG_VMMOUSE=y ++CONFIG_VMPORT=y ++CONFIG_VTD=y ++CONFIG_WDT_IB6300ESB=y ++CONFIG_WDT_IB700=y ++CONFIG_XIO3130=y ++CONFIG_TPM=y ++CONFIG_TPM_CRB=y ++CONFIG_TPM_TIS_ISA=y ++CONFIG_TPM_EMULATOR=y ++CONFIG_SGX=y ++CONFIG_VHOST_VSOCK=y ++CONFIG_VHOST_USER_VSOCK=y ++CONFIG_VHOST_USER_FS=y ++CONFIG_IOMMUFD=y ++CONFIG_VHOST_USER_SND=y +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 687fe0bb8b..eea7d2d038 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3032,6 +3032,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + MachineClass *mc = MACHINE_CLASS(oc); + HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc); + static const char * const valid_cpu_types[] = { ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + #ifdef CONFIG_TCG + ARM_CPU_TYPE_NAME("cortex-a7"), + ARM_CPU_TYPE_NAME("cortex-a15"), +@@ -3047,8 +3048,11 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + ARM_CPU_TYPE_NAME("neoverse-n2"), + #endif /* TARGET_AARCH64 */ + #endif /* CONFIG_TCG */ ++#endif /* disabled for RHEL */ + #ifdef TARGET_AARCH64 ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + ARM_CPU_TYPE_NAME("cortex-a53"), ++#endif /* disabled for RHEL */ + ARM_CPU_TYPE_NAME("cortex-a57"), + #if defined(CONFIG_KVM) || defined(CONFIG_HVF) + ARM_CPU_TYPE_NAME("host"), +diff --git a/hw/cxl/meson.build b/hw/cxl/meson.build +index 3e375f61a9..613adb3ebb 100644 +--- a/hw/cxl/meson.build ++++ b/hw/cxl/meson.build +@@ -6,7 +6,8 @@ system_ss.add(when: 'CONFIG_CXL', + 'cxl-host.c', + 'cxl-cdat.c', + 'cxl-events.c', +- 'switch-mailbox-cci.c', ++# Disabled for 8.2.0 rebase for RHEL 9.4.0 ++# 'switch-mailbox-cci.c', + ), + if_false: files( + 'cxl-host-stubs.c', +diff --git a/hw/ide/piix.c b/hw/ide/piix.c +index 80efc633d3..9cb82b8eea 100644 +--- a/hw/ide/piix.c ++++ b/hw/ide/piix.c +@@ -191,7 +191,8 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data) + k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1; + k->class_id = PCI_CLASS_STORAGE_IDE; + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); +- dc->hotpluggable = false; ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->user_creatable = false; + } + + static const TypeInfo piix3_ide_info = { +@@ -215,6 +216,8 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data) + k->class_id = PCI_CLASS_STORAGE_IDE; + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + dc->hotpluggable = false; ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->user_creatable = false; + } + + static const TypeInfo piix4_ide_info = { +diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c +index 74f10b640f..2e85ecf476 100644 +--- a/hw/input/pckbd.c ++++ b/hw/input/pckbd.c +@@ -952,6 +952,8 @@ static void i8042_class_initfn(ObjectClass *klass, void *data) + dc->vmsd = &vmstate_kbd_isa; + adevc->build_dev_aml = i8042_build_aml; + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->user_creatable = false; + } + + static const TypeInfo i8042_info = { +diff --git a/hw/net/e1000.c b/hw/net/e1000.c +index 5012b96464..b435e54228 100644 +--- a/hw/net/e1000.c ++++ b/hw/net/e1000.c +@@ -1746,6 +1746,7 @@ static const E1000Info e1000_devices[] = { + .revision = 0x03, + .phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT, + }, ++#if 0 /* Disabled for Red Hat Enterprise Linux 7 */ + { + .name = "e1000-82544gc", + .device_id = E1000_DEV_ID_82544GC_COPPER, +@@ -1758,6 +1759,7 @@ static const E1000Info e1000_devices[] = { + .revision = 0x03, + .phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT, + }, ++#endif + }; + + static void e1000_register_types(void) +diff --git a/hw/usb/meson.build b/hw/usb/meson.build +index d7de1003e3..1cdc0a1ba0 100644 +--- a/hw/usb/meson.build ++++ b/hw/usb/meson.build +@@ -55,7 +55,7 @@ system_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader + if cacard.found() + usbsmartcard_ss = ss.source_set() + usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD', +- if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')]) ++ if_true: [cacard, files('ccid-card-passthru.c')]) + hw_usb_modules += {'smartcard': usbsmartcard_ss} + endif + +diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build +index 621fc65454..c38bdd6fa4 100644 +--- a/hw/virtio/meson.build ++++ b/hw/virtio/meson.build +@@ -20,7 +20,8 @@ if have_vhost + system_virtio_ss.add(files('vhost-user-base.c')) + + # MMIO Stubs +- system_virtio_ss.add(files('vhost-user-device.c')) ++# Disabled for 8.2.0 rebase for RHEL 9.4.0 ++# system_virtio_ss.add(files('vhost-user-device.c')) + system_virtio_ss.add(when: 'CONFIG_VHOST_USER_GPIO', if_true: files('vhost-user-gpio.c')) + system_virtio_ss.add(when: 'CONFIG_VHOST_USER_I2C', if_true: files('vhost-user-i2c.c')) + system_virtio_ss.add(when: 'CONFIG_VHOST_USER_RNG', if_true: files('vhost-user-rng.c')) +@@ -28,7 +29,8 @@ if have_vhost + system_virtio_ss.add(when: 'CONFIG_VHOST_USER_INPUT', if_true: files('vhost-user-input.c')) + + # PCI Stubs +- system_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('vhost-user-device-pci.c')) ++# Disabled for 8.2.0 rebase for RHEL 9.4.0 ++# system_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('vhost-user-device-pci.c')) + system_virtio_ss.add(when: ['CONFIG_VIRTIO_PCI', 'CONFIG_VHOST_USER_GPIO'], + if_true: files('vhost-user-gpio-pci.c')) + system_virtio_ss.add(when: ['CONFIG_VIRTIO_PCI', 'CONFIG_VHOST_USER_I2C'], +diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c +index 3cc8cc738b..6f21fea1f5 100644 +--- a/target/arm/arm-qmp-cmds.c ++++ b/target/arm/arm-qmp-cmds.c +@@ -223,6 +223,7 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type, + static void arm_cpu_add_definition(gpointer data, gpointer user_data) + { + ObjectClass *oc = data; ++ CPUClass *cc = CPU_CLASS(oc); + CpuDefinitionInfoList **cpu_list = user_data; + CpuDefinitionInfo *info; + const char *typename; +@@ -231,6 +232,7 @@ static void arm_cpu_add_definition(gpointer data, gpointer user_data) + info = g_malloc0(sizeof(*info)); + info->name = cpu_model_from_type(typename); + info->q_typename = g_strdup(typename); ++ info->deprecated = !!cc->deprecation_note; + + QAPI_LIST_PREPEND(*cpu_list, info); + } +diff --git a/target/arm/cpu.c b/target/arm/cpu.c +index 19191c2391..465f423d25 100644 +--- a/target/arm/cpu.c ++++ b/target/arm/cpu.c +@@ -2726,6 +2726,10 @@ static void cpu_register_class_init(ObjectClass *oc, void *data) + + acc->info = data; + cc->gdb_core_xml_file = "arm-core.xml"; ++ ++ if (acc->info->deprecation_note) { ++ cc->deprecation_note = acc->info->deprecation_note; ++ } + } + + void arm_cpu_register(const ARMCPUInfo *info) +diff --git a/target/arm/cpu.h b/target/arm/cpu.h +index 9a3fd59562..1261eae94d 100644 +--- a/target/arm/cpu.h ++++ b/target/arm/cpu.h +@@ -35,6 +35,8 @@ + #define KVM_HAVE_MCE_INJECTION 1 + #endif + ++#define RHEL_CPU_DEPRECATION "use 'host' / 'max'" ++ + #define EXCP_UDEF 1 /* undefined instruction */ + #define EXCP_SWI 2 /* software interrupt */ + #define EXCP_PREFETCH_ABORT 3 +@@ -1110,6 +1112,7 @@ typedef struct ARMCPUInfo { + const char *name; + void (*initfn)(Object *obj); + void (*class_init)(ObjectClass *oc, void *data); ++ const char *deprecation_note; + } ARMCPUInfo; + + /** +diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c +index 262a1d6c0b..800514d3fc 100644 +--- a/target/arm/cpu64.c ++++ b/target/arm/cpu64.c +@@ -653,6 +653,7 @@ static void aarch64_a57_initfn(Object *obj) + define_cortex_a72_a57_a53_cp_reginfo(cpu); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void aarch64_a53_initfn(Object *obj) + { + ARMCPU *cpu = ARM_CPU(obj); +@@ -710,6 +711,7 @@ static void aarch64_a53_initfn(Object *obj) + cpu->gic_pribits = 5; + define_cortex_a72_a57_a53_cp_reginfo(cpu); + } ++#endif + + static void aarch64_host_initfn(Object *obj) + { +@@ -748,8 +750,11 @@ static void aarch64_max_initfn(Object *obj) + } + + static const ARMCPUInfo aarch64_cpus[] = { +- { .name = "cortex-a57", .initfn = aarch64_a57_initfn }, ++ { .name = "cortex-a57", .initfn = aarch64_a57_initfn, ++ .deprecation_note = RHEL_CPU_DEPRECATION }, ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { .name = "cortex-a53", .initfn = aarch64_a53_initfn }, ++#endif /* disabled for RHEL */ + { .name = "max", .initfn = aarch64_max_initfn }, + #if defined(CONFIG_KVM) || defined(CONFIG_HVF) + { .name = "host", .initfn = aarch64_host_initfn }, +@@ -820,8 +825,13 @@ static void aarch64_cpu_instance_init(Object *obj) + static void cpu_register_class_init(ObjectClass *oc, void *data) + { + ARMCPUClass *acc = ARM_CPU_CLASS(oc); ++ CPUClass *cc = CPU_CLASS(oc); + + acc->info = data; ++ ++ if (acc->info->deprecation_note) { ++ cc->deprecation_note = acc->info->deprecation_note; ++ } + } + + void aarch64_cpu_register(const ARMCPUInfo *info) +diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c +index 20c2737f17..7e66fb6f14 100644 +--- a/target/arm/tcg/cpu32.c ++++ b/target/arm/tcg/cpu32.c +@@ -120,6 +120,7 @@ void aa32_max_features(ARMCPU *cpu) + cpu->isar.id_dfr1 = t; + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + /* CPU models. These are not needed for the AArch64 linux-user build. */ + #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) + +@@ -1066,3 +1067,4 @@ static void arm_tcg_cpu_register_types(void) + type_init(arm_tcg_cpu_register_types) + + #endif /* !CONFIG_USER_ONLY || !TARGET_AARCH64 */ ++#endif /* disabled for RHEL */ +diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c +index fe232eb306..2678047488 100644 +--- a/target/arm/tcg/cpu64.c ++++ b/target/arm/tcg/cpu64.c +@@ -29,6 +29,7 @@ + #include "cpu-features.h" + #include "cpregs.h" + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static uint64_t make_ccsidr64(unsigned assoc, unsigned linesize, + unsigned cachesize) + { +@@ -135,6 +136,7 @@ static void aarch64_a35_initfn(Object *obj) + /* These values are the same with A53/A57/A72. */ + define_cortex_a72_a57_a53_cp_reginfo(cpu); + } ++#endif + + static void cpu_max_get_sve_max_vq(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +@@ -224,6 +226,7 @@ static void cpu_max_get_l0gptsz(Object *obj, Visitor *v, const char *name, + static Property arm_cpu_lpa2_property = + DEFINE_PROP_BOOL("lpa2", ARMCPU, prop_lpa2, true); + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void aarch64_a55_initfn(Object *obj) + { + ARMCPU *cpu = ARM_CPU(obj); +@@ -1074,6 +1077,7 @@ static void aarch64_neoverse_n2_initfn(Object *obj) + aarch64_add_pauth_properties(obj); + aarch64_add_sve_properties(obj); + } ++#endif + + /* + * -cpu max: a CPU with as many features enabled as our emulation supports. +@@ -1295,6 +1299,7 @@ void aarch64_max_tcg_initfn(Object *obj) + qdev_property_add_static(DEVICE(obj), &arm_cpu_lpa2_property); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static const ARMCPUInfo aarch64_cpus[] = { + { .name = "cortex-a35", .initfn = aarch64_a35_initfn }, + { .name = "cortex-a55", .initfn = aarch64_a55_initfn }, +@@ -1306,14 +1311,17 @@ static const ARMCPUInfo aarch64_cpus[] = { + { .name = "neoverse-v1", .initfn = aarch64_neoverse_v1_initfn }, + { .name = "neoverse-n2", .initfn = aarch64_neoverse_n2_initfn }, + }; ++#endif + + static void aarch64_cpu_register_types(void) + { ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + size_t i; + + for (i = 0; i < ARRAY_SIZE(aarch64_cpus); ++i) { + aarch64_cpu_register(&aarch64_cpus[i]); + } ++#endif + } + + type_init(aarch64_cpu_register_types) +diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build +index 508932a249..1293647501 100644 +--- a/target/arm/tcg/meson.build ++++ b/target/arm/tcg/meson.build +@@ -58,5 +58,5 @@ arm_system_ss.add(files( + 'psci.c', + )) + +-arm_system_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('cpu-v7m.c')) ++#arm_system_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('cpu-v7m.c')) + arm_user_ss.add(when: 'TARGET_AARCH64', if_false: files('cpu-v7m.c')) +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index 85ef7452c0..34e0ce5e62 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -2411,9 +2411,13 @@ static const CPUCaches epyc_genoa_cache_info = { + * PT in VMX operation + */ + ++#define RHEL_CPU_DEPRECATION \ ++ "use at least 'Haswell' / 'EPYC', or 'host' / 'max'" ++ + static const X86CPUDefinition builtin_x86_defs[] = { + { + .name = "qemu64", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 0xd, + .vendor = CPUID_VENDOR_AMD, + .family = 15, +@@ -2432,6 +2436,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + .xlevel = 0x8000000A, + .model_id = "QEMU Virtual CPU version " QEMU_HW_VERSION, + }, ++#if 0 // Deprecated CPU models are removed in RHEL-10 + { + .name = "phenom", + .level = 5, +@@ -2796,8 +2801,10 @@ static const X86CPUDefinition builtin_x86_defs[] = { + .xlevel = 0x80000008, + .model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)", + }, ++#endif // Removal of deprecated CPU models in RHEL-10 + { + .name = "Nehalem", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 11, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -2875,6 +2882,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "Westmere", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 11, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -2956,6 +2964,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "SandyBridge", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 0xd, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -3042,6 +3051,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "IvyBridge", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 0xd, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -4469,6 +4479,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "Denverton", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 21, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -4579,6 +4590,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "Snowridge", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 27, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -4760,8 +4772,10 @@ static const X86CPUDefinition builtin_x86_defs[] = { + .xlevel = 0x80000008, + .model_id = "Intel Xeon Phi Processor (Knights Mill)", + }, ++#if 0 // Deprecated CPU models are removed in RHEL-10 + { + .name = "Opteron_G1", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 5, + .vendor = CPUID_VENDOR_AMD, + .family = 15, +@@ -4782,6 +4796,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "Opteron_G2", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 5, + .vendor = CPUID_VENDOR_AMD, + .family = 15, +@@ -4804,6 +4819,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "Opteron_G3", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 5, + .vendor = CPUID_VENDOR_AMD, + .family = 16, +@@ -4827,8 +4843,10 @@ static const X86CPUDefinition builtin_x86_defs[] = { + .xlevel = 0x80000008, + .model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)", + }, ++#endif + { + .name = "Opteron_G4", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 0xd, + .vendor = CPUID_VENDOR_AMD, + .family = 21, +@@ -4861,6 +4879,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "Opteron_G5", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 0xd, + .vendor = CPUID_VENDOR_AMD, + .family = 21, +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index a27f4b6f79..798c18f940 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -72,7 +72,6 @@ static S390CPUDef s390_cpu_defs[] = { + CPUDEF_INIT(0x2096, 9, 2, 40, 0x00000000U, "z9BC", "IBM System z9 BC GA1"), + CPUDEF_INIT(0x2094, 9, 3, 40, 0x00000000U, "z9EC.3", "IBM System z9 EC GA3"), + CPUDEF_INIT(0x2096, 9, 3, 40, 0x00000000U, "z9BC.2", "IBM System z9 BC GA2"), +-#endif + CPUDEF_INIT(0x2097, 10, 1, 43, 0x00000000U, "z10EC", "IBM System z10 EC GA1"), + CPUDEF_INIT(0x2097, 10, 2, 43, 0x00000000U, "z10EC.2", "IBM System z10 EC GA2"), + CPUDEF_INIT(0x2098, 10, 2, 43, 0x00000000U, "z10BC", "IBM System z10 BC GA1"), +@@ -81,6 +80,7 @@ static S390CPUDef s390_cpu_defs[] = { + CPUDEF_INIT(0x2817, 11, 1, 44, 0x08000000U, "z196", "IBM zEnterprise 196 GA1"), + CPUDEF_INIT(0x2817, 11, 2, 44, 0x08000000U, "z196.2", "IBM zEnterprise 196 GA2"), + CPUDEF_INIT(0x2818, 11, 2, 44, 0x08000000U, "z114", "IBM zEnterprise 114 GA1"), ++#endif + CPUDEF_INIT(0x2827, 12, 1, 44, 0x08000000U, "zEC12", "IBM zEnterprise EC12 GA1"), + CPUDEF_INIT(0x2827, 12, 2, 44, 0x08000000U, "zEC12.2", "IBM zEnterprise EC12 GA2"), + CPUDEF_INIT(0x2828, 12, 2, 44, 0x08000000U, "zBC12", "IBM zEnterprise BC12 GA1"), +diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c +index cfd6f77353..3016e6233c 100644 +--- a/tests/qtest/arm-cpu-features.c ++++ b/tests/qtest/arm-cpu-features.c +@@ -452,8 +452,10 @@ static void test_query_cpu_model_expansion(const void *data) + assert_error(qts, "host", "The CPU type 'host' requires KVM", NULL); + + /* Test expected feature presence/absence for some cpu types */ ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + assert_has_feature_enabled(qts, "cortex-a15", "pmu"); + assert_has_not_feature(qts, "cortex-a15", "aarch64"); ++#endif /* disabled for RHEL */ + + /* Enabling and disabling pmu should always work. */ + assert_has_feature_enabled(qts, "max", "pmu"); +@@ -470,6 +472,7 @@ static void test_query_cpu_model_expansion(const void *data) + assert_has_feature_enabled(qts, "cortex-a57", "pmu"); + assert_has_feature_enabled(qts, "cortex-a57", "aarch64"); + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + assert_has_feature_enabled(qts, "a64fx", "pmu"); + assert_has_feature_enabled(qts, "a64fx", "aarch64"); + /* +@@ -482,6 +485,7 @@ static void test_query_cpu_model_expansion(const void *data) + "{ 'sve384': true }"); + assert_error(qts, "a64fx", "cannot enable sve640", + "{ 'sve640': true }"); ++#endif /* disabled for RHEL */ + + sve_tests_default(qts, "max"); + pauth_tests_default(qts, "max"); +-- +2.39.3 + diff --git a/SOURCES/0006-Machine-type-related-general-changes.patch b/SOURCES/0006-Machine-type-related-general-changes.patch new file mode 100644 index 0000000..f7832d0 --- /dev/null +++ b/SOURCES/0006-Machine-type-related-general-changes.patch @@ -0,0 +1,691 @@ +From 18ae40658bedd6dceab0ffe0bce77ba48e6f0fae Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 11 Jan 2019 09:54:45 +0100 +Subject: Machine type related general changes + +This patch is first part of original "Add RHEL machine types" patch we +split to allow easier review. It contains changes not related to any +architecture. + +Signed-off-by: Miroslav Rezanina + +--- +Rebase notes (9.1.0 rc0): +- Upstream removed uuid_encoced argument on smbios_set_defaults + +Merged commits (9.1.0 rc0): +- 043ad5ce97 Add upstream compatibility bits (partial) +- bfbdab5824 rhel 9.4.0 machine type compat for virtio-gpu migration +--- + hw/acpi/piix4.c | 2 +- + hw/arm/virt.c | 3 +- + hw/core/machine.c | 281 +++++++++++++++++++++++++++++++++++ + hw/i386/fw_cfg.c | 3 +- + hw/net/rtl8139.c | 4 +- + hw/smbios/smbios.c | 46 +++++- + hw/timer/i8254_common.c | 2 +- + hw/usb/hcd-xhci-pci.c | 59 ++++++-- + hw/usb/hcd-xhci-pci.h | 1 + + hw/virtio/virtio-mem.c | 3 +- + include/hw/boards.h | 43 ++++++ + include/hw/firmware/smbios.h | 4 +- + include/hw/i386/pc.h | 3 + + 13 files changed, 430 insertions(+), 24 deletions(-) + +diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c +index debe1adb84..e8ddcd716e 100644 +--- a/hw/acpi/piix4.c ++++ b/hw/acpi/piix4.c +@@ -245,7 +245,7 @@ static bool vmstate_test_migrate_acpi_index(void *opaque, int version_id) + static const VMStateDescription vmstate_acpi = { + .name = "piix4_pm", + .version_id = 3, +- .minimum_version_id = 3, ++ .minimum_version_id = 2, + .post_load = vmstate_acpi_post_load, + .fields = (const VMStateField[]) { + VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState), +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index eea7d2d038..b2aa3f1355 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -1699,7 +1699,8 @@ static void virt_build_smbios(VirtMachineState *vms) + } + + smbios_set_defaults("QEMU", product, +- vmc->smbios_old_sys_ver ? "1.0" : mc->name); ++ vmc->smbios_old_sys_ver ? "1.0" : mc->name, ++ NULL, NULL); + + /* build the array of physical mem area from base_memmap */ + mem_array.address = vms->memmap[VIRT_MEM].base; +diff --git a/hw/core/machine.c b/hw/core/machine.c +index 27dcda0248..f7fed78e4b 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -305,6 +305,287 @@ GlobalProperty hw_compat_2_1[] = { + }; + const size_t hw_compat_2_1_len = G_N_ELEMENTS(hw_compat_2_1); + ++/* ++ * RHEL only: machine types for previous major releases are deprecated ++ */ ++const char *rhel_old_machine_deprecation = ++ "machine types for previous major releases are deprecated"; ++ ++GlobalProperty hw_compat_rhel_9_5[] = { ++ /* hw_compat_rhel_9_5 from hw_compat_8_2 */ ++ { "migration", "zero-page-detection", "legacy"}, ++ /* hw_compat_rhel_9_5 from hw_compat_8_2 */ ++ { TYPE_VIRTIO_IOMMU_PCI, "granule", "4k" }, ++ /* hw_compat_rhel_9_5 from hw_compat_8_2 */ ++ { TYPE_VIRTIO_IOMMU_PCI, "aw-bits", "64" }, ++ /* hw_compat_rhel_9_5 from hw_compat_8_2 */ ++ { "virtio-gpu-device", "x-scanout-vmstate-version", "1" }, ++}; ++const size_t hw_compat_rhel_9_5_len = G_N_ELEMENTS(hw_compat_rhel_9_5); ++ ++GlobalProperty hw_compat_rhel_9_4[] = { ++ /* hw_compat_rhel_9_4 from hw_compat_8_0 */ ++ { TYPE_VIRTIO_NET, "host_uso", "off"}, ++ /* hw_compat_rhel_9_4 from hw_compat_8_0 */ ++ { TYPE_VIRTIO_NET, "guest_uso4", "off"}, ++ /* hw_compat_rhel_9_4 from hw_compat_8_0 */ ++ { TYPE_VIRTIO_NET, "guest_uso6", "off"}, ++ /* hw_compat_rhel_9_4 from hw_compat_8_1 */ ++ { TYPE_PCI_BRIDGE, "x-pci-express-writeable-slt-bug", "true" }, ++ /* hw_compat_rhel_9_4 from hw_compat_8_1 */ ++ { "ramfb", "x-migrate", "off" }, ++ /* hw_compat_rhel_9_4 from hw_compat_8_1 */ ++ { "vfio-pci-nohotplug", "x-ramfb-migrate", "off" }, ++ /* hw_compat_rhel_9_4 from hw_compat_8_1 */ ++ { "igb", "x-pcie-flr-init", "off" }, ++ /* hw_compat_rhel_9_4 jira RHEL-24045 */ ++ { "virtio-mem", "dynamic-memslots", "off" }, ++}; ++const size_t hw_compat_rhel_9_4_len = G_N_ELEMENTS(hw_compat_rhel_9_4); ++ ++GlobalProperty hw_compat_rhel_9_3[] = { ++ /* hw_compat_rhel_9_3 from hw_compat_8_0 */ ++ { "migration", "multifd-flush-after-each-section", "on"}, ++ /* hw_compat_rhel_9_3 from hw_compat_8_0 */ ++ { TYPE_PCI_DEVICE, "x-pcie-ari-nextfn-1", "on" }, ++}; ++const size_t hw_compat_rhel_9_3_len = G_N_ELEMENTS(hw_compat_rhel_9_3); ++ ++GlobalProperty hw_compat_rhel_9_2[] = { ++ /* hw_compat_rhel_9_2 from hw_compat_7_2 */ ++ { "e1000e", "migrate-timadj", "off" }, ++ /* hw_compat_rhel_9_2 from hw_compat_7_2 */ ++ { "virtio-mem", "x-early-migration", "false" }, ++ /* hw_compat_rhel_9_2 from hw_compat_7_2 */ ++ { "migration", "x-preempt-pre-7-2", "true" }, ++ /* hw_compat_rhel_9_2 from hw_compat_7_2 */ ++ { TYPE_PCI_DEVICE, "x-pcie-err-unc-mask", "off" }, ++}; ++const size_t hw_compat_rhel_9_2_len = G_N_ELEMENTS(hw_compat_rhel_9_2); ++ ++/* ++ * Mostly the same as hw_compat_7_0 ++ */ ++GlobalProperty hw_compat_rhel_9_1[] = { ++ /* hw_compat_rhel_9_1 from hw_compat_7_0 */ ++ { "arm-gicv3-common", "force-8-bit-prio", "on" }, ++ /* hw_compat_rhel_9_1 from hw_compat_7_0 */ ++ { "nvme-ns", "eui64-default", "on"}, ++ /* hw_compat_rhel_9_1 from hw_compat_7_1 */ ++ { "virtio-device", "queue_reset", "false" }, ++ /* hw_compat_rhel_9_1 bz 2155749 */ ++ { "virtio-rng-pci", "vectors", "0" }, ++ /* hw_compat_rhel_9_1 bz 2162569 */ ++ { "virtio-rng-pci-transitional", "vectors", "0" }, ++ { "virtio-rng-pci-non-transitional", "vectors", "0" }, ++}; ++const size_t hw_compat_rhel_9_1_len = G_N_ELEMENTS(hw_compat_rhel_9_1); ++ ++/* ++ * Mostly the same as hw_compat_6_2 ++ */ ++GlobalProperty hw_compat_rhel_9_0[] = { ++ /* hw_compat_rhel_9_0 from hw_compat_6_2 */ ++ { "PIIX4_PM", "x-not-migrate-acpi-index", "on"}, ++}; ++const size_t hw_compat_rhel_9_0_len = G_N_ELEMENTS(hw_compat_rhel_9_0); ++ ++GlobalProperty hw_compat_rhel_8_6[] = { ++ /* hw_compat_rhel_8_6 bz 2065589 */ ++ /* ++ * vhost-vsock device in RHEL 8 kernels doesn't support seqpacket, so ++ * we need do disable it downstream on the latest hw_compat_rhel_8. ++ */ ++ { "vhost-vsock-device", "seqpacket", "off" }, ++}; ++const size_t hw_compat_rhel_8_6_len = G_N_ELEMENTS(hw_compat_rhel_8_6); ++ ++/* ++ * Mostly the same as hw_compat_6_0 and hw_compat_6_1 ++ */ ++GlobalProperty hw_compat_rhel_8_5[] = { ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "gpex-pcihost", "allow-unmapped-accesses", "false" }, ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "i8042", "extended-state", "false"}, ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "nvme-ns", "eui64-default", "off"}, ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "e1000", "init-vet", "off" }, ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "e1000e", "init-vet", "off" }, ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "vhost-vsock-device", "seqpacket", "off" }, ++ /* hw_compat_rhel_8_5 from hw_compat_6_1 */ ++ { "vhost-user-vsock-device", "seqpacket", "off" }, ++ /* hw_compat_rhel_8_5 from hw_compat_6_1 */ ++ { "nvme-ns", "shared", "off" }, ++}; ++const size_t hw_compat_rhel_8_5_len = G_N_ELEMENTS(hw_compat_rhel_8_5); ++ ++/* ++ * Mostly the same as hw_compat_5_2 ++ */ ++GlobalProperty hw_compat_rhel_8_4[] = { ++ /* hw_compat_rhel_8_4 from hw_compat_5_2 */ ++ { "ICH9-LPC", "smm-compat", "on"}, ++ /* hw_compat_rhel_8_4 from hw_compat_5_2 */ ++ { "PIIX4_PM", "smm-compat", "on"}, ++ /* hw_compat_rhel_8_4 from hw_compat_5_2 */ ++ { "virtio-blk-device", "report-discard-granularity", "off" }, ++ /* hw_compat_rhel_8_4 from hw_compat_5_2 */ ++ /* ++ * Upstream incorrectly had "virtio-net-pci" instead of "virtio-net-pci-base", ++ * (https://bugzilla.redhat.com/show_bug.cgi?id=1999141) ++ */ ++ { "virtio-net-pci-base", "vectors", "3"}, ++}; ++const size_t hw_compat_rhel_8_4_len = G_N_ELEMENTS(hw_compat_rhel_8_4); ++ ++/* ++ * Mostly the same as hw_compat_5_1 ++ */ ++GlobalProperty hw_compat_rhel_8_3[] = { ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "vhost-scsi", "num_queues", "1"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "vhost-user-blk", "num-queues", "1"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "vhost-user-scsi", "num_queues", "1"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "virtio-blk-device", "num-queues", "1"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "virtio-scsi-device", "num_queues", "1"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "nvme", "use-intel-id", "on"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "pvpanic", "events", "1"}, /* PVPANIC_PANICKED */ ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "pl011", "migrate-clk", "off" }, ++ /* hw_compat_rhel_8_3 bz 1912846 */ ++ { "pci-xhci", "x-rh-late-msi-cap", "off" }, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "virtio-pci", "x-ats-page-aligned", "off"}, ++}; ++const size_t hw_compat_rhel_8_3_len = G_N_ELEMENTS(hw_compat_rhel_8_3); ++ ++/* ++ * The same as hw_compat_4_2 + hw_compat_5_0 ++ */ ++GlobalProperty hw_compat_rhel_8_2[] = { ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-blk-device", "queue-size", "128"}, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-scsi-device", "virtqueue_size", "128"}, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-blk-device", "x-enable-wce-if-config-wce", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-blk-device", "seg-max-adjust", "off"}, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-scsi-device", "seg_max_adjust", "off"}, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "vhost-blk-device", "seg_max_adjust", "off"}, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "usb-host", "suppress-remote-wake", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "usb-redir", "suppress-remote-wake", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "qxl", "revision", "4" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "qxl-vga", "revision", "4" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "fw_cfg", "acpi-mr-restore", "false" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-device", "use-disabled-flag", "false" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "pci-host-bridge", "x-config-reg-migration-enabled", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "virtio-balloon-device", "page-poison", "false" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "vmport", "x-read-set-eax", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "vmport", "x-signal-unsupported-cmd", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "vmport", "x-report-vmx-type", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "vmport", "x-cmds-v2", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "virtio-device", "x-disable-legacy-check", "true" }, ++}; ++const size_t hw_compat_rhel_8_2_len = G_N_ELEMENTS(hw_compat_rhel_8_2); ++ ++/* ++ * The same as hw_compat_4_1 ++ */ ++GlobalProperty hw_compat_rhel_8_1[] = { ++ /* hw_compat_rhel_8_1 from hw_compat_4_1 */ ++ { "virtio-pci", "x-pcie-flr-init", "off" }, ++}; ++const size_t hw_compat_rhel_8_1_len = G_N_ELEMENTS(hw_compat_rhel_8_1); ++ ++/* The same as hw_compat_3_1 ++ * format of array has been changed by: ++ * 6c36bddf5340 ("machine: Use shorter format for GlobalProperty arrays") ++ */ ++GlobalProperty hw_compat_rhel_8_0[] = { ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "pcie-root-port", "x-speed", "2_5" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "pcie-root-port", "x-width", "1" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "memory-backend-file", "x-use-canonical-path-for-ramblock-id", "true" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "memory-backend-memfd", "x-use-canonical-path-for-ramblock-id", "true" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "tpm-crb", "ppi", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "tpm-tis", "ppi", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "usb-kbd", "serial", "42" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "usb-mouse", "serial", "42" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "usb-tablet", "serial", "42" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "virtio-blk-device", "discard", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "virtio-blk-device", "write-zeroes", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "VGA", "edid", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "secondary-vga", "edid", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "bochs-display", "edid", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "virtio-vga", "edid", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "virtio-gpu-device", "edid", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "virtio-device", "use-started", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 - that was added in 4.1 */ ++ { "pcie-root-port-base", "disable-acs", "true" }, ++}; ++const size_t hw_compat_rhel_8_0_len = G_N_ELEMENTS(hw_compat_rhel_8_0); ++ ++/* The same as hw_compat_3_0 + hw_compat_2_12 ++ * except that ++ * there's nothing in 3_0 ++ * migration.decompress-error-check=off was in 7.5 from bz 1584139 ++ */ ++GlobalProperty hw_compat_rhel_7_6[] = { ++ /* hw_compat_rhel_7_6 from hw_compat_2_12 */ ++ { "hda-audio", "use-timer", "false" }, ++ /* hw_compat_rhel_7_6 from hw_compat_2_12 */ ++ { "cirrus-vga", "global-vmstate", "true" }, ++ /* hw_compat_rhel_7_6 from hw_compat_2_12 */ ++ { "VGA", "global-vmstate", "true" }, ++ /* hw_compat_rhel_7_6 from hw_compat_2_12 */ ++ { "vmware-svga", "global-vmstate", "true" }, ++ /* hw_compat_rhel_7_6 from hw_compat_2_12 */ ++ { "qxl-vga", "global-vmstate", "true" }, ++}; ++const size_t hw_compat_rhel_7_6_len = G_N_ELEMENTS(hw_compat_rhel_7_6); ++ + MachineState *current_machine; + + static char *machine_get_kernel(Object *obj, Error **errp) +diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c +index 0e4494627c..33ef280420 100644 +--- a/hw/i386/fw_cfg.c ++++ b/hw/i386/fw_cfg.c +@@ -73,7 +73,8 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg, + + if (pcmc->smbios_defaults) { + /* These values are guest ABI, do not change */ +- smbios_set_defaults("QEMU", mc->desc, mc->name); ++ smbios_set_defaults("QEMU", mc->desc, mc->name, ++ pcmc->smbios_stream_product, pcmc->smbios_stream_version); + } + + /* tell smbios about cpuid version and features */ +diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c +index 03a204ef8a..f2fe057535 100644 +--- a/hw/net/rtl8139.c ++++ b/hw/net/rtl8139.c +@@ -3173,7 +3173,7 @@ static int rtl8139_pre_save(void *opaque) + + static const VMStateDescription vmstate_rtl8139 = { + .name = "rtl8139", +- .version_id = 5, ++ .version_id = 4, + .minimum_version_id = 3, + .post_load = rtl8139_post_load, + .pre_save = rtl8139_pre_save, +@@ -3254,7 +3254,9 @@ static const VMStateDescription vmstate_rtl8139 = { + VMSTATE_UINT32(tally_counters.TxMCol, RTL8139State), + VMSTATE_UINT64(tally_counters.RxOkPhy, RTL8139State), + VMSTATE_UINT64(tally_counters.RxOkBrd, RTL8139State), ++#if 0 /* Disabled for Red Hat Enterprise Linux bz 1420195 */ + VMSTATE_UINT32_V(tally_counters.RxOkMul, RTL8139State, 5), ++#endif + VMSTATE_UINT16(tally_counters.TxAbt, RTL8139State), + VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State), + +diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c +index a394514264..88642ccce0 100644 +--- a/hw/smbios/smbios.c ++++ b/hw/smbios/smbios.c +@@ -38,6 +38,10 @@ size_t usr_blobs_len; + static unsigned usr_table_max; + static unsigned usr_table_cnt; + ++/* Set to true for modern Windows 10 HardwareID-6 compat */ ++static bool smbios_type2_required; ++ ++ + uint8_t *smbios_tables; + size_t smbios_tables_len; + unsigned smbios_table_max; +@@ -626,7 +630,7 @@ static void smbios_build_type_1_table(void) + + static void smbios_build_type_2_table(void) + { +- SMBIOS_BUILD_TABLE_PRE(2, T2_BASE, false); /* optional */ ++ SMBIOS_BUILD_TABLE_PRE(2, T2_BASE, smbios_type2_required); + + SMBIOS_TABLE_SET_STR(2, manufacturer_str, type2.manufacturer); + SMBIOS_TABLE_SET_STR(2, product_str, type2.product); +@@ -1014,15 +1018,51 @@ void smbios_set_default_processor_family(uint16_t processor_family) + } + + void smbios_set_defaults(const char *manufacturer, const char *product, +- const char *version) ++ const char *version, ++ const char *stream_product, ++ const char *stream_version) + { + smbios_have_defaults = true; + ++ /* ++ * If @stream_product & @stream_version are non-NULL, then ++ * we're following rules for new Windows driver support. ++ * The data we have to report is defined in this doc: ++ * ++ * https://docs.microsoft.com/en-us/windows-hardware/drivers/install/specifying-hardware-ids-for-a-computer ++ * ++ * The Windows drivers are written to expect use of the ++ * scheme documented as "HardwareID-6" against Windows 10, ++ * which uses SMBIOS System (Type 1) and Base Board (Type 2) ++ * tables and will match on ++ * ++ * System Manufacturer = Red Hat (@manufacturer) ++ * System SKU Number = 8.2.0 (@stream_version) ++ * Baseboard Manufacturer = Red Hat (@manufacturer) ++ * Baseboard Product = RHEL-AV (@stream_product) ++ * ++ * NB, SKU must be changed with each RHEL-AV release ++ * ++ * Other fields can be freely used by applications using ++ * QEMU. For example apps can use the "System product" ++ * and "System version" to identify themselves. ++ * ++ * We get 'System Manufacturer' and 'Baseboard Manufacturer' ++ */ + SMBIOS_SET_DEFAULT(smbios_type1.manufacturer, manufacturer); + SMBIOS_SET_DEFAULT(smbios_type1.product, product); + SMBIOS_SET_DEFAULT(smbios_type1.version, version); ++ SMBIOS_SET_DEFAULT(smbios_type1.family, "Red Hat Enterprise Linux"); ++ if (stream_version != NULL) { ++ SMBIOS_SET_DEFAULT(smbios_type1.sku, stream_version); ++ } + SMBIOS_SET_DEFAULT(type2.manufacturer, manufacturer); +- SMBIOS_SET_DEFAULT(type2.product, product); ++ if (stream_product != NULL) { ++ SMBIOS_SET_DEFAULT(type2.product, stream_product); ++ smbios_type2_required = true; ++ } else { ++ SMBIOS_SET_DEFAULT(type2.product, product); ++ } + SMBIOS_SET_DEFAULT(type2.version, version); + SMBIOS_SET_DEFAULT(type3.manufacturer, manufacturer); + SMBIOS_SET_DEFAULT(type3.version, version); +diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c +index 28fdabc321..bad13ec224 100644 +--- a/hw/timer/i8254_common.c ++++ b/hw/timer/i8254_common.c +@@ -229,7 +229,7 @@ static const VMStateDescription vmstate_pit_common = { + .pre_save = pit_dispatch_pre_save, + .post_load = pit_dispatch_post_load, + .fields = (const VMStateField[]) { +- VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3), ++ VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), /* qemu-kvm's v2 had 'flags' here */ + VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2, + vmstate_pit_channel, PITChannelState), + VMSTATE_INT64(channels[0].next_transition_time, +diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c +index 264d7ebb77..2b9a3e06d4 100644 +--- a/hw/usb/hcd-xhci-pci.c ++++ b/hw/usb/hcd-xhci-pci.c +@@ -104,6 +104,33 @@ static int xhci_pci_vmstate_post_load(void *opaque, int version_id) + return 0; + } + ++/* RH bz 1912846 */ ++static bool usb_xhci_pci_add_msi(struct PCIDevice *dev, Error **errp) ++{ ++ int ret; ++ Error *err = NULL; ++ XHCIPciState *s = XHCI_PCI(dev); ++ ++ ret = msi_init(dev, 0x70, s->xhci.numintrs, true, false, &err); ++ /* ++ * Any error other than -ENOTSUP(board's MSI support is broken) ++ * is a programming error ++ */ ++ assert(!ret || ret == -ENOTSUP); ++ if (ret && s->msi == ON_OFF_AUTO_ON) { ++ /* Can't satisfy user's explicit msi=on request, fail */ ++ error_append_hint(&err, "You have to use msi=auto (default) or " ++ "msi=off with this machine type.\n"); ++ error_propagate(errp, err); ++ return true; ++ } ++ assert(!err || s->msi == ON_OFF_AUTO_AUTO); ++ /* With msi=auto, we fall back to MSI off silently */ ++ error_free(err); ++ ++ return false; ++} ++ + static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp) + { + int ret; +@@ -125,23 +152,12 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp) + s->xhci.nec_quirks = true; + } + +- if (s->msi != ON_OFF_AUTO_OFF) { +- ret = msi_init(dev, 0x70, s->xhci.numintrs, true, false, &err); +- /* +- * Any error other than -ENOTSUP(board's MSI support is broken) +- * is a programming error +- */ +- assert(!ret || ret == -ENOTSUP); +- if (ret && s->msi == ON_OFF_AUTO_ON) { +- /* Can't satisfy user's explicit msi=on request, fail */ +- error_append_hint(&err, "You have to use msi=auto (default) or " +- "msi=off with this machine type.\n"); ++ if (s->msi != ON_OFF_AUTO_OFF && s->rh_late_msi_cap) { ++ /* This gives the behaviour from 5.2.0 onwards, lspci shows 90,a0,70 */ ++ if (usb_xhci_pci_add_msi(dev, &err)) { + error_propagate(errp, err); + return; + } +- assert(!err || s->msi == ON_OFF_AUTO_AUTO); +- /* With msi=auto, we fall back to MSI off silently */ +- error_free(err); + } + pci_register_bar(dev, 0, + PCI_BASE_ADDRESS_SPACE_MEMORY | +@@ -153,6 +169,14 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp) + assert(ret > 0); + } + ++ /* RH bz 1912846 */ ++ if (s->msi != ON_OFF_AUTO_OFF && !s->rh_late_msi_cap) { ++ /* This gives the older RH machine behaviour, lspci shows 90,70,a0 */ ++ if (usb_xhci_pci_add_msi(dev, &err)) { ++ error_propagate(errp, err); ++ return; ++ } ++ } + if (s->msix != ON_OFF_AUTO_OFF) { + /* TODO check for errors, and should fail when msix=on */ + msix_init(dev, s->xhci.numintrs, +@@ -197,11 +221,18 @@ static void xhci_instance_init(Object *obj) + qdev_alias_all_properties(DEVICE(&s->xhci), obj); + } + ++static Property xhci_pci_properties[] = { ++ /* RH bz 1912846 */ ++ DEFINE_PROP_BOOL("x-rh-late-msi-cap", XHCIPciState, rh_late_msi_cap, true), ++ DEFINE_PROP_END_OF_LIST() ++}; ++ + static void xhci_class_init(ObjectClass *klass, void *data) + { + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + DeviceClass *dc = DEVICE_CLASS(klass); + ++ device_class_set_props(dc, xhci_pci_properties); + dc->reset = xhci_pci_reset; + dc->vmsd = &vmstate_xhci_pci; + set_bit(DEVICE_CATEGORY_USB, dc->categories); +diff --git a/hw/usb/hcd-xhci-pci.h b/hw/usb/hcd-xhci-pci.h +index 08f70ce97c..1be7527c1b 100644 +--- a/hw/usb/hcd-xhci-pci.h ++++ b/hw/usb/hcd-xhci-pci.h +@@ -40,6 +40,7 @@ typedef struct XHCIPciState { + XHCIState xhci; + OnOffAuto msi; + OnOffAuto msix; ++ bool rh_late_msi_cap; /* bz 1912846 */ + } XHCIPciState; + + #endif +diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c +index ef64bf1b4a..ba11aa4646 100644 +--- a/hw/virtio/virtio-mem.c ++++ b/hw/virtio/virtio-mem.c +@@ -1694,8 +1694,9 @@ static Property virtio_mem_properties[] = { + #endif + DEFINE_PROP_BOOL(VIRTIO_MEM_EARLY_MIGRATION_PROP, VirtIOMEM, + early_migration, true), ++ /* RHEL: default-enable "dynamic-memslots" (jira RHEL-24045) */ + DEFINE_PROP_BOOL(VIRTIO_MEM_DYNAMIC_MEMSLOTS_PROP, VirtIOMEM, +- dynamic_memslots, false), ++ dynamic_memslots, true), + DEFINE_PROP_END_OF_LIST(), + }; + +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 48ff6d8b93..ccfc3e10eb 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -822,4 +822,47 @@ extern const size_t hw_compat_2_2_len; + extern GlobalProperty hw_compat_2_1[]; + extern const size_t hw_compat_2_1_len; + ++extern GlobalProperty hw_compat_rhel_9_5[]; ++extern const size_t hw_compat_rhel_9_5_len; ++ ++extern GlobalProperty hw_compat_rhel_9_4[]; ++extern const size_t hw_compat_rhel_9_4_len; ++ ++extern GlobalProperty hw_compat_rhel_9_3[]; ++extern const size_t hw_compat_rhel_9_3_len; ++ ++extern GlobalProperty hw_compat_rhel_9_2[]; ++extern const size_t hw_compat_rhel_9_2_len; ++ ++extern GlobalProperty hw_compat_rhel_9_1[]; ++extern const size_t hw_compat_rhel_9_1_len; ++ ++extern GlobalProperty hw_compat_rhel_9_0[]; ++extern const size_t hw_compat_rhel_9_0_len; ++ ++extern GlobalProperty hw_compat_rhel_8_6[]; ++extern const size_t hw_compat_rhel_8_6_len; ++ ++extern GlobalProperty hw_compat_rhel_8_5[]; ++extern const size_t hw_compat_rhel_8_5_len; ++ ++extern GlobalProperty hw_compat_rhel_8_4[]; ++extern const size_t hw_compat_rhel_8_4_len; ++ ++extern GlobalProperty hw_compat_rhel_8_3[]; ++extern const size_t hw_compat_rhel_8_3_len; ++ ++extern GlobalProperty hw_compat_rhel_8_2[]; ++extern const size_t hw_compat_rhel_8_2_len; ++ ++extern GlobalProperty hw_compat_rhel_8_1[]; ++extern const size_t hw_compat_rhel_8_1_len; ++ ++extern GlobalProperty hw_compat_rhel_8_0[]; ++extern const size_t hw_compat_rhel_8_0_len; ++ ++extern GlobalProperty hw_compat_rhel_7_6[]; ++extern const size_t hw_compat_rhel_7_6_len; ++ ++extern const char *rhel_old_machine_deprecation; + #endif +diff --git a/include/hw/firmware/smbios.h b/include/hw/firmware/smbios.h +index f066ab7262..e805d25fbe 100644 +--- a/include/hw/firmware/smbios.h ++++ b/include/hw/firmware/smbios.h +@@ -331,7 +331,9 @@ void smbios_add_usr_blob_size(size_t size); + void smbios_entry_add(QemuOpts *opts, Error **errp); + void smbios_set_cpuid(uint32_t version, uint32_t features); + void smbios_set_defaults(const char *manufacturer, const char *product, +- const char *version); ++ const char *version, ++ const char *stream_product, ++ const char *stream_version); + void smbios_set_default_processor_family(uint16_t processor_family); + uint8_t *smbios_get_table_legacy(size_t *length, Error **errp); + void smbios_get_tables(MachineState *ms, +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 4e55d7ef6e..8776a3c937 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -103,6 +103,9 @@ struct PCMachineClass { + bool smbios_defaults; + bool smbios_legacy_mode; + SmbiosEntryPointType default_smbios_ep_type; ++ /* New fields needed for Windows HardwareID-6 matching */ ++ const char *smbios_stream_product; ++ const char *smbios_stream_version; + + /* RAM / address space compat: */ + bool gigabyte_align; +-- +2.39.3 + diff --git a/SOURCES/0007-meson-temporarily-disable-Wunused-function.patch b/SOURCES/0007-meson-temporarily-disable-Wunused-function.patch new file mode 100644 index 0000000..ce7c17c --- /dev/null +++ b/SOURCES/0007-meson-temporarily-disable-Wunused-function.patch @@ -0,0 +1,36 @@ +From 16946c2c7be0ae23dc1f267323cfc7630a1c9e87 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= +Date: Wed, 3 Jul 2024 13:32:32 +0100 +Subject: meson: temporarily disable -Wunused-function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Deleting the upstream versioned machine types will leave some functions +unused until RHEL machine types are added once again. Temporarily +disable the -Wunused-function warning to preserve bisectability with +fine grained patch splits. + +Signed-off-by: Daniel P. Berrangé + +Rebase notes (9.1.0 rc0) +- New patch +--- + meson.build | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/meson.build b/meson.build +index fbda17c987..161d496d55 100644 +--- a/meson.build ++++ b/meson.build +@@ -651,6 +651,7 @@ warn_flags = [ + '-Wno-string-plus-int', + '-Wno-tautological-type-limit-compare', + '-Wno-typedef-redefinition', ++ '-Wno-unused-function', + ] + + if host_os != 'darwin' +-- +2.39.3 + diff --git a/SOURCES/0008-Remove-upstream-machine-types-for-aarch64-s390x-and-.patch b/SOURCES/0008-Remove-upstream-machine-types-for-aarch64-s390x-and-.patch new file mode 100644 index 0000000..335b53f --- /dev/null +++ b/SOURCES/0008-Remove-upstream-machine-types-for-aarch64-s390x-and-.patch @@ -0,0 +1,101 @@ +From 2f0ba1a1ed66a8ae32e7a92f3d3b744d8b59b879 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 10 Jul 2024 02:25:51 -0400 +Subject: Remove upstream machine types for aarch64, s390x and x86_64 + architectures +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We will replace upstream machine types on supported architectures with RHEL +machine types. + +Signed-off-by: Daniel P. Berrangé +Signed-off-by: Miroslav Rezanina + +Rebase notes (9.1.0 rc0): +- Split off commits adding RHEL machine types +--- + hw/arm/virt.c | 2 ++ + hw/i386/pc_piix.c | 2 ++ + hw/i386/pc_q35.c | 2 ++ + hw/s390x/s390-virtio-ccw.c | 2 ++ + 4 files changed, 8 insertions(+) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index b2aa3f1355..5396e7cb24 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3306,6 +3306,7 @@ static void machvirt_machine_init(void) + } + type_init(machvirt_machine_init); + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void virt_machine_9_1_options(MachineClass *mc) + { + } +@@ -3552,3 +3553,4 @@ static void virt_machine_2_6_options(MachineClass *mc) + vmc->no_pmu = true; + } + DEFINE_VIRT_MACHINE(2, 6) ++#endif /* disabled for RHEL */ +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 347afa4c37..67107b174a 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -448,6 +448,7 @@ static void pc_i440fx_init(MachineState *machine) + #define DEFINE_I440FX_MACHINE(major, minor) \ + DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, major, minor); + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void pc_i440fx_machine_options(MachineClass *m) + { + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +@@ -775,6 +776,7 @@ static void pc_i440fx_machine_2_4_options(MachineClass *m) + } + + DEFINE_I440FX_MACHINE(2, 4); ++#endif /* Disabled for Red Hat Enterprise Linux */ + + #ifdef CONFIG_ISAPC + static void isapc_machine_options(MachineClass *m) +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index f2d8edfa84..5fb283f2df 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -356,6 +356,7 @@ static void pc_q35_machine_options(MachineClass *m) + pc_q35_compat_defaults, pc_q35_compat_defaults_len); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void pc_q35_machine_9_1_options(MachineClass *m) + { + pc_q35_machine_options(m); +@@ -668,3 +669,4 @@ static void pc_q35_machine_2_4_options(MachineClass *m) + } + + DEFINE_Q35_MACHINE(2, 4); ++#endif /* Disabled for Red Hat Enterprise Linux */ +diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c +index c483ff8064..86bfc9d2eb 100644 +--- a/hw/s390x/s390-virtio-ccw.c ++++ b/hw/s390x/s390-virtio-ccw.c +@@ -871,6 +871,7 @@ static const TypeInfo ccw_machine_info = { + DEFINE_CCW_MACHINE_IMPL(false, major, minor) + + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void ccw_machine_9_1_instance_options(MachineState *machine) + { + } +@@ -1305,6 +1306,7 @@ static void ccw_machine_2_4_class_options(MachineClass *mc) + DEFINE_CCW_MACHINE(2, 4); + + #endif ++#endif /* disabled for RHEL */ + + static void ccw_machine_register_types(void) + { +-- +2.39.3 + diff --git a/SOURCES/0009-Adapt-versioned-machine-type-macros-for-RHEL.patch b/SOURCES/0009-Adapt-versioned-machine-type-macros-for-RHEL.patch new file mode 100644 index 0000000..40f753a --- /dev/null +++ b/SOURCES/0009-Adapt-versioned-machine-type-macros-for-RHEL.patch @@ -0,0 +1,197 @@ +From ccb1eaa95ce9c92a196fe034c033502f582a324b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= +Date: Wed, 3 Jul 2024 15:27:03 +0100 +Subject: Adapt versioned machine type macros for RHEL +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The versioned machine type macros are changed thus: + + * All symbol names get 'rhel' inserted eg 'virt_rhel_macine_9_4_0_' + * All machine type names get 'rhel' inserted eg 'virt-rhel9.4.0-machine' + * Lifecycle is changed to deprecate after 1 major RHEL release, + force non-registration (effectively deletion) after 2 major releases + * Custom message to explain RHEL deprecation/deletion policy + * Remove upstream logic that temporarily disabled deletion since + the upstream constraints in this area don't apply to RHEL + * For automatic deprecation/deletion, RHEL_VERSION is defined + +Signed-off-by: Daniel P. Berrangé +Signed-off-by: Miroslav Rezanina +--- + .distro/Makefile | 2 +- + .distro/Makefile.common | 1 + + .distro/qemu-kvm.spec.template | 1 + + .distro/scripts/process-patches.sh | 3 ++ + include/hw/boards.h | 60 ++++++++++-------------------- + meson.build | 1 + + meson_options.txt | 2 + + scripts/meson-buildoptions.sh | 2 + + 8 files changed, 30 insertions(+), 42 deletions(-) + +diff --git a/include/hw/boards.h b/include/hw/boards.h +index ccfc3e10eb..7f7eb4ec40 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -548,16 +548,16 @@ struct MachineState { + * "{prefix}-{major}.{minor}.{micro}-{tag}" + */ + #define _MACHINE_VER_TYPE_NAME2(prefix, major, minor) \ +- prefix "-" #major "." #minor TYPE_MACHINE_SUFFIX ++ prefix "-rhel" #major "." #minor TYPE_MACHINE_SUFFIX + + #define _MACHINE_VER_TYPE_NAME3(prefix, major, minor, micro) \ +- prefix "-" #major "." #minor "." #micro TYPE_MACHINE_SUFFIX ++ prefix "-rhel" #major "." #minor "." #micro TYPE_MACHINE_SUFFIX + + #define _MACHINE_VER_TYPE_NAME4(prefix, major, minor, _unused_, tag) \ +- prefix "-" #major "." #minor "-" #tag TYPE_MACHINE_SUFFIX ++ prefix "-rhel" #major "." #minor "-" #tag TYPE_MACHINE_SUFFIX + + #define _MACHINE_VER_TYPE_NAME5(prefix, major, minor, micro, _unused_, tag) \ +- prefix "-" #major "." #minor "." #micro "-" #tag TYPE_MACHINE_SUFFIX ++ prefix "-rhel" #major "." #minor "." #micro "-" #tag TYPE_MACHINE_SUFFIX + + #define MACHINE_VER_TYPE_NAME(prefix, ...) \ + _MACHINE_VER_PICK(__VA_ARGS__, \ +@@ -585,16 +585,16 @@ struct MachineState { + * {prefix}_machine_{major}_{minor}_{micro}_{tag}_{sym} + */ + #define _MACHINE_VER_SYM2(sym, prefix, major, minor) \ +- prefix ## _machine_ ## major ## _ ## minor ## _ ## sym ++ prefix ## _rhel_machine_ ## major ## _ ## minor ## _ ## sym + + #define _MACHINE_VER_SYM3(sym, prefix, major, minor, micro) \ +- prefix ## _machine_ ## major ## _ ## minor ## _ ## micro ## _ ## sym ++ prefix ## _rhel_machine_ ## major ## _ ## minor ## _ ## micro ## _ ## sym + + #define _MACHINE_VER_SYM4(sym, prefix, major, minor, _unused_, tag) \ +- prefix ## _machine_ ## major ## _ ## minor ## _ ## tag ## _ ## sym ++ prefix ## _rhel_machine_ ## major ## _ ## minor ## _ ## tag ## _ ## sym + + #define _MACHINE_VER_SYM5(sym, prefix, major, minor, micro, _unused_, tag) \ +- prefix ## _machine_ ## major ## _ ## minor ## _ ## micro ## _ ## tag ## _ ## sym ++ prefix ## _rhel_machine_ ## major ## _ ## minor ## _ ## micro ## _ ## tag ## _ ## sym + + #define MACHINE_VER_SYM(sym, prefix, ...) \ + _MACHINE_VER_PICK(__VA_ARGS__, \ +@@ -605,26 +605,22 @@ struct MachineState { + + + /* +- * How many years/major releases for each phase +- * of the life cycle. Assumes use of versioning +- * scheme where major is bumped each year ++ * How many RHEL major releases for each phase ++ * of the life cycle. + */ +-#define MACHINE_VER_DELETION_MAJOR 6 +-#define MACHINE_VER_DEPRECATION_MAJOR 3 ++#define MACHINE_VER_DELETION_MAJOR 2 ++#define MACHINE_VER_DEPRECATION_MAJOR 1 + + /* + * Expands to a static string containing a deprecation + * message for a versioned machine type + */ + #define MACHINE_VER_DEPRECATION_MSG \ +- "machines more than " stringify(MACHINE_VER_DEPRECATION_MAJOR) \ +- " years old are subject to deletion after " \ +- stringify(MACHINE_VER_DELETION_MAJOR) " years" ++ "machines from the previous RHEL major release are " \ ++ "subject to deletion in the next RHEL major release" + + #define _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) \ +- (((QEMU_VERSION_MAJOR - major) > cutoff) || \ +- (((QEMU_VERSION_MAJOR - major) == cutoff) && \ +- (QEMU_VERSION_MINOR - minor) >= 0)) ++ ((RHEL_VERSION - major) >= cutoff) + + #define _MACHINE_VER_IS_EXPIRED2(cutoff, major, minor) \ + _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) +@@ -686,32 +682,14 @@ struct MachineState { + * This must be unconditionally used in the register + * method for all machine types which support versioning. + * +- * Inijtially it will effectively be a no-op, but after a +- * suitable period of time has passed, it will cause +- * execution of the method to return, avoiding registration +- * of the machine +- * +- * The new deprecation and deletion policy for versioned +- * machine types was introduced in QEMU 9.1.0. +- * +- * Under the new policy a number of old machine types (any +- * prior to 2.12) would be liable for immediate deletion +- * which would be a violation of our historical deprecation +- * and removal policy +- * +- * Thus deletions are temporarily gated on existance of +- * the env variable "QEMU_DELETE_MACHINES" / QEMU version +- * number >= 10.1.0. This gate can be deleted in the 10.1.0 +- * dev cycle ++ * It will automatically avoid registration of machines ++ * that should have been deleted at the start of this ++ * RHEL release + */ + #define MACHINE_VER_DELETION(...) \ + do { \ + if (MACHINE_VER_SHOULD_DELETE(__VA_ARGS__)) { \ +- if (getenv("QEMU_DELETE_MACHINES") || \ +- QEMU_VERSION_MAJOR > 10 || (QEMU_VERSION_MAJOR == 10 && \ +- QEMU_VERSION_MINOR >= 1)) { \ +- return; \ +- } \ ++ return; \ + } \ + } while (0) + +diff --git a/meson.build b/meson.build +index 161d496d55..2de5ab024f 100644 +--- a/meson.build ++++ b/meson.build +@@ -2440,6 +2440,7 @@ config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version())) + config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0]) + config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1]) + config_host_data.set('QEMU_VERSION_MICRO', meson.project_version().split('.')[2]) ++config_host_data.set('RHEL_VERSION', get_option('rhel_version').split('.')[0]) + + config_host_data.set_quoted('CONFIG_HOST_DSOSUF', host_dsosuf) + config_host_data.set('HAVE_HOST_BLOCK_DEVICE', have_host_block_device) +diff --git a/meson_options.txt b/meson_options.txt +index 0269fa0f16..aa2ba0baef 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -2,6 +2,8 @@ + # on the configure script command line. If you add more, list them in + # scripts/meson-buildoptions.py's SKIP_OPTIONS constant too. + ++option('rhel_version', type: 'string', value: '0.0', ++ description: 'RHEL major/minor version') + option('qemu_suffix', type : 'string', value: 'qemu', + description: 'Suffix for QEMU data/modules/config directories (can be empty)') + option('docdir', type : 'string', value : 'share/doc', +diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh +index c97079a38c..5f0cbfc725 100644 +--- a/scripts/meson-buildoptions.sh ++++ b/scripts/meson-buildoptions.sh +@@ -71,6 +71,7 @@ meson_options_help() { + printf "%s\n" ' "manufacturer" name for qemu-ga registry entries' + printf "%s\n" ' [QEMU]' + printf "%s\n" ' --qemu-ga-version=VALUE version number for qemu-ga installer' ++ printf "%s\n" ' --rhel-version=VALUE RHEL major/minor version [0.0]' + printf "%s\n" ' --smbd=VALUE Path to smbd for slirp networking' + printf "%s\n" ' --sysconfdir=VALUE Sysconf data directory [etc]' + printf "%s\n" ' --tls-priority=VALUE Default TLS protocol/cipher priority string' +@@ -450,6 +451,7 @@ _meson_option_parse() { + --disable-relocatable) printf "%s" -Drelocatable=false ;; + --enable-replication) printf "%s" -Dreplication=enabled ;; + --disable-replication) printf "%s" -Dreplication=disabled ;; ++ --rhel-version=*) quote_sh "-Drhel_version=$2" ;; + --enable-rng-none) printf "%s" -Drng_none=true ;; + --disable-rng-none) printf "%s" -Drng_none=false ;; + --enable-rutabaga-gfx) printf "%s" -Drutabaga_gfx=enabled ;; +-- +2.39.3 + diff --git a/SOURCES/0010-Increase-deletion-schedule-to-4-releases.patch b/SOURCES/0010-Increase-deletion-schedule-to-4-releases.patch new file mode 100644 index 0000000..ac7e4eb --- /dev/null +++ b/SOURCES/0010-Increase-deletion-schedule-to-4-releases.patch @@ -0,0 +1,37 @@ +From 551632921a8330cff09e7d92429aa45cf51c75e6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= +Date: Wed, 3 Jul 2024 18:45:58 +0100 +Subject: Increase deletion schedule to 4 releases +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Until RHEL 10 pc machine type is introduced, we have to keep +7.6.0 machine types as a special exception to our normal rule of +deleting machine types after 2 releases due to being a default +machine type. + +Signed-off-by: Daniel P. Berrangé + +Rebase notes (9.1.0 rc0) + - New patch +--- + include/hw/boards.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 7f7eb4ec40..fd5a957cad 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -608,7 +608,7 @@ struct MachineState { + * How many RHEL major releases for each phase + * of the life cycle. + */ +-#define MACHINE_VER_DELETION_MAJOR 2 ++#define MACHINE_VER_DELETION_MAJOR 4 + #define MACHINE_VER_DEPRECATION_MAJOR 1 + + /* +-- +2.39.3 + diff --git a/SOURCES/0011-Add-downstream-aarch64-versioned-virt-machine-types.patch b/SOURCES/0011-Add-downstream-aarch64-versioned-virt-machine-types.patch new file mode 100644 index 0000000..97b2fb1 --- /dev/null +++ b/SOURCES/0011-Add-downstream-aarch64-versioned-virt-machine-types.patch @@ -0,0 +1,301 @@ +From 6cb1d3cf4ac08fe8c435e98500224a022d019e55 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= +Date: Wed, 3 Jul 2024 13:25:47 +0100 +Subject: Add downstream aarch64 versioned 'virt' machine types + +Adding changes to add RHEL machine types for aarch64 architecture. + +Signed-off-by: Miroslav Rezanina +--- +Rebase notes (9.1.0 rc0): +- Merge copy+pasted base machine definition back with upstream + base machine definition to reduce RHEL delta, as is done with + other targets +- Convert to new DEFINE_VIRT_MACHINE macros + +Rebase notes (9.1.0 rc1): +- do not remove cpu validation (review comment) + +Rebase notes (9.1.0 rc2): +- use ifdef instead of removal for disabling unwanted upstream code + +Merged patches (9.1.0 rc0): +- 043ad5ce97 Add upstream compatibility bits (partial) +--- + hw/arm/virt.c | 101 ++++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 81 insertions(+), 20 deletions(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 5396e7cb24..903c0f2e9f 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -90,6 +90,22 @@ static GlobalProperty arm_virt_compat[] = { + }; + static const size_t arm_virt_compat_len = G_N_ELEMENTS(arm_virt_compat); + ++/* ++ * This variable is for changes to properties that are RHEL specific, ++ * different to the current upstream and to be applied to the latest ++ * machine type. They may be overriden by older machine compats. ++ * ++ * virtio-net-pci variant romfiles are not needed because edk2 does ++ * fully support the pxe boot. Besides virtio romfiles are not shipped ++ * on rhel/aarch64. ++ */ ++GlobalProperty arm_rhel_compat[] = { ++ {"virtio-net-pci", "romfile", "" }, ++ {"virtio-net-pci-transitional", "romfile", "" }, ++ {"virtio-net-pci-non-transitional", "romfile", "" }, ++}; ++const size_t arm_rhel_compat_len = G_N_ELEMENTS(arm_rhel_compat); ++ + /* + * This cannot be called from the virt_machine_class_init() because + * TYPE_VIRT_MACHINE is abstract and mc->compat_props g_ptr_array_new() +@@ -99,6 +115,8 @@ static void arm_virt_compat_set(MachineClass *mc) + { + compat_props_add(mc->compat_props, arm_virt_compat, + arm_virt_compat_len); ++ compat_props_add(mc->compat_props, arm_rhel_compat, ++ arm_rhel_compat_len); + } + + #define DEFINE_VIRT_MACHINE_IMPL(latest, ...) \ +@@ -109,10 +127,11 @@ static void arm_virt_compat_set(MachineClass *mc) + MachineClass *mc = MACHINE_CLASS(oc); \ + arm_virt_compat_set(mc); \ + MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ +- mc->desc = "QEMU " MACHINE_VER_STR(__VA_ARGS__) " ARM Virtual Machine"; \ ++ mc->desc = "RHEL " MACHINE_VER_STR(__VA_ARGS__) " ARM Virtual Machine"; \ + MACHINE_VER_DEPRECATION(__VA_ARGS__); \ + if (latest) { \ + mc->alias = "virt"; \ ++ mc->is_default = 1; \ + } \ + } \ + static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) = \ +@@ -128,10 +147,10 @@ static void arm_virt_compat_set(MachineClass *mc) + } \ + type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); + +-#define DEFINE_VIRT_MACHINE_AS_LATEST(major, minor) \ +- DEFINE_VIRT_MACHINE_IMPL(true, major, minor) +-#define DEFINE_VIRT_MACHINE(major, minor) \ +- DEFINE_VIRT_MACHINE_IMPL(false, major, minor) ++#define DEFINE_VIRT_MACHINE_AS_LATEST(major, minor, micro) \ ++ DEFINE_VIRT_MACHINE_IMPL(true, major, minor, micro) ++#define DEFINE_VIRT_MACHINE(major, minor, micro) \ ++ DEFINE_VIRT_MACHINE_IMPL(false, major, minor, micro) + + + /* Number of external interrupt lines to configure the GIC with */ +@@ -2434,6 +2453,7 @@ static void machvirt_init(MachineState *machine) + qemu_add_machine_init_done_notifier(&vms->machine_done); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static bool virt_get_secure(Object *obj, Error **errp) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -2461,6 +2481,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp) + + vms->virt = value; + } ++#endif /* disabled for RHEL */ + + static bool virt_get_highmem(Object *obj, Error **errp) + { +@@ -2476,6 +2497,7 @@ static void virt_set_highmem(Object *obj, bool value, Error **errp) + vms->highmem = value; + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static bool virt_get_compact_highmem(Object *obj, Error **errp) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -2489,6 +2511,7 @@ static void virt_set_compact_highmem(Object *obj, bool value, Error **errp) + + vms->highmem_compact = value; + } ++#endif /* disabled for RHEL */ + + static bool virt_get_highmem_redists(Object *obj, Error **errp) + { +@@ -2547,6 +2570,7 @@ static void virt_set_its(Object *obj, bool value, Error **errp) + vms->its = value; + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static bool virt_get_dtb_randomness(Object *obj, Error **errp) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -2560,6 +2584,7 @@ static void virt_set_dtb_randomness(Object *obj, bool value, Error **errp) + + vms->dtb_randomness = value; + } ++#endif /* disabled for RHEL */ + + static char *virt_get_oem_id(Object *obj, Error **errp) + { +@@ -2643,6 +2668,7 @@ static void virt_set_ras(Object *obj, bool value, Error **errp) + vms->ras = value; + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static bool virt_get_mte(Object *obj, Error **errp) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -2656,6 +2682,7 @@ static void virt_set_mte(Object *obj, bool value, Error **errp) + + vms->mte = value; + } ++#endif /* disabled for RHEL */ + + static char *virt_get_gic_version(Object *obj, Error **errp) + { +@@ -3063,16 +3090,10 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + NULL + }; + ++ mc->family = "virt-rhel-Z"; + mc->init = machvirt_init; +- /* Start with max_cpus set to 512, which is the maximum supported by KVM. +- * The value may be reduced later when we have more information about the +- * configuration of the particular instance. +- */ +- mc->max_cpus = 512; +- machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_CALXEDA_XGMAC); +- machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_AMD_XGBE); +- machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); +- machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_PLATFORM); ++ /* Maximum supported VCPU count for all virt-rhel* machines */ ++ mc->max_cpus = 384; + #ifdef CONFIG_TPM + machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS); + #endif +@@ -3083,11 +3104,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + mc->minimum_page_bits = 12; + mc->possible_cpu_arch_ids = virt_possible_cpu_arch_ids; + mc->cpu_index_to_instance_props = virt_cpu_index_to_props; +-#ifdef CONFIG_TCG +- mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15"); +-#else +- mc->default_cpu_type = ARM_CPU_TYPE_NAME("max"); +-#endif ++ mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a57"); + mc->valid_cpu_types = valid_cpu_types; + mc->get_default_cpu_node_id = virt_get_default_cpu_node_id; + mc->kvm_type = virt_kvm_type; +@@ -3111,6 +3128,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + NULL, NULL); + object_class_property_set_description(oc, "acpi", + "Enable ACPI"); ++#if 0 /* disabled for RHEL */ + object_class_property_add_bool(oc, "secure", virt_get_secure, + virt_set_secure); + object_class_property_set_description(oc, "secure", +@@ -3123,6 +3141,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + "Set on/off to enable/disable emulating a " + "guest CPU which implements the ARM " + "Virtualization Extensions"); ++#endif /* disabled for RHEL */ + + object_class_property_add_bool(oc, "highmem", virt_get_highmem, + virt_set_highmem); +@@ -3130,12 +3149,14 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + "Set on/off to enable/disable using " + "physical address space above 32 bits"); + ++#if 0 /* disabled for RHEL */ + object_class_property_add_bool(oc, "compact-highmem", + virt_get_compact_highmem, + virt_set_compact_highmem); + object_class_property_set_description(oc, "compact-highmem", + "Set on/off to enable/disable compact " + "layout for high memory regions"); ++#endif /* disabled for RHEL */ + + object_class_property_add_bool(oc, "highmem-redists", + virt_get_highmem_redists, +@@ -3163,7 +3184,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + virt_set_gic_version); + object_class_property_set_description(oc, "gic-version", + "Set GIC version. " +- "Valid values are 2, 3, 4, host and max"); ++ "Valid values are 2, 3, host and max"); + + object_class_property_add_str(oc, "iommu", virt_get_iommu, virt_set_iommu); + object_class_property_set_description(oc, "iommu", +@@ -3183,11 +3204,13 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + "Set on/off to enable/disable reporting host memory errors " + "to a KVM guest using ACPI and guest external abort exceptions"); + ++#if 0 /* disabled for RHEL */ + object_class_property_add_bool(oc, "mte", virt_get_mte, virt_set_mte); + object_class_property_set_description(oc, "mte", + "Set on/off to enable/disable emulating a " + "guest CPU which implements the ARM " + "Memory Tagging Extension"); ++#endif /* disabled for RHEL */ + + object_class_property_add_bool(oc, "its", virt_get_its, + virt_set_its); +@@ -3195,6 +3218,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + "Set on/off to enable/disable " + "ITS instantiation"); + ++#if 0 /* disabled for RHEL */ + object_class_property_add_bool(oc, "dtb-randomness", + virt_get_dtb_randomness, + virt_set_dtb_randomness); +@@ -3207,6 +3231,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + virt_set_dtb_randomness); + object_class_property_set_description(oc, "dtb-kaslr-seed", + "Deprecated synonym of dtb-randomness"); ++#endif /* disabled for RHEL */ + + object_class_property_add_str(oc, "x-oem-id", + virt_get_oem_id, +@@ -3554,3 +3579,39 @@ static void virt_machine_2_6_options(MachineClass *mc) + } + DEFINE_VIRT_MACHINE(2, 6) + #endif /* disabled for RHEL */ ++ ++static void virt_rhel_machine_9_4_0_options(MachineClass *mc) ++{ ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_5, hw_compat_rhel_9_5_len); ++} ++DEFINE_VIRT_MACHINE_AS_LATEST(9, 4, 0) ++ ++static void virt_rhel_machine_9_2_0_options(MachineClass *mc) ++{ ++ virt_rhel_machine_9_4_0_options(mc); ++ ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_4, hw_compat_rhel_9_4_len); ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_3, hw_compat_rhel_9_3_len); ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_2, hw_compat_rhel_9_2_len); ++ ++ /* RHEL 9.4 is the first supported release */ ++ mc->deprecation_reason = ++ "machine types for versions prior to 9.4 are deprecated"; ++} ++DEFINE_VIRT_MACHINE(9, 2, 0) ++ ++static void virt_rhel_machine_9_0_0_options(MachineClass *mc) ++{ ++ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); ++ ++ virt_rhel_machine_9_2_0_options(mc); ++ ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_1, hw_compat_rhel_9_1_len); ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_0, hw_compat_rhel_9_0_len); ++ ++ /* Disable FEAT_LPA2 since old kernels (<= v5.12) don't boot with that feature */ ++ vmc->no_tcg_lpa2 = true; ++ /* Compact layout for high memory regions was introduced with 9.2.0 */ ++ vmc->no_highmem_compact = true; ++} ++DEFINE_VIRT_MACHINE(9, 0, 0) +-- +2.39.3 + diff --git a/SOURCES/0012-Add-downstream-s390x-versioned-s390-ccw-virtio-machi.patch b/SOURCES/0012-Add-downstream-s390x-versioned-s390-ccw-virtio-machi.patch new file mode 100644 index 0000000..a684e80 --- /dev/null +++ b/SOURCES/0012-Add-downstream-s390x-versioned-s390-ccw-virtio-machi.patch @@ -0,0 +1,208 @@ +From 24d6b22e10c87e9a4bf4df834738f42caa1d5014 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= +Date: Wed, 3 Jul 2024 13:44:36 +0100 +Subject: Add downstream s390x versioned 's390-ccw-virtio' machine types + +Adding changes to add RHEL machine types for s390x architecture. + +Signed-off-by: Miroslav Rezanina +-- +Rebase notes(9.1.0 rc0): +- Convert to new DEFINE_CCW_MACHINE macros + +Merged patches (9.1.0 rc0): +- 043ad5ce97 Add upstream compatibility bits (partial) +- 04596b496e s390x: remove deprecated rhel machine types +--- + hw/s390x/s390-virtio-ccw.c | 65 +++++++++++++++++++++++++++++--- + target/s390x/cpu_models.c | 11 ++++++ + target/s390x/cpu_models.h | 2 + + target/s390x/cpu_models_sysemu.c | 2 + + 4 files changed, 75 insertions(+), 5 deletions(-) + +diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c +index 86bfc9d2eb..451017c50e 100644 +--- a/hw/s390x/s390-virtio-ccw.c ++++ b/hw/s390x/s390-virtio-ccw.c +@@ -617,6 +617,7 @@ static void s390_nmi(NMIState *n, int cpu_index, Error **errp) + s390_cpu_restart(S390_CPU(cs)); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static ram_addr_t s390_fixup_ram_size(ram_addr_t sz) + { + /* same logic as in sclp.c */ +@@ -636,6 +637,7 @@ static ram_addr_t s390_fixup_ram_size(ram_addr_t sz) + } + return newsz; + } ++#endif /* disabled for RHEL */ + + static inline bool machine_get_aes_key_wrap(Object *obj, Error **errp) + { +@@ -837,7 +839,7 @@ static const TypeInfo ccw_machine_info = { + { \ + MachineClass *mc = MACHINE_CLASS(oc); \ + MACHINE_VER_SYM(class_options, ccw, __VA_ARGS__)(mc); \ +- mc->desc = "Virtual s390x machine (version " MACHINE_VER_STR(__VA_ARGS__) ")"; \ ++ mc->desc = "Virtual s390x machine (version rhel" MACHINE_VER_STR(__VA_ARGS__) ")"; \ + MACHINE_VER_DEPRECATION(__VA_ARGS__); \ + if (latest) { \ + mc->alias = "s390-ccw-virtio"; \ +@@ -864,11 +866,11 @@ static const TypeInfo ccw_machine_info = { + } \ + type_init(MACHINE_VER_SYM(register, ccw, __VA_ARGS__)) + +-#define DEFINE_CCW_MACHINE_AS_LATEST(major, minor) \ +- DEFINE_CCW_MACHINE_IMPL(true, major, minor) ++#define DEFINE_CCW_MACHINE_AS_LATEST(major, minor, micro) \ ++ DEFINE_CCW_MACHINE_IMPL(true, major, minor, micro) + +-#define DEFINE_CCW_MACHINE(major, minor) \ +- DEFINE_CCW_MACHINE_IMPL(false, major, minor) ++#define DEFINE_CCW_MACHINE(major, minor, micro) \ ++ DEFINE_CCW_MACHINE_IMPL(false, major, minor, micro) + + + #if 0 /* Disabled for Red Hat Enterprise Linux */ +@@ -1308,6 +1310,59 @@ DEFINE_CCW_MACHINE(2, 4); + #endif + #endif /* disabled for RHEL */ + ++static void ccw_rhel_machine_9_4_0_instance_options(MachineState *machine) ++{ ++} ++ ++static void ccw_rhel_machine_9_4_0_class_options(MachineClass *mc) ++{ ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_5, hw_compat_rhel_9_5_len); ++} ++DEFINE_CCW_MACHINE_AS_LATEST(9, 4, 0); ++ ++static void ccw_rhel_machine_9_2_0_instance_options(MachineState *machine) ++{ ++ ccw_rhel_machine_9_4_0_instance_options(machine); ++} ++ ++static void ccw_rhel_machine_9_2_0_class_options(MachineClass *mc) ++{ ++ ccw_rhel_machine_9_4_0_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_4, hw_compat_rhel_9_4_len); ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_3, hw_compat_rhel_9_3_len); ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_2, hw_compat_rhel_9_2_len); ++ mc->smp_props.drawers_supported = false; /* from ccw_machine_8_1 */ ++ mc->smp_props.books_supported = false; /* from ccw_machine_8_1 */ ++} ++DEFINE_CCW_MACHINE(9, 2, 0); ++ ++static void ccw_rhel_machine_9_0_0_instance_options(MachineState *machine) ++{ ++ static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V6_2 }; ++ ++ ccw_rhel_machine_9_2_0_instance_options(machine); ++ ++ s390_set_qemu_cpu_model(0x3906, 14, 2, qemu_cpu_feat); ++ s390_cpudef_featoff_greater(16, 1, S390_FEAT_PAIE); ++} ++ ++static void ccw_rhel_machine_9_0_0_class_options(MachineClass *mc) ++{ ++ S390CcwMachineClass *s390mc = S390_CCW_MACHINE_CLASS(mc); ++ static GlobalProperty compat[] = { ++ { TYPE_S390_PCI_DEVICE, "interpret", "off", }, ++ { TYPE_S390_PCI_DEVICE, "forwarding-assist", "off", }, ++ }; ++ ++ ccw_rhel_machine_9_2_0_class_options(mc); ++ ++ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_1, hw_compat_rhel_9_1_len); ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_0, hw_compat_rhel_9_0_len); ++ s390mc->max_threads = S390_MAX_CPUS; ++} ++DEFINE_CCW_MACHINE(9, 0, 0); ++ + static void ccw_machine_register_types(void) + { + type_register_static(&ccw_machine_info); +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index 798c18f940..8afa9af1a5 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -47,6 +47,9 @@ + * of a following release have been a superset of the previous release. With + * generation 15 one base feature and one optional feature have been deprecated. + */ ++ ++#define RHEL_CPU_DEPRECATION "use at least 'z14', or 'host' / 'qemu' / 'max'" ++ + static S390CPUDef s390_cpu_defs[] = { + /* + * Linux requires at least z10 nowadays, and IBM only supports recent CPUs +@@ -871,22 +874,30 @@ static void s390_host_cpu_model_class_init(ObjectClass *oc, void *data) + static void s390_base_cpu_model_class_init(ObjectClass *oc, void *data) + { + S390CPUClass *xcc = S390_CPU_CLASS(oc); ++ CPUClass *cc = CPU_CLASS(oc); + + /* all base models are migration safe */ + xcc->cpu_def = (const S390CPUDef *) data; + xcc->is_migration_safe = true; + xcc->is_static = true; + xcc->desc = xcc->cpu_def->desc; ++ if (xcc->cpu_def->gen < 14) { ++ cc->deprecation_note = RHEL_CPU_DEPRECATION; ++ } + } + + static void s390_cpu_model_class_init(ObjectClass *oc, void *data) + { + S390CPUClass *xcc = S390_CPU_CLASS(oc); ++ CPUClass *cc = CPU_CLASS(oc); + + /* model that can change between QEMU versions */ + xcc->cpu_def = (const S390CPUDef *) data; + xcc->is_migration_safe = true; + xcc->desc = xcc->cpu_def->desc; ++ if (xcc->cpu_def->gen < 14) { ++ cc->deprecation_note = RHEL_CPU_DEPRECATION; ++ } + } + + static void s390_qemu_cpu_model_class_init(ObjectClass *oc, void *data) +diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h +index 71d4bc2dd4..d6c7c2cb50 100644 +--- a/target/s390x/cpu_models.h ++++ b/target/s390x/cpu_models.h +@@ -38,6 +38,8 @@ typedef struct S390CPUDef { + S390FeatBitmap full_feat; + /* used to init full_feat from generated data */ + S390FeatInit full_init; ++ /* if deprecated, provides a suggestion */ ++ const char *deprecation_note; + } S390CPUDef; + + /* CPU model based on a CPU definition */ +diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sysemu.c +index f6df691b66..b8de04de99 100644 +--- a/target/s390x/cpu_models_sysemu.c ++++ b/target/s390x/cpu_models_sysemu.c +@@ -56,6 +56,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque) + CpuDefinitionInfo *info; + char *name = g_strdup(object_class_get_name(klass)); + S390CPUClass *scc = S390_CPU_CLASS(klass); ++ CPUClass *cc = CPU_CLASS(klass); + + /* strip off the -s390x-cpu */ + g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0; +@@ -65,6 +66,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque) + info->migration_safe = scc->is_migration_safe; + info->q_static = scc->is_static; + info->q_typename = g_strdup(object_class_get_name(klass)); ++ info->deprecated = !!cc->deprecation_note; + /* check for unavailable features */ + if (cpu_list_data->model) { + Object *obj; +-- +2.39.3 + diff --git a/SOURCES/0013-Add-downstream-x86_64-versioned-pc-q35-machine-types.patch b/SOURCES/0013-Add-downstream-x86_64-versioned-pc-q35-machine-types.patch new file mode 100644 index 0000000..18058b2 --- /dev/null +++ b/SOURCES/0013-Add-downstream-x86_64-versioned-pc-q35-machine-types.patch @@ -0,0 +1,695 @@ +From c8510c21f0fde361d6cbce81bfb2f4acb6941b58 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= +Date: Wed, 3 Jul 2024 13:44:41 +0100 +Subject: Add downstream x86_64 versioned 'pc' & 'q35' machine types + +Adding changes to add RHEL machine types for x86_64 architecture. + +Signed-off-by: Miroslav Rezanina +--- +Rebase notes (9.1.0 rc0): +- Merged pc_q35_machine_rhel_options back into + pc_q35_machine_options to reduce delta to upstream +- Convert to new DEFINE_(I440FX|Q35)_MACHINE macros + +Rebase notes (9.1.0 rc4): +- Moved x86 cpu deprecation note to device disable patch + +Merged patches (9.1.0 rc0): +- 043ad5ce97 Add upstream compatibility bits (partial) +--- + hw/i386/fw_cfg.c | 2 +- + hw/i386/pc.c | 159 ++++++++++++++++++++++++++++- + hw/i386/pc_piix.c | 102 ++++++++++++++++++- + hw/i386/pc_q35.c | 204 +++++++++++++++++++++++++++++++++++-- + include/hw/boards.h | 2 + + include/hw/i386/pc.h | 33 ++++++ + target/i386/kvm/kvm-cpu.c | 1 + + target/i386/kvm/kvm.c | 4 + + tests/qtest/pvpanic-test.c | 5 +- + 9 files changed, 499 insertions(+), 13 deletions(-) + +diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c +index 33ef280420..a322709ffa 100644 +--- a/hw/i386/fw_cfg.c ++++ b/hw/i386/fw_cfg.c +@@ -73,7 +73,7 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg, + + if (pcmc->smbios_defaults) { + /* These values are guest ABI, do not change */ +- smbios_set_defaults("QEMU", mc->desc, mc->name, ++ smbios_set_defaults("Red Hat", "KVM", mc->desc, + pcmc->smbios_stream_product, pcmc->smbios_stream_version); + } + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 7779c88a91..a49d346d2e 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -276,6 +276,161 @@ const size_t pc_compat_2_4_len = G_N_ELEMENTS(pc_compat_2_4); + */ + #define PC_FW_DATA (0x20000 + 0x8000) + ++/* This macro is for changes to properties that are RHEL specific, ++ * different to the current upstream and to be applied to the latest ++ * machine type. ++ */ ++GlobalProperty pc_rhel_compat[] = { ++ /* we don't support s3/s4 suspend */ ++ { "PIIX4_PM", "disable_s3", "1" }, ++ { "PIIX4_PM", "disable_s4", "1" }, ++ { "ICH9-LPC", "disable_s3", "1" }, ++ { "ICH9-LPC", "disable_s4", "1" }, ++ ++ { TYPE_X86_CPU, "host-phys-bits", "on" }, ++ { TYPE_X86_CPU, "host-phys-bits-limit", "48" }, ++ { TYPE_X86_CPU, "vmx-entry-load-perf-global-ctrl", "off" }, ++ { TYPE_X86_CPU, "vmx-exit-load-perf-global-ctrl", "off" }, ++ /* bz 1508330 */ ++ { "vfio-pci", "x-no-geforce-quirks", "on" }, ++ /* bz 1941397 */ ++ { TYPE_X86_CPU, "kvm-asyncpf-int", "on" }, ++}; ++const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_compat); ++ ++GlobalProperty pc_rhel_9_3_compat[] = { ++ /* pc_rhel_9_3_compat from pc_compat_8_0 */ ++ { "virtio-mem", "unplugged-inaccessible", "auto" }, ++}; ++const size_t pc_rhel_9_3_compat_len = G_N_ELEMENTS(pc_rhel_9_3_compat); ++ ++GlobalProperty pc_rhel_9_2_compat[] = { ++ /* pc_rhel_9_2_compat from pc_compat_7_2 */ ++ { "ICH9-LPC", "noreboot", "true" }, ++}; ++const size_t pc_rhel_9_2_compat_len = G_N_ELEMENTS(pc_rhel_9_2_compat); ++ ++GlobalProperty pc_rhel_9_0_compat[] = { ++ /* pc_rhel_9_0_compat from pc_compat_6_2 */ ++ { "virtio-mem", "unplugged-inaccessible", "off" }, ++}; ++const size_t pc_rhel_9_0_compat_len = G_N_ELEMENTS(pc_rhel_9_0_compat); ++ ++GlobalProperty pc_rhel_8_5_compat[] = { ++ /* pc_rhel_8_5_compat from pc_compat_6_0 */ ++ { "qemu64" "-" TYPE_X86_CPU, "family", "6" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_0 */ ++ { "qemu64" "-" TYPE_X86_CPU, "model", "6" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_0 */ ++ { "qemu64" "-" TYPE_X86_CPU, "stepping", "3" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_0 */ ++ { TYPE_X86_CPU, "x-vendor-cpuid-only", "off" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_0 */ ++ { "ICH9-LPC", ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, "off" }, ++ ++ /* pc_rhel_8_5_compat from pc_compat_6_1 */ ++ { TYPE_X86_CPU, "hv-version-id-build", "0x1bbc" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_1 */ ++ { TYPE_X86_CPU, "hv-version-id-major", "0x0006" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_1 */ ++ { TYPE_X86_CPU, "hv-version-id-minor", "0x0001" }, ++}; ++const size_t pc_rhel_8_5_compat_len = G_N_ELEMENTS(pc_rhel_8_5_compat); ++ ++GlobalProperty pc_rhel_8_4_compat[] = { ++ /* pc_rhel_8_4_compat from pc_compat_5_2 */ ++ { "ICH9-LPC", "x-smi-cpu-hotunplug", "off" }, ++ { TYPE_X86_CPU, "kvm-asyncpf-int", "off" }, ++}; ++const size_t pc_rhel_8_4_compat_len = G_N_ELEMENTS(pc_rhel_8_4_compat); ++ ++GlobalProperty pc_rhel_8_3_compat[] = { ++ /* pc_rhel_8_3_compat from pc_compat_5_1 */ ++ { "ICH9-LPC", "x-smi-cpu-hotplug", "off" }, ++}; ++const size_t pc_rhel_8_3_compat_len = G_N_ELEMENTS(pc_rhel_8_3_compat); ++ ++GlobalProperty pc_rhel_8_2_compat[] = { ++ /* pc_rhel_8_2_compat from pc_compat_4_2 */ ++ { "mch", "smbase-smram", "off" }, ++}; ++const size_t pc_rhel_8_2_compat_len = G_N_ELEMENTS(pc_rhel_8_2_compat); ++ ++/* pc_rhel_8_1_compat is empty since pc_4_1_compat is */ ++GlobalProperty pc_rhel_8_1_compat[] = { }; ++const size_t pc_rhel_8_1_compat_len = G_N_ELEMENTS(pc_rhel_8_1_compat); ++ ++GlobalProperty pc_rhel_8_0_compat[] = { ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "intel-iommu", "dma-drain", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G3" "-" TYPE_X86_CPU, "rdtscp", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G4" "-" TYPE_X86_CPU, "rdtscp", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G4" "-" TYPE_X86_CPU, "npt", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G4" "-" TYPE_X86_CPU, "nrip-save", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G5" "-" TYPE_X86_CPU, "rdtscp", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G5" "-" TYPE_X86_CPU, "npt", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G5" "-" TYPE_X86_CPU, "nrip-save", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "EPYC" "-" TYPE_X86_CPU, "npt", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "EPYC" "-" TYPE_X86_CPU, "nrip-save", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "EPYC-IBPB" "-" TYPE_X86_CPU, "npt", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "EPYC-IBPB" "-" TYPE_X86_CPU, "nrip-save", "off" }, ++ /** The mpx=on entries from pc_compat_3_1 are in pc_rhel_7_6_compat **/ ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Cascadelake-Server" "-" TYPE_X86_CPU, "stepping", "5" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { TYPE_X86_CPU, "x-intel-pt-auto-level", "off" }, ++}; ++const size_t pc_rhel_8_0_compat_len = G_N_ELEMENTS(pc_rhel_8_0_compat); ++ ++/* Similar to PC_COMPAT_3_0 + PC_COMPAT_2_12, but: ++ * all of the 2_12 stuff was already in 7.6 from bz 1481253 ++ * x-migrate-smi-count comes from PC_COMPAT_2_11 but ++ * is really tied to kernel version so keep it off on 7.x ++ * machine types irrespective of host. ++ */ ++GlobalProperty pc_rhel_7_6_compat[] = { ++ /* pc_rhel_7_6_compat from pc_compat_3_0 */ ++ { TYPE_X86_CPU, "x-hv-synic-kvm-only", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_3_0 */ ++ { "Skylake-Server" "-" TYPE_X86_CPU, "pku", "off" }, ++ /* pc_rhel_7_6_compat from pc_compat_3_0 */ ++ { "Skylake-Server-IBRS" "-" TYPE_X86_CPU, "pku", "off" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { TYPE_X86_CPU, "x-migrate-smi-count", "off" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Skylake-Client" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Skylake-Client-IBRS" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Skylake-Server" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Skylake-Server-IBRS" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Cascadelake-Server" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Icelake-Client" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Icelake-Server" "-" TYPE_X86_CPU, "mpx", "on" }, ++}; ++const size_t pc_rhel_7_6_compat_len = G_N_ELEMENTS(pc_rhel_7_6_compat); ++ ++/* ++ * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine ++ * types as the PC_COMPAT_* do for upstream types. ++ * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types. ++ */ ++ + GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled) + { + GSIState *s; +@@ -1767,6 +1922,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) + pcmc->kvmclock_create_always = true; + x86mc->apic_xrupt_override = true; + assert(!mc->get_hotplug_handler); ++ mc->async_pf_vmexit_disable = false; + mc->get_hotplug_handler = pc_get_hotplug_handler; + mc->hotplug_allowed = pc_hotplug_allowed; + mc->auto_enable_numa_with_memhp = true; +@@ -1774,7 +1930,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) + mc->has_hotpluggable_cpus = true; + mc->default_boot_order = "cad"; + mc->block_default_type = IF_IDE; +- mc->max_cpus = 255; ++ /* 240: max CPU count for RHEL */ ++ mc->max_cpus = 240; + mc->reset = pc_machine_reset; + mc->wakeup = pc_machine_wakeup; + hc->pre_plug = pc_machine_device_pre_plug_cb; +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 67107b174a..5535e1ffbf 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -52,6 +52,7 @@ + #include "qapi/error.h" + #include "qemu/error-report.h" + #include "sysemu/xen.h" ++#include "migration/migration.h" + #ifdef CONFIG_XEN + #include + #include "hw/xen/xen_pt.h" +@@ -445,8 +446,8 @@ static void pc_i440fx_init(MachineState *machine) + pc_init1(machine, TYPE_I440FX_PCI_DEVICE); + } + +-#define DEFINE_I440FX_MACHINE(major, minor) \ +- DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, major, minor); ++#define DEFINE_I440FX_MACHINE(major, minor, micro) \ ++ DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, major, minor, micro); + + #if 0 /* Disabled for Red Hat Enterprise Linux */ + static void pc_i440fx_machine_options(MachineClass *m) +@@ -826,3 +827,100 @@ static void xenfv_machine_3_1_options(MachineClass *m) + DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init, + xenfv_machine_3_1_options); + #endif ++ ++/* Red Hat Enterprise Linux machine types */ ++ ++/* Options for the latest rhel7 machine type */ ++static void pc_machine_rhel7_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ m->family = "pc_piix_Y"; ++ m->default_machine_opts = "firmware=bios-256k.bin,hpet=off"; ++ pcmc->pci_root_uid = 0; ++ m->default_nic = "e1000"; ++ m->default_display = "std"; ++ m->no_parallel = 1; ++ m->numa_mem_supported = true; ++ m->auto_enable_numa_with_memdev = false; ++ machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE); ++ compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len); ++ m->alias = "pc"; ++ m->is_default = 1; ++ m->smp_props.prefer_sockets = true; ++} ++ ++static void pc_i440fx_rhel_machine_7_6_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ ObjectClass *oc = OBJECT_CLASS(m); ++ pc_machine_rhel7_options(m); ++ m->desc = "RHEL 7.6.0 PC (i440FX + PIIX, 1996)"; ++ m->async_pf_vmexit_disable = true; ++ m->smbus_no_migration_support = true; ++ ++ pcmc->pvh_enabled = false; ++ pcmc->default_cpu_version = CPU_VERSION_LEGACY; ++ pcmc->kvmclock_create_always = false; ++ /* From pc_i440fx_5_1_machine_options() */ ++ pcmc->pci_root_uid = 1; ++ /* From pc_i440fx_7_0_machine_options() */ ++ pcmc->enforce_amd_1tb_hole = false; ++ /* From pc_i440fx_8_0_machine_options() */ ++ pcmc->default_smbios_ep_type = SMBIOS_ENTRY_POINT_TYPE_32; ++ /* From pc_i440fx_8_1_machine_options() */ ++ pcmc->broken_32bit_mem_addr_check = true; ++ /* Introduced in QEMU 8.2 */ ++ pcmc->default_south_bridge = TYPE_PIIX3_DEVICE; ++ ++ object_class_property_add_enum(oc, "x-south-bridge", "PCSouthBridgeOption", ++ &PCSouthBridgeOption_lookup, ++ pc_get_south_bridge, ++ pc_set_south_bridge); ++ object_class_property_set_description(oc, "x-south-bridge", ++ "Use a different south bridge than PIIX3"); ++ ++ compat_props_add(m->compat_props, hw_compat_rhel_9_5, ++ hw_compat_rhel_9_5_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_9_4, ++ hw_compat_rhel_9_4_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_9_3, ++ hw_compat_rhel_9_3_len); ++ compat_props_add(m->compat_props, pc_rhel_9_3_compat, ++ pc_rhel_9_3_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_9_2, ++ hw_compat_rhel_9_2_len); ++ compat_props_add(m->compat_props, pc_rhel_9_2_compat, ++ pc_rhel_9_2_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_9_1, ++ hw_compat_rhel_9_1_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_9_0, ++ hw_compat_rhel_9_0_len); ++ compat_props_add(m->compat_props, pc_rhel_9_0_compat, ++ pc_rhel_9_0_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_6, ++ hw_compat_rhel_8_6_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_5, ++ hw_compat_rhel_8_5_len); ++ compat_props_add(m->compat_props, pc_rhel_8_5_compat, ++ pc_rhel_8_5_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_4, ++ hw_compat_rhel_8_4_len); ++ compat_props_add(m->compat_props, pc_rhel_8_4_compat, ++ pc_rhel_8_4_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_3, ++ hw_compat_rhel_8_3_len); ++ compat_props_add(m->compat_props, pc_rhel_8_3_compat, ++ pc_rhel_8_3_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_2, ++ hw_compat_rhel_8_2_len); ++ compat_props_add(m->compat_props, pc_rhel_8_2_compat, ++ pc_rhel_8_2_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len); ++ compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len); ++ compat_props_add(m->compat_props, pc_rhel_8_0_compat, pc_rhel_8_0_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len); ++ compat_props_add(m->compat_props, pc_rhel_7_6_compat, pc_rhel_7_6_compat_len); ++} ++ ++DEFINE_I440FX_MACHINE(7, 6, 0); +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 5fb283f2df..2ca9ff3747 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -338,20 +338,19 @@ static void pc_q35_machine_options(MachineClass *m) + pcmc->pci_root_uid = 0; + pcmc->default_cpu_version = 1; + +- m->family = "pc_q35"; +- m->desc = "Standard PC (Q35 + ICH9, 2009)"; ++ m->family = "pc_q35_Z"; + m->units_per_default_bus = 1; +- m->default_machine_opts = "firmware=bios-256k.bin"; ++ m->default_machine_opts = "firmware=bios-256k.bin,hpet=off"; + m->default_display = "std"; + m->default_nic = "e1000e"; +- m->default_kernel_irqchip_split = false; + m->no_floppy = 1; +- m->max_cpus = 4096; +- m->no_parallel = !module_object_class_by_name(TYPE_ISA_PARALLEL); ++ m->max_cpus = 710; ++ m->no_parallel = 1; + machine_class_allow_dynamic_sysbus_dev(m, TYPE_AMD_IOMMU_DEVICE); + machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE); + machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE); +- machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); ++ m->alias = "q35"; ++ compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len); + compat_props_add(m->compat_props, + pc_q35_compat_defaults, pc_q35_compat_defaults_len); + } +@@ -670,3 +669,194 @@ static void pc_q35_machine_2_4_options(MachineClass *m) + + DEFINE_Q35_MACHINE(2, 4); + #endif /* Disabled for Red Hat Enterprise Linux */ ++ ++/* Red Hat Enterprise Linux machine types */ ++ ++static void pc_q35_rhel_machine_9_4_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_options(m); ++ m->desc = "RHEL-9.4.0 PC (Q35 + ICH9, 2009)"; ++ pcmc->smbios_stream_product = "RHEL"; ++ pcmc->smbios_stream_version = "9.4.0"; ++ ++ compat_props_add(m->compat_props, hw_compat_rhel_9_5, ++ hw_compat_rhel_9_5_len); ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(9, 4, 0); ++ ++static void pc_q35_rhel_machine_9_2_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_rhel_machine_9_4_0_options(m); ++ m->desc = "RHEL-9.2.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ pcmc->smbios_stream_product = "RHEL"; ++ pcmc->smbios_stream_version = "9.2.0"; ++ ++ /* From pc_q35_8_0_machine_options() */ ++ pcmc->default_smbios_ep_type = SMBIOS_ENTRY_POINT_TYPE_32; ++ /* From pc_q35_8_1_machine_options() */ ++ pcmc->broken_32bit_mem_addr_check = true; ++ ++ compat_props_add(m->compat_props, hw_compat_rhel_9_4, ++ hw_compat_rhel_9_4_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_9_3, ++ hw_compat_rhel_9_3_len); ++ compat_props_add(m->compat_props, pc_rhel_9_3_compat, ++ pc_rhel_9_3_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_9_2, ++ hw_compat_rhel_9_2_len); ++ compat_props_add(m->compat_props, pc_rhel_9_2_compat, ++ pc_rhel_9_2_compat_len); ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(9, 2, 0); ++ ++static void pc_q35_rhel_machine_9_0_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_rhel_machine_9_2_0_options(m); ++ m->desc = "RHEL-9.0.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ pcmc->smbios_stream_product = "RHEL"; ++ pcmc->smbios_stream_version = "9.0.0"; ++ pcmc->enforce_amd_1tb_hole = false; ++ compat_props_add(m->compat_props, hw_compat_rhel_9_1, ++ hw_compat_rhel_9_1_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_9_0, ++ hw_compat_rhel_9_0_len); ++ compat_props_add(m->compat_props, pc_rhel_9_0_compat, ++ pc_rhel_9_0_compat_len); ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(9, 0, 0); ++ ++static void pc_q35_rhel_machine_8_6_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_rhel_machine_9_0_0_options(m); ++ m->desc = "RHEL-8.6.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ ++ pcmc->smbios_stream_product = "RHEL-AV"; ++ pcmc->smbios_stream_version = "8.6.0"; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_6, ++ hw_compat_rhel_8_6_len); ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(8, 6, 0); ++ ++static void pc_q35_rhel_machine_8_5_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_rhel_machine_8_6_0_options(m); ++ m->desc = "RHEL-8.5.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ pcmc->smbios_stream_product = "RHEL-AV"; ++ pcmc->smbios_stream_version = "8.5.0"; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_5, ++ hw_compat_rhel_8_5_len); ++ compat_props_add(m->compat_props, pc_rhel_8_5_compat, ++ pc_rhel_8_5_compat_len); ++ m->smp_props.prefer_sockets = true; ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(8, 5, 0); ++ ++static void pc_q35_rhel_machine_8_4_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_rhel_machine_8_5_0_options(m); ++ m->desc = "RHEL-8.4.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ pcmc->smbios_stream_product = "RHEL-AV"; ++ pcmc->smbios_stream_version = "8.4.0"; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_4, ++ hw_compat_rhel_8_4_len); ++ compat_props_add(m->compat_props, pc_rhel_8_4_compat, ++ pc_rhel_8_4_compat_len); ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(8, 4, 0); ++ ++static void pc_q35_rhel_machine_8_3_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_rhel_machine_8_4_0_options(m); ++ m->desc = "RHEL-8.3.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ pcmc->smbios_stream_product = "RHEL-AV"; ++ pcmc->smbios_stream_version = "8.3.0"; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_3, ++ hw_compat_rhel_8_3_len); ++ compat_props_add(m->compat_props, pc_rhel_8_3_compat, ++ pc_rhel_8_3_compat_len); ++ /* From pc_q35_5_1_machine_options() */ ++ pcmc->kvmclock_create_always = false; ++ /* From pc_q35_5_1_machine_options() */ ++ pcmc->pci_root_uid = 1; ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(8, 3, 0); ++ ++static void pc_q35_rhel_machine_8_2_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_rhel_machine_8_3_0_options(m); ++ m->desc = "RHEL-8.2.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ m->numa_mem_supported = true; ++ m->auto_enable_numa_with_memdev = false; ++ pcmc->smbios_stream_product = "RHEL-AV"; ++ pcmc->smbios_stream_version = "8.2.0"; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_2, ++ hw_compat_rhel_8_2_len); ++ compat_props_add(m->compat_props, pc_rhel_8_2_compat, ++ pc_rhel_8_2_compat_len); ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(8, 2, 0); ++ ++static void pc_q35_rhel_machine_8_1_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_rhel_machine_8_2_0_options(m); ++ m->desc = "RHEL-8.1.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ pcmc->smbios_stream_product = NULL; ++ pcmc->smbios_stream_version = NULL; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len); ++ compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len); ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(8, 1, 0); ++ ++static void pc_q35_rhel_machine_8_0_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_rhel_machine_8_1_0_options(m); ++ m->desc = "RHEL-8.0.0 PC (Q35 + ICH9, 2009)"; ++ m->smbus_no_migration_support = true; ++ m->alias = NULL; ++ pcmc->pvh_enabled = false; ++ pcmc->default_cpu_version = CPU_VERSION_LEGACY; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len); ++ compat_props_add(m->compat_props, pc_rhel_8_0_compat, pc_rhel_8_0_compat_len); ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(8, 0, 0); ++ ++static void pc_q35_rhel_machine_7_6_0_options(MachineClass *m) ++{ ++ pc_q35_rhel_machine_8_0_0_options(m); ++ m->alias = NULL; ++ m->desc = "RHEL-7.6.0 PC (Q35 + ICH9, 2009)"; ++ m->async_pf_vmexit_disable = true; ++ compat_props_add(m->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len); ++ compat_props_add(m->compat_props, pc_rhel_7_6_compat, pc_rhel_7_6_compat_len); ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(7, 6, 0); ++ +diff --git a/include/hw/boards.h b/include/hw/boards.h +index fd5a957cad..3dea5cee73 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -289,6 +289,8 @@ struct MachineClass { + strList *allowed_dynamic_sysbus_devices; + bool auto_enable_numa_with_memhp; + bool auto_enable_numa_with_memdev; ++ /* RHEL only */ ++ bool async_pf_vmexit_disable; + bool ignore_boot_device_suffixes; + bool smbus_no_migration_support; + bool nvdimm_supported; +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 8776a3c937..8e9597f40f 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -302,6 +302,39 @@ extern const size_t pc_compat_2_4_len; + extern GlobalProperty pc_compat_2_3[]; + extern const size_t pc_compat_2_3_len; + ++extern GlobalProperty pc_rhel_compat[]; ++extern const size_t pc_rhel_compat_len; ++ ++extern GlobalProperty pc_rhel_9_3_compat[]; ++extern const size_t pc_rhel_9_3_compat_len; ++ ++extern GlobalProperty pc_rhel_9_2_compat[]; ++extern const size_t pc_rhel_9_2_compat_len; ++ ++extern GlobalProperty pc_rhel_9_0_compat[]; ++extern const size_t pc_rhel_9_0_compat_len; ++ ++extern GlobalProperty pc_rhel_8_5_compat[]; ++extern const size_t pc_rhel_8_5_compat_len; ++ ++extern GlobalProperty pc_rhel_8_4_compat[]; ++extern const size_t pc_rhel_8_4_compat_len; ++ ++extern GlobalProperty pc_rhel_8_3_compat[]; ++extern const size_t pc_rhel_8_3_compat_len; ++ ++extern GlobalProperty pc_rhel_8_2_compat[]; ++extern const size_t pc_rhel_8_2_compat_len; ++ ++extern GlobalProperty pc_rhel_8_1_compat[]; ++extern const size_t pc_rhel_8_1_compat_len; ++ ++extern GlobalProperty pc_rhel_8_0_compat[]; ++extern const size_t pc_rhel_8_0_compat_len; ++ ++extern GlobalProperty pc_rhel_7_6_compat[]; ++extern const size_t pc_rhel_7_6_compat_len; ++ + #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \ + static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ + { \ +diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c +index 6bf8dcfc60..684e731cbc 100644 +--- a/target/i386/kvm/kvm-cpu.c ++++ b/target/i386/kvm/kvm-cpu.c +@@ -178,6 +178,7 @@ static PropValue kvm_default_props[] = { + { "acpi", "off" }, + { "monitor", "off" }, + { "svm", "off" }, ++ { "kvm-pv-unhalt", "on" }, + { NULL, NULL }, + }; + +diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c +index 2fa88ef1e3..2b28c18693 100644 +--- a/target/i386/kvm/kvm.c ++++ b/target/i386/kvm/kvm.c +@@ -4244,6 +4244,7 @@ static int kvm_get_msrs(X86CPU *cpu) + struct kvm_msr_entry *msrs = cpu->kvm_msr_buf->entries; + int ret, i; + uint64_t mtrr_top_bits; ++ MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); + + kvm_msr_buf_reset(cpu); + +@@ -4636,6 +4637,9 @@ static int kvm_get_msrs(X86CPU *cpu) + break; + case MSR_KVM_ASYNC_PF_EN: + env->async_pf_en_msr = msrs[i].data; ++ if (mc->async_pf_vmexit_disable) { ++ env->async_pf_en_msr &= ~(1ULL << 2); ++ } + break; + case MSR_KVM_ASYNC_PF_INT: + env->async_pf_int_msr = msrs[i].data; +diff --git a/tests/qtest/pvpanic-test.c b/tests/qtest/pvpanic-test.c +index d49d2ba931..c18f63e255 100644 +--- a/tests/qtest/pvpanic-test.c ++++ b/tests/qtest/pvpanic-test.c +@@ -18,7 +18,7 @@ static void test_panic_nopause(void) + QDict *response, *data; + QTestState *qts; + +- qts = qtest_init("-device pvpanic -action panic=none"); ++ qts = qtest_init("-M q35 -device pvpanic -action panic=none"); + + val = qtest_inb(qts, 0x505); + g_assert_cmpuint(val, ==, PVPANIC_EVENTS); +@@ -41,7 +41,8 @@ static void test_panic(void) + QDict *response, *data; + QTestState *qts; + +- qts = qtest_init("-device pvpanic -action panic=pause"); ++ /* RHEL: Use q35 */ ++ qts = qtest_init("-M q35 -device pvpanic -action panic=pause"); + + val = qtest_inb(qts, 0x505); + g_assert_cmpuint(val, ==, PVPANIC_EVENTS); +-- +2.39.3 + diff --git a/SOURCES/0014-Revert-meson-temporarily-disable-Wunused-function.patch b/SOURCES/0014-Revert-meson-temporarily-disable-Wunused-function.patch new file mode 100644 index 0000000..426e39f --- /dev/null +++ b/SOURCES/0014-Revert-meson-temporarily-disable-Wunused-function.patch @@ -0,0 +1,32 @@ +From bd6f1170d3a011c475ec4a8315512c7c190de3e4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= +Date: Wed, 3 Jul 2024 13:47:04 +0100 +Subject: Revert "meson: temporarily disable -Wunused-function" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit c682111eaa73d9b985187b8be330338f50b78a7a. + +No longer needed after introduction of downstream machines. + +Signed-off-by: Daniel P. Berrangé +--- + meson.build | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 2de5ab024f..b3529aa0e1 100644 +--- a/meson.build ++++ b/meson.build +@@ -651,7 +651,6 @@ warn_flags = [ + '-Wno-string-plus-int', + '-Wno-tautological-type-limit-compare', + '-Wno-typedef-redefinition', +- '-Wno-unused-function', + ] + + if host_os != 'darwin' +-- +2.39.3 + diff --git a/SOURCES/0015-Enable-make-check.patch b/SOURCES/0015-Enable-make-check.patch new file mode 100644 index 0000000..5c5ebc1 --- /dev/null +++ b/SOURCES/0015-Enable-make-check.patch @@ -0,0 +1,252 @@ +From 3c4bab07566d32859e227ca1083b0dc64111e3f7 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 2 Sep 2020 09:39:41 +0200 +Subject: Enable make check + +Fixing tests after device disabling and machine types changes and enabling +make check run during build. + +Signed-off-by: Miroslav Rezanina + +--- +Rebase notes (9.1.0 rc0): +- Disable fdc-testa + +Rebase notes (9.1.0 rc0): +- Use q35 machine type for new pvpanic test +--- + .distro/qemu-kvm.spec.template | 4 ++-- + tests/avocado/replay_kernel.py | 2 +- + tests/avocado/reverse_debugging.py | 2 +- + tests/avocado/tcg_plugins.py | 4 ++-- + tests/qemu-iotests/meson.build | 34 ++++++++++++++--------------- + tests/qemu-iotests/testenv.py | 3 +++ + tests/qtest/fuzz-e1000e-test.c | 2 +- + tests/qtest/fuzz-virtio-scsi-test.c | 2 +- + tests/qtest/intel-hda-test.c | 2 +- + tests/qtest/libqos/meson.build | 2 +- + tests/qtest/lpc-ich9-test.c | 2 +- + tests/qtest/meson.build | 3 +-- + tests/qtest/pvpanic-test.c | 2 +- + tests/qtest/virtio-net-failover.c | 1 + + 14 files changed, 34 insertions(+), 31 deletions(-) + +diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py +index e22c200a36..cb7ca19b1b 100644 +--- a/tests/avocado/replay_kernel.py ++++ b/tests/avocado/replay_kernel.py +@@ -193,7 +193,7 @@ def test_aarch64_virt(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt +- :avocado: tags=cpu:cortex-a53 ++ :avocado: tags=cpu:cortex-a57 + """ + kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora' + '/linux/releases/29/Everything/aarch64/os/images/pxeboot' +diff --git a/tests/avocado/reverse_debugging.py b/tests/avocado/reverse_debugging.py +index f24287cd0a..3880b81df6 100644 +--- a/tests/avocado/reverse_debugging.py ++++ b/tests/avocado/reverse_debugging.py +@@ -228,7 +228,7 @@ def test_aarch64_virt(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt +- :avocado: tags=cpu:cortex-a53 ++ :avocado: tags=cpu:cortex-a57 + """ + kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora' + '/linux/releases/29/Everything/aarch64/os/images/pxeboot' +diff --git a/tests/avocado/tcg_plugins.py b/tests/avocado/tcg_plugins.py +index a6ff457e27..5172ee9b9e 100644 +--- a/tests/avocado/tcg_plugins.py ++++ b/tests/avocado/tcg_plugins.py +@@ -66,7 +66,7 @@ def test_aarch64_virt_insn(self): + :avocado: tags=accel:tcg + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt +- :avocado: tags=cpu:cortex-a53 ++ :avocado: tags=cpu:cortex-a57 + """ + kernel_path = self._grab_aarch64_kernel() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + +@@ -96,7 +96,7 @@ def test_aarch64_virt_insn_icount(self): + :avocado: tags=accel:tcg + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt +- :avocado: tags=cpu:cortex-a53 ++ :avocado: tags=cpu:cortex-a57 + """ + kernel_path = self._grab_aarch64_kernel() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + +diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build +index fad340ad59..3c0d5241f6 100644 +--- a/tests/qemu-iotests/meson.build ++++ b/tests/qemu-iotests/meson.build +@@ -51,21 +51,21 @@ foreach format, speed: qemu_iotests_formats + check: true, + ) + +- foreach item: rc.stdout().strip().split() +- args = [qemu_iotests_check_cmd, +- '-tap', '-' + format, item, +- '--source-dir', meson.current_source_dir(), +- '--build-dir', meson.current_build_dir()] +- # Some individual tests take as long as 45 seconds +- # Bump the timeout to 3 minutes for some headroom +- # on slow machines to minimize spurious failures +- test('io-' + format + '-' + item, +- python, +- args: args, +- depends: qemu_iotests_binaries, +- env: qemu_iotests_env, +- protocol: 'tap', +- timeout: 180, +- suite: suites) +- endforeach ++# foreach item: rc.stdout().strip().split() ++# args = [qemu_iotests_check_cmd, ++# '-tap', '-' + format, item, ++# '--source-dir', meson.current_source_dir(), ++# '--build-dir', meson.current_build_dir()] ++# # Some individual tests take as long as 45 seconds ++# # Bump the timeout to 3 minutes for some headroom ++# # on slow machines to minimize spurious failures ++# test('io-' + format + '-' + item, ++# python, ++# args: args, ++# depends: qemu_iotests_binaries, ++# env: qemu_iotests_env, ++# protocol: 'tap', ++# timeout: 180, ++# suite: suites) ++# endforeach + endforeach +diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py +index c8848f2ec2..d515e5b8b0 100644 +--- a/tests/qemu-iotests/testenv.py ++++ b/tests/qemu-iotests/testenv.py +@@ -249,6 +249,9 @@ def __init__(self, source_dir: str, build_dir: str, + if self.qemu_prog.endswith(f'qemu-system-{suffix}'): + self.qemu_options += f' -machine {machine}' + ++ if self.qemu_prog.endswith('qemu-system-x86_64'): ++ self.qemu_options += ' -cpu Nehalem' ++ + # QEMU_DEFAULT_MACHINE + self.qemu_default_machine = get_default_machine(self.qemu_prog) + +diff --git a/tests/qtest/fuzz-e1000e-test.c b/tests/qtest/fuzz-e1000e-test.c +index 5052883fb6..8242190170 100644 +--- a/tests/qtest/fuzz-e1000e-test.c ++++ b/tests/qtest/fuzz-e1000e-test.c +@@ -17,7 +17,7 @@ static void test_lp1879531_eth_get_rss_ex_dst_addr(void) + { + QTestState *s; + +- s = qtest_init("-nographic -monitor none -serial none -M pc-q35-5.0"); ++ s = qtest_init("-nographic -monitor none -serial none -M pc-q35-rhel9.4.0"); + + qtest_outl(s, 0xcf8, 0x80001010); + qtest_outl(s, 0xcfc, 0xe1020000); +diff --git a/tests/qtest/fuzz-virtio-scsi-test.c b/tests/qtest/fuzz-virtio-scsi-test.c +index e37b48b2cc..9f1965b530 100644 +--- a/tests/qtest/fuzz-virtio-scsi-test.c ++++ b/tests/qtest/fuzz-virtio-scsi-test.c +@@ -19,7 +19,7 @@ static void test_mmio_oob_from_memory_region_cache(void) + { + QTestState *s; + +- s = qtest_init("-M pc-q35-5.2 -m 512M " ++ s = qtest_init("-M pc-q35-rhel9.4.0 -m 512M " + "-device virtio-scsi,num_queues=8,addr=03.0 "); + + qtest_outl(s, 0xcf8, 0x80001811); +diff --git a/tests/qtest/intel-hda-test.c b/tests/qtest/intel-hda-test.c +index 663bb6c485..2efc43e3f7 100644 +--- a/tests/qtest/intel-hda-test.c ++++ b/tests/qtest/intel-hda-test.c +@@ -42,7 +42,7 @@ static void test_issue542_ich6(void) + { + QTestState *s; + +- s = qtest_init("-nographic -nodefaults -M pc-q35-6.2 " ++ s = qtest_init("-nographic -nodefaults -M pc-q35-rhel9.0.0 " + AUDIODEV + "-device intel-hda,id=" HDA_ID CODEC_DEVICES); + +diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build +index 1b2b2dbb22..86afbddb58 100644 +--- a/tests/qtest/libqos/meson.build ++++ b/tests/qtest/libqos/meson.build +@@ -44,7 +44,7 @@ libqos_srcs = files( + 'virtio-rng.c', + 'virtio-scsi.c', + 'virtio-serial.c', +- 'virtio-iommu.c', ++# 'virtio-iommu.c', + 'virtio-gpio.c', + 'virtio-scmi.c', + 'generic-pcihost.c', +diff --git a/tests/qtest/lpc-ich9-test.c b/tests/qtest/lpc-ich9-test.c +index 8ac95b89f7..0e118b76eb 100644 +--- a/tests/qtest/lpc-ich9-test.c ++++ b/tests/qtest/lpc-ich9-test.c +@@ -15,7 +15,7 @@ static void test_lp1878642_pci_bus_get_irq_level_assert(void) + { + QTestState *s; + +- s = qtest_init("-M pc-q35-5.0 " ++ s = qtest_init("-M pc-q35-rhel9.4.0 " + "-nographic -monitor none -serial none"); + + qtest_outl(s, 0xcf8, 0x8000f840); /* PMBASE */ +diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build +index 2f0d3ef080..134c48c10e 100644 +--- a/tests/qtest/meson.build ++++ b/tests/qtest/meson.build +@@ -91,7 +91,7 @@ qtests_i386 = \ + config_all_devices.has_key('CONFIG_PARALLEL') ? ['bios-tables-test'] : []) + \ + qtests_pci + \ + qtests_cxl + \ +- ['fdc-test', ++ [ + 'ide-test', + 'hd-geo-test', + 'boot-order-test', +@@ -102,7 +102,6 @@ qtests_i386 = \ + 'drive_del-test', + 'tco-test', + 'cpu-plug-test', +- 'q35-test', + 'vmgenid-test', + 'migration-test', + 'test-x86-cpuid-compat', +diff --git a/tests/qtest/pvpanic-test.c b/tests/qtest/pvpanic-test.c +index c18f63e255..57fb129ae4 100644 +--- a/tests/qtest/pvpanic-test.c ++++ b/tests/qtest/pvpanic-test.c +@@ -65,7 +65,7 @@ static void test_pvshutdown(void) + QDict *response, *data; + QTestState *qts; + +- qts = qtest_init("-device pvpanic"); ++ qts = qtest_init("-M q35 -device pvpanic"); + + val = qtest_inb(qts, 0x505); + g_assert_cmpuint(val, ==, PVPANIC_EVENTS); +diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c +index 73dfabc272..a9dd304781 100644 +--- a/tests/qtest/virtio-net-failover.c ++++ b/tests/qtest/virtio-net-failover.c +@@ -26,6 +26,7 @@ + #define PCI_SEL_BASE 0x0010 + + #define BASE_MACHINE "-M q35 -nodefaults " \ ++ "-global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=on " \ + "-device pcie-root-port,id=root0,addr=0x1,bus=pcie.0,chassis=1 " \ + "-device pcie-root-port,id=root1,addr=0x2,bus=pcie.0,chassis=2 " + +-- +2.39.3 + diff --git a/SOURCES/0016-vfio-cap-number-of-devices-that-can-be-assigned.patch b/SOURCES/0016-vfio-cap-number-of-devices-that-can-be-assigned.patch new file mode 100644 index 0000000..a492875 --- /dev/null +++ b/SOURCES/0016-vfio-cap-number-of-devices-that-can-be-assigned.patch @@ -0,0 +1,98 @@ +From 9813098fb73e899dd1d824f9c1e7e570a87b1771 Mon Sep 17 00:00:00 2001 +From: Bandan Das +Date: Tue, 3 Dec 2013 20:05:13 +0100 +Subject: vfio: cap number of devices that can be assigned + +Go through all groups to get count of total number of devices +active to enforce limit + +Reasoning from Alex for the limit(32) - Assuming 3 slots per +device, with 125 slots (number of memory slots for RHEL 7), +we can support almost 40 devices and still have few slots left +for other uses. Stepping down a bit, the number 32 arbitrarily +matches the number of slots on a PCI bus and is also a nice power +of two. + +Count of slots increased to 509 later so we could increase limit +to 64 as some usecases require more than 32 devices. + +Signed-off-by: Bandan Das +--- + hw/vfio/pci.c | 31 ++++++++++++++++++++++++++++++- + hw/vfio/pci.h | 1 + + 2 files changed, 31 insertions(+), 1 deletion(-) + +diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c +index 2407720c35..82a47edc89 100644 +--- a/hw/vfio/pci.c ++++ b/hw/vfio/pci.c +@@ -50,6 +50,9 @@ + /* Protected by BQL */ + static KVMRouteChange vfio_route_change; + ++/* RHEL only: Set once for the first assigned dev */ ++static uint16_t device_limit; ++ + static void vfio_disable_interrupts(VFIOPCIDevice *vdev); + static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled); + static void vfio_msi_disable_common(VFIOPCIDevice *vdev); +@@ -2963,10 +2966,33 @@ static void vfio_realize(PCIDevice *pdev, Error **errp) + ERRP_GUARD(); + VFIOPCIDevice *vdev = VFIO_PCI(pdev); + VFIODevice *vbasedev = &vdev->vbasedev; +- int i, ret; ++ int ret, i = 0; ++ VFIODevice *vbasedev_iter; ++ VFIOGroup *group; + char uuid[UUID_STR_LEN]; + g_autofree char *name = NULL; + ++ if (device_limit && device_limit != vdev->assigned_device_limit) { ++ error_setg(errp, "Assigned device limit has been redefined. " ++ "Old:%d, New:%d", ++ device_limit, vdev->assigned_device_limit); ++ return; ++ } else { ++ device_limit = vdev->assigned_device_limit; ++ } ++ ++ QLIST_FOREACH(group, &vfio_group_list, next) { ++ QLIST_FOREACH(vbasedev_iter, &group->device_list, next) { ++ i++; ++ } ++ } ++ ++ if (i >= vdev->assigned_device_limit) { ++ error_setg(errp, "Maximum supported vfio devices (%d) " ++ "already attached", vdev->assigned_device_limit); ++ return; ++ } ++ + if (vbasedev->fd < 0 && !vbasedev->sysfsdev) { + if (!(~vdev->host.domain || ~vdev->host.bus || + ~vdev->host.slot || ~vdev->host.function)) { +@@ -3388,6 +3414,9 @@ static Property vfio_pci_dev_properties[] = { + DEFINE_PROP_BOOL("x-no-kvm-msix", VFIOPCIDevice, no_kvm_msix, false), + DEFINE_PROP_BOOL("x-no-geforce-quirks", VFIOPCIDevice, + no_geforce_quirks, false), ++ /* RHEL only */ ++ DEFINE_PROP_UINT16("x-assigned-device-limit", VFIOPCIDevice, ++ assigned_device_limit, 64), + DEFINE_PROP_BOOL("x-no-kvm-ioeventfd", VFIOPCIDevice, no_kvm_ioeventfd, + false), + DEFINE_PROP_BOOL("x-no-vfio-ioeventfd", VFIOPCIDevice, no_vfio_ioeventfd, +diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h +index bf67df2fbc..0d3c93fb2e 100644 +--- a/hw/vfio/pci.h ++++ b/hw/vfio/pci.h +@@ -142,6 +142,7 @@ struct VFIOPCIDevice { + EventNotifier err_notifier; + EventNotifier req_notifier; + int (*resetfn)(struct VFIOPCIDevice *); ++ uint16_t assigned_device_limit; + uint32_t vendor_id; + uint32_t device_id; + uint32_t sub_vendor_id; +-- +2.39.3 + diff --git a/SOURCES/0017-Add-support-statement-to-help-output.patch b/SOURCES/0017-Add-support-statement-to-help-output.patch new file mode 100644 index 0000000..1d3cd3f --- /dev/null +++ b/SOURCES/0017-Add-support-statement-to-help-output.patch @@ -0,0 +1,46 @@ +From e46f7b696ec32b18969c9cd7c1553d7d30e489b3 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Wed, 4 Dec 2013 18:53:17 +0100 +Subject: Add support statement to -help output + +Add support statement to -help output, reporting direct qemu-kvm usage +as unsupported by Red Hat, and advising users to use libvirt instead. + +Signed-off-by: Eduardo Habkost +--- + system/vl.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/system/vl.c b/system/vl.c +index 01b8b8e77a..5359231bf5 100644 +--- a/system/vl.c ++++ b/system/vl.c +@@ -877,9 +877,17 @@ static void version(void) + QEMU_COPYRIGHT "\n"); + } + ++static void print_rh_warning(void) ++{ ++ printf("\nWARNING: Direct use of qemu-kvm from the command line is not supported by Red Hat.\n" ++ "WARNING: Use libvirt as the stable management interface.\n" ++ "WARNING: Some command line options listed here may not be available in future releases.\n\n"); ++} ++ + static void help(int exitcode) + { + version(); ++ print_rh_warning(); + printf("usage: %s [options] [disk_image]\n\n" + "'disk_image' is a raw hard disk image for IDE hard disk 0\n\n", + g_get_prgname()); +@@ -905,6 +913,7 @@ static void help(int exitcode) + "\n" + QEMU_HELP_BOTTOM "\n"); + ++ print_rh_warning(); + exit(exitcode); + } + +-- +2.39.3 + diff --git a/SOURCES/0018-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch b/SOURCES/0018-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch new file mode 100644 index 0000000..8226ee1 --- /dev/null +++ b/SOURCES/0018-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch @@ -0,0 +1,52 @@ +From 40274d161d20719709d92356077175f93795ea1e Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 8 Jul 2020 08:35:50 +0200 +Subject: Use qemu-kvm in documentation instead of qemu-system- + +We change the name and location of qemu-kvm binaries. Update documentation +to reflect this change. Only architectures available in RHEL are updated. + +Signed-off-by: Miroslav Rezanina +--- + docs/defs.rst.inc | 4 ++-- + qemu-options.hx | 10 +++++----- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/docs/defs.rst.inc b/docs/defs.rst.inc +index 52d6454b93..d74dbdeca9 100644 +--- a/docs/defs.rst.inc ++++ b/docs/defs.rst.inc +@@ -9,7 +9,7 @@ + but the manpages will end up misrendered with following normal text + incorrectly in boldface. + +-.. |qemu_system| replace:: qemu-system-x86_64 +-.. |qemu_system_x86| replace:: qemu-system-x86_64 ++.. |qemu_system| replace:: qemu-kvm ++.. |qemu_system_x86| replace:: qemu-kvm + .. |I2C| replace:: I\ :sup:`2`\ C + .. |I2S| replace:: I\ :sup:`2`\ S +diff --git a/qemu-options.hx b/qemu-options.hx +index d94e2cbbae..a7444abc7f 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -3688,11 +3688,11 @@ SRST + + :: + +- qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \ +- -numa node,memdev=mem \ +- -chardev socket,id=chr0,path=/path/to/socket \ +- -netdev type=vhost-user,id=net0,chardev=chr0 \ +- -device virtio-net-pci,netdev=net0 ++ qemu-kvm -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \ ++ -numa node,memdev=mem \ ++ -chardev socket,id=chr0,path=/path/to/socket \ ++ -netdev type=vhost-user,id=net0,chardev=chr0 \ ++ -device virtio-net-pci,netdev=net0 + + ``-netdev vhost-vdpa[,vhostdev=/path/to/dev][,vhostfd=h]`` + Establish a vhost-vdpa netdev. +-- +2.39.3 + diff --git a/SOURCES/0019-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch b/SOURCES/0019-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch new file mode 100644 index 0000000..ef84e7d --- /dev/null +++ b/SOURCES/0019-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch @@ -0,0 +1,58 @@ +From 728e3d8a124f4ec51c005ad6867270f3e60df16c Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Fri, 20 Aug 2021 18:25:12 +0200 +Subject: qcow2: Deprecation warning when opening v2 images rw + +qcow2 v3 has been around for a long time (since QEMU 1.1/RHEL 7), so +there is no real reason any more to use it. People still using it might +do so unintentionally. Warn about it and suggest upgrading during the +RHEL 9 timeframe so that the code can possibly be disabled in RHEL 10. + +The warning is restricted to read-write mode and the system emulator. +The primary motivation for not having it in qemu-img is that 'qemu-img +amend' for upgrades would warn otherwise. It also avoids having to make +too many changes to the test suite. + +bdrv_uses_whitelist() is used as a proxy for deciding whether we are +running in a tool or the system emulator. This is not entirely clean, +but it's what is available and the same function qcow2_do_open() already +uses it this way for another warning. + +Signed-off-by: Kevin Wolf +--- + block/qcow2.c | 6 ++++++ + tests/qemu-iotests/common.filter | 1 + + 2 files changed, 7 insertions(+) + +diff --git a/block/qcow2.c b/block/qcow2.c +index 70b19730a3..a4cffb628c 100644 +--- a/block/qcow2.c ++++ b/block/qcow2.c +@@ -1358,6 +1358,12 @@ qcow2_do_open(BlockDriverState *bs, QDict *options, int flags, + ret = -ENOTSUP; + goto fail; + } ++ if (header.version < 3 && !bdrv_is_read_only(bs) && bdrv_uses_whitelist()) { ++ warn_report_once("qcow2 v2 images are deprecated and may not be " ++ "supported in future versions. Please consider " ++ "upgrading the image with 'qemu-img amend " ++ "-o compat=v3'."); ++ } + + s->qcow_version = header.version; + +diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter +index fc3c64bcb8..4b238954d5 100644 +--- a/tests/qemu-iotests/common.filter ++++ b/tests/qemu-iotests/common.filter +@@ -83,6 +83,7 @@ _filter_qemu() + { + gsed -e "s#\\(^\\|(qemu) \\)$(basename $QEMU_PROG):#\1QEMU_PROG:#" \ + -e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monitor#' \ ++ -e "/qcow2 v2 images are deprecated/d" \ + -e $'s#\r##' # QEMU monitor uses \r\n line endings + } + +-- +2.39.3 + diff --git a/SOURCES/0021-Add-upstream-compatibility-bits.patch b/SOURCES/0021-Add-upstream-compatibility-bits.patch new file mode 100644 index 0000000..8f0de48 --- /dev/null +++ b/SOURCES/0021-Add-upstream-compatibility-bits.patch @@ -0,0 +1,109 @@ +From 03502faf7012e20fb7c4f1efee7e429ad3727fd1 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 15 May 2024 01:41:13 -0400 +Subject: Add upstream compatibility bits + +--- + hw/arm/virt.c | 1 + + hw/core/machine.c | 17 +++++++++++++++++ + hw/i386/pc_piix.c | 2 ++ + hw/i386/pc_q35.c | 2 ++ + hw/s390x/s390-virtio-ccw.c | 1 + + include/hw/boards.h | 3 +++ + 6 files changed, 26 insertions(+) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 903c0f2e9f..3374d3b0bc 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3582,6 +3582,7 @@ DEFINE_VIRT_MACHINE(2, 6) + + static void virt_rhel_machine_9_4_0_options(MachineClass *mc) + { ++ compat_props_add(mc->compat_props, hw_compat_rhel_10_0, hw_compat_rhel_10_0_len); + compat_props_add(mc->compat_props, hw_compat_rhel_9_5, hw_compat_rhel_9_5_len); + } + DEFINE_VIRT_MACHINE_AS_LATEST(9, 4, 0) +diff --git a/hw/core/machine.c b/hw/core/machine.c +index f7fed78e4b..9cf8242b32 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -311,6 +311,23 @@ const size_t hw_compat_2_1_len = G_N_ELEMENTS(hw_compat_2_1); + const char *rhel_old_machine_deprecation = + "machine types for previous major releases are deprecated"; + ++GlobalProperty hw_compat_rhel_10_0[] = { ++ /* hw_compat_rhel_10_0 from hw_compat_9_0 */ ++ {"arm-cpu", "backcompat-cntfrq", "true" }, ++ /* hw_compat_rhel_10_0 from hw_compat_9_0 */ ++ { "scsi-hd", "migrate-emulated-scsi-request", "false" }, ++ /* hw_compat_rhel_10_0 from hw_compat_9_0 */ ++ { "scsi-cd", "migrate-emulated-scsi-request", "false" }, ++ /* hw_compat_rhel_10_0 from hw_compat_9_0 */ ++ {"vfio-pci", "skip-vsc-check", "false" }, ++ /* hw_compat_rhel_10_0 from hw_compat_9_0 */ ++ { "virtio-pci", "x-pcie-pm-no-soft-reset", "off" }, ++ /* hw_compat_rhel_10_0 from hw_compat_9_0 */ ++ {"sd-card", "spec_version", "2" }, ++}; ++const size_t hw_compat_rhel_10_0_len = G_N_ELEMENTS(hw_compat_rhel_10_0); ++ ++ + GlobalProperty hw_compat_rhel_9_5[] = { + /* hw_compat_rhel_9_5 from hw_compat_8_2 */ + { "migration", "zero-page-detection", "legacy"}, +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 5535e1ffbf..447f98b438 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -879,6 +879,8 @@ static void pc_i440fx_rhel_machine_7_6_0_options(MachineClass *m) + object_class_property_set_description(oc, "x-south-bridge", + "Use a different south bridge than PIIX3"); + ++ compat_props_add(m->compat_props, hw_compat_rhel_10_0, ++ hw_compat_rhel_10_0_len); + compat_props_add(m->compat_props, hw_compat_rhel_9_5, + hw_compat_rhel_9_5_len); + compat_props_add(m->compat_props, hw_compat_rhel_9_4, +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 2ca9ff3747..849b231a74 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -680,6 +680,8 @@ static void pc_q35_rhel_machine_9_4_0_options(MachineClass *m) + pcmc->smbios_stream_product = "RHEL"; + pcmc->smbios_stream_version = "9.4.0"; + ++ compat_props_add(m->compat_props, hw_compat_rhel_10_0, ++ hw_compat_rhel_10_0_len); + compat_props_add(m->compat_props, hw_compat_rhel_9_5, + hw_compat_rhel_9_5_len); + } +diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c +index 451017c50e..5db5fed1bf 100644 +--- a/hw/s390x/s390-virtio-ccw.c ++++ b/hw/s390x/s390-virtio-ccw.c +@@ -1316,6 +1316,7 @@ static void ccw_rhel_machine_9_4_0_instance_options(MachineState *machine) + + static void ccw_rhel_machine_9_4_0_class_options(MachineClass *mc) + { ++ compat_props_add(mc->compat_props, hw_compat_rhel_10_0, hw_compat_rhel_10_0_len); + compat_props_add(mc->compat_props, hw_compat_rhel_9_5, hw_compat_rhel_9_5_len); + } + DEFINE_CCW_MACHINE_AS_LATEST(9, 4, 0); +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 3dea5cee73..6d98aaf4c7 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -802,6 +802,9 @@ extern const size_t hw_compat_2_2_len; + extern GlobalProperty hw_compat_2_1[]; + extern const size_t hw_compat_2_1_len; + ++extern GlobalProperty hw_compat_rhel_10_0[]; ++extern const size_t hw_compat_rhel_10_0_len; ++ + extern GlobalProperty hw_compat_rhel_9_5[]; + extern const size_t hw_compat_rhel_9_5_len; + +-- +2.39.3 + diff --git a/SOURCES/0022-redhat-Add-QEMU-9.1-compat-handling-to-the-s390x-mac.patch b/SOURCES/0022-redhat-Add-QEMU-9.1-compat-handling-to-the-s390x-mac.patch new file mode 100644 index 0000000..2353cc5 --- /dev/null +++ b/SOURCES/0022-redhat-Add-QEMU-9.1-compat-handling-to-the-s390x-mac.patch @@ -0,0 +1,37 @@ +From d27437e5baba347cb3392280399d402414dcb21c Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Mon, 26 Aug 2024 14:27:49 +0200 +Subject: redhat: Add QEMU 9.1 compat handling to the s390x machine types + +JIRA: https://issues.redhat.com/browse/RHEL-52319 + +Upstream changed the amount of information that is migrated for +the S390 interrupt controller (FLIC), so we have to switch on +a compatibility property for older machine types. + +Signed-off-by: Thomas Huth +--- + hw/s390x/s390-virtio-ccw.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c +index 5db5fed1bf..feef81ed8b 100644 +--- a/hw/s390x/s390-virtio-ccw.c ++++ b/hw/s390x/s390-virtio-ccw.c +@@ -1316,8 +1316,13 @@ static void ccw_rhel_machine_9_4_0_instance_options(MachineState *machine) + + static void ccw_rhel_machine_9_4_0_class_options(MachineClass *mc) + { ++ static GlobalProperty compat[] = { ++ { TYPE_QEMU_S390_FLIC, "migrate-all-state", "off", }, ++ }; ++ + compat_props_add(mc->compat_props, hw_compat_rhel_10_0, hw_compat_rhel_10_0_len); + compat_props_add(mc->compat_props, hw_compat_rhel_9_5, hw_compat_rhel_9_5_len); ++ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); + } + DEFINE_CCW_MACHINE_AS_LATEST(9, 4, 0); + +-- +2.39.3 + diff --git a/SOURCES/0023-redhat-Add-rhel9.6.0-and-rhel10.0.0-machine-types.patch b/SOURCES/0023-redhat-Add-rhel9.6.0-and-rhel10.0.0-machine-types.patch new file mode 100644 index 0000000..33b6f77 --- /dev/null +++ b/SOURCES/0023-redhat-Add-rhel9.6.0-and-rhel10.0.0-machine-types.patch @@ -0,0 +1,66 @@ +From 926a9d0ca2437b4c4270062f707ed24284ad469f Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Mon, 26 Aug 2024 14:42:24 +0200 +Subject: redhat: Add rhel9.6.0 and rhel10.0.0 machine types + +JIRA: https://issues.redhat.com/browse/RHEL-52319 + +Add a new machine types to enable the latest features by default. + +Signed-off-by: Thomas Huth +--- + hw/s390x/s390-virtio-ccw.c | 25 ++++++++++++++++++++++++- + 1 file changed, 24 insertions(+), 1 deletion(-) + +diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c +index feef81ed8b..b61392bac1 100644 +--- a/hw/s390x/s390-virtio-ccw.c ++++ b/hw/s390x/s390-virtio-ccw.c +@@ -1310,8 +1310,29 @@ DEFINE_CCW_MACHINE(2, 4); + #endif + #endif /* disabled for RHEL */ + ++static void ccw_rhel_machine_10_0_0_instance_options(MachineState *machine) ++{ ++} ++ ++static void ccw_rhel_machine_10_0_0_class_options(MachineClass *mc) ++{ ++} ++DEFINE_CCW_MACHINE_AS_LATEST(10, 0, 0); ++ ++static void ccw_rhel_machine_9_6_0_instance_options(MachineState *machine) ++{ ++ ccw_rhel_machine_10_0_0_instance_options(machine); ++} ++ ++static void ccw_rhel_machine_9_6_0_class_options(MachineClass *mc) ++{ ++ ccw_rhel_machine_10_0_0_class_options(mc); ++} ++DEFINE_CCW_MACHINE(9, 6, 0); ++ + static void ccw_rhel_machine_9_4_0_instance_options(MachineState *machine) + { ++ ccw_rhel_machine_9_6_0_instance_options(machine); + } + + static void ccw_rhel_machine_9_4_0_class_options(MachineClass *mc) +@@ -1320,11 +1341,13 @@ static void ccw_rhel_machine_9_4_0_class_options(MachineClass *mc) + { TYPE_QEMU_S390_FLIC, "migrate-all-state", "off", }, + }; + ++ ccw_rhel_machine_9_6_0_class_options(mc); ++ + compat_props_add(mc->compat_props, hw_compat_rhel_10_0, hw_compat_rhel_10_0_len); + compat_props_add(mc->compat_props, hw_compat_rhel_9_5, hw_compat_rhel_9_5_len); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); + } +-DEFINE_CCW_MACHINE_AS_LATEST(9, 4, 0); ++DEFINE_CCW_MACHINE(9, 4, 0); + + static void ccw_rhel_machine_9_2_0_instance_options(MachineState *machine) + { +-- +2.39.3 + diff --git a/SOURCES/0024-x86-ensure-compatibility-of-pc-q35-rhel9.patch b/SOURCES/0024-x86-ensure-compatibility-of-pc-q35-rhel9.patch new file mode 100644 index 0000000..b1e23de --- /dev/null +++ b/SOURCES/0024-x86-ensure-compatibility-of-pc-q35-rhel9.patch @@ -0,0 +1,28 @@ +From 6be70c681bf7a1b9666ed5896b5be8be7df2bf50 Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Wed, 4 Sep 2024 15:46:53 +0200 +Subject: x86: ensure compatibility of pc-q35-rhel9* + +Signed-off-by: Sebastian Ott +--- + hw/i386/pc_q35.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 849b231a74..a05df61cfc 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -680,6 +680,10 @@ static void pc_q35_rhel_machine_9_4_0_options(MachineClass *m) + pcmc->smbios_stream_product = "RHEL"; + pcmc->smbios_stream_version = "9.4.0"; + ++ /* From pc_q35_machine_9_0_options() */ ++ pcmc->isa_bios_alias = false; ++ m->smbios_memory_device_size = 16 * GiB; ++ + compat_props_add(m->compat_props, hw_compat_rhel_10_0, + hw_compat_rhel_10_0_len); + compat_props_add(m->compat_props, hw_compat_rhel_9_5, +-- +2.39.3 + diff --git a/SOURCES/0025-arm-ensure-compatibility-of-virt-rhel9.patch b/SOURCES/0025-arm-ensure-compatibility-of-virt-rhel9.patch new file mode 100644 index 0000000..2b95ffe --- /dev/null +++ b/SOURCES/0025-arm-ensure-compatibility-of-virt-rhel9.patch @@ -0,0 +1,27 @@ +From 17c3bccf2f2804772ab60bf4f04d7437f13ed48a Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Wed, 4 Sep 2024 15:52:00 +0200 +Subject: arm: ensure compatibility of virt-rhel9* + +Signed-off-by: Sebastian Ott +--- + hw/arm/virt.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 3374d3b0bc..31a71a7f45 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3582,6 +3582,9 @@ DEFINE_VIRT_MACHINE(2, 6) + + static void virt_rhel_machine_9_4_0_options(MachineClass *mc) + { ++ /* From virt_machine_9_0_options() */ ++ mc->smbios_memory_device_size = 16 * GiB; ++ + compat_props_add(mc->compat_props, hw_compat_rhel_10_0, hw_compat_rhel_10_0_len); + compat_props_add(mc->compat_props, hw_compat_rhel_9_5, hw_compat_rhel_9_5_len); + } +-- +2.39.3 + diff --git a/SOURCES/95-kvm-memlock.conf b/SOURCES/95-kvm-memlock.conf new file mode 100644 index 0000000..fc59dbe --- /dev/null +++ b/SOURCES/95-kvm-memlock.conf @@ -0,0 +1,10 @@ +# The KVM HV implementation on Power can require a significant amount +# of unswappable memory (about half of which also needs to be host +# physically contiguous) to hold the guest's Hash Page Table (HPT) - +# roughly 1/64th of the guest's RAM size, minimum 16MiB. +# +# These limits allow unprivileged users to start smallish VMs, such as +# those used by libguestfs. +# +* hard memlock 65536 +* soft memlock 65536 diff --git a/SOURCES/99-qemu-guest-agent.rules b/SOURCES/99-qemu-guest-agent.rules new file mode 100644 index 0000000..8a290ab --- /dev/null +++ b/SOURCES/99-qemu-guest-agent.rules @@ -0,0 +1,2 @@ +SUBSYSTEM=="virtio-ports", ATTR{name}=="org.qemu.guest_agent.0", \ + TAG+="systemd" ENV{SYSTEMD_WANTS}="qemu-guest-agent.service" diff --git a/SOURCES/README.tests b/SOURCES/README.tests new file mode 100644 index 0000000..739e2c6 --- /dev/null +++ b/SOURCES/README.tests @@ -0,0 +1,39 @@ +qemu-kvm-tests README +===================== + +The qemu-kvm-tests rpm contains tests that can be used to verify the +functionality of the installed qemu-kvm package + +When installed, the files from this rpm will be arranged in the following +directory structure + +tests-src/ +├── README +├── scripts +│   ├── qemu.py +│   └── qmp +└── tests + ├── acceptance + ├── Makefile.include + └── qemu-iotests + +The tests/ directory within the tests-src/ directory is setup to remain a copy +of a subset of the tests/ directory from the QEMU source tree + +The avocado_qemu tests and qemu-iotests, along with files required for the +execution of the avocado_qemu tests (scripts/qemu.py and scripts/qmp/) will be +installed in a new location - /usr/lib64/qemu-kvm/tests-src/ + +avocado_qemu tests: +The avocado_qemu tests can be executed by running the following avocado command: +avocado run -p qemu_bin=/usr/libexec/qemu-kvm /usr/lib64/qemu-kvm/tests/acceptance/ +Avocado needs to be installed separately using either pip or from source as +Avocado is not being packaged for RHEL. + +qemu-iotests: +symlinks to corresponding binaries need to be created for QEMU_PROG, +QEMU_IO_PROG, QEMU_IMG_PROG, and QEMU_NBD_PROG before the iotests can be +executed. + +The primary purpose of this package is to make these tests available to be +executed as gating tests for the qemu-kvm in the RHEL OSCI environment. diff --git a/SOURCES/bridge.conf b/SOURCES/bridge.conf new file mode 100644 index 0000000..a573665 --- /dev/null +++ b/SOURCES/bridge.conf @@ -0,0 +1 @@ +allow virbr0 diff --git a/SOURCES/kvm-RH-Author-Shaoqin-Huang-shahuang-redhat.com.patch b/SOURCES/kvm-RH-Author-Shaoqin-Huang-shahuang-redhat.com.patch new file mode 100644 index 0000000..f1ddc9b --- /dev/null +++ b/SOURCES/kvm-RH-Author-Shaoqin-Huang-shahuang-redhat.com.patch @@ -0,0 +1,76 @@ +From 5110e137294163ae43a61376485a7f610bf496f3 Mon Sep 17 00:00:00 2001 +From: Shaoqin Huang +Date: Wed, 22 May 2024 03:23:28 -0400 +Subject: [PATCH 8/9] RH-Author: Shaoqin Huang + RH-MergeRequest: 271: hw/arm/virt: Fix Manufacturer and Product Name in + emulated SMBIOS mode RH-Jira: RHEL-38374 RH-Acked-by: Cornelia Huck + RH-Acked-by: Miroslav Rezanina + RH-Acked-by: Eric Auger RH-Commit: [8/8] + d1daacc6ed427094cf92a9ecc66af8171950c718 (shahuang/qemu-kvm) + +--- + hw/arm/virt.c | 15 +++++++++++++-- + include/hw/arm/virt.h | 1 + + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 907c26c635..078098ec3a 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -1711,14 +1711,21 @@ static void virt_build_smbios(VirtMachineState *vms) + uint8_t *smbios_tables, *smbios_anchor; + size_t smbios_tables_len, smbios_anchor_len; + struct smbios_phys_mem_area mem_array; ++ const char *manufacturer = "QEMU"; + const char *product = "QEMU Virtual Machine"; ++ const char *version = vmc->smbios_old_sys_ver ? "1.0" : mc->name; + + if (kvm_enabled()) { + product = "KVM Virtual Machine"; + } + +- smbios_set_defaults("QEMU", product, +- vmc->smbios_old_sys_ver ? "1.0" : mc->name, ++ if (!vmc->manufacturer_product_compat) { ++ manufacturer = "Red Hat"; ++ product = "KVM"; ++ version = mc->desc; ++ } ++ ++ smbios_set_defaults(manufacturer, product, version, + NULL, NULL); + + /* build the array of physical mem area from base_memmap */ +@@ -3593,6 +3600,8 @@ DEFINE_VIRT_MACHINE(9, 6, 0) + + static void virt_rhel_machine_9_4_0_options(MachineClass *mc) + { ++ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); ++ + virt_rhel_machine_9_6_0_options(mc); + + /* From virt_machine_9_0_options() */ +@@ -3600,6 +3609,8 @@ static void virt_rhel_machine_9_4_0_options(MachineClass *mc) + + compat_props_add(mc->compat_props, hw_compat_rhel_10_0, hw_compat_rhel_10_0_len); + compat_props_add(mc->compat_props, hw_compat_rhel_9_5, hw_compat_rhel_9_5_len); ++ ++ vmc->manufacturer_product_compat = true; + } + DEFINE_VIRT_MACHINE(9, 4, 0) + +diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h +index a4d937ed45..2fc30a7626 100644 +--- a/include/hw/arm/virt.h ++++ b/include/hw/arm/virt.h +@@ -134,6 +134,7 @@ struct VirtMachineClass { + bool no_cpu_topology; + bool no_tcg_lpa2; + bool no_ns_el2_virt_timer_irq; ++ bool manufacturer_product_compat; + }; + + struct VirtMachineState { +-- +2.39.3 + diff --git a/SOURCES/kvm-arm-create-new-virt-machine-type-for-rhel-9.6.patch b/SOURCES/kvm-arm-create-new-virt-machine-type-for-rhel-9.6.patch new file mode 100644 index 0000000..f32bd03 --- /dev/null +++ b/SOURCES/kvm-arm-create-new-virt-machine-type-for-rhel-9.6.patch @@ -0,0 +1,49 @@ +From 60d59db99f0527eaf0ce8d3a18d8333aa77a03f2 Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Thu, 5 Sep 2024 13:53:13 +0200 +Subject: [PATCH 2/9] arm: create new virt machine type for rhel 9.6 + +RH-Author: Sebastian Ott +RH-MergeRequest: 270: RHEL10 machine types +RH-Jira: RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141 RHEL-52318 RHEL-52320 +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck +RH-Acked-by: Eric Auger +RH-Commit: [2/7] 0179f5a7a177f53b58ff9b82bd09217e183f258b (seott1/cos-qemu-kvm) + +Signed-off-by: Sebastian Ott +--- + hw/arm/virt.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 31a71a7f45..f94be8656c 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3580,15 +3580,22 @@ static void virt_machine_2_6_options(MachineClass *mc) + DEFINE_VIRT_MACHINE(2, 6) + #endif /* disabled for RHEL */ + ++static void virt_rhel_machine_9_6_0_options(MachineClass *mc) ++{ ++} ++DEFINE_VIRT_MACHINE_AS_LATEST(9, 6, 0) ++ + static void virt_rhel_machine_9_4_0_options(MachineClass *mc) + { ++ virt_rhel_machine_9_6_0_options(mc); ++ + /* From virt_machine_9_0_options() */ + mc->smbios_memory_device_size = 16 * GiB; + + compat_props_add(mc->compat_props, hw_compat_rhel_10_0, hw_compat_rhel_10_0_len); + compat_props_add(mc->compat_props, hw_compat_rhel_9_5, hw_compat_rhel_9_5_len); + } +-DEFINE_VIRT_MACHINE_AS_LATEST(9, 4, 0) ++DEFINE_VIRT_MACHINE(9, 4, 0) + + static void virt_rhel_machine_9_2_0_options(MachineClass *mc) + { +-- +2.39.3 + diff --git a/SOURCES/kvm-arm-create-virt-machine-type-for-rhel10.patch b/SOURCES/kvm-arm-create-virt-machine-type-for-rhel10.patch new file mode 100644 index 0000000..422f99a --- /dev/null +++ b/SOURCES/kvm-arm-create-virt-machine-type-for-rhel10.patch @@ -0,0 +1,45 @@ +From 704596b05f7dcdfa98857b71fed295d0005d4acc Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Thu, 22 Aug 2024 17:08:26 +0200 +Subject: [PATCH 5/9] arm: create virt machine type for rhel10 + +RH-Author: Sebastian Ott +RH-MergeRequest: 270: RHEL10 machine types +RH-Jira: RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141 RHEL-52318 RHEL-52320 +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck +RH-Acked-by: Eric Auger +RH-Commit: [5/7] cd8f31de4cd189cd1de69e68c84d823e43473e8c (seott1/cos-qemu-kvm) + +Create a new default virt machine type for rhel 10. + +Signed-off-by: Sebastian Ott +--- + hw/arm/virt.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index f94be8656c..907c26c635 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3580,10 +3580,16 @@ static void virt_machine_2_6_options(MachineClass *mc) + DEFINE_VIRT_MACHINE(2, 6) + #endif /* disabled for RHEL */ + ++static void virt_rhel_machine_10_0_0_options(MachineClass *mc) ++{ ++} ++DEFINE_VIRT_MACHINE_AS_LATEST(10, 0, 0) ++ + static void virt_rhel_machine_9_6_0_options(MachineClass *mc) + { ++ virt_rhel_machine_10_0_0_options(mc); + } +-DEFINE_VIRT_MACHINE_AS_LATEST(9, 6, 0) ++DEFINE_VIRT_MACHINE(9, 6, 0) + + static void virt_rhel_machine_9_4_0_options(MachineClass *mc) + { +-- +2.39.3 + diff --git a/SOURCES/kvm-qemu-guest-agent-Update-the-logfile-path-of-qga-fsfr.patch b/SOURCES/kvm-qemu-guest-agent-Update-the-logfile-path-of-qga-fsfr.patch new file mode 100644 index 0000000..08328b0 --- /dev/null +++ b/SOURCES/kvm-qemu-guest-agent-Update-the-logfile-path-of-qga-fsfr.patch @@ -0,0 +1,39 @@ +From 18c53acff0c50491dddac1e9d023b9ad5f540f7f Mon Sep 17 00:00:00 2001 +From: Dehan Meng +Date: Wed, 4 Sep 2024 16:39:51 +0800 +Subject: [PATCH 9/9] qemu-guest-agent: Update the logfile path of + qga-fsfreeze-hook.log + +RH-Author: Dehan Meng +RH-MergeRequest: 269: qemu-guest-agent: Update the logfile path of qga-fsfreeze-hook.log +RH-Jira: RHEL-57028 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [45/45] eebec1989edade851807d775de75d4d14da01cf2 (6-dehan/src_centosupstream_qemu-kvm) + +Since '/var/log/qga-fsfreeze-hook.log' is not included to proper +selinux context 'system_u:object_r:virt_qemu_ga_log_t:s0', it +should be changed to '/var/log/qemu-ga/qga-fsfreeze-hook.log'. And +it's worth to mention that this is RHEL-only change for matching +existing SELinux boolean and policy. + +Signed-off-by: Dehan Meng +--- + scripts/qemu-guest-agent/fsfreeze-hook | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook +index e9b84ec028..70536ba3e3 100755 +--- a/scripts/qemu-guest-agent/fsfreeze-hook ++++ b/scripts/qemu-guest-agent/fsfreeze-hook +@@ -7,7 +7,7 @@ + # "freeze" argument before the filesystem is frozen. And for fsfreeze-thaw + # request, it is issued with "thaw" argument after filesystem is thawed. + +-LOGFILE=/var/log/qga-fsfreeze-hook.log ++LOGFILE=/var/log/qemu-ga/qga-fsfreeze-hook.log + FSFREEZE_D=$(dirname -- "$(realpath $0)")/fsfreeze-hook.d + + # Check whether file $1 is a backup or rpm-generated file and should be ignored +-- +2.39.3 + diff --git a/SOURCES/kvm-remove-stale-compat-definitions.patch b/SOURCES/kvm-remove-stale-compat-definitions.patch new file mode 100644 index 0000000..cc1180f --- /dev/null +++ b/SOURCES/kvm-remove-stale-compat-definitions.patch @@ -0,0 +1,425 @@ +From 3cb4688b0b353296724b75772725e80fe2486958 Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Fri, 19 Apr 2024 17:20:49 +0200 +Subject: [PATCH 7/9] remove stale compat definitions + +RH-Author: Sebastian Ott +RH-MergeRequest: 270: RHEL10 machine types +RH-Jira: RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141 RHEL-52318 RHEL-52320 +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck +RH-Acked-by: Eric Auger +RH-Commit: [7/7] b8dd0980c40974787ed80ccd216c299f0a1aefb7 (seott1/cos-qemu-kvm) + +Get rid of unused [pc|hw_compat]_rhel_[7|8]* definitions. + +Signed-off-by: Sebastian Ott +--- + hw/core/machine.c | 196 ------------------------------------------- + hw/i386/pc.c | 115 ------------------------- + include/hw/boards.h | 24 ------ + include/hw/i386/pc.h | 21 ----- + 4 files changed, 356 deletions(-) + +diff --git a/hw/core/machine.c b/hw/core/machine.c +index 9cf8242b32..d95f246f66 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -407,202 +407,6 @@ GlobalProperty hw_compat_rhel_9_0[] = { + }; + const size_t hw_compat_rhel_9_0_len = G_N_ELEMENTS(hw_compat_rhel_9_0); + +-GlobalProperty hw_compat_rhel_8_6[] = { +- /* hw_compat_rhel_8_6 bz 2065589 */ +- /* +- * vhost-vsock device in RHEL 8 kernels doesn't support seqpacket, so +- * we need do disable it downstream on the latest hw_compat_rhel_8. +- */ +- { "vhost-vsock-device", "seqpacket", "off" }, +-}; +-const size_t hw_compat_rhel_8_6_len = G_N_ELEMENTS(hw_compat_rhel_8_6); +- +-/* +- * Mostly the same as hw_compat_6_0 and hw_compat_6_1 +- */ +-GlobalProperty hw_compat_rhel_8_5[] = { +- /* hw_compat_rhel_8_5 from hw_compat_6_0 */ +- { "gpex-pcihost", "allow-unmapped-accesses", "false" }, +- /* hw_compat_rhel_8_5 from hw_compat_6_0 */ +- { "i8042", "extended-state", "false"}, +- /* hw_compat_rhel_8_5 from hw_compat_6_0 */ +- { "nvme-ns", "eui64-default", "off"}, +- /* hw_compat_rhel_8_5 from hw_compat_6_0 */ +- { "e1000", "init-vet", "off" }, +- /* hw_compat_rhel_8_5 from hw_compat_6_0 */ +- { "e1000e", "init-vet", "off" }, +- /* hw_compat_rhel_8_5 from hw_compat_6_0 */ +- { "vhost-vsock-device", "seqpacket", "off" }, +- /* hw_compat_rhel_8_5 from hw_compat_6_1 */ +- { "vhost-user-vsock-device", "seqpacket", "off" }, +- /* hw_compat_rhel_8_5 from hw_compat_6_1 */ +- { "nvme-ns", "shared", "off" }, +-}; +-const size_t hw_compat_rhel_8_5_len = G_N_ELEMENTS(hw_compat_rhel_8_5); +- +-/* +- * Mostly the same as hw_compat_5_2 +- */ +-GlobalProperty hw_compat_rhel_8_4[] = { +- /* hw_compat_rhel_8_4 from hw_compat_5_2 */ +- { "ICH9-LPC", "smm-compat", "on"}, +- /* hw_compat_rhel_8_4 from hw_compat_5_2 */ +- { "PIIX4_PM", "smm-compat", "on"}, +- /* hw_compat_rhel_8_4 from hw_compat_5_2 */ +- { "virtio-blk-device", "report-discard-granularity", "off" }, +- /* hw_compat_rhel_8_4 from hw_compat_5_2 */ +- /* +- * Upstream incorrectly had "virtio-net-pci" instead of "virtio-net-pci-base", +- * (https://bugzilla.redhat.com/show_bug.cgi?id=1999141) +- */ +- { "virtio-net-pci-base", "vectors", "3"}, +-}; +-const size_t hw_compat_rhel_8_4_len = G_N_ELEMENTS(hw_compat_rhel_8_4); +- +-/* +- * Mostly the same as hw_compat_5_1 +- */ +-GlobalProperty hw_compat_rhel_8_3[] = { +- /* hw_compat_rhel_8_3 from hw_compat_5_1 */ +- { "vhost-scsi", "num_queues", "1"}, +- /* hw_compat_rhel_8_3 from hw_compat_5_1 */ +- { "vhost-user-blk", "num-queues", "1"}, +- /* hw_compat_rhel_8_3 from hw_compat_5_1 */ +- { "vhost-user-scsi", "num_queues", "1"}, +- /* hw_compat_rhel_8_3 from hw_compat_5_1 */ +- { "virtio-blk-device", "num-queues", "1"}, +- /* hw_compat_rhel_8_3 from hw_compat_5_1 */ +- { "virtio-scsi-device", "num_queues", "1"}, +- /* hw_compat_rhel_8_3 from hw_compat_5_1 */ +- { "nvme", "use-intel-id", "on"}, +- /* hw_compat_rhel_8_3 from hw_compat_5_1 */ +- { "pvpanic", "events", "1"}, /* PVPANIC_PANICKED */ +- /* hw_compat_rhel_8_3 from hw_compat_5_1 */ +- { "pl011", "migrate-clk", "off" }, +- /* hw_compat_rhel_8_3 bz 1912846 */ +- { "pci-xhci", "x-rh-late-msi-cap", "off" }, +- /* hw_compat_rhel_8_3 from hw_compat_5_1 */ +- { "virtio-pci", "x-ats-page-aligned", "off"}, +-}; +-const size_t hw_compat_rhel_8_3_len = G_N_ELEMENTS(hw_compat_rhel_8_3); +- +-/* +- * The same as hw_compat_4_2 + hw_compat_5_0 +- */ +-GlobalProperty hw_compat_rhel_8_2[] = { +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "virtio-blk-device", "queue-size", "128"}, +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "virtio-scsi-device", "virtqueue_size", "128"}, +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "virtio-blk-device", "x-enable-wce-if-config-wce", "off" }, +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "virtio-blk-device", "seg-max-adjust", "off"}, +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "virtio-scsi-device", "seg_max_adjust", "off"}, +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "vhost-blk-device", "seg_max_adjust", "off"}, +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "usb-host", "suppress-remote-wake", "off" }, +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "usb-redir", "suppress-remote-wake", "off" }, +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "qxl", "revision", "4" }, +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "qxl-vga", "revision", "4" }, +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "fw_cfg", "acpi-mr-restore", "false" }, +- /* hw_compat_rhel_8_2 from hw_compat_4_2 */ +- { "virtio-device", "use-disabled-flag", "false" }, +- /* hw_compat_rhel_8_2 from hw_compat_5_0 */ +- { "pci-host-bridge", "x-config-reg-migration-enabled", "off" }, +- /* hw_compat_rhel_8_2 from hw_compat_5_0 */ +- { "virtio-balloon-device", "page-poison", "false" }, +- /* hw_compat_rhel_8_2 from hw_compat_5_0 */ +- { "vmport", "x-read-set-eax", "off" }, +- /* hw_compat_rhel_8_2 from hw_compat_5_0 */ +- { "vmport", "x-signal-unsupported-cmd", "off" }, +- /* hw_compat_rhel_8_2 from hw_compat_5_0 */ +- { "vmport", "x-report-vmx-type", "off" }, +- /* hw_compat_rhel_8_2 from hw_compat_5_0 */ +- { "vmport", "x-cmds-v2", "off" }, +- /* hw_compat_rhel_8_2 from hw_compat_5_0 */ +- { "virtio-device", "x-disable-legacy-check", "true" }, +-}; +-const size_t hw_compat_rhel_8_2_len = G_N_ELEMENTS(hw_compat_rhel_8_2); +- +-/* +- * The same as hw_compat_4_1 +- */ +-GlobalProperty hw_compat_rhel_8_1[] = { +- /* hw_compat_rhel_8_1 from hw_compat_4_1 */ +- { "virtio-pci", "x-pcie-flr-init", "off" }, +-}; +-const size_t hw_compat_rhel_8_1_len = G_N_ELEMENTS(hw_compat_rhel_8_1); +- +-/* The same as hw_compat_3_1 +- * format of array has been changed by: +- * 6c36bddf5340 ("machine: Use shorter format for GlobalProperty arrays") +- */ +-GlobalProperty hw_compat_rhel_8_0[] = { +- /* hw_compat_rhel_8_0 from hw_compat_3_1 */ +- { "pcie-root-port", "x-speed", "2_5" }, +- /* hw_compat_rhel_8_0 from hw_compat_3_1 */ +- { "pcie-root-port", "x-width", "1" }, +- /* hw_compat_rhel_8_0 from hw_compat_3_1 */ +- { "memory-backend-file", "x-use-canonical-path-for-ramblock-id", "true" }, +- /* hw_compat_rhel_8_0 from hw_compat_3_1 */ +- { "memory-backend-memfd", "x-use-canonical-path-for-ramblock-id", "true" }, +- /* hw_compat_rhel_8_0 from hw_compat_3_1 */ +- { "tpm-crb", "ppi", "false" }, +- /* hw_compat_rhel_8_0 from hw_compat_3_1 */ +- { "tpm-tis", "ppi", "false" }, +- /* hw_compat_rhel_8_0 from hw_compat_3_1 */ +- { "usb-kbd", "serial", "42" }, +- /* hw_compat_rhel_8_0 from hw_compat_3_1 */ +- { "usb-mouse", "serial", "42" }, +- /* hw_compat_rhel_8_0 from hw_compat_3_1 */ +- { "usb-tablet", "serial", "42" }, +- /* hw_compat_rhel_8_0 from hw_compat_3_1 */ +- { "virtio-blk-device", "discard", "false" }, +- /* hw_compat_rhel_8_0 from hw_compat_3_1 */ +- { "virtio-blk-device", "write-zeroes", "false" }, +- /* hw_compat_rhel_8_0 from hw_compat_4_0 */ +- { "VGA", "edid", "false" }, +- /* hw_compat_rhel_8_0 from hw_compat_4_0 */ +- { "secondary-vga", "edid", "false" }, +- /* hw_compat_rhel_8_0 from hw_compat_4_0 */ +- { "bochs-display", "edid", "false" }, +- /* hw_compat_rhel_8_0 from hw_compat_4_0 */ +- { "virtio-vga", "edid", "false" }, +- /* hw_compat_rhel_8_0 from hw_compat_4_0 */ +- { "virtio-gpu-device", "edid", "false" }, +- /* hw_compat_rhel_8_0 from hw_compat_4_0 */ +- { "virtio-device", "use-started", "false" }, +- /* hw_compat_rhel_8_0 from hw_compat_3_1 - that was added in 4.1 */ +- { "pcie-root-port-base", "disable-acs", "true" }, +-}; +-const size_t hw_compat_rhel_8_0_len = G_N_ELEMENTS(hw_compat_rhel_8_0); +- +-/* The same as hw_compat_3_0 + hw_compat_2_12 +- * except that +- * there's nothing in 3_0 +- * migration.decompress-error-check=off was in 7.5 from bz 1584139 +- */ +-GlobalProperty hw_compat_rhel_7_6[] = { +- /* hw_compat_rhel_7_6 from hw_compat_2_12 */ +- { "hda-audio", "use-timer", "false" }, +- /* hw_compat_rhel_7_6 from hw_compat_2_12 */ +- { "cirrus-vga", "global-vmstate", "true" }, +- /* hw_compat_rhel_7_6 from hw_compat_2_12 */ +- { "VGA", "global-vmstate", "true" }, +- /* hw_compat_rhel_7_6 from hw_compat_2_12 */ +- { "vmware-svga", "global-vmstate", "true" }, +- /* hw_compat_rhel_7_6 from hw_compat_2_12 */ +- { "qxl-vga", "global-vmstate", "true" }, +-}; +-const size_t hw_compat_rhel_7_6_len = G_N_ELEMENTS(hw_compat_rhel_7_6); +- + MachineState *current_machine; + + static char *machine_get_kernel(Object *obj, Error **errp) +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index a49d346d2e..7af762065f 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -316,121 +316,6 @@ GlobalProperty pc_rhel_9_0_compat[] = { + }; + const size_t pc_rhel_9_0_compat_len = G_N_ELEMENTS(pc_rhel_9_0_compat); + +-GlobalProperty pc_rhel_8_5_compat[] = { +- /* pc_rhel_8_5_compat from pc_compat_6_0 */ +- { "qemu64" "-" TYPE_X86_CPU, "family", "6" }, +- /* pc_rhel_8_5_compat from pc_compat_6_0 */ +- { "qemu64" "-" TYPE_X86_CPU, "model", "6" }, +- /* pc_rhel_8_5_compat from pc_compat_6_0 */ +- { "qemu64" "-" TYPE_X86_CPU, "stepping", "3" }, +- /* pc_rhel_8_5_compat from pc_compat_6_0 */ +- { TYPE_X86_CPU, "x-vendor-cpuid-only", "off" }, +- /* pc_rhel_8_5_compat from pc_compat_6_0 */ +- { "ICH9-LPC", ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, "off" }, +- +- /* pc_rhel_8_5_compat from pc_compat_6_1 */ +- { TYPE_X86_CPU, "hv-version-id-build", "0x1bbc" }, +- /* pc_rhel_8_5_compat from pc_compat_6_1 */ +- { TYPE_X86_CPU, "hv-version-id-major", "0x0006" }, +- /* pc_rhel_8_5_compat from pc_compat_6_1 */ +- { TYPE_X86_CPU, "hv-version-id-minor", "0x0001" }, +-}; +-const size_t pc_rhel_8_5_compat_len = G_N_ELEMENTS(pc_rhel_8_5_compat); +- +-GlobalProperty pc_rhel_8_4_compat[] = { +- /* pc_rhel_8_4_compat from pc_compat_5_2 */ +- { "ICH9-LPC", "x-smi-cpu-hotunplug", "off" }, +- { TYPE_X86_CPU, "kvm-asyncpf-int", "off" }, +-}; +-const size_t pc_rhel_8_4_compat_len = G_N_ELEMENTS(pc_rhel_8_4_compat); +- +-GlobalProperty pc_rhel_8_3_compat[] = { +- /* pc_rhel_8_3_compat from pc_compat_5_1 */ +- { "ICH9-LPC", "x-smi-cpu-hotplug", "off" }, +-}; +-const size_t pc_rhel_8_3_compat_len = G_N_ELEMENTS(pc_rhel_8_3_compat); +- +-GlobalProperty pc_rhel_8_2_compat[] = { +- /* pc_rhel_8_2_compat from pc_compat_4_2 */ +- { "mch", "smbase-smram", "off" }, +-}; +-const size_t pc_rhel_8_2_compat_len = G_N_ELEMENTS(pc_rhel_8_2_compat); +- +-/* pc_rhel_8_1_compat is empty since pc_4_1_compat is */ +-GlobalProperty pc_rhel_8_1_compat[] = { }; +-const size_t pc_rhel_8_1_compat_len = G_N_ELEMENTS(pc_rhel_8_1_compat); +- +-GlobalProperty pc_rhel_8_0_compat[] = { +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "intel-iommu", "dma-drain", "off" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "Opteron_G3" "-" TYPE_X86_CPU, "rdtscp", "off" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "Opteron_G4" "-" TYPE_X86_CPU, "rdtscp", "off" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "Opteron_G4" "-" TYPE_X86_CPU, "npt", "off" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "Opteron_G4" "-" TYPE_X86_CPU, "nrip-save", "off" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "Opteron_G5" "-" TYPE_X86_CPU, "rdtscp", "off" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "Opteron_G5" "-" TYPE_X86_CPU, "npt", "off" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "Opteron_G5" "-" TYPE_X86_CPU, "nrip-save", "off" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "EPYC" "-" TYPE_X86_CPU, "npt", "off" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "EPYC" "-" TYPE_X86_CPU, "nrip-save", "off" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "EPYC-IBPB" "-" TYPE_X86_CPU, "npt", "off" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "EPYC-IBPB" "-" TYPE_X86_CPU, "nrip-save", "off" }, +- /** The mpx=on entries from pc_compat_3_1 are in pc_rhel_7_6_compat **/ +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { "Cascadelake-Server" "-" TYPE_X86_CPU, "stepping", "5" }, +- /* pc_rhel_8_0_compat from pc_compat_3_1 */ +- { TYPE_X86_CPU, "x-intel-pt-auto-level", "off" }, +-}; +-const size_t pc_rhel_8_0_compat_len = G_N_ELEMENTS(pc_rhel_8_0_compat); +- +-/* Similar to PC_COMPAT_3_0 + PC_COMPAT_2_12, but: +- * all of the 2_12 stuff was already in 7.6 from bz 1481253 +- * x-migrate-smi-count comes from PC_COMPAT_2_11 but +- * is really tied to kernel version so keep it off on 7.x +- * machine types irrespective of host. +- */ +-GlobalProperty pc_rhel_7_6_compat[] = { +- /* pc_rhel_7_6_compat from pc_compat_3_0 */ +- { TYPE_X86_CPU, "x-hv-synic-kvm-only", "on" }, +- /* pc_rhel_7_6_compat from pc_compat_3_0 */ +- { "Skylake-Server" "-" TYPE_X86_CPU, "pku", "off" }, +- /* pc_rhel_7_6_compat from pc_compat_3_0 */ +- { "Skylake-Server-IBRS" "-" TYPE_X86_CPU, "pku", "off" }, +- /* pc_rhel_7_6_compat from pc_compat_2_11 */ +- { TYPE_X86_CPU, "x-migrate-smi-count", "off" }, +- /* pc_rhel_7_6_compat from pc_compat_2_11 */ +- { "Skylake-Client" "-" TYPE_X86_CPU, "mpx", "on" }, +- /* pc_rhel_7_6_compat from pc_compat_2_11 */ +- { "Skylake-Client-IBRS" "-" TYPE_X86_CPU, "mpx", "on" }, +- /* pc_rhel_7_6_compat from pc_compat_2_11 */ +- { "Skylake-Server" "-" TYPE_X86_CPU, "mpx", "on" }, +- /* pc_rhel_7_6_compat from pc_compat_2_11 */ +- { "Skylake-Server-IBRS" "-" TYPE_X86_CPU, "mpx", "on" }, +- /* pc_rhel_7_6_compat from pc_compat_2_11 */ +- { "Cascadelake-Server" "-" TYPE_X86_CPU, "mpx", "on" }, +- /* pc_rhel_7_6_compat from pc_compat_2_11 */ +- { "Icelake-Client" "-" TYPE_X86_CPU, "mpx", "on" }, +- /* pc_rhel_7_6_compat from pc_compat_2_11 */ +- { "Icelake-Server" "-" TYPE_X86_CPU, "mpx", "on" }, +-}; +-const size_t pc_rhel_7_6_compat_len = G_N_ELEMENTS(pc_rhel_7_6_compat); +- +-/* +- * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine +- * types as the PC_COMPAT_* do for upstream types. +- * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types. +- */ +- + GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled) + { + GSIState *s; +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 6d98aaf4c7..ac917b87fb 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -823,29 +823,5 @@ extern const size_t hw_compat_rhel_9_1_len; + extern GlobalProperty hw_compat_rhel_9_0[]; + extern const size_t hw_compat_rhel_9_0_len; + +-extern GlobalProperty hw_compat_rhel_8_6[]; +-extern const size_t hw_compat_rhel_8_6_len; +- +-extern GlobalProperty hw_compat_rhel_8_5[]; +-extern const size_t hw_compat_rhel_8_5_len; +- +-extern GlobalProperty hw_compat_rhel_8_4[]; +-extern const size_t hw_compat_rhel_8_4_len; +- +-extern GlobalProperty hw_compat_rhel_8_3[]; +-extern const size_t hw_compat_rhel_8_3_len; +- +-extern GlobalProperty hw_compat_rhel_8_2[]; +-extern const size_t hw_compat_rhel_8_2_len; +- +-extern GlobalProperty hw_compat_rhel_8_1[]; +-extern const size_t hw_compat_rhel_8_1_len; +- +-extern GlobalProperty hw_compat_rhel_8_0[]; +-extern const size_t hw_compat_rhel_8_0_len; +- +-extern GlobalProperty hw_compat_rhel_7_6[]; +-extern const size_t hw_compat_rhel_7_6_len; +- + extern const char *rhel_old_machine_deprecation; + #endif +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 8e9597f40f..61609027d0 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -314,27 +314,6 @@ extern const size_t pc_rhel_9_2_compat_len; + extern GlobalProperty pc_rhel_9_0_compat[]; + extern const size_t pc_rhel_9_0_compat_len; + +-extern GlobalProperty pc_rhel_8_5_compat[]; +-extern const size_t pc_rhel_8_5_compat_len; +- +-extern GlobalProperty pc_rhel_8_4_compat[]; +-extern const size_t pc_rhel_8_4_compat_len; +- +-extern GlobalProperty pc_rhel_8_3_compat[]; +-extern const size_t pc_rhel_8_3_compat_len; +- +-extern GlobalProperty pc_rhel_8_2_compat[]; +-extern const size_t pc_rhel_8_2_compat_len; +- +-extern GlobalProperty pc_rhel_8_1_compat[]; +-extern const size_t pc_rhel_8_1_compat_len; +- +-extern GlobalProperty pc_rhel_8_0_compat[]; +-extern const size_t pc_rhel_8_0_compat_len; +- +-extern GlobalProperty pc_rhel_7_6_compat[]; +-extern const size_t pc_rhel_7_6_compat_len; +- + #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \ + static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ + { \ +-- +2.39.3 + diff --git a/SOURCES/kvm-s390x.conf b/SOURCES/kvm-s390x.conf new file mode 100644 index 0000000..d82b818 --- /dev/null +++ b/SOURCES/kvm-s390x.conf @@ -0,0 +1,19 @@ +# User changes in this file are preserved across upgrades. +# +# Setting "modprobe kvm nested=1" only enables Nested Virtualization until +# the next reboot or module reload. Uncomment the option below to enable +# the feature permanently. +# +#options kvm nested=1 +# +# +# Setting "modprobe kvm hpage=1" only enables Huge Page Backing (1MB) +# support until the next reboot or module reload. Uncomment the option +# below to enable the feature permanently. +# +# Note: - Incompatible with "nested=1". Loading the module will fail. +# - Dirty page logging will be performed on a 1MB (not 4KB) basis, +# which can result in a lot of data having to be transferred during +# migration, and therefore taking very long to converge. +# +#options kvm hpage=1 diff --git a/SOURCES/kvm-x86-create-new-pc-q35-machine-type-for-rhel-9.6.patch b/SOURCES/kvm-x86-create-new-pc-q35-machine-type-for-rhel-9.6.patch new file mode 100644 index 0000000..55f3618 --- /dev/null +++ b/SOURCES/kvm-x86-create-new-pc-q35-machine-type-for-rhel-9.6.patch @@ -0,0 +1,50 @@ +From a498476ecdb2b81b7feae6bf496f0b8caa68d2e7 Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Thu, 5 Sep 2024 13:58:44 +0200 +Subject: [PATCH 1/9] x86: create new pc-q35 machine type for rhel 9.6 + +RH-Author: Sebastian Ott +RH-MergeRequest: 270: RHEL10 machine types +RH-Jira: RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141 RHEL-52318 RHEL-52320 +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck +RH-Acked-by: Eric Auger +RH-Commit: [1/7] 3c735a074e629eee589d5acf8fdace6517c57c54 (seott1/cos-qemu-kvm) + +Signed-off-by: Sebastian Ott +--- + hw/i386/pc_q35.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index a05df61cfc..6ee032e91e 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -672,11 +672,23 @@ DEFINE_Q35_MACHINE(2, 4); + + /* Red Hat Enterprise Linux machine types */ + +-static void pc_q35_rhel_machine_9_4_0_options(MachineClass *m) ++static void pc_q35_rhel_machine_9_6_0_options(MachineClass *m) + { + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_q35_machine_options(m); ++ m->desc = "RHEL-9.6.0 PC (Q35 + ICH9, 2009)"; ++ pcmc->smbios_stream_product = "RHEL"; ++ pcmc->smbios_stream_version = "9.6.0"; ++} ++ ++DEFINE_Q35_MACHINE_BUGFIX(9, 6, 0); ++ ++static void pc_q35_rhel_machine_9_4_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_rhel_machine_9_6_0_options(m); + m->desc = "RHEL-9.4.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; + pcmc->smbios_stream_product = "RHEL"; + pcmc->smbios_stream_version = "9.4.0"; + +-- +2.39.3 + diff --git a/SOURCES/kvm-x86-create-pc-i440fx-machine-type-for-rhel10.patch b/SOURCES/kvm-x86-create-pc-i440fx-machine-type-for-rhel10.patch new file mode 100644 index 0000000..41f065d --- /dev/null +++ b/SOURCES/kvm-x86-create-pc-i440fx-machine-type-for-rhel10.patch @@ -0,0 +1,79 @@ +From e31809f655d2298a4e21e317c8c6cb453a63939b Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Tue, 28 May 2024 14:04:07 +0200 +Subject: [PATCH 3/9] x86: create pc-i440fx machine type for rhel10 + +RH-Author: Sebastian Ott +RH-MergeRequest: 270: RHEL10 machine types +RH-Jira: RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141 RHEL-52318 RHEL-52320 +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck +RH-Acked-by: Eric Auger +RH-Commit: [3/7] e5aab53bc07dac21097497ce0d9798c6414dce57 (seott1/cos-qemu-kvm) + +Create a new machine type pc-i440fx-rhel10.0.0, +set it as default and alias to pc. + +Signed-off-by: Sebastian Ott +--- + hw/i386/pc_piix.c | 37 +++++++++++++++++++++++++++++++++++-- + 1 file changed, 35 insertions(+), 2 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 447f98b438..663f67aa3a 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -830,6 +830,41 @@ DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init, + + /* Red Hat Enterprise Linux machine types */ + ++static void pc_machine_rhel10_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ ObjectClass *oc = OBJECT_CLASS(m); ++ pcmc->default_south_bridge = TYPE_PIIX3_DEVICE; ++ pcmc->pci_root_uid = 0; ++ pcmc->default_cpu_version = 1; ++ ++ m->family = "pc_piix_Y"; ++ m->default_machine_opts = "firmware=bios-256k.bin"; ++ m->default_display = "std"; ++ m->default_nic = "e1000"; ++ m->no_parallel = 1; ++ m->no_floppy = 1; ++ machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE); ++ ++ object_class_property_add_enum(oc, "x-south-bridge", "PCSouthBridgeOption", ++ &PCSouthBridgeOption_lookup, ++ pc_get_south_bridge, ++ pc_set_south_bridge); ++ object_class_property_set_description(oc, "x-south-bridge", ++ "Use a different south bridge than PIIX3"); ++} ++ ++static void pc_i440fx_rhel_machine_10_0_0_options(MachineClass *m) ++{ ++ pc_machine_rhel10_options(m); ++ ++ m->desc = "RHEL 10.0.0 PC (i440FX + PIIX, 1996)"; ++ m->deprecation_reason = rhel_old_machine_deprecation; ++ m->alias = "pc"; ++ m->is_default = 1; ++} ++DEFINE_I440FX_MACHINE(10, 0, 0); ++ + /* Options for the latest rhel7 machine type */ + static void pc_machine_rhel7_options(MachineClass *m) + { +@@ -844,8 +879,6 @@ static void pc_machine_rhel7_options(MachineClass *m) + m->auto_enable_numa_with_memdev = false; + machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE); + compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len); +- m->alias = "pc"; +- m->is_default = 1; + m->smp_props.prefer_sockets = true; + } + +-- +2.39.3 + diff --git a/SOURCES/kvm-x86-create-pc-q35-machine-type-for-rhel10.patch b/SOURCES/kvm-x86-create-pc-q35-machine-type-for-rhel10.patch new file mode 100644 index 0000000..47a7be3 --- /dev/null +++ b/SOURCES/kvm-x86-create-pc-q35-machine-type-for-rhel10.patch @@ -0,0 +1,59 @@ +From 16bd67e1b3706f2e20bda52a5f8ad42742a51f55 Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Thu, 22 Aug 2024 17:21:52 +0200 +Subject: [PATCH 4/9] x86: create pc-q35 machine type for rhel10 + +RH-Author: Sebastian Ott +RH-MergeRequest: 270: RHEL10 machine types +RH-Jira: RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141 RHEL-52318 RHEL-52320 +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck +RH-Acked-by: Eric Auger +RH-Commit: [4/7] 86639ee63c884fb97e1f6bc7e24b2773ac2b4a7a (seott1/cos-qemu-kvm) + +Create a new machine type pc-q35-rhel10.0.0 with alias q35. + +Signed-off-by: Sebastian Ott +--- + hw/i386/pc_q35.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 6ee032e91e..4ad4ad79a4 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -672,11 +672,22 @@ DEFINE_Q35_MACHINE(2, 4); + + /* Red Hat Enterprise Linux machine types */ + +-static void pc_q35_rhel_machine_9_6_0_options(MachineClass *m) ++static void pc_q35_rhel_machine_10_0_0_options(MachineClass *m) + { + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_q35_machine_options(m); ++ m->desc = "RHEL-10.0.0 PC (Q35 + ICH9, 2009)"; ++ pcmc->smbios_stream_product = "RHEL"; ++ pcmc->smbios_stream_version = "10.0.0"; ++} ++DEFINE_Q35_MACHINE_BUGFIX(10, 0, 0); ++ ++static void pc_q35_rhel_machine_9_6_0_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_rhel_machine_10_0_0_options(m); + m->desc = "RHEL-9.6.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; + pcmc->smbios_stream_product = "RHEL"; + pcmc->smbios_stream_version = "9.6.0"; + } +@@ -688,7 +699,6 @@ static void pc_q35_rhel_machine_9_4_0_options(MachineClass *m) + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_q35_rhel_machine_9_6_0_options(m); + m->desc = "RHEL-9.4.0 PC (Q35 + ICH9, 2009)"; +- m->alias = NULL; + pcmc->smbios_stream_product = "RHEL"; + pcmc->smbios_stream_version = "9.4.0"; + +-- +2.39.3 + diff --git a/SOURCES/kvm-x86-remove-deprecated-rhel-machine-types.patch b/SOURCES/kvm-x86-remove-deprecated-rhel-machine-types.patch new file mode 100644 index 0000000..98acd71 --- /dev/null +++ b/SOURCES/kvm-x86-remove-deprecated-rhel-machine-types.patch @@ -0,0 +1,274 @@ +From e0fdae22db8d3a333d5c01e64d0c063b3d47c553 Mon Sep 17 00:00:00 2001 +From: Sebastian Ott +Date: Thu, 22 Aug 2024 16:30:08 +0200 +Subject: [PATCH 6/9] x86: remove deprecated rhel machine types + +RH-Author: Sebastian Ott +RH-MergeRequest: 270: RHEL10 machine types +RH-Jira: RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141 RHEL-52318 RHEL-52320 +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck +RH-Acked-by: Eric Auger +RH-Commit: [6/7] 928c59980a5c5f613e90e4ccfcfcfc08488da519 (seott1/cos-qemu-kvm) + +Remove the following deprecated x86 rhel specific machine types: + +pc RHEL 7.6.0 PC (i440FX + PIIX, 1996) (alias of pc-i440fx-rhel7.6.0) +pc-i440fx-rhel7.6.0 RHEL 7.6.0 PC (i440FX + PIIX, 1996) (default) (deprecated) +pc-q35-rhel8.6.0 RHEL-8.6.0 PC (Q35 + ICH9, 2009) (deprecated) +pc-q35-rhel8.5.0 RHEL-8.5.0 PC (Q35 + ICH9, 2009) (deprecated) +pc-q35-rhel8.4.0 RHEL-8.4.0 PC (Q35 + ICH9, 2009) (deprecated) +pc-q35-rhel8.3.0 RHEL-8.3.0 PC (Q35 + ICH9, 2009) (deprecated) +pc-q35-rhel8.2.0 RHEL-8.2.0 PC (Q35 + ICH9, 2009) (deprecated) +pc-q35-rhel8.1.0 RHEL-8.1.0 PC (Q35 + ICH9, 2009) (deprecated) +pc-q35-rhel8.0.0 RHEL-8.0.0 PC (Q35 + ICH9, 2009) (deprecated) +pc-q35-rhel7.6.0 RHEL-7.6.0 PC (Q35 + ICH9, 2009) (deprecated) + +Signed-off-by: Sebastian Ott +--- + hw/i386/pc_piix.c | 95 ---------------------------------- + hw/i386/pc_q35.c | 128 ---------------------------------------------- + 2 files changed, 223 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 663f67aa3a..96f5997051 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -864,98 +864,3 @@ static void pc_i440fx_rhel_machine_10_0_0_options(MachineClass *m) + m->is_default = 1; + } + DEFINE_I440FX_MACHINE(10, 0, 0); +- +-/* Options for the latest rhel7 machine type */ +-static void pc_machine_rhel7_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- m->family = "pc_piix_Y"; +- m->default_machine_opts = "firmware=bios-256k.bin,hpet=off"; +- pcmc->pci_root_uid = 0; +- m->default_nic = "e1000"; +- m->default_display = "std"; +- m->no_parallel = 1; +- m->numa_mem_supported = true; +- m->auto_enable_numa_with_memdev = false; +- machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE); +- compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len); +- m->smp_props.prefer_sockets = true; +-} +- +-static void pc_i440fx_rhel_machine_7_6_0_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- ObjectClass *oc = OBJECT_CLASS(m); +- pc_machine_rhel7_options(m); +- m->desc = "RHEL 7.6.0 PC (i440FX + PIIX, 1996)"; +- m->async_pf_vmexit_disable = true; +- m->smbus_no_migration_support = true; +- +- pcmc->pvh_enabled = false; +- pcmc->default_cpu_version = CPU_VERSION_LEGACY; +- pcmc->kvmclock_create_always = false; +- /* From pc_i440fx_5_1_machine_options() */ +- pcmc->pci_root_uid = 1; +- /* From pc_i440fx_7_0_machine_options() */ +- pcmc->enforce_amd_1tb_hole = false; +- /* From pc_i440fx_8_0_machine_options() */ +- pcmc->default_smbios_ep_type = SMBIOS_ENTRY_POINT_TYPE_32; +- /* From pc_i440fx_8_1_machine_options() */ +- pcmc->broken_32bit_mem_addr_check = true; +- /* Introduced in QEMU 8.2 */ +- pcmc->default_south_bridge = TYPE_PIIX3_DEVICE; +- +- object_class_property_add_enum(oc, "x-south-bridge", "PCSouthBridgeOption", +- &PCSouthBridgeOption_lookup, +- pc_get_south_bridge, +- pc_set_south_bridge); +- object_class_property_set_description(oc, "x-south-bridge", +- "Use a different south bridge than PIIX3"); +- +- compat_props_add(m->compat_props, hw_compat_rhel_10_0, +- hw_compat_rhel_10_0_len); +- compat_props_add(m->compat_props, hw_compat_rhel_9_5, +- hw_compat_rhel_9_5_len); +- compat_props_add(m->compat_props, hw_compat_rhel_9_4, +- hw_compat_rhel_9_4_len); +- compat_props_add(m->compat_props, hw_compat_rhel_9_3, +- hw_compat_rhel_9_3_len); +- compat_props_add(m->compat_props, pc_rhel_9_3_compat, +- pc_rhel_9_3_compat_len); +- compat_props_add(m->compat_props, hw_compat_rhel_9_2, +- hw_compat_rhel_9_2_len); +- compat_props_add(m->compat_props, pc_rhel_9_2_compat, +- pc_rhel_9_2_compat_len); +- compat_props_add(m->compat_props, hw_compat_rhel_9_1, +- hw_compat_rhel_9_1_len); +- compat_props_add(m->compat_props, hw_compat_rhel_9_0, +- hw_compat_rhel_9_0_len); +- compat_props_add(m->compat_props, pc_rhel_9_0_compat, +- pc_rhel_9_0_compat_len); +- compat_props_add(m->compat_props, hw_compat_rhel_8_6, +- hw_compat_rhel_8_6_len); +- compat_props_add(m->compat_props, hw_compat_rhel_8_5, +- hw_compat_rhel_8_5_len); +- compat_props_add(m->compat_props, pc_rhel_8_5_compat, +- pc_rhel_8_5_compat_len); +- compat_props_add(m->compat_props, hw_compat_rhel_8_4, +- hw_compat_rhel_8_4_len); +- compat_props_add(m->compat_props, pc_rhel_8_4_compat, +- pc_rhel_8_4_compat_len); +- compat_props_add(m->compat_props, hw_compat_rhel_8_3, +- hw_compat_rhel_8_3_len); +- compat_props_add(m->compat_props, pc_rhel_8_3_compat, +- pc_rhel_8_3_compat_len); +- compat_props_add(m->compat_props, hw_compat_rhel_8_2, +- hw_compat_rhel_8_2_len); +- compat_props_add(m->compat_props, pc_rhel_8_2_compat, +- pc_rhel_8_2_compat_len); +- compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len); +- compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len); +- compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len); +- compat_props_add(m->compat_props, pc_rhel_8_0_compat, pc_rhel_8_0_compat_len); +- compat_props_add(m->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len); +- compat_props_add(m->compat_props, pc_rhel_7_6_compat, pc_rhel_7_6_compat_len); +-} +- +-DEFINE_I440FX_MACHINE(7, 6, 0); +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 4ad4ad79a4..37f54062c8 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -760,131 +760,3 @@ static void pc_q35_rhel_machine_9_0_0_options(MachineClass *m) + } + + DEFINE_Q35_MACHINE_BUGFIX(9, 0, 0); +- +-static void pc_q35_rhel_machine_8_6_0_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_q35_rhel_machine_9_0_0_options(m); +- m->desc = "RHEL-8.6.0 PC (Q35 + ICH9, 2009)"; +- m->alias = NULL; +- +- pcmc->smbios_stream_product = "RHEL-AV"; +- pcmc->smbios_stream_version = "8.6.0"; +- compat_props_add(m->compat_props, hw_compat_rhel_8_6, +- hw_compat_rhel_8_6_len); +-} +- +-DEFINE_Q35_MACHINE_BUGFIX(8, 6, 0); +- +-static void pc_q35_rhel_machine_8_5_0_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_q35_rhel_machine_8_6_0_options(m); +- m->desc = "RHEL-8.5.0 PC (Q35 + ICH9, 2009)"; +- m->alias = NULL; +- pcmc->smbios_stream_product = "RHEL-AV"; +- pcmc->smbios_stream_version = "8.5.0"; +- compat_props_add(m->compat_props, hw_compat_rhel_8_5, +- hw_compat_rhel_8_5_len); +- compat_props_add(m->compat_props, pc_rhel_8_5_compat, +- pc_rhel_8_5_compat_len); +- m->smp_props.prefer_sockets = true; +-} +- +-DEFINE_Q35_MACHINE_BUGFIX(8, 5, 0); +- +-static void pc_q35_rhel_machine_8_4_0_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_q35_rhel_machine_8_5_0_options(m); +- m->desc = "RHEL-8.4.0 PC (Q35 + ICH9, 2009)"; +- m->alias = NULL; +- pcmc->smbios_stream_product = "RHEL-AV"; +- pcmc->smbios_stream_version = "8.4.0"; +- compat_props_add(m->compat_props, hw_compat_rhel_8_4, +- hw_compat_rhel_8_4_len); +- compat_props_add(m->compat_props, pc_rhel_8_4_compat, +- pc_rhel_8_4_compat_len); +-} +- +-DEFINE_Q35_MACHINE_BUGFIX(8, 4, 0); +- +-static void pc_q35_rhel_machine_8_3_0_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_q35_rhel_machine_8_4_0_options(m); +- m->desc = "RHEL-8.3.0 PC (Q35 + ICH9, 2009)"; +- m->alias = NULL; +- pcmc->smbios_stream_product = "RHEL-AV"; +- pcmc->smbios_stream_version = "8.3.0"; +- compat_props_add(m->compat_props, hw_compat_rhel_8_3, +- hw_compat_rhel_8_3_len); +- compat_props_add(m->compat_props, pc_rhel_8_3_compat, +- pc_rhel_8_3_compat_len); +- /* From pc_q35_5_1_machine_options() */ +- pcmc->kvmclock_create_always = false; +- /* From pc_q35_5_1_machine_options() */ +- pcmc->pci_root_uid = 1; +-} +- +-DEFINE_Q35_MACHINE_BUGFIX(8, 3, 0); +- +-static void pc_q35_rhel_machine_8_2_0_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_q35_rhel_machine_8_3_0_options(m); +- m->desc = "RHEL-8.2.0 PC (Q35 + ICH9, 2009)"; +- m->alias = NULL; +- m->numa_mem_supported = true; +- m->auto_enable_numa_with_memdev = false; +- pcmc->smbios_stream_product = "RHEL-AV"; +- pcmc->smbios_stream_version = "8.2.0"; +- compat_props_add(m->compat_props, hw_compat_rhel_8_2, +- hw_compat_rhel_8_2_len); +- compat_props_add(m->compat_props, pc_rhel_8_2_compat, +- pc_rhel_8_2_compat_len); +-} +- +-DEFINE_Q35_MACHINE_BUGFIX(8, 2, 0); +- +-static void pc_q35_rhel_machine_8_1_0_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_q35_rhel_machine_8_2_0_options(m); +- m->desc = "RHEL-8.1.0 PC (Q35 + ICH9, 2009)"; +- m->alias = NULL; +- pcmc->smbios_stream_product = NULL; +- pcmc->smbios_stream_version = NULL; +- compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len); +- compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len); +-} +- +-DEFINE_Q35_MACHINE_BUGFIX(8, 1, 0); +- +-static void pc_q35_rhel_machine_8_0_0_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_q35_rhel_machine_8_1_0_options(m); +- m->desc = "RHEL-8.0.0 PC (Q35 + ICH9, 2009)"; +- m->smbus_no_migration_support = true; +- m->alias = NULL; +- pcmc->pvh_enabled = false; +- pcmc->default_cpu_version = CPU_VERSION_LEGACY; +- compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len); +- compat_props_add(m->compat_props, pc_rhel_8_0_compat, pc_rhel_8_0_compat_len); +-} +- +-DEFINE_Q35_MACHINE_BUGFIX(8, 0, 0); +- +-static void pc_q35_rhel_machine_7_6_0_options(MachineClass *m) +-{ +- pc_q35_rhel_machine_8_0_0_options(m); +- m->alias = NULL; +- m->desc = "RHEL-7.6.0 PC (Q35 + ICH9, 2009)"; +- m->async_pf_vmexit_disable = true; +- compat_props_add(m->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len); +- compat_props_add(m->compat_props, pc_rhel_7_6_compat, pc_rhel_7_6_compat_len); +-} +- +-DEFINE_Q35_MACHINE_BUGFIX(7, 6, 0); +- +-- +2.39.3 + diff --git a/SOURCES/kvm-x86.conf b/SOURCES/kvm-x86.conf new file mode 100644 index 0000000..3f7842a --- /dev/null +++ b/SOURCES/kvm-x86.conf @@ -0,0 +1,12 @@ +# Setting modprobe kvm_intel/kvm_amd nested = 1 +# only enables Nested Virtualization until the next reboot or +# module reload. Uncomment the option applicable +# to your system below to enable the feature permanently. +# +# User changes in this file are preserved across upgrades. +# +# For Intel +#options kvm_intel nested=1 +# +# For AMD +#options kvm_amd nested=1 diff --git a/SOURCES/kvm.conf b/SOURCES/kvm.conf new file mode 100644 index 0000000..24e60e9 --- /dev/null +++ b/SOURCES/kvm.conf @@ -0,0 +1,3 @@ +# +# User changes in this file are preserved across upgrades. +# diff --git a/SOURCES/modules-load.conf b/SOURCES/modules-load.conf new file mode 100644 index 0000000..45b477d --- /dev/null +++ b/SOURCES/modules-load.conf @@ -0,0 +1,4 @@ +# When using SELinux in libvirt, automatic loading of the kvm.ko kernel +# module might not work when qemu-kvm tries to access /dev/kvm - thus we +# simply always load this module during the boot process already. +kvm diff --git a/SOURCES/qemu-ga.sysconfig b/SOURCES/qemu-ga.sysconfig new file mode 100644 index 0000000..736b471 --- /dev/null +++ b/SOURCES/qemu-ga.sysconfig @@ -0,0 +1,27 @@ +# This is a systemd environment file, not a shell script. +# It provides settings for "/lib/systemd/system/qemu-guest-agent.service". + +# Guest agent command with comma-separated blocked RPCs to disable, +# or empty list to enable all. +# +# You can get the list of RPC commands using "qemu-ga --block-rpcs='?'". +# There should be no spaces between commas and commands in the block list. +# FILTER_RPC_ARGS="--block-rpcs=guest-file-open,guest-file-close,guest-file-read,guest-file-write,guest-file-seek,guest-file-flush,guest-exec,guest-exec-status" + +# Guest agent command with comma-separated allowed RPCs to enable, +# or empty list to disable all. +# +# You can get the list of RPC commands using "qemu-ga --allow-rpcs='?'". +# There should be no spaces between commas and commands in the allow list. +FILTER_RPC_ARGS="--allow-rpcs=guest-sync-delimited,guest-sync,guest-ping,guest-get-time,guest-set-time,guest-info,guest-shutdown,guest-fsfreeze-status,guest-fsfreeze-freeze,guest-fsfreeze-freeze-list,guest-fsfreeze-thaw,guest-fstrim,guest-suspend-disk,guest-suspend-ram,guest-suspend-hybrid,guest-network-get-interfaces,guest-get-vcpus,guest-set-vcpus,guest-get-disks,guest-get-fsinfo,guest-set-user-password,guest-get-memory-blocks,guest-set-memory-blocks,guest-get-memory-block-info,guest-get-host-name,guest-get-users,guest-get-timezone,guest-get-osinfo,guest-get-devices,guest-ssh-get-authorized-keys,guest-ssh-add-authorized-keys,guest-ssh-remove-authorized-keys,guest-get-diskstats,guest-get-cpustats" + +# Fsfreeze hook script specification. +# +# FSFREEZE_HOOK_PATHNAME=/dev/null : disables the feature. +# +# FSFREEZE_HOOK_PATHNAME=/path/to/executable : enables the feature with the +# specified binary or shell script. +# +# FSFREEZE_HOOK_PATHNAME= : enables the feature with the +# default value (invoke "qemu-ga --help" to interrogate). +FSFREEZE_HOOK_PATHNAME=/etc/qemu-ga/fsfreeze-hook diff --git a/SOURCES/qemu-guest-agent.service b/SOURCES/qemu-guest-agent.service new file mode 100644 index 0000000..f74ebd0 --- /dev/null +++ b/SOURCES/qemu-guest-agent.service @@ -0,0 +1,19 @@ +[Unit] +Description=QEMU Guest Agent +BindsTo=dev-virtio\x2dports-org.qemu.guest_agent.0.device +After=dev-virtio\x2dports-org.qemu.guest_agent.0.device +IgnoreOnIsolate=True + +[Service] +UMask=0077 +EnvironmentFile=/etc/sysconfig/qemu-ga +ExecStart=/usr/bin/qemu-ga \ + --method=virtio-serial \ + --path=/dev/virtio-ports/org.qemu.guest_agent.0 \ + ${FILTER_RPC_ARGS} \ + -F${FSFREEZE_HOOK_PATHNAME} +Restart=always +RestartSec=0 + +[Install] +WantedBy=dev-virtio\x2dports-org.qemu.guest_agent.0.device diff --git a/SOURCES/vhost.conf b/SOURCES/vhost.conf new file mode 100644 index 0000000..68d6d7f --- /dev/null +++ b/SOURCES/vhost.conf @@ -0,0 +1,3 @@ +# Increase default vhost memory map limit to match +# KVM's memory slot limit +options vhost max_mem_regions=509 diff --git a/SPECS/qemu-kvm.spec b/SPECS/qemu-kvm.spec new file mode 100644 index 0000000..c56cc46 --- /dev/null +++ b/SPECS/qemu-kvm.spec @@ -0,0 +1,1436 @@ +%global libfdt_version 1.6.0 +%global libseccomp_version 2.4.0 +%global libusbx_version 1.0.23 +%global meson_version 0.61.3 +%global usbredir_version 0.7.1 +%global ipxe_version 20200823-5.git4bd064de + +# LTO does not work with the coroutines of QEMU on non-x86 architectures +# (see BZ 1952483 and 1950192 for more information) +%ifnarch x86_64 + %global _lto_cflags %%{nil} +%endif + +%global have_usbredir 1 +%global have_opengl 1 +%global have_fdt 1 +%global have_modules_load 0 +%global have_memlock_limits 0 +# Some of these are not relevant for RHEL, but defining them +# makes it easier to sync the dependency list with Fedora +%global have_block_rbd 1 +%global enable_werror 1 +%global have_clang 1 +%global have_safe_stack 0 + + +%if %{have_clang} +%global toolchain clang +%ifarch x86_64 +%global have_safe_stack 1 +%endif +%else +%global toolchain gcc +%global cc_suffix .gcc +%endif + + + +# Release candidate version tracking +# global rcver rc4 +%if 0%{?rcver:1} +%global rcrel .%{rcver} +%global rcstr -%{rcver} +%endif + +# Features disabled in RHEL 10 +%global have_pmem 0 +%global have_librdma 0 + +%global have_numactl 1 +%ifarch s390x + %global have_numactl 0 +%endif + +%global tools_only 0 +%ifarch %{power64} + %global tools_only 1 +%endif + +%ifnarch %{ix86} x86_64 aarch64 + %global have_usbredir 0 +%endif + + +%global modprobe_kvm_conf %{_sourcedir}/kvm.conf +%ifarch s390x + %global modprobe_kvm_conf %{_sourcedir}/kvm-s390x.conf +%endif +%ifarch %{ix86} x86_64 + %global modprobe_kvm_conf %{_sourcedir}/kvm-x86.conf +%endif + +%ifarch %{ix86} + %global kvm_target i386 +%endif +%ifarch x86_64 + %global kvm_target x86_64 +%else + %global have_opengl 0 +%endif +%ifarch %{power64} + %global kvm_target ppc64 + %global have_memlock_limits 1 +%endif +%ifarch s390x + %global kvm_target s390x + %global have_modules_load 1 +%endif +%ifarch ppc + %global kvm_target ppc +%endif +%ifarch aarch64 + %global kvm_target aarch64 +%endif + +%global target_list %{kvm_target}-softmmu +%global block_drivers_rw_list qcow2,raw,file,host_device,nbd,iscsi,rbd,blkdebug,luks,null-co,nvme,copy-on-read,throttle,compress,virtio-blk-vhost-vdpa,virtio-blk-vfio-pci,virtio-blk-vhost-user,io_uring,nvme-io_uring +%global block_drivers_ro_list vdi,vmdk,vhdx,vpc,https +%define qemudocdir %{_docdir}/%{name} +%global firmwaredirs "%{_datadir}/qemu-firmware:%{_datadir}/ipxe/qemu:%{_datadir}/seavgabios:%{_datadir}/seabios" + +#Versions of various parts: + +%global requires_all_modules \ +%if %{have_opengl} \ +Requires: %{name}-ui-opengl = %{epoch}:%{version}-%{release} \ +Requires: %{name}-ui-egl-headless = %{epoch}:%{version}-%{release} \ +%endif \ +Requires: %{name}-device-display-virtio-gpu = %{epoch}:%{version}-%{release} \ +%ifarch s390x \ +Requires: %{name}-device-display-virtio-gpu-ccw = %{epoch}:%{version}-%{release} \ +%else \ +Requires: %{name}-device-display-virtio-gpu-pci = %{epoch}:%{version}-%{release} \ +%endif \ +%ifarch x86_64 %{power64} \ +Requires: %{name}-device-display-virtio-vga = %{epoch}:%{version}-%{release} \ +%endif \ +Requires: %{name}-device-usb-host = %{epoch}:%{version}-%{release} \ +%if %{have_usbredir} \ +Requires: %{name}-device-usb-redirect = %{epoch}:%{version}-%{release} \ +%endif \ +Requires: %{name}-block-blkio = %{epoch}:%{version}-%{release} \ +Requires: %{name}-block-rbd = %{epoch}:%{version}-%{release} \ +Requires: %{name}-audio-pa = %{epoch}:%{version}-%{release} + +# Since SPICE is removed from RHEL-9, the following Obsoletes: +# removes {name}-ui-spice for upgrades from RHEL-8 +# The "<= {version}" assumes RHEL-9 version >= RHEL-8 version (in +# other words RHEL-9 rebases are done together/before RHEL-8 ones) + +# In addition, we obsolete some block drivers as we are no longer support +# them in default qemu-kvm installation. + +# Note: ssh driver wasn't removed yet just disabled due to late handling + +%global obsoletes_some_modules \ +Obsoletes: %{name}-ui-spice <= %{epoch}:%{version} \ +Obsoletes: %{name}-block-gluster <= %{epoch}:%{version} \ +Obsoletes: %{name}-block-iscsi <= %{epoch}:%{version} \ +Obsoletes: %{name}-block-ssh <= %{epoch}:%{version} \ + + +Summary: QEMU is a machine emulator and virtualizer +Name: qemu-kvm +Version: 9.1.0 +Release: 2%{?rcrel}%{?dist}%{?cc_suffix} +# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped +# Epoch 15 used for RHEL 8 +# Epoch 17 used for RHEL 9 (due to release versioning offset in RHEL 8.5) +Epoch: 18 +License: GPL-2.0-only AND GPL-2.0-or-later AND CC-BY-3.0 +URL: http://www.qemu.org/ +ExclusiveArch: x86_64 %{power64} aarch64 s390x + + +Source0: http://wiki.qemu.org/download/qemu-%{version}%{?rcstr}.tar.xz + +Source10: qemu-guest-agent.service +Source11: 99-qemu-guest-agent.rules +Source12: bridge.conf +Source13: qemu-ga.sysconfig +Source21: modules-load.conf +Source26: vhost.conf +Source27: kvm.conf +Source28: 95-kvm-memlock.conf +Source30: kvm-s390x.conf +Source31: kvm-x86.conf +Source36: README.tests + + +Patch0004: 0004-Initial-redhat-build.patch +Patch0005: 0005-Enable-disable-devices-for-RHEL.patch +Patch0006: 0006-Machine-type-related-general-changes.patch +Patch0007: 0007-meson-temporarily-disable-Wunused-function.patch +Patch0008: 0008-Remove-upstream-machine-types-for-aarch64-s390x-and-.patch +Patch0009: 0009-Adapt-versioned-machine-type-macros-for-RHEL.patch +Patch0010: 0010-Increase-deletion-schedule-to-4-releases.patch +Patch0011: 0011-Add-downstream-aarch64-versioned-virt-machine-types.patch +Patch0012: 0012-Add-downstream-s390x-versioned-s390-ccw-virtio-machi.patch +Patch0013: 0013-Add-downstream-x86_64-versioned-pc-q35-machine-types.patch +Patch0014: 0014-Revert-meson-temporarily-disable-Wunused-function.patch +Patch0015: 0015-Enable-make-check.patch +Patch0016: 0016-vfio-cap-number-of-devices-that-can-be-assigned.patch +Patch0017: 0017-Add-support-statement-to-help-output.patch +Patch0018: 0018-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch +Patch0019: 0019-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch +Patch0021: 0021-Add-upstream-compatibility-bits.patch +Patch0022: 0022-redhat-Add-QEMU-9.1-compat-handling-to-the-s390x-mac.patch +Patch0023: 0023-redhat-Add-rhel9.6.0-and-rhel10.0.0-machine-types.patch +Patch0024: 0024-x86-ensure-compatibility-of-pc-q35-rhel9.patch +Patch0025: 0025-arm-ensure-compatibility-of-virt-rhel9.patch +# For RHEL-29002 - Remove the existing deprecated machine types in RHEL-10 +# For RHEL-29003 - Deprecate RHEL-9 machine types in RHEL-10 +# For RHEL-35587 - Create a pc-i440fx-rhel10.0 machine type +# For RHEL-38411 - [Fujitsu 10.0 FEAT]: qemu-kvm: Continue to support i440fx for RHEL10 +# For RHEL-45141 - Introduce virt-rhel10.0 arm-virt machine type [aarch64] +Patch26: kvm-x86-create-new-pc-q35-machine-type-for-rhel-9.6.patch +# For RHEL-29002 - Remove the existing deprecated machine types in RHEL-10 +# For RHEL-29003 - Deprecate RHEL-9 machine types in RHEL-10 +# For RHEL-35587 - Create a pc-i440fx-rhel10.0 machine type +# For RHEL-38411 - [Fujitsu 10.0 FEAT]: qemu-kvm: Continue to support i440fx for RHEL10 +# For RHEL-45141 - Introduce virt-rhel10.0 arm-virt machine type [aarch64] +Patch27: kvm-arm-create-new-virt-machine-type-for-rhel-9.6.patch +# For RHEL-29002 - Remove the existing deprecated machine types in RHEL-10 +# For RHEL-29003 - Deprecate RHEL-9 machine types in RHEL-10 +# For RHEL-35587 - Create a pc-i440fx-rhel10.0 machine type +# For RHEL-38411 - [Fujitsu 10.0 FEAT]: qemu-kvm: Continue to support i440fx for RHEL10 +# For RHEL-45141 - Introduce virt-rhel10.0 arm-virt machine type [aarch64] +Patch28: kvm-x86-create-pc-i440fx-machine-type-for-rhel10.patch +# For RHEL-29002 - Remove the existing deprecated machine types in RHEL-10 +# For RHEL-29003 - Deprecate RHEL-9 machine types in RHEL-10 +# For RHEL-35587 - Create a pc-i440fx-rhel10.0 machine type +# For RHEL-38411 - [Fujitsu 10.0 FEAT]: qemu-kvm: Continue to support i440fx for RHEL10 +# For RHEL-45141 - Introduce virt-rhel10.0 arm-virt machine type [aarch64] +Patch29: kvm-x86-create-pc-q35-machine-type-for-rhel10.patch +# For RHEL-29002 - Remove the existing deprecated machine types in RHEL-10 +# For RHEL-29003 - Deprecate RHEL-9 machine types in RHEL-10 +# For RHEL-35587 - Create a pc-i440fx-rhel10.0 machine type +# For RHEL-38411 - [Fujitsu 10.0 FEAT]: qemu-kvm: Continue to support i440fx for RHEL10 +# For RHEL-45141 - Introduce virt-rhel10.0 arm-virt machine type [aarch64] +Patch30: kvm-arm-create-virt-machine-type-for-rhel10.patch +# For RHEL-29002 - Remove the existing deprecated machine types in RHEL-10 +# For RHEL-29003 - Deprecate RHEL-9 machine types in RHEL-10 +# For RHEL-35587 - Create a pc-i440fx-rhel10.0 machine type +# For RHEL-38411 - [Fujitsu 10.0 FEAT]: qemu-kvm: Continue to support i440fx for RHEL10 +# For RHEL-45141 - Introduce virt-rhel10.0 arm-virt machine type [aarch64] +Patch31: kvm-x86-remove-deprecated-rhel-machine-types.patch +# For RHEL-29002 - Remove the existing deprecated machine types in RHEL-10 +# For RHEL-29003 - Deprecate RHEL-9 machine types in RHEL-10 +# For RHEL-35587 - Create a pc-i440fx-rhel10.0 machine type +# For RHEL-38411 - [Fujitsu 10.0 FEAT]: qemu-kvm: Continue to support i440fx for RHEL10 +# For RHEL-45141 - Introduce virt-rhel10.0 arm-virt machine type [aarch64] +Patch32: kvm-remove-stale-compat-definitions.patch +# For RHEL-38374 - aarch64 SMBIOS 'Manufacturer' and 'Product Name' differ from x86 ones [rhel-10] +Patch33: kvm-RH-Author-Shaoqin-Huang-shahuang-redhat.com.patch +# For RHEL-57028 - fsfreeze hooks break on the systems first restorecon [rhel-10] +Patch34: kvm-qemu-guest-agent-Update-the-logfile-path-of-qga-fsfr.patch + +%if %{have_clang} +BuildRequires: clang +%if %{have_safe_stack} +BuildRequires: compiler-rt +%endif +%else +BuildRequires: gcc +%endif +BuildRequires: meson >= %{meson_version} +BuildRequires: ninja-build +BuildRequires: zlib-devel +BuildRequires: libzstd-devel +BuildRequires: glib2-devel +BuildRequires: gnutls-devel +BuildRequires: cyrus-sasl-devel +BuildRequires: libaio-devel +BuildRequires: libblkio-devel +BuildRequires: liburing-devel +BuildRequires: python3-devel +BuildRequires: libattr-devel +BuildRequires: libusbx-devel >= %{libusbx_version} +%if %{have_usbredir} +BuildRequires: usbredir-devel >= %{usbredir_version} +%endif +BuildRequires: texinfo +BuildRequires: python3-sphinx +BuildRequires: python3-sphinx_rtd_theme +BuildRequires: libseccomp-devel >= %{libseccomp_version} +# For network block driver +BuildRequires: libcurl-devel +%if %{have_block_rbd} +BuildRequires: librbd-devel +%endif +# We need both because the 'stap' binary is probed for by configure +BuildRequires: systemtap +BuildRequires: systemtap-sdt-devel +# For VNC PNG support +BuildRequires: libpng-devel +# For virtiofs +BuildRequires: libcap-ng-devel +# Hard requirement for version >= 1.3 +BuildRequires: pixman-devel +# For rdma +%if %{have_librdma} +BuildRequires: rdma-core-devel +%endif +%if %{have_fdt} +BuildRequires: libfdt-devel >= %{libfdt_version} +%endif +# For compressed guest memory dumps +BuildRequires: lzo-devel snappy-devel +# For NUMA memory binding +%if %{have_numactl} +BuildRequires: numactl-devel +%endif +# qemu-pr-helper multipath support (requires libudev too) +BuildRequires: device-mapper-multipath-devel +BuildRequires: systemd-devel +%if %{have_pmem} +BuildRequires: libpmem-devel +%endif +# qemu-keymap +BuildRequires: pkgconfig(xkbcommon) +%if %{have_opengl} +BuildRequires: pkgconfig(epoxy) +BuildRequires: pkgconfig(libdrm) +BuildRequires: pkgconfig(gbm) +%endif +BuildRequires: perl-Test-Harness +BuildRequires: libslirp-devel +BuildRequires: pulseaudio-libs-devel +BuildRequires: spice-protocol +BuildRequires: capstone-devel + +# Requires for qemu-kvm package +Requires: %{name}-core = %{epoch}:%{version}-%{release} +Requires: %{name}-docs = %{epoch}:%{version}-%{release} +Requires: %{name}-tools = %{epoch}:%{version}-%{release} +Requires: qemu-pr-helper = %{epoch}:%{version}-%{release} +Requires: virtiofsd >= 1.5.0 +%{requires_all_modules} + +%description +%{name} is an open source virtualizer that provides hardware +emulation for the KVM hypervisor. %{name} acts as a virtual +machine monitor together with the KVM kernel modules, and emulates the +hardware for a full system such as a PC and its associated peripherals. + + +%package core +Summary: %{name} core components +%{obsoletes_some_modules} +Requires: %{name}-common = %{epoch}:%{version}-%{release} +Requires: qemu-img = %{epoch}:%{version}-%{release} +%ifarch %{ix86} x86_64 +Requires: edk2-ovmf +%endif +%ifarch aarch64 +Requires: edk2-aarch64 +%endif + +Requires: libseccomp >= %{libseccomp_version} +Requires: libusbx >= %{libusbx_version} +Requires: capstone +%if %{have_fdt} +Requires: libfdt >= %{libfdt_version} +%endif + +%description core +%{name} is an open source virtualizer that provides hardware +emulation for the KVM hypervisor. %{name} acts as a virtual +machine monitor together with the KVM kernel modules, and emulates the +hardware for a full system such as a PC and its associated peripherals. +This is a minimalistic installation of %{name}. Functionality provided by +this package is not ensured and it can change in a future version as some +functionality can be split out to separate package. +Before updating this package, it is recommended to check the package +changelog for information on functionality which might have been moved to +a separate package to prevent issues due to the moved functionality. +If apps opt-in to minimalist packaging by depending on %{name}-core, they +explicitly accept that features may disappear from %{name}-core in future +updates. + +%package common +Summary: QEMU common files needed by all QEMU targets +Requires(post): /usr/bin/getent +Requires(post): /usr/sbin/groupadd +Requires(post): /usr/sbin/useradd +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +%ifarch %{ix86} x86_64 +Requires: seabios-bin >= 1.10.2-1 +%endif +%ifnarch aarch64 s390x +Requires: seavgabios-bin >= 1.12.0-3 +Requires: ipxe-roms-qemu >= %{ipxe_version} +%endif +# Removal -gl modules as they do not provide any functionality - see bz#2149022 +Obsoletes: %{name}-device-display-virtio-gpu-gl <= %{epoch}:%{version} +Obsoletes: %{name}-device-display-virtio-gpu-pci-gl <= %{epoch}:%{version} +Obsoletes: %{name}-device-display-virtio-vga-gl <= %{epoch}:%{version} + +%description common +%{name} is an open source virtualizer that provides hardware emulation for +the KVM hypervisor. + +This package provides documentation and auxiliary programs used with %{name}. + + +%package tools +Summary: %{name} support tools +%description tools +%{name}-tools provides various tools related to %{name} usage. + + +%package docs +Summary: %{name} documentation +%description docs +%{name}-docs provides documentation files regarding %{name}. + + +%package -n qemu-pr-helper +Summary: qemu-pr-helper utility for %{name} +%description -n qemu-pr-helper +This package provides the qemu-pr-helper utility that is required for certain +SCSI features. + + +%package -n qemu-img +Summary: QEMU command line tool for manipulating disk images +%description -n qemu-img +This package provides a command line tool for manipulating disk images. + + +%package -n qemu-guest-agent +Summary: QEMU guest agent +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +%description -n qemu-guest-agent +%{name} is an open source virtualizer that provides hardware emulation for +the KVM hypervisor. + +This package provides an agent to run inside guests, which communicates +with the host over a virtio-serial channel named "org.qemu.guest_agent.0" + +This package does not need to be installed on the host OS. + + +%package tests +Summary: tests for the %{name} package +Requires: %{name} = %{epoch}:%{version}-%{release} + +%define testsdir %{_libdir}/%{name}/tests-src + +%description tests +The %{name}-tests rpm contains tests that can be used to verify +the functionality of the installed %{name} package + +Install this package if you want access to the avocado_qemu +tests, or qemu-iotests. + + +%package block-blkio +Summary: QEMU libblkio block drivers +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description block-blkio +This package provides the additional libblkio block drivers for QEMU. + +Install this package if you want to use virtio-blk-vdpa-blk, +virtio-blk-vfio-pci, virtio-blk-vhost-user, io_uring, and nvme-io_uring block +drivers provided by libblkio. + + +%package block-curl +Summary: QEMU CURL block driver +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description block-curl +This package provides the additional CURL block driver for QEMU. + +Install this package if you want to access remote disks over +http, https, ftp and other transports provided by the CURL library. + + +%if %{have_block_rbd} +%package block-rbd +Summary: QEMU Ceph/RBD block driver +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description block-rbd +This package provides the additional Ceph/RBD block driver for QEMU. + +Install this package if you want to access remote Ceph volumes +using the rbd protocol. +%endif + + +%package audio-pa +Summary: QEMU PulseAudio audio driver +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description audio-pa +This package provides the additional PulseAudio audio driver for QEMU. + + +%if %{have_opengl} +%package ui-opengl +Summary: QEMU opengl support +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: mesa-libGL +Requires: mesa-libEGL +Requires: mesa-dri-drivers +%description ui-opengl +This package provides opengl support. + +%package ui-egl-headless +Summary: QEMU EGL headless driver +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-ui-opengl%{?_isa} = %{epoch}:%{version}-%{release} +%description ui-egl-headless +This package provides the additional egl-headless UI for QEMU. +%endif + + +%package device-display-virtio-gpu +Summary: QEMU virtio-gpu display device +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description device-display-virtio-gpu +This package provides the virtio-gpu display device for QEMU. + +%ifarch s390x +%package device-display-virtio-gpu-ccw +Summary: QEMU virtio-gpu-ccw display device +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-device-display-virtio-gpu = %{epoch}:%{version}-%{release} +%description device-display-virtio-gpu-ccw +This package provides the virtio-gpu-ccw display device for QEMU. +%else +%package device-display-virtio-gpu-pci +Summary: QEMU virtio-gpu-pci display device +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-device-display-virtio-gpu = %{epoch}:%{version}-%{release} +%description device-display-virtio-gpu-pci +This package provides the virtio-gpu-pci display device for QEMU. +%endif + +%ifarch x86_64 %{power64} +%package device-display-virtio-vga +Summary: QEMU virtio-vga display device +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description device-display-virtio-vga +This package provides the virtio-vga display device for QEMU. +%endif + +%package device-usb-host +Summary: QEMU usb host device +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description device-usb-host +This package provides the USB pass through driver for QEMU. + +%if %{have_usbredir} +%package device-usb-redirect +Summary: QEMU usbredir support +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: usbredir >= 0.7.1 +Provides: %{name}-hw-usbredir +Obsoletes: %{name}-hw-usbredir <= %{epoch}:%{version} + +%description device-usb-redirect +This package provides usbredir support. +%endif + +%package ui-dbus +Summary: QEMU D-Bus UI driver +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description ui-dbus +This package provides the additional D-Bus UI for QEMU. + +%package audio-dbus +Summary: QEMU D-Bus audio driver +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-ui-dbus = %{epoch}:%{version}-%{release} +%description audio-dbus +This package provides the additional D-Bus audio driver for QEMU. + +%prep +%setup -q -n qemu-%{version}%{?rcstr} +%autopatch -p1 + +%global qemu_kvm_build qemu_kvm_build +mkdir -p %{qemu_kvm_build} + + +%build + +# Necessary hack for ZUUL CI +ulimit -n 10240 + +%define disable_everything \\\ + --audio-drv-list= \\\ + --disable-alsa \\\ + --disable-attr \\\ + --disable-auth-pam \\\ + --disable-avx2 \\\ + --disable-avx512bw \\\ + --disable-blkio \\\ + --disable-block-drv-whitelist-in-tools \\\ + --disable-bochs \\\ + --disable-bpf \\\ + --disable-brlapi \\\ + --disable-bsd-user \\\ + --disable-bzip2 \\\ + --disable-cap-ng \\\ + --disable-capstone \\\ + --disable-cfi \\\ + --disable-cfi-debug \\\ + --disable-cloop \\\ + --disable-cocoa \\\ + --disable-coreaudio \\\ + --disable-coroutine-pool \\\ + --disable-crypto-afalg \\\ + --disable-curl \\\ + --disable-curses \\\ + --disable-dbus-display \\\ + --disable-debug-info \\\ + --disable-debug-mutex \\\ + --disable-debug-tcg \\\ + --disable-dmg \\\ + --disable-docs \\\ + --disable-download \\\ + --disable-dsound \\\ + --disable-fdt \\\ + --disable-fuse \\\ + --disable-fuse-lseek \\\ + --disable-gcrypt \\\ + --disable-gettext \\\ + --disable-gio \\\ + --disable-glusterfs \\\ + --disable-gnutls \\\ + --disable-gtk \\\ + --disable-guest-agent \\\ + --disable-guest-agent-msi \\\ + --disable-hvf \\\ + --disable-iconv \\\ + --disable-jack \\\ + --disable-kvm \\\ + --disable-l2tpv3 \\\ + --disable-libdaxctl \\\ + --disable-libdw \\\ + --disable-libiscsi \\\ + --disable-libnfs \\\ + --disable-libpmem \\\ + --disable-libssh \\\ + --disable-libudev \\\ + --disable-libusb \\\ + --disable-libvduse \\\ + --disable-linux-aio \\\ + --disable-linux-io-uring \\\ + --disable-linux-user \\\ + --disable-lto \\\ + --disable-lzfse \\\ + --disable-lzo \\\ + --disable-malloc-trim \\\ + --disable-membarrier \\\ + --disable-modules \\\ + --disable-module-upgrades \\\ + --disable-mpath \\\ + --disable-multiprocess \\\ + --disable-netmap \\\ + --disable-nettle \\\ + --disable-numa \\\ + --disable-nvmm \\\ + --disable-opengl \\\ + --disable-oss \\\ + --disable-pa \\\ + --disable-parallels \\\ + --disable-pie \\\ + --disable-plugins \\\ + --disable-qcow1 \\\ + --disable-qed \\\ + --disable-qga-vss \\\ + --disable-qom-cast-debug \\\ + --disable-rbd \\\ + --disable-rdma \\\ + --disable-replication \\\ + --disable-rng-none \\\ + --disable-safe-stack \\\ + --disable-sanitizers \\\ + --disable-sdl \\\ + --disable-sdl-image \\\ + --disable-seccomp \\\ + --disable-selinux \\\ + --disable-slirp \\\ + --disable-slirp-smbd \\\ + --disable-smartcard \\\ + --disable-snappy \\\ + --disable-sndio \\\ + --disable-sparse \\\ + --disable-spice \\\ + --disable-spice-protocol \\\ + --disable-strip \\\ + --disable-system \\\ + --disable-tcg \\\ + --disable-tools \\\ + --disable-tpm \\\ + --disable-u2f \\\ + --disable-usb-redir \\\ + --disable-user \\\ + --disable-vde \\\ + --disable-vdi \\\ + --disable-vduse-blk-export \\\ + --disable-vhost-crypto \\\ + --disable-vhost-kernel \\\ + --disable-vhost-net \\\ + --disable-vhost-user \\\ + --disable-vhost-user-blk-server \\\ + --disable-vhost-vdpa \\\ + --disable-virglrenderer \\\ + --disable-virtfs \\\ + --disable-vnc \\\ + --disable-vnc-jpeg \\\ + --disable-png \\\ + --disable-vnc-sasl \\\ + --disable-vte \\\ + --disable-vvfat \\\ + --disable-werror \\\ + --disable-whpx \\\ + --disable-xen \\\ + --disable-xen-pci-passthrough \\\ + --disable-xkbcommon \\\ + --disable-zstd \\\ + --without-default-devices + + +run_configure() { + ../configure \ + --cc=%{__cc} \ + --cxx=/bin/false \ + --prefix="%{_prefix}" \ + --libdir="%{_libdir}" \ + --datadir="%{_datadir}" \ + --sysconfdir="%{_sysconfdir}" \ + --interp-prefix=%{_prefix}/qemu-%M \ + --localstatedir="%{_localstatedir}" \ + --docdir="%{_docdir}" \ + --libexecdir="%{_libexecdir}" \ + --extra-ldflags="%{build_ldflags}" \ + --extra-cflags="%{optflags} -Wno-string-plus-int" \ + --with-pkgversion="%{name}-%{version}-%{release}" \ + --with-suffix="%{name}" \ + --firmwarepath=%{firmwaredirs} \ + --enable-trace-backends=dtrace \ + --with-coroutine=ucontext \ + --tls-priority=@QEMU,SYSTEM \ + %{disable_everything} \ +%ifarch aarch64 s390x x86_64 + --with-devices-%{kvm_target}=%{kvm_target}-rh-devices \ +%endif + --rhel-version=10 \ + "$@" + + echo "config-host.mak contents:" + echo "===" + cat config-host.mak + echo "===" +} + + +pushd %{qemu_kvm_build} +run_configure \ +%if %{defined target_list} + --target-list="%{target_list}" \ +%endif +%if %{defined block_drivers_rw_list} + --block-drv-rw-whitelist=%{block_drivers_rw_list} \ +%endif +%if %{defined block_drivers_ro_list} + --block-drv-ro-whitelist=%{block_drivers_ro_list} \ +%endif + --enable-attr \ + --enable-blkio \ + --enable-cap-ng \ + --enable-capstone \ + --enable-coroutine-pool \ + --enable-curl \ + --enable-dbus-display \ + --enable-debug-info \ + --enable-docs \ +%if %{have_fdt} + --enable-fdt=system \ +%endif + --enable-gio \ + --enable-gnutls \ + --enable-guest-agent \ + --enable-iconv \ + --enable-kvm \ +%if %{have_pmem} + --enable-libpmem \ +%endif + --enable-libusb \ + --enable-libudev \ + --enable-linux-aio \ + --enable-linux-io-uring \ + --enable-lzo \ + --enable-malloc-trim \ + --enable-modules \ + --enable-mpath \ +%if %{have_numactl} + --enable-numa \ +%endif +%if %{have_opengl} + --enable-opengl \ +%endif + --enable-pa \ + --enable-pie \ +%if %{have_block_rbd} + --enable-rbd \ +%endif +%if %{have_librdma} + --enable-rdma \ +%endif + --enable-seccomp \ + --enable-selinux \ + --enable-slirp \ + --enable-snappy \ + --enable-spice-protocol \ + --enable-system \ + --enable-tcg \ + --enable-tools \ + --enable-tpm \ +%if %{have_usbredir} + --enable-usb-redir \ +%endif + --enable-vdi \ + --enable-vhost-kernel \ + --enable-vhost-net \ + --enable-vhost-user \ + --enable-vhost-user-blk-server \ + --enable-vhost-vdpa \ + --enable-vnc \ + --enable-png \ + --enable-vnc-sasl \ +%if %{enable_werror} + --enable-werror \ +%endif + --enable-xkbcommon \ + --enable-zstd \ +%if %{have_safe_stack} + --enable-safe-stack \ +%endif + +%if %{tools_only} +%make_build qemu-img +%make_build qemu-io +%make_build qemu-nbd +%make_build storage-daemon/qemu-storage-daemon + +%make_build docs/qemu-img.1 +%make_build docs/qemu-nbd.8 +%make_build docs/qemu-storage-daemon.1 +%make_build docs/qemu-storage-daemon-qmp-ref.7 + +%make_build qga/qemu-ga +%make_build docs/qemu-ga.8 +# endif tools_only +%endif + + +%if !%{tools_only} +%make_build + +# Setup back compat qemu-kvm binary +%{__python3} scripts/tracetool.py --backend dtrace --format stap \ + --group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \ + trace/trace-events-all qemu-kvm.stp + +%{__python3} scripts/tracetool.py --backends=dtrace --format=log-stap \ + --group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \ + trace/trace-events-all qemu-kvm-log.stp + +%{__python3} scripts/tracetool.py --backend dtrace --format simpletrace-stap \ + --group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \ + trace/trace-events-all qemu-kvm-simpletrace.stp + +cp -a qemu-system-%{kvm_target} qemu-kvm + +%ifarch s390x + # Copy the built new images into place for "make check": + cp pc-bios/s390-ccw/s390-ccw.img pc-bios/s390-ccw/s390-netboot.img pc-bios/ +%endif + +popd +# endif !tools_only +%endif + + + +%install +# Install qemu-guest-agent service and udev rules +install -D -m 0644 %{_sourcedir}/qemu-guest-agent.service %{buildroot}%{_unitdir}/qemu-guest-agent.service +install -D -m 0644 %{_sourcedir}/qemu-ga.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/qemu-ga +install -D -m 0644 %{_sourcedir}/99-qemu-guest-agent.rules %{buildroot}%{_udevrulesdir}/99-qemu-guest-agent.rules + + +# Install qemu-ga fsfreeze bits +mkdir -p %{buildroot}%{_sysconfdir}/qemu-ga/fsfreeze-hook.d +install -p scripts/qemu-guest-agent/fsfreeze-hook %{buildroot}%{_sysconfdir}/qemu-ga/fsfreeze-hook +mkdir -p %{buildroot}%{_datadir}/%{name}/qemu-ga/fsfreeze-hook.d/ +install -p -m 0644 scripts/qemu-guest-agent/fsfreeze-hook.d/*.sample %{buildroot}%{_datadir}/%{name}/qemu-ga/fsfreeze-hook.d/ +mkdir -p -v %{buildroot}%{_localstatedir}/log/qemu-ga/ + + +%if %{tools_only} +pushd %{qemu_kvm_build} +install -D -p -m 0755 qga/qemu-ga %{buildroot}%{_bindir}/qemu-ga +install -D -p -m 0755 qemu-img %{buildroot}%{_bindir}/qemu-img +install -D -p -m 0755 qemu-io %{buildroot}%{_bindir}/qemu-io +install -D -p -m 0755 qemu-nbd %{buildroot}%{_bindir}/qemu-nbd +install -D -p -m 0755 storage-daemon/qemu-storage-daemon %{buildroot}%{_bindir}/qemu-storage-daemon + +mkdir -p %{buildroot}%{_mandir}/man1/ +mkdir -p %{buildroot}%{_mandir}/man7/ +mkdir -p %{buildroot}%{_mandir}/man8/ + +install -D -p -m 644 docs/qemu-img.1* %{buildroot}%{_mandir}/man1 +install -D -p -m 644 docs/qemu-nbd.8* %{buildroot}%{_mandir}/man8 +install -D -p -m 644 docs/qemu-storage-daemon.1* %{buildroot}%{_mandir}/man1 +install -D -p -m 644 docs/qemu-storage-daemon-qmp-ref.7* %{buildroot}%{_mandir}/man7 +install -D -p -m 644 docs/qemu-ga.8* %{buildroot}%{_mandir}/man8 +popd +# endif tools_only +%endif + +%if !%{tools_only} + +install -D -p -m 0644 %{_sourcedir}/vhost.conf %{buildroot}%{_sysconfdir}/modprobe.d/vhost.conf +install -D -p -m 0644 %{modprobe_kvm_conf} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/kvm.conf + +# Create new directories and put them all under tests-src +mkdir -p %{buildroot}%{testsdir}/python +mkdir -p %{buildroot}%{testsdir}/tests +mkdir -p %{buildroot}%{testsdir}/tests/avocado +mkdir -p %{buildroot}%{testsdir}/tests/qemu-iotests +mkdir -p %{buildroot}%{testsdir}/scripts/qmp + + +install -m 0644 scripts/dump-guest-memory.py \ + %{buildroot}%{_datadir}/%{name} + +# Install avocado_qemu tests +cp -R %{qemu_kvm_build}/tests/avocado/* %{buildroot}%{testsdir}/tests/avocado/ + +# Install qemu.py and qmp/ scripts required to run avocado_qemu tests +cp -R %{qemu_kvm_build}/python/qemu %{buildroot}%{testsdir}/python +cp -R %{qemu_kvm_build}/scripts/qmp/* %{buildroot}%{testsdir}/scripts/qmp +install -p -m 0644 tests/Makefile.include %{buildroot}%{testsdir}/tests/ + +# Install qemu-iotests +cp -R tests/qemu-iotests/* %{buildroot}%{testsdir}/tests/qemu-iotests/ +cp -ur %{qemu_kvm_build}/tests/qemu-iotests/* %{buildroot}%{testsdir}/tests/qemu-iotests/ + +install -p -m 0644 %{_sourcedir}/README.tests %{buildroot}%{testsdir}/README + +# Do the actual qemu tree install +pushd %{qemu_kvm_build} +%make_install +popd + +mkdir -p %{buildroot}%{_datadir}/systemtap/tapset + +install -m 0755 %{qemu_kvm_build}/qemu-system-%{kvm_target} %{buildroot}%{_libexecdir}/qemu-kvm +install -m 0644 %{qemu_kvm_build}/qemu-kvm.stp %{buildroot}%{_datadir}/systemtap/tapset/ +install -m 0644 %{qemu_kvm_build}/qemu-kvm-log.stp %{buildroot}%{_datadir}/systemtap/tapset/ +install -m 0644 %{qemu_kvm_build}/qemu-kvm-simpletrace.stp %{buildroot}%{_datadir}/systemtap/tapset/ +install -d -m 0755 "%{buildroot}%{_datadir}/%{name}/systemtap/script.d" +install -c -m 0644 %{qemu_kvm_build}/scripts/systemtap/script.d/qemu_kvm.stp "%{buildroot}%{_datadir}/%{name}/systemtap/script.d/" +install -d -m 0755 "%{buildroot}%{_datadir}/%{name}/systemtap/conf.d" +install -c -m 0644 %{qemu_kvm_build}/scripts/systemtap/conf.d/qemu_kvm.conf "%{buildroot}%{_datadir}/%{name}/systemtap/conf.d/" + + +rm %{buildroot}/%{_datadir}/applications/qemu.desktop +rm %{buildroot}%{_bindir}/qemu-system-%{kvm_target} +rm %{buildroot}%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}.stp +rm %{buildroot}%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}-simpletrace.stp +rm %{buildroot}%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}-log.stp + +# Install simpletrace +install -m 0755 scripts/simpletrace.py %{buildroot}%{_datadir}/%{name}/simpletrace.py +# Avoid ambiguous 'python' interpreter name +mkdir -p %{buildroot}%{_datadir}/%{name}/tracetool +install -m 0644 -t %{buildroot}%{_datadir}/%{name}/tracetool scripts/tracetool/*.py +mkdir -p %{buildroot}%{_datadir}/%{name}/tracetool/backend +install -m 0644 -t %{buildroot}%{_datadir}/%{name}/tracetool/backend scripts/tracetool/backend/*.py +mkdir -p %{buildroot}%{_datadir}/%{name}/tracetool/format +install -m 0644 -t %{buildroot}%{_datadir}/%{name}/tracetool/format scripts/tracetool/format/*.py + +mkdir -p %{buildroot}%{qemudocdir} +install -p -m 0644 -t %{buildroot}%{qemudocdir} README.rst README.systemtap COPYING COPYING.LIB LICENSE + +# Rename man page +pushd %{buildroot}%{_mandir}/man1/ +for fn in qemu.1*; do + mv $fn "qemu-kvm${fn#qemu}" +done +popd + +install -D -p -m 0644 qemu.sasl %{buildroot}%{_sysconfdir}/sasl2/%{name}.conf + +# Provided by package openbios +rm -rf %{buildroot}%{_datadir}/%{name}/openbios-ppc +rm -rf %{buildroot}%{_datadir}/%{name}/openbios-sparc32 +rm -rf %{buildroot}%{_datadir}/%{name}/openbios-sparc64 +# Provided by package SLOF +rm -rf %{buildroot}%{_datadir}/%{name}/slof.bin + +# Remove unpackaged files. +rm -rf %{buildroot}%{_datadir}/%{name}/palcode-clipper +rm -rf %{buildroot}%{_datadir}/%{name}/petalogix*.dtb +rm -f %{buildroot}%{_datadir}/%{name}/bamboo.dtb +rm -f %{buildroot}%{_datadir}/%{name}/ppc_rom.bin +rm -rf %{buildroot}%{_datadir}/%{name}/s390-zipl.rom +rm -rf %{buildroot}%{_datadir}/%{name}/u-boot.e500 +rm -rf %{buildroot}%{_datadir}/%{name}/qemu_vga.ndrv +rm -rf %{buildroot}%{_datadir}/%{name}/skiboot.lid +rm -rf %{buildroot}%{_datadir}/%{name}/qboot.rom + +rm -rf %{buildroot}%{_datadir}/%{name}/s390-ccw.img +rm -rf %{buildroot}%{_datadir}/%{name}/s390-netboot.img +rm -rf %{buildroot}%{_datadir}/%{name}/hppa-firmware.img +rm -rf %{buildroot}%{_datadir}/%{name}/hppa-firmware64.img +rm -rf %{buildroot}%{_datadir}/%{name}/canyonlands.dtb +rm -rf %{buildroot}%{_datadir}/%{name}/u-boot-sam460-20100605.bin + +rm -rf %{buildroot}%{_datadir}/%{name}/firmware +rm -rf %{buildroot}%{_datadir}/%{name}/edk2-*.fd +rm -rf %{buildroot}%{_datadir}/%{name}/edk2-licenses.txt + +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv32-sifive_u-fw_jump.bin +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv32-virt-fw_jump.bin +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv32-generic-fw_dynamic.* +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv64-sifive_u-fw_jump.bin +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv64-virt-fw_jump.bin +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv64-generic-fw_dynamic.* +rm -rf %{buildroot}%{_datadir}/%{name}/qemu-nsis.bmp +rm -rf %{buildroot}%{_datadir}/%{name}/npcm7xx_bootrom.bin + +# Remove virtfs-proxy-helper files +rm -rf %{buildroot}%{_libexecdir}/virtfs-proxy-helper +rm -rf %{buildroot}%{_mandir}/man1/virtfs-proxy-helper* + +%ifarch s390x + # Use the s390-*.img that we've just built, not the pre-built ones + install -m 0644 %{qemu_kvm_build}/pc-bios/s390-ccw/s390-ccw.img %{buildroot}%{_datadir}/%{name}/ + install -m 0644 %{qemu_kvm_build}/pc-bios/s390-ccw/s390-netboot.img %{buildroot}%{_datadir}/%{name}/ +%else + rm -rf %{buildroot}%{_libdir}/%{name}/hw-s390x-virtio-gpu-ccw.so +%endif + +%ifnarch x86_64 + rm -rf %{buildroot}%{_datadir}/%{name}/kvmvapic.bin + rm -rf %{buildroot}%{_datadir}/%{name}/linuxboot.bin + rm -rf %{buildroot}%{_datadir}/%{name}/multiboot.bin + rm -rf %{buildroot}%{_datadir}/%{name}/multiboot_dma.bin + rm -rf %{buildroot}%{_datadir}/%{name}/pvh.bin +%else + rm -rf %{buildroot}%{_bindir}/qemu-vmsr-helper +%endif + +# Remove sparc files +rm -rf %{buildroot}%{_datadir}/%{name}/QEMU,tcx.bin +rm -rf %{buildroot}%{_datadir}/%{name}/QEMU,cgthree.bin + +# Remove ivshmem example programs +rm -rf %{buildroot}%{_bindir}/ivshmem-client +rm -rf %{buildroot}%{_bindir}/ivshmem-server + +# Remove efi roms +rm -rf %{buildroot}%{_datadir}/%{name}/efi*.rom + +# Provided by package ipxe +rm -rf %{buildroot}%{_datadir}/%{name}/pxe*rom +# Provided by package vgabios +rm -rf %{buildroot}%{_datadir}/%{name}/vgabios*bin +# Provided by package seabios +rm -rf %{buildroot}%{_datadir}/%{name}/bios*.bin + +# Remove vof roms +rm -rf %{buildroot}%{_datadir}/%{name}/vof-nvram.bin +rm -rf %{buildroot}%{_datadir}/%{name}/vof.bin + +%if %{have_modules_load} + install -D -p -m 644 %{_sourcedir}/modules-load.conf %{buildroot}%{_sysconfdir}/modules-load.d/kvm.conf +%endif + +%if %{have_memlock_limits} + install -D -p -m 644 %{_sourcedir}/95-kvm-memlock.conf %{buildroot}%{_sysconfdir}/security/limits.d/95-kvm-memlock.conf +%endif + +# Install rules to use the bridge helper with libvirt's virbr0 +install -D -m 0644 %{_sourcedir}/bridge.conf %{buildroot}%{_sysconfdir}/%{name}/bridge.conf + +# Install qemu-pr-helper service +install -m 0644 contrib/systemd/qemu-pr-helper.service %{buildroot}%{_unitdir} +install -m 0644 contrib/systemd/qemu-pr-helper.socket %{buildroot}%{_unitdir} + +# We do not support gl display devices so we can remove their modules as they +# do not have expected functionality included. +# +# https://gitlab.com/qemu-project/qemu/-/issues/1352 was filed to stop building these +# modules in case all dependencies are not satisfied. + +rm -rf %{buildroot}%{_libdir}/%{name}/hw-display-virtio-gpu-gl.so +rm -rf %{buildroot}%{_libdir}/%{name}/hw-display-virtio-gpu-pci-gl.so +rm -rf %{buildroot}%{_libdir}/%{name}/hw-display-virtio-vga-gl.so + +# We need to make the block device modules and other qemu SO files executable +# otherwise RPM won't pick up their dependencies. +chmod +x %{buildroot}%{_libdir}/%{name}/*.so + +# Remove docs we don't care about +find %{buildroot}%{qemudocdir} -name .buildinfo -delete +rm -rf %{buildroot}%{qemudocdir}/specs + +# endif !tools_only +%endif + +%check +%if !%{tools_only} + +pushd %{qemu_kvm_build} +echo "Testing %{name}-build" +#%make_build check +make V=1 check +popd + +# endif !tools_only +%endif + +%post -n qemu-guest-agent +%systemd_post qemu-guest-agent.service +%preun -n qemu-guest-agent +%systemd_preun qemu-guest-agent.service +%postun -n qemu-guest-agent +%systemd_postun_with_restart qemu-guest-agent.service + +%if !%{tools_only} +%post common +getent group kvm >/dev/null || groupadd -g 36 -r kvm +getent group qemu >/dev/null || groupadd -g 107 -r qemu +getent passwd qemu >/dev/null || \ +useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ + -c "qemu user" qemu + +# If this is a new installation, then load kvm modules now, so we can make +# sure that the user gets a system where KVM is ready to use. In case of +# an upgrade, don't try to modprobe again in case the user unloaded the +# kvm module on purpose. +%if %{have_modules_load} + if [ "$1" = "1" ]; then + modprobe -b kvm &> /dev/null || : + fi +%endif +# endif !tools_only +%endif + + + +%files -n qemu-img +%{_bindir}/qemu-img +%{_bindir}/qemu-io +%{_bindir}/qemu-nbd +%{_bindir}/qemu-storage-daemon +%{_mandir}/man1/qemu-img.1* +%{_mandir}/man8/qemu-nbd.8* +%{_mandir}/man1/qemu-storage-daemon.1* +%{_mandir}/man7/qemu-storage-daemon-qmp-ref.7* + + +%files -n qemu-guest-agent +%doc COPYING README.rst +%{_bindir}/qemu-ga +%{_mandir}/man8/qemu-ga.8* +%{_unitdir}/qemu-guest-agent.service +%{_udevrulesdir}/99-qemu-guest-agent.rules +%config(noreplace) %{_sysconfdir}/sysconfig/qemu-ga +%{_sysconfdir}/qemu-ga +%{_datadir}/%{name}/qemu-ga +%dir %{_localstatedir}/log/qemu-ga + + +%if !%{tools_only} +%files +# Deliberately empty + +%files tools +%{_bindir}/qemu-keymap +%{_bindir}/qemu-edid +%{_bindir}/qemu-trace-stap +%{_bindir}/elf2dmp +%{_datadir}/%{name}/simpletrace.py* +%{_datadir}/%{name}/tracetool/*.py* +%{_datadir}/%{name}/tracetool/backend/*.py* +%{_datadir}/%{name}/tracetool/format/*.py* +%{_datadir}/%{name}/dump-guest-memory.py* +%{_datadir}/%{name}/trace-events-all +%{_mandir}/man1/qemu-trace-stap.1* + +%files -n qemu-pr-helper +%{_bindir}/qemu-pr-helper +%{_unitdir}/qemu-pr-helper.service +%{_unitdir}/qemu-pr-helper.socket +%{_mandir}/man8/qemu-pr-helper.8* + +%files docs +%doc %{qemudocdir} + +%files common +%license COPYING COPYING.LIB LICENSE +%{_mandir}/man7/qemu-qmp-ref.7* +%{_mandir}/man7/qemu-cpu-models.7* +%{_mandir}/man7/qemu-ga-ref.7* + +%dir %{_datadir}/%{name}/ +%{_datadir}/%{name}/keymaps/ +%{_mandir}/man1/%{name}.1* +%{_mandir}/man7/qemu-block-drivers.7* +%attr(4755, -, -) %{_libexecdir}/qemu-bridge-helper +%config(noreplace) %{_sysconfdir}/sasl2/%{name}.conf +%ghost %{_sysconfdir}/kvm +%dir %{_sysconfdir}/%{name} +%config(noreplace) %{_sysconfdir}/%{name}/bridge.conf +%config(noreplace) %{_sysconfdir}/modprobe.d/vhost.conf +%config(noreplace) %{_sysconfdir}/modprobe.d/kvm.conf + +%ifarch x86_64 + %{_datadir}/%{name}/linuxboot.bin + %{_datadir}/%{name}/multiboot.bin + %{_datadir}/%{name}/multiboot_dma.bin + %{_datadir}/%{name}/kvmvapic.bin + %{_datadir}/%{name}/pvh.bin +%endif +%ifarch s390x + %{_datadir}/%{name}/s390-ccw.img + %{_datadir}/%{name}/s390-netboot.img +%endif +%{_datadir}/icons/* +%{_datadir}/%{name}/linuxboot_dma.bin +%if %{have_modules_load} + %{_sysconfdir}/modules-load.d/kvm.conf +%endif +%if %{have_memlock_limits} + %{_sysconfdir}/security/limits.d/95-kvm-memlock.conf +%endif + +%files core +%{_libexecdir}/qemu-kvm +%{_datadir}/systemtap/tapset/qemu-kvm.stp +%{_datadir}/systemtap/tapset/qemu-kvm-log.stp +%{_datadir}/systemtap/tapset/qemu-kvm-simpletrace.stp +%{_datadir}/%{name}/systemtap/script.d/qemu_kvm.stp +%{_datadir}/%{name}/systemtap/conf.d/qemu_kvm.conf +%{_datadir}/systemtap/tapset/qemu-img*.stp +%{_datadir}/systemtap/tapset/qemu-io*.stp +%{_datadir}/systemtap/tapset/qemu-nbd*.stp +%{_datadir}/systemtap/tapset/qemu-storage-daemon*.stp + +%ifarch x86_64 + %{_libdir}/%{name}/accel-tcg-%{kvm_target}.so +%endif + +%files device-display-virtio-gpu +%{_libdir}/%{name}/hw-display-virtio-gpu.so + +%ifarch s390x +%files device-display-virtio-gpu-ccw + %{_libdir}/%{name}/hw-s390x-virtio-gpu-ccw.so +%else +%files device-display-virtio-gpu-pci + %{_libdir}/%{name}/hw-display-virtio-gpu-pci.so +%endif + +%ifarch x86_64 %{power64} +%files device-display-virtio-vga + %{_libdir}/%{name}/hw-display-virtio-vga.so +%endif + +%files tests +%{testsdir} +%{_libdir}/%{name}/accel-qtest-%{kvm_target}.so + +%files block-blkio +%{_libdir}/%{name}/block-blkio.so + +%files block-curl +%{_libdir}/%{name}/block-curl.so +%if %{have_block_rbd} +%files block-rbd +%{_libdir}/%{name}/block-rbd.so +%endif +%files audio-pa +%{_libdir}/%{name}/audio-pa.so + +%if %{have_opengl} +%files ui-opengl +%{_libdir}/%{name}/ui-opengl.so +%files ui-egl-headless +%{_libdir}/%{name}/ui-egl-headless.so +%endif + +%files device-usb-host +%{_libdir}/%{name}/hw-usb-host.so + +%if %{have_usbredir} +%files device-usb-redirect + %{_libdir}/%{name}/hw-usb-redirect.so +%endif + +%files audio-dbus +%{_libdir}/%{name}/audio-dbus.so + +%files ui-dbus +%{_libdir}/%{name}/ui-dbus.so + +# endif !tools_only +%endif + +%changelog +* Fri Oct 25 2024 MSVSphere Packaging Team - 18:9.1.0-2 +- Rebuilt for MSVSphere 10 + +* Mon Sep 30 2024 Miroslav Rezanina - 9.1.0-2 +- kvm-x86-create-new-pc-q35-machine-type-for-rhel-9.6.patch [RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141] +- kvm-arm-create-new-virt-machine-type-for-rhel-9.6.patch [RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141] +- kvm-x86-create-pc-i440fx-machine-type-for-rhel10.patch [RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141] +- kvm-x86-create-pc-q35-machine-type-for-rhel10.patch [RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141] +- kvm-arm-create-virt-machine-type-for-rhel10.patch [RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141] +- kvm-x86-remove-deprecated-rhel-machine-types.patch [RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141] +- kvm-remove-stale-compat-definitions.patch [RHEL-29002 RHEL-29003 RHEL-35587 RHEL-38411 RHEL-45141] +- kvm-RH-Author-Shaoqin-Huang-shahuang-redhat.com.patch [RHEL-38374] +- kvm-qemu-guest-agent-Update-the-logfile-path-of-qga-fsfr.patch [RHEL-57028] +- Resolves: RHEL-29002 + (Remove the existing deprecated machine types in RHEL-10) +- Resolves: RHEL-29003 + (Deprecate RHEL-9 machine types in RHEL-10) +- Resolves: RHEL-35587 + (Create a pc-i440fx-rhel10.0 machine type) +- Resolves: RHEL-38411 + ([Fujitsu 10.0 FEAT]: qemu-kvm: Continue to support i440fx for RHEL10) +- Resolves: RHEL-45141 + (Introduce virt-rhel10.0 arm-virt machine type [aarch64]) +- Resolves: RHEL-38374 + (aarch64 SMBIOS 'Manufacturer' and 'Product Name' differ from x86 ones [rhel-10]) +- Resolves: RHEL-57028 + (fsfreeze hooks break on the systems first restorecon [rhel-10]) + +* Tue Sep 10 2024 Miroslav Rezanina - 9.1.0-1 +- Rebase to QEMU 9.1.0 [RHEL-41246] +- Resolves: RHEL-41246 + (Rebase qemu-9.1 for RHEL 10.0) + +* Mon Aug 26 2024 Miroslav Rezanina - 9.0.0-8 +- kvm-x86-cpu-update-deprecation-string-to-match-lowest-un.patch [RHEL-54260] +- Resolves: RHEL-54260 + ([RHEL10] Need to update the deprecated CPU model warning message) + +* Thu Aug 15 2024 Miroslav Rezanina - 9.0.0-7 +- kvm-linux-aio-add-IO_CMD_FDSYNC-command-support.patch [RHEL-51901] +- kvm-nbd-server-Plumb-in-new-args-to-nbd_client_add.patch [RHEL-52599] +- kvm-nbd-server-CVE-2024-7409-Cap-default-max-connections.patch [RHEL-52599] +- kvm-nbd-server-CVE-2024-7409-Drop-non-negotiating-client.patch [RHEL-52599] +- kvm-nbd-server-CVE-2024-7409-Close-stray-clients-at-serv.patch [RHEL-52599] +- Resolves: RHEL-51901 + (qemu-kvm: linux-aio: add support for IO_CMD_FDSYNC command[RHEL-10]) +- Resolves: RHEL-52599 + (CVE-2024-7409 qemu-kvm: Denial of Service via Improper Synchronization in QEMU NBD Server During Socket Closure [rhel-10.0]) + +* Tue Jul 30 2024 Miroslav Rezanina - 9.0.0-6 +- kvm-Enable-vhost-user-scmi-devices.patch [RHEL-50165] +- Resolves: RHEL-50165 + (Enable 'vhost-user-scmi-pci' and 'vhost-user-scmi' in qemu-kvm for RHIVOS) + +* Wed Jul 24 2024 Miroslav Rezanina - 9.0.0-5 +- kvm-nbd-server-do-not-poll-within-a-coroutine-context.patch [RHEL-40959] +- kvm-nbd-server-Mark-negotiation-functions-as-coroutine_f.patch [RHEL-40959] +- kvm-qio-Inherit-follow_coroutine_ctx-across-TLS.patch [RHEL-40959] +- kvm-iotests-test-NBD-TLS-iothread.patch [RHEL-40959] +- Resolves: RHEL-40959 + (Qemu hang when quit dst vm after storage migration(nbd+tls)) + +* Thu Jul 04 2024 Miroslav Rezanina - 9.0.0-4 +- kvm-qcow2-Don-t-open-data_file-with-BDRV_O_NO_IO.patch [RHEL-46239] +- kvm-iotests-244-Don-t-store-data-file-with-protocol-in-i.patch [RHEL-46239] +- kvm-iotests-270-Don-t-store-data-file-with-json-prefix-i.patch [RHEL-46239] +- kvm-block-Parse-filenames-only-when-explicitly-requested.patch [RHEL-46239] +- Resolves: RHEL-46239 + (CVE-2024-4467 qemu-kvm: QEMU: 'qemu-img info' leads to host file read/write [rhel-10.0]) + +* Mon Jul 01 2024 Miroslav Rezanina - 9.0.0-3 +- kvm-qtest-x86-numa-test-do-not-use-the-obsolete-pentium-.patch [RHEL-28972] +- kvm-tests-qtest-libqtest-add-qtest_has_cpu_model-api.patch [RHEL-28972] +- kvm-tests-qtest-x86-check-for-availability-of-older-cpu-.patch [RHEL-28972] +- kvm-target-cpu-models-x86-Remove-the-existing-deprecated.patch [RHEL-28972] +- kvm-x86-cpu-deprecate-cpu-models-that-do-not-support-x86.patch [RHEL-28971] +- kvm-virtio-gpu-fix-v2-migration.patch [RHEL-36329] +- kvm-rhel-9.4.0-machine-type-compat-for-virtio-gpu-migrat.patch [RHEL-36329] +- kvm-s390x-remove-deprecated-rhel-machine-types.patch [RHEL-39898] +- kvm-s390x-select-correct-components-for-no-board-build.patch [RHEL-39898] +- kvm-target-s390x-Add-a-CONFIG-switch-to-disable-legacy-C.patch [RHEL-39898] +- kvm-target-s390x-cpu_models-Disable-everything-up-to-the.patch [RHEL-39898] +- kvm-target-s390x-Revert-the-old-s390x-CPU-model-disablem.patch [RHEL-39898] +- kvm-Revert-monitor-use-aio_co_reschedule_self.patch [RHEL-43409 RHEL-43410] +- kvm-aio-warn-about-iohandler_ctx-special-casing.patch [RHEL-43409 RHEL-43410] +- Resolves: RHEL-28972 + (x86: Remove the existing deprecated CPU models on RHEL10) +- Resolves: RHEL-28971 + (Consider deprecating CPU models like "Nehalem" / "IvyBridge" on RHEL 10) +- Resolves: RHEL-36329 + ([RHEL10.0.beta][stable_guest_abi]Failed to migrate VM with (qemu) qemu-kvm: Missing section footer for 0000:00:01.0/virtio-gpu qemu-kvm: load of migration failed: Invalid argument) +- Resolves: RHEL-39898 + (s390: Remove the legacy CPU models on RHEL10) +- Resolves: RHEL-43409 + (aio=io_uring: Assertion failure `luringcb->co->ctx == s->aio_context' with block_resize) +- Resolves: RHEL-43410 + (aio=native: Assertion failure `laiocb->co->ctx == laiocb->ctx->aio_context' with block_resize) + +* Mon Jun 10 2024 Miroslav Rezanina - 9.0.0-2 +- kvm-Enable-vhost-user-snd-pci-device.patch [RHEL-37563] +- Resolves: RHEL-37563 + (Enable 'vhost-user-snd-pci' in qemu-kvm for RHIVOS) + +* Tue May 14 2024 Miroslav Rezanina - 9.0.0-1 +- Rebase to QEMU 9.0.0 [RHEL-28852] +- Resolves: RHEL-28852 + (Rebase qemu-kvm to QEMU 9.0.0 for RHEL 10.0 beta) +- Resolves: RHEL-23771 + ([qemu-kvm] Disable passthrough of pmem device) +- Resolves: RHEL-34024 + (Remove RDMA migration support +- Resolves: RHEL-30366 + (Check/fix machine type compatibility for QEMU 9.0.0 [x86_64][rhel-10.0 Beta]) +- Resolves: RHEL-30367 + (Check/fix machine type compatibility for QEMU 9.0.0 [aarch64][rhel-10.0 Beta]) + +* Tue Jan 02 2024 Miroslav Rezanina - 8.2.0-1 +- Rebase to QEMU 8.2.0 [RHEL-14111] +- Fix machine type compatibility [RHEL-17067 RHEL-17068] +- Add 9.4.0 machine type [RHEL-17168 RHEL-19117 RHEL-19119] +- Resolves: RHEL-14111 + (Rebase qemu-kvm to QEMU 8.2.0) +- Resolves: RHEL-17067 + (Check/fix machine type compatibility for qemu-kvm 8.2.0 [s390x]) +- Resolves: RHEL-17068 + (Check/fix machine type compatibility for qemu-kvm 8.2.0 [x86_64]) +- Resolves: RHEL-17168 + (Introduce virt-rhel9.4.0 arm-virt machine type [aarch64]) +- Resolves: RHEL-19117 + (Introduce virt-rhel9.4.0 arm-virt machine type [x86_64]) +- Resolves: RHEL-19119 + (Introduce virt-rhel9.4.0 arm-virt machine type [s390x])