diff --git a/.gitignore b/.gitignore index 2a426ee..b926b6e 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ /qemu-8.2.0.tar.xz /qemu-9.0.0.tar.xz /qemu-9.1.0.tar.xz +/qemu-10.0.0.tar.xz diff --git a/0004-Initial-redhat-build.patch b/0004-Initial-redhat-build.patch index fa0e5f7..853276c 100644 --- a/0004-Initial-redhat-build.patch +++ b/0004-Initial-redhat-build.patch @@ -1,4 +1,4 @@ -From 7e57931a524e1e805ba8d68e75828e98c591e975 Mon Sep 17 00:00:00 2001 +From ff5cdaa4c69d89d7c6429b30fbdc5b9e1f0a6968 Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Wed, 26 May 2021 10:56:02 +0200 Subject: Initial redhat build @@ -13,33 +13,57 @@ several issues are fixed 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. +We are rebasing from qemu-kvm-9.1.0-17.el10. Signed-off-by: Miroslav Rezanina --- -Rebase notes (9.1.0 rc0): +Rebase notes (9.1.0): - Remove --disable-block-migration and --disable-pvrdma configure options (upstream) - Removed --disable-avx512f configure option - Removed qemu-vsmr-helper (changed upstream) + +Rebase notes (10.0.0 rc0): +- Split --disable-sanitazers configure option (upstream change) +- Removed s390x-netboot.img (upstream) +- accel-tcg module no longer built (upstream) +- Removed new upstream npcm8xx board rom +- Not package hw-uefi-vars.so +- Not package pnv-pnor.bin on build + +Rebase notes (10.0.0): +- Include riscv support + +Merged patches (9.1.0): +- b206b8f7cb redhat: Remove the s390-netboot.img from the spec file +- 95605107f1 Require new dtrace package + +Merged patches (10.0.0 rc0): +- 07c8c9b9ff qemu-guest-agent: Update the logfile path of qga-fsfreeze-hook.log + +Merged patches (10.0.0 rc1): +- 1f54babd2a Recommend systemtap-client from qemu-tools + +Merged patches (10.0.0 rc3): +- 3e4d2a0fb8 Also recommend systemtap-devel from qemu-tools --- .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/qemu-kvm.spec.template | 1606 +++++++++++++++++++++++ .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/qemu-guest-agent/fsfreeze-hook | 4 +- 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(-) + 16 files changed, 1868 insertions(+), 8 deletions(-) create mode 100644 .distro/Makefile create mode 100644 .distro/Makefile.common create mode 100644 .distro/README.tests @@ -99,14 +123,16 @@ index 0000000000..ad913fc990 +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 +index c1feb6f5ce..d5d8d4daf8 100755 --- a/scripts/qemu-guest-agent/fsfreeze-hook +++ b/scripts/qemu-guest-agent/fsfreeze-hook -@@ -8,7 +8,7 @@ +@@ -7,8 +7,8 @@ + # "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/qga-fsfreeze-hook.log -FSFREEZE_D=$(dirname -- "$0")/fsfreeze-hook.d ++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 @@ -129,7 +155,7 @@ index 0000000000..c04abf9449 @@ -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 +index 3f4cfc471d..09dafba18d 100644 --- a/ui/vnc-auth-sasl.c +++ b/ui/vnc-auth-sasl.c @@ -42,7 +42,7 @@ diff --git a/0005-Enable-disable-devices-for-RHEL.patch b/0005-Enable-disable-devices-for-RHEL.patch index 459ce3b..e470db7 100644 --- a/0005-Enable-disable-devices-for-RHEL.patch +++ b/0005-Enable-disable-devices-for-RHEL.patch @@ -1,4 +1,4 @@ -From 003f37e17fb03b8977effd968426a0aeb5855028 Mon Sep 17 00:00:00 2001 +From e56f9e1921ab836e454ee003812487cd520580b1 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 @@ -8,24 +8,32 @@ This commit adds all changes related to changes in supported devices. Signed-off-by: Miroslav Rezanina --- -Rebase notes (9.1.0 rc0): +Rebase notes (9.1.0): - 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): +Rebase notes (10.0.0 rc0): +- Added CONFIG_PCI_BRIDGE for aarch64 and x86_64 (new upstream) +- Do not add deprecation_note member as it was added upstream (target/arm/cpu.h) +- Rename CONFIG_ARM_GICV3_TCG to CONFIG_ARM_GICV3 + +Rebase notes (10.0.0 rc1): +- Remove deprecated line change for code commented out +- Do not change minimal revision for piix4 +- Remove YongFeng vcpu + +Rebase notes (10.0.0): +- Add rebase devices changes +- Enable virtio-mem on s390x + +Merged commits (9.1.0): - f24c7a1fee Disable FDC devices - fe8c6cb1ce Disable vga-cirrus device - fccd117a12 Enable vhost-user-snd-pci device @@ -34,15 +42,14 @@ Merged commits (9.1.0 rc0): - 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 +++++++ + .../aarch64-softmmu/aarch64-rh-devices.mak | 47 +++++++ configs/devices/rh-virtio.mak | 10 ++ - .../s390x-softmmu/s390x-rh-devices.mak | 19 +++ - .../x86_64-softmmu/x86_64-rh-devices.mak | 114 ++++++++++++++++++ + .../riscv64-softmmu/riscv64-rh-devices.mak | 39 ++++++ + .../s390x-softmmu/s390x-rh-devices.mak | 20 +++ + .../x86_64-softmmu/x86_64-rh-devices.mak | 115 ++++++++++++++++++ hw/arm/virt.c | 4 + hw/cxl/meson.build | 3 +- hw/ide/piix.c | 5 +- @@ -51,37 +58,39 @@ Merged commits (9.1.0 rc4): 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/cpu.h | 2 + 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/i386/cpu.c | 18 +++ + target/riscv/cpu.c | 6 + target/s390x/cpu_models.c | 2 +- tests/qtest/arm-cpu-features.c | 4 + - 22 files changed, 275 insertions(+), 16 deletions(-) + 23 files changed, 317 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/riscv64-softmmu/riscv64-rh-devices.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 +index 0000000000..dce5fca821 --- /dev/null +++ b/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak -@@ -0,0 +1,46 @@ +@@ -0,0 +1,47 @@ +include ../rh-virtio.mak + +CONFIG_ARM_GIC_KVM=y -+CONFIG_ARM_GICV3_TCG=y ++CONFIG_ARM_GICV3=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_PCI_BRIDGE=y +CONFIG_PCIE_PORT=y +CONFIG_PCIE_PCI_BRIDGE=y +CONFIG_PCI_DEVICES=y @@ -134,12 +143,57 @@ index 0000000000..94ede1b5f6 +CONFIG_VIRTIO_RNG=y +CONFIG_VIRTIO_SCSI=y +CONFIG_VIRTIO_SERIAL=y +diff --git a/configs/devices/riscv64-softmmu/riscv64-rh-devices.mak b/configs/devices/riscv64-softmmu/riscv64-rh-devices.mak +new file mode 100644 +index 0000000000..b5e55de916 +--- /dev/null ++++ b/configs/devices/riscv64-softmmu/riscv64-rh-devices.mak +@@ -0,0 +1,39 @@ ++include ../rh-virtio.mak ++ ++CONFIG_RISCV_VIRT=y ++CONFIG_CXL=y ++CONFIG_CXL_MEM_DEVICE=y ++CONFIG_EDID=y ++CONFIG_PCI_BRIDGE=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_IOMMU=y ++CONFIG_XIO3130=y ++CONFIG_ACPI_APEI=y ++CONFIG_TPM=y ++CONFIG_TPM_EMULATOR=y ++CONFIG_TPM_TIS_SYSBUS=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 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 +index 0000000000..834281d872 --- /dev/null +++ b/configs/devices/s390x-softmmu/s390x-rh-devices.mak -@@ -0,0 +1,19 @@ +@@ -0,0 +1,20 @@ +include ../rh-virtio.mak + +CONFIG_PCI=y @@ -154,6 +208,7 @@ index 0000000000..24cf6dbd03 +CONFIG_VFIO_PCI=y +CONFIG_VHOST_USER=y +CONFIG_VIRTIO_CCW=y ++CONFIG_VIRTIO_MEM=y +CONFIG_WDT_DIAG288=y +CONFIG_VHOST_VSOCK=y +CONFIG_VHOST_USER_VSOCK=y @@ -161,10 +216,10 @@ index 0000000000..24cf6dbd03 +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 +index 0000000000..8da1a8f82f --- /dev/null +++ b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak -@@ -0,0 +1,114 @@ +@@ -0,0 +1,115 @@ +include ../rh-virtio.mak + +CONFIG_ACPI=y @@ -227,6 +282,7 @@ index 0000000000..45a8a15291 +CONFIG_PCSPK=y +CONFIG_PC_ACPI=y +CONFIG_PC_PCI=y ++CONFIG_PCI_BRIDGE=y +CONFIG_PCIE_PCI_BRIDGE=y +CONFIG_PFLASH_CFI01=y +CONFIG_PVPANIC_ISA=y @@ -280,10 +336,10 @@ index 0000000000..45a8a15291 +CONFIG_IOMMUFD=y +CONFIG_VHOST_USER_SND=y diff --git a/hw/arm/virt.c b/hw/arm/virt.c -index 687fe0bb8b..eea7d2d038 100644 +index a96452f17a..68bb983ecf 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) +@@ -3129,6 +3129,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[] = { @@ -291,7 +347,7 @@ index 687fe0bb8b..eea7d2d038 100644 #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) +@@ -3144,8 +3145,11 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) ARM_CPU_TYPE_NAME("neoverse-n2"), #endif /* TARGET_AARCH64 */ #endif /* CONFIG_TCG */ @@ -318,7 +374,7 @@ index 3e375f61a9..613adb3ebb 100644 if_false: files( 'cxl-host-stubs.c', diff --git a/hw/ide/piix.c b/hw/ide/piix.c -index 80efc633d3..9cb82b8eea 100644 +index 818ff60d6f..2a1caca7f7 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) @@ -341,10 +397,10 @@ index 80efc633d3..9cb82b8eea 100644 static const TypeInfo piix4_ide_info = { diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c -index 74f10b640f..2e85ecf476 100644 +index fa0c549eb9..9aa92c1f76 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c -@@ -952,6 +952,8 @@ static void i8042_class_initfn(ObjectClass *klass, void *data) +@@ -950,6 +950,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); @@ -354,10 +410,10 @@ index 74f10b640f..2e85ecf476 100644 static const TypeInfo i8042_info = { diff --git a/hw/net/e1000.c b/hw/net/e1000.c -index 5012b96464..b435e54228 100644 +index 3d0b227703..6b96be40ef 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c -@@ -1746,6 +1746,7 @@ static const E1000Info e1000_devices[] = { +@@ -1745,6 +1745,7 @@ static const E1000Info e1000_devices[] = { .revision = 0x03, .phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT, }, @@ -365,7 +421,7 @@ index 5012b96464..b435e54228 100644 { .name = "e1000-82544gc", .device_id = E1000_DEV_ID_82544GC_COPPER, -@@ -1758,6 +1759,7 @@ static const E1000Info e1000_devices[] = { +@@ -1757,6 +1758,7 @@ static const E1000Info e1000_devices[] = { .revision = 0x03, .phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT, }, @@ -374,10 +430,10 @@ index 5012b96464..b435e54228 100644 static void e1000_register_types(void) diff --git a/hw/usb/meson.build b/hw/usb/meson.build -index d7de1003e3..1cdc0a1ba0 100644 +index 17360a5b5a..3c4fdfc31d 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 +@@ -53,7 +53,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', @@ -387,10 +443,10 @@ index d7de1003e3..1cdc0a1ba0 100644 endif diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build -index 621fc65454..c38bdd6fa4 100644 +index 164f6fd995..43f9c477da 100644 --- a/hw/virtio/meson.build +++ b/hw/virtio/meson.build -@@ -20,7 +20,8 @@ if have_vhost +@@ -21,7 +21,8 @@ if have_vhost system_virtio_ss.add(files('vhost-user-base.c')) # MMIO Stubs @@ -400,7 +456,7 @@ index 621fc65454..c38bdd6fa4 100644 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 +@@ -29,7 +30,8 @@ if have_vhost system_virtio_ss.add(when: 'CONFIG_VHOST_USER_INPUT', if_true: files('vhost-user-input.c')) # PCI Stubs @@ -411,7 +467,7 @@ index 621fc65454..c38bdd6fa4 100644 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 +index 883c0a0e8c..dc06eb6778 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, @@ -430,23 +486,8 @@ index 3cc8cc738b..6f21fea1f5 100644 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 +index a8177c6c2e..6d1055a90c 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -35,6 +35,8 @@ @@ -458,19 +499,11 @@ index 9a3fd59562..1261eae94d 100644 #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 +index 8188ede5cc..550232f362 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c -@@ -653,6 +653,7 @@ static void aarch64_a57_initfn(Object *obj) +@@ -675,6 +675,7 @@ static void aarch64_a57_initfn(Object *obj) define_cortex_a72_a57_a53_cp_reginfo(cpu); } @@ -478,7 +511,7 @@ index 262a1d6c0b..800514d3fc 100644 static void aarch64_a53_initfn(Object *obj) { ARMCPU *cpu = ARM_CPU(obj); -@@ -710,6 +711,7 @@ static void aarch64_a53_initfn(Object *obj) +@@ -735,6 +736,7 @@ static void aarch64_a53_initfn(Object *obj) cpu->gic_pribits = 5; define_cortex_a72_a57_a53_cp_reginfo(cpu); } @@ -486,7 +519,7 @@ index 262a1d6c0b..800514d3fc 100644 static void aarch64_host_initfn(Object *obj) { -@@ -748,8 +750,11 @@ static void aarch64_max_initfn(Object *obj) +@@ -773,8 +775,11 @@ static void aarch64_max_initfn(Object *obj) } static const ARMCPUInfo aarch64_cpus[] = { @@ -499,7 +532,7 @@ index 262a1d6c0b..800514d3fc 100644 { .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) +@@ -845,8 +850,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); @@ -514,7 +547,7 @@ index 262a1d6c0b..800514d3fc 100644 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 +index 2c45b7eddd..09c5f3f74a 100644 --- a/target/arm/tcg/cpu32.c +++ b/target/arm/tcg/cpu32.c @@ -120,6 +120,7 @@ void aa32_max_features(ARMCPU *cpu) @@ -525,13 +558,13 @@ index 20c2737f17..7e66fb6f14 100644 /* 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) +@@ -1078,3 +1079,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 +index 29ab0ac79d..be3baf5fba 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -29,6 +29,7 @@ @@ -539,10 +572,10 @@ index fe232eb306..2678047488 100644 #include "cpregs.h" +#if 0 /* Disabled for Red Hat Enterprise Linux */ - static uint64_t make_ccsidr64(unsigned assoc, unsigned linesize, - unsigned cachesize) + static void aarch64_a35_initfn(Object *obj) { -@@ -135,6 +136,7 @@ static void aarch64_a35_initfn(Object *obj) + ARMCPU *cpu = ARM_CPU(obj); +@@ -112,6 +113,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); } @@ -550,8 +583,8 @@ index fe232eb306..2678047488 100644 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 = +@@ -201,6 +203,7 @@ static void cpu_max_get_l0gptsz(Object *obj, Visitor *v, const char *name, + static const Property arm_cpu_lpa2_property = DEFINE_PROP_BOOL("lpa2", ARMCPU, prop_lpa2, true); +#if 0 /* Disabled for Red Hat Enterprise Linux */ @@ -566,7 +599,7 @@ index fe232eb306..2678047488 100644 /* * -cpu max: a CPU with as many features enabled as our emulation supports. -@@ -1295,6 +1299,7 @@ void aarch64_max_tcg_initfn(Object *obj) +@@ -1299,6 +1303,7 @@ void aarch64_max_tcg_initfn(Object *obj) qdev_property_add_static(DEVICE(obj), &arm_cpu_lpa2_property); } @@ -574,7 +607,7 @@ index fe232eb306..2678047488 100644 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[] = { +@@ -1310,14 +1315,17 @@ static const ARMCPUInfo aarch64_cpus[] = { { .name = "neoverse-v1", .initfn = aarch64_neoverse_v1_initfn }, { .name = "neoverse-n2", .initfn = aarch64_neoverse_n2_initfn }, }; @@ -593,10 +626,10 @@ index fe232eb306..2678047488 100644 type_init(aarch64_cpu_register_types) diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build -index 508932a249..1293647501 100644 +index dd12ccedb1..545c2cc3a7 100644 --- a/target/arm/tcg/meson.build +++ b/target/arm/tcg/meson.build -@@ -58,5 +58,5 @@ arm_system_ss.add(files( +@@ -61,5 +61,5 @@ arm_system_ss.add(files( 'psci.c', )) @@ -604,10 +637,10 @@ index 508932a249..1293647501 100644 +#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 +index 1b64ceaaba..0b09990a8f 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c -@@ -2411,9 +2411,13 @@ static const CPUCaches epyc_genoa_cache_info = { +@@ -2481,9 +2481,13 @@ static const CPUCaches epyc_genoa_cache_info = { * PT in VMX operation */ @@ -621,7 +654,7 @@ index 85ef7452c0..34e0ce5e62 100644 .level = 0xd, .vendor = CPUID_VENDOR_AMD, .family = 15, -@@ -2432,6 +2436,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { +@@ -2502,6 +2506,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { .xlevel = 0x8000000A, .model_id = "QEMU Virtual CPU version " QEMU_HW_VERSION, }, @@ -629,7 +662,7 @@ index 85ef7452c0..34e0ce5e62 100644 { .name = "phenom", .level = 5, -@@ -2796,8 +2801,10 @@ static const X86CPUDefinition builtin_x86_defs[] = { +@@ -2866,8 +2871,10 @@ static const X86CPUDefinition builtin_x86_defs[] = { .xlevel = 0x80000008, .model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)", }, @@ -640,7 +673,7 @@ index 85ef7452c0..34e0ce5e62 100644 .level = 11, .vendor = CPUID_VENDOR_INTEL, .family = 6, -@@ -2875,6 +2882,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { +@@ -2945,6 +2952,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, { .name = "Westmere", @@ -648,7 +681,7 @@ index 85ef7452c0..34e0ce5e62 100644 .level = 11, .vendor = CPUID_VENDOR_INTEL, .family = 6, -@@ -2956,6 +2964,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { +@@ -3026,6 +3034,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, { .name = "SandyBridge", @@ -656,7 +689,7 @@ index 85ef7452c0..34e0ce5e62 100644 .level = 0xd, .vendor = CPUID_VENDOR_INTEL, .family = 6, -@@ -3042,6 +3051,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { +@@ -3112,6 +3121,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, { .name = "IvyBridge", @@ -664,7 +697,7 @@ index 85ef7452c0..34e0ce5e62 100644 .level = 0xd, .vendor = CPUID_VENDOR_INTEL, .family = 6, -@@ -4469,6 +4479,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { +@@ -4711,6 +4721,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, { .name = "Denverton", @@ -672,7 +705,7 @@ index 85ef7452c0..34e0ce5e62 100644 .level = 21, .vendor = CPUID_VENDOR_INTEL, .family = 6, -@@ -4579,6 +4590,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { +@@ -4821,6 +4832,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, { .name = "Snowridge", @@ -680,34 +713,15 @@ index 85ef7452c0..34e0ce5e62 100644 .level = 27, .vendor = CPUID_VENDOR_INTEL, .family = 6, -@@ -4760,8 +4772,10 @@ static const X86CPUDefinition builtin_x86_defs[] = { +@@ -5002,6 +5014,7 @@ 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[] = { +@@ -5069,8 +5082,10 @@ static const X86CPUDefinition builtin_x86_defs[] = { .xlevel = 0x80000008, .model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)", }, @@ -718,7 +732,7 @@ index 85ef7452c0..34e0ce5e62 100644 .level = 0xd, .vendor = CPUID_VENDOR_AMD, .family = 21, -@@ -4861,6 +4879,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { +@@ -5103,6 +5118,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, { .name = "Opteron_G5", @@ -726,8 +740,76 @@ index 85ef7452c0..34e0ce5e62 100644 .level = 0xd, .vendor = CPUID_VENDOR_AMD, .family = 21, +@@ -5498,6 +5514,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + .model_id = "AMD EPYC-Genoa Processor", + .cache_info = &epyc_genoa_cache_info, + }, ++#if 0 // Disabled for Red Hat Enterprise Linux + { + .name = "YongFeng", + .level = 0x1F, +@@ -5622,6 +5639,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + .xlevel = 0x80000008, + .model_id = "Zhaoxin YongFeng Processor", + }, ++#endif + }; + + /* +diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c +index 09ded6829a..1893ad2f0d 100644 +--- a/target/riscv/cpu.c ++++ b/target/riscv/cpu.c +@@ -481,6 +481,7 @@ static void riscv_max_cpu_init(Object *obj) + #endif + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + #if defined(TARGET_RISCV64) + static void rv64_base_cpu_init(Object *obj) + { +@@ -831,6 +832,7 @@ static void rv32e_bare_cpu_init(Object *obj) + riscv_cpu_set_misa_ext(env, RVE); + } + #endif ++#endif /* disabled for RHEL */ + + static ObjectClass *riscv_cpu_class_by_name(const char *cpu_model) + { +@@ -2970,6 +2972,7 @@ static const Property riscv_cpu_properties[] = { + DEFINE_PROP_BOOL("x-misa-w", RISCVCPU, cfg.misa_w, false), + }; + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + #if defined(TARGET_RISCV64) + static void rva22u64_profile_cpu_init(Object *obj) + { +@@ -2999,6 +3002,7 @@ static void rva23s64_profile_cpu_init(Object *obj) + RVA23S64.enabled = true; + } + #endif ++#endif /* disabled for RHEL */ + + static const gchar *riscv_gdb_arch_name(CPUState *cs) + { +@@ -3236,6 +3240,7 @@ static const TypeInfo riscv_cpu_type_infos[] = { + DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_MAX, MXL_RV64, riscv_max_cpu_init), + #endif + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + #if defined(TARGET_RISCV32) || \ + (defined(TARGET_RISCV64) && !defined(CONFIG_USER_ONLY)) + DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_BASE32, MXL_RV32, rv32_base_cpu_init), +@@ -3271,6 +3276,7 @@ static const TypeInfo riscv_cpu_type_infos[] = { + DEFINE_PROFILE_CPU(TYPE_RISCV_CPU_RVA23U64, MXL_RV64, rva23u64_profile_cpu_init), + DEFINE_PROFILE_CPU(TYPE_RISCV_CPU_RVA23S64, MXL_RV64, rva23s64_profile_cpu_init), + #endif /* TARGET_RISCV64 */ ++#endif /* disabled for RHEL */ + }; + + DEFINE_TYPES(riscv_cpu_type_infos) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c -index a27f4b6f79..798c18f940 100644 +index 93a05e43d7..111d46a59a 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -72,7 +72,6 @@ static S390CPUDef s390_cpu_defs[] = { @@ -747,10 +829,10 @@ index a27f4b6f79..798c18f940 100644 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 +index eb8ddebffb..2d3304bb4a 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) +@@ -459,8 +459,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 */ @@ -761,7 +843,7 @@ index cfd6f77353..3016e6233c 100644 /* 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) +@@ -477,6 +479,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"); @@ -769,7 +851,7 @@ index cfd6f77353..3016e6233c 100644 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) +@@ -489,6 +492,7 @@ static void test_query_cpu_model_expansion(const void *data) "{ 'sve384': true }"); assert_error(qts, "a64fx", "cannot enable sve640", "{ 'sve640': true }"); diff --git a/0006-Machine-type-related-general-changes.patch b/0006-Machine-type-related-general-changes.patch index f7832d0..005d537 100644 --- a/0006-Machine-type-related-general-changes.patch +++ b/0006-Machine-type-related-general-changes.patch @@ -1,4 +1,4 @@ -From 18ae40658bedd6dceab0ffe0bce77ba48e6f0fae Mon Sep 17 00:00:00 2001 +From db31addfd949b587e937dc39137fc93aa9596990 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 @@ -10,30 +10,43 @@ architecture. Signed-off-by: Miroslav Rezanina --- -Rebase notes (9.1.0 rc0): +Rebase notes (9.1.0): - Upstream removed uuid_encoced argument on smbios_set_defaults -Merged commits (9.1.0 rc0): +Rebase notes (10.0.0 rc0): +- Solve conflicting xhci_pci_properties (downstream vs upstream) + +Rebase notes (10.0.0): +- Add riscv changes +- Added upstream compat changes + +Merged commits (9.1.0): - 043ad5ce97 Add upstream compatibility bits (partial) - bfbdab5824 rhel 9.4.0 machine type compat for virtio-gpu migration + +Merged commits (10.0.0 rc0): +- 03502faf70 Add upstream compatibility bits (partial) +- f53dbf7532 remove stale compat definitions (partial) +- d93fcb3940 virtio-net: disable USO for all RHEL9 (partial) --- hw/acpi/piix4.c | 2 +- hw/arm/virt.c | 3 +- - hw/core/machine.c | 281 +++++++++++++++++++++++++++++++++++ + hw/core/machine.c | 133 +++++++++++++++++++++++++++++++++++ hw/i386/fw_cfg.c | 3 +- hw/net/rtl8139.c | 4 +- - hw/smbios/smbios.c | 46 +++++- + hw/riscv/virt.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.c | 55 +++++++++++---- hw/usb/hcd-xhci-pci.h | 1 + hw/virtio/virtio-mem.c | 3 +- - include/hw/boards.h | 43 ++++++ + include/hw/boards.h | 28 ++++++++ include/hw/firmware/smbios.h | 4 +- include/hw/i386/pc.h | 3 + - 13 files changed, 430 insertions(+), 24 deletions(-) + 14 files changed, 265 insertions(+), 26 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c -index debe1adb84..e8ddcd716e 100644 +index 6d023e595b..8b8aa6b3aa 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) @@ -46,10 +59,10 @@ index debe1adb84..e8ddcd716e 100644 .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 +index 68bb983ecf..904596ae3b 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c -@@ -1699,7 +1699,8 @@ static void virt_build_smbios(VirtMachineState *vms) +@@ -1715,7 +1715,8 @@ static void virt_build_smbios(VirtMachineState *vms) } smbios_set_defaults("QEMU", product, @@ -60,12 +73,12 @@ index eea7d2d038..b2aa3f1355 100644 /* 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 +index 63c6ef93d2..c219ae589c 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c -@@ -305,6 +305,287 @@ GlobalProperty hw_compat_2_1[] = { +@@ -298,6 +298,139 @@ GlobalProperty hw_compat_2_4[] = { }; - const size_t hw_compat_2_1_len = G_N_ELEMENTS(hw_compat_2_1); + const size_t hw_compat_2_4_len = G_N_ELEMENTS(hw_compat_2_4); +/* + * RHEL only: machine types for previous major releases are deprecated @@ -73,6 +86,54 @@ index 27dcda0248..f7fed78e4b 100644 +const char *rhel_old_machine_deprecation = + "machine types for previous major releases are deprecated"; + ++GlobalProperty hw_compat_rhel_10_1[] = { ++ /* hw_compat_rhel_10_1 from hw_compat_9_1 */ ++ { TYPE_PCI_DEVICE, "x-pcie-ext-tag", "false" }, ++ /* hw_compat_rhel_10_1 from hw_compat_9_2 */ ++ {"arm-cpu", "backcompat-pauth-default-use-qarma5", "true"}, ++ /* hw_compat_rhel_10_1 from hw_compat_9_2 */ ++ { "virtio-balloon-pci", "vectors", "0" }, ++ /* hw_compat_rhel_10_1 from hw_compat_9_2 */ ++ { "virtio-balloon-pci-transitional", "vectors", "0" }, ++ /* hw_compat_rhel_10_1 from hw_compat_9_2 */ ++ { "virtio-balloon-pci-non-transitional", "vectors", "0" }, ++ /* hw_compat_rhel_10_1 from hw_compat_9_2 */ ++ { "virtio-mem-pci", "vectors", "0" }, ++ /* hw_compat_rhel_10_1 from hw_compat_9_2 */ ++ { "migration", "multifd-clean-tls-termination", "false" }, ++ /* hw_compat_rhel_10_1 from hw_compat_9_2 */ ++ { "migration", "send-switchover-start", "off"}, ++ /* hw_compat_rhel_10_1 from hw_compat_9_2 */ ++ { "vfio-pci", "x-migration-multifd-transfer", "off" }, ++}; ++const size_t hw_compat_rhel_10_1_len = G_N_ELEMENTS(hw_compat_rhel_10_1); ++ ++ ++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); ++ ++/* Apply this to all RHEL9 boards going backward and forward */ ++GlobalProperty hw_compat_rhel_9[] = { ++ /* supported by userspace, but RHEL 9 *kernels* do not support USO. */ ++ { TYPE_VIRTIO_NET, "host_uso", "off"}, ++ { TYPE_VIRTIO_NET, "guest_uso4", "off"}, ++ { TYPE_VIRTIO_NET, "guest_uso6", "off"}, ++}; ++const size_t hw_compat_rhel_9_len = G_N_ELEMENTS(hw_compat_rhel_9); ++ +GlobalProperty hw_compat_rhel_9_5[] = { + /* hw_compat_rhel_9_5 from hw_compat_8_2 */ + { "migration", "zero-page-detection", "legacy"}, @@ -151,211 +212,15 @@ index 27dcda0248..f7fed78e4b 100644 + { "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 +index 5c0bcd5f8a..07df7281d2 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, +@@ -75,7 +75,8 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg, if (pcmc->smbios_defaults) { /* These values are guest ABI, do not change */ @@ -366,10 +231,10 @@ index 0e4494627c..33ef280420 100644 /* tell smbios about cpuid version and features */ diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c -index 03a204ef8a..f2fe057535 100644 +index 135ab57160..6c57a8985b 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c -@@ -3173,7 +3173,7 @@ static int rtl8139_pre_save(void *opaque) +@@ -3171,7 +3171,7 @@ static int rtl8139_pre_save(void *opaque) static const VMStateDescription vmstate_rtl8139 = { .name = "rtl8139", @@ -378,7 +243,7 @@ index 03a204ef8a..f2fe057535 100644 .minimum_version_id = 3, .post_load = rtl8139_post_load, .pre_save = rtl8139_pre_save, -@@ -3254,7 +3254,9 @@ static const VMStateDescription vmstate_rtl8139 = { +@@ -3252,7 +3252,9 @@ static const VMStateDescription vmstate_rtl8139 = { VMSTATE_UINT32(tally_counters.TxMCol, RTL8139State), VMSTATE_UINT64(tally_counters.RxOkPhy, RTL8139State), VMSTATE_UINT64(tally_counters.RxOkBrd, RTL8139State), @@ -388,8 +253,30 @@ index 03a204ef8a..f2fe057535 100644 VMSTATE_UINT16(tally_counters.TxAbt, RTL8139State), VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State), +diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c +index e517002fdf..b8d20575af 100644 +--- a/hw/riscv/virt.c ++++ b/hw/riscv/virt.c +@@ -1400,7 +1400,7 @@ static void virt_build_smbios(RISCVVirtState *s) + product = "KVM Virtual Machine"; + } + +- smbios_set_defaults("QEMU", product, mc->name); ++ smbios_set_defaults("QEMU", product, mc->name, NULL, NULL); + + if (riscv_is_32bit(&s->soc[0])) { + smbios_set_default_processor_family(0x200); +@@ -1919,7 +1919,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + mc->desc = "RISC-V VirtIO board"; + mc->init = virt_machine_init; + mc->max_cpus = VIRT_CPUS_MAX; +- mc->default_cpu_type = TYPE_RISCV_CPU_BASE; ++ mc->default_cpu_type = TYPE_RISCV_CPU_MAX; + mc->block_default_type = IF_VIRTIO; + mc->no_cdrom = 1; + mc->pci_allow_0_address = true; diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c -index a394514264..88642ccce0 100644 +index ad4cd6721e..813b9b43ec 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -38,6 +38,10 @@ size_t usr_blobs_len; @@ -467,7 +354,7 @@ index a394514264..88642ccce0 100644 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 +index 29105afcc3..cef91c9a79 100644 --- a/hw/timer/i8254_common.c +++ b/hw/timer/i8254_common.c @@ -229,7 +229,7 @@ static const VMStateDescription vmstate_pit_common = { @@ -480,10 +367,10 @@ index 28fdabc321..bad13ec224 100644 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 +index d908eb787d..401a2734ed 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) +@@ -120,6 +120,33 @@ static int xhci_pci_vmstate_post_load(void *opaque, int version_id) return 0; } @@ -517,7 +404,7 @@ index 264d7ebb77..2b9a3e06d4 100644 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) +@@ -144,23 +171,12 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp) s->xhci.nec_quirks = true; } @@ -544,7 +431,7 @@ index 264d7ebb77..2b9a3e06d4 100644 } 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) +@@ -172,6 +188,14 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp) assert(ret > 0); } @@ -559,42 +446,35 @@ index 264d7ebb77..2b9a3e06d4 100644 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[] = { +@@ -221,8 +245,11 @@ static const Property xhci_pci_properties[] = { + DEFINE_PROP_ON_OFF_AUTO("msix", XHCIPciState, msix, ON_OFF_AUTO_AUTO), + DEFINE_PROP_BOOL("conditional-intr-mapping", XHCIPciState, + conditional_intr_mapping, false), + /* 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 +index 5b61ae8455..3170db064b 100644 --- a/hw/usb/hcd-xhci-pci.h +++ b/hw/usb/hcd-xhci-pci.h -@@ -40,6 +40,7 @@ typedef struct XHCIPciState { - XHCIState xhci; +@@ -41,6 +41,7 @@ typedef struct XHCIPciState { OnOffAuto msi; OnOffAuto msix; + bool conditional_intr_mapping; + 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 +index 5f57eccbb6..391d85c652 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c -@@ -1694,8 +1694,9 @@ static Property virtio_mem_properties[] = { +@@ -1717,8 +1717,9 @@ static const Property virtio_mem_properties[] = { #endif DEFINE_PROP_BOOL(VIRTIO_MEM_EARLY_MIGRATION_PROP, VirtIOMEM, early_migration, true), @@ -602,17 +482,26 @@ index ef64bf1b4a..ba11aa4646 100644 DEFINE_PROP_BOOL(VIRTIO_MEM_DYNAMIC_MEMSLOTS_PROP, VirtIOMEM, - dynamic_memslots, false), + dynamic_memslots, true), - DEFINE_PROP_END_OF_LIST(), }; + static uint64_t virtio_mem_rdm_get_min_granularity(const RamDiscardManager *rdm, diff --git a/include/hw/boards.h b/include/hw/boards.h -index 48ff6d8b93..ccfc3e10eb 100644 +index f22b2e7fc7..d7fa968dca 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; +@@ -848,4 +848,32 @@ extern const size_t hw_compat_2_5_len; + extern GlobalProperty hw_compat_2_4[]; + extern const size_t hw_compat_2_4_len; ++extern GlobalProperty hw_compat_rhel_10_1[]; ++extern const size_t hw_compat_rhel_10_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[]; ++extern const size_t hw_compat_rhel_9_len; ++ +extern GlobalProperty hw_compat_rhel_9_5[]; +extern const size_t hw_compat_rhel_9_5_len; + @@ -631,30 +520,6 @@ index 48ff6d8b93..ccfc3e10eb 100644 +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 @@ -673,7 +538,7 @@ index f066ab7262..e805d25fbe 100644 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 +index 103b54301f..e4d32f8aea 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -103,6 +103,9 @@ struct PCMachineClass { diff --git a/0007-meson-temporarily-disable-Wunused-function.patch b/0007-meson-temporarily-disable-Wunused-function.patch index ce7c17c..c87b164 100644 --- a/0007-meson-temporarily-disable-Wunused-function.patch +++ b/0007-meson-temporarily-disable-Wunused-function.patch @@ -1,4 +1,4 @@ -From 16946c2c7be0ae23dc1f267323cfc7630a1c9e87 Mon Sep 17 00:00:00 2001 +From 6871c5dd1655c578d9605015b2f88cba38715767 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 @@ -13,17 +13,17 @@ fine grained patch splits. Signed-off-by: Daniel P. Berrangé -Rebase notes (9.1.0 rc0) +Rebase notes (9.1.0) - New patch --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build -index fbda17c987..161d496d55 100644 +index 41f68d3806..066ca7a2c9 100644 --- a/meson.build +++ b/meson.build -@@ -651,6 +651,7 @@ warn_flags = [ +@@ -747,6 +747,7 @@ warn_flags = [ '-Wno-string-plus-int', '-Wno-tautological-type-limit-compare', '-Wno-typedef-redefinition', diff --git a/0008-Remove-upstream-machine-types-for-aarch64-s390x-and-.patch b/0008-Remove-upstream-machine-types-for-aarch64-s390x-and-.patch index 335b53f..59cdaa0 100644 --- a/0008-Remove-upstream-machine-types-for-aarch64-s390x-and-.patch +++ b/0008-Remove-upstream-machine-types-for-aarch64-s390x-and-.patch @@ -1,4 +1,4 @@ -From 2f0ba1a1ed66a8ae32e7a92f3d3b744d8b59b879 Mon Sep 17 00:00:00 2001 +From af51df70a29fec7ae9e8bb64006dab26487c1a35 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 @@ -13,7 +13,7 @@ machine types. Signed-off-by: Daniel P. Berrangé Signed-off-by: Miroslav Rezanina -Rebase notes (9.1.0 rc0): +Rebase notes (9.1.0): - Split off commits adding RHEL machine types --- hw/arm/virt.c | 2 ++ @@ -23,35 +23,35 @@ Rebase notes (9.1.0 rc0): 4 files changed, 8 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c -index b2aa3f1355..5396e7cb24 100644 +index 904596ae3b..6d5ea31e46 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c -@@ -3306,6 +3306,7 @@ static void machvirt_machine_init(void) +@@ -3413,6 +3413,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) + static void virt_machine_10_0_options(MachineClass *mc) { } -@@ -3552,3 +3553,4 @@ static void virt_machine_2_6_options(MachineClass *mc) +@@ -3677,3 +3678,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 +index 6c91e2d292..1b58988c9a 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); +@@ -452,6 +452,7 @@ static void pc_i440fx_init(MachineState *machine) + #define DEFINE_I440FX_MACHINE_AS_LATEST(major, minor) \ + DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, true, "pc", 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) +@@ -794,6 +795,7 @@ static void pc_i440fx_machine_2_4_options(MachineClass *m) } DEFINE_I440FX_MACHINE(2, 4); @@ -60,36 +60,36 @@ index 347afa4c37..67107b174a 100644 #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 +index fd96d0345c..97a40a3a9c 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) +@@ -361,6 +361,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) + static void pc_q35_machine_10_0_options(MachineClass *m) { pc_q35_machine_options(m); -@@ -668,3 +669,4 @@ static void pc_q35_machine_2_4_options(MachineClass *m) +@@ -689,3 +690,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 +index 75b32182eb..5aa5910399 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 = { +@@ -921,6 +921,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) + static void ccw_machine_10_0_instance_options(MachineState *machine) { } -@@ -1305,6 +1306,7 @@ static void ccw_machine_2_4_class_options(MachineClass *mc) - DEFINE_CCW_MACHINE(2, 4); +@@ -1295,6 +1296,7 @@ static void ccw_machine_2_9_class_options(MachineClass *mc) + DEFINE_CCW_MACHINE(2, 9); #endif +#endif /* disabled for RHEL */ diff --git a/0009-Adapt-versioned-machine-type-macros-for-RHEL.patch b/0009-Adapt-versioned-machine-type-macros-for-RHEL.patch index 40f753a..fea50ed 100644 --- a/0009-Adapt-versioned-machine-type-macros-for-RHEL.patch +++ b/0009-Adapt-versioned-machine-type-macros-for-RHEL.patch @@ -1,4 +1,4 @@ -From ccb1eaa95ce9c92a196fe034c033502f582a324b Mon Sep 17 00:00:00 2001 +From d74a60788160bf1cefe391430bb7ef2f2bd0d29c 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 @@ -31,10 +31,10 @@ Signed-off-by: Miroslav Rezanina 8 files changed, 30 insertions(+), 42 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h -index ccfc3e10eb..7f7eb4ec40 100644 +index d7fa968dca..1f6bba7d64 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h -@@ -548,16 +548,16 @@ struct MachineState { +@@ -577,16 +577,16 @@ struct MachineState { * "{prefix}-{major}.{minor}.{micro}-{tag}" */ #define _MACHINE_VER_TYPE_NAME2(prefix, major, minor) \ @@ -55,7 +55,7 @@ index ccfc3e10eb..7f7eb4ec40 100644 #define MACHINE_VER_TYPE_NAME(prefix, ...) \ _MACHINE_VER_PICK(__VA_ARGS__, \ -@@ -585,16 +585,16 @@ struct MachineState { +@@ -614,16 +614,16 @@ struct MachineState { * {prefix}_machine_{major}_{minor}_{micro}_{tag}_{sym} */ #define _MACHINE_VER_SYM2(sym, prefix, major, minor) \ @@ -76,7 +76,7 @@ index ccfc3e10eb..7f7eb4ec40 100644 #define MACHINE_VER_SYM(sym, prefix, ...) \ _MACHINE_VER_PICK(__VA_ARGS__, \ -@@ -605,26 +605,22 @@ struct MachineState { +@@ -634,26 +634,22 @@ struct MachineState { /* @@ -110,7 +110,7 @@ index ccfc3e10eb..7f7eb4ec40 100644 #define _MACHINE_VER_IS_EXPIRED2(cutoff, major, minor) \ _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) -@@ -686,32 +682,14 @@ struct MachineState { +@@ -715,32 +711,14 @@ struct MachineState { * This must be unconditionally used in the register * method for all machine types which support versioning. * @@ -148,10 +148,10 @@ index ccfc3e10eb..7f7eb4ec40 100644 } while (0) diff --git a/meson.build b/meson.build -index 161d496d55..2de5ab024f 100644 +index 066ca7a2c9..38ad60fc10 100644 --- a/meson.build +++ b/meson.build -@@ -2440,6 +2440,7 @@ config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version())) +@@ -2594,6 +2594,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]) @@ -160,7 +160,7 @@ index 161d496d55..2de5ab024f 100644 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 +index 59d973bca0..ad6996178c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,6 +2,8 @@ @@ -173,25 +173,25 @@ index 0269fa0f16..aa2ba0baef 100644 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 +index 3e8e00852b..e9edc8a919 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' +@@ -75,6 +75,7 @@ meson_options_help() { printf "%s\n" ' [QEMU]' printf "%s\n" ' --qemu-ga-version=VALUE version number for qemu-ga installer' + printf "%s\n" ' --rtsig-map=VALUE default value of QEMU_RTSIG_MAP [NULL]' + 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() { +@@ -464,6 +465,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 ;; + --rtsig-map=*) quote_sh "-Drtsig_map=$2" ;; -- 2.39.3 diff --git a/0010-Increase-deletion-schedule-to-4-releases.patch b/0010-Increase-deletion-schedule-to-4-releases.patch index ac7e4eb..047cf63 100644 --- a/0010-Increase-deletion-schedule-to-4-releases.patch +++ b/0010-Increase-deletion-schedule-to-4-releases.patch @@ -1,4 +1,4 @@ -From 551632921a8330cff09e7d92429aa45cf51c75e6 Mon Sep 17 00:00:00 2001 +From 4d25fc36b02293e78f93ce3512fe485d799fa8f5 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 @@ -13,17 +13,17 @@ machine type. Signed-off-by: Daniel P. Berrangé -Rebase notes (9.1.0 rc0) +Rebase notes (9.1.0) - 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 +index 1f6bba7d64..182c11dc2c 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h -@@ -608,7 +608,7 @@ struct MachineState { +@@ -637,7 +637,7 @@ struct MachineState { * How many RHEL major releases for each phase * of the life cycle. */ diff --git a/0011-Add-downstream-aarch64-versioned-virt-machine-types.patch b/0011-Add-downstream-aarch64-versioned-virt-machine-types.patch index 97b2fb1..d6469f6 100644 --- a/0011-Add-downstream-aarch64-versioned-virt-machine-types.patch +++ b/0011-Add-downstream-aarch64-versioned-virt-machine-types.patch @@ -1,4 +1,4 @@ -From 6cb1d3cf4ac08fe8c435e98500224a022d019e55 Mon Sep 17 00:00:00 2001 +From 9da015b8759b082330459277058c014e71bff62b 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 @@ -7,32 +7,53 @@ Adding changes to add RHEL machine types for aarch64 architecture. Signed-off-by: Miroslav Rezanina --- -Rebase notes (9.1.0 rc0): +Rebase notes (9.1.0): - 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): +Rebase notes (10.0.0) +- Removed unwanted sysbus dev +- Set no_nested_smmu +- Use upstream compat + +Merged patches (9.1.0): - 043ad5ce97 Add upstream compatibility bits (partial) + +Merged patches (10.0.0 rc0): +- 03502faf70 Add upstream compatibility bits +- 17c3bccf2f arm: ensure compatibility of virt-rhel9* +- 12e5b038be arm: create new virt machine type for rhel 9.6 +- fb1bc2766e arm: create virt machine type for rhel10 +- 727307e5ed hw/arm/virt: Fix Manufacturer and Product Name in emulated SMBIOS mode +- d93fcb3940 virtio-net: disable USO for all RHEL9 (partial) +- 0440f3d003 arm: disable pauth for virt-rhel9* in RHEL10 --- - hw/arm/virt.c | 101 ++++++++++++++++++++++++++++++++++++++++---------- - 1 file changed, 81 insertions(+), 20 deletions(-) + hw/arm/virt.c | 152 ++++++++++++++++++++++++++++++++++++------ + include/hw/arm/virt.h | 1 + + 2 files changed, 134 insertions(+), 19 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c -index 5396e7cb24..903c0f2e9f 100644 +index 6d5ea31e46..12bf754b6a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c -@@ -90,6 +90,22 @@ static GlobalProperty arm_virt_compat[] = { +@@ -93,6 +93,32 @@ static GlobalProperty arm_virt_compat[] = { }; static const size_t arm_virt_compat_len = G_N_ELEMENTS(arm_virt_compat); ++/* ++ * RHEL9 kernels have pauth disabled while RHEL10 has it enabled, ++ * since qemu will setup the VM with pauth when KVM supports it we ++ * have to disable it for virt-rhel9* to support upgrades / migration. ++ */ ++GlobalProperty arm_rhel9_compat[] = { ++ {TYPE_ARM_CPU, "pauth", "off", .optional = true}, ++}; ++const size_t arm_rhel9_compat_len = G_N_ELEMENTS(arm_rhel9_compat); ++ +/* + * This variable is for changes to properties that are RHEL specific, + * different to the current upstream and to be applied to the latest @@ -52,7 +73,7 @@ index 5396e7cb24..903c0f2e9f 100644 /* * 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) +@@ -102,6 +128,8 @@ static void arm_virt_compat_set(MachineClass *mc) { compat_props_add(mc->compat_props, arm_virt_compat, arm_virt_compat_len); @@ -61,7 +82,7 @@ index 5396e7cb24..903c0f2e9f 100644 } #define DEFINE_VIRT_MACHINE_IMPL(latest, ...) \ -@@ -109,10 +127,11 @@ static void arm_virt_compat_set(MachineClass *mc) +@@ -112,10 +140,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); \ @@ -74,7 +95,7 @@ index 5396e7cb24..903c0f2e9f 100644 } \ } \ static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) = \ -@@ -128,10 +147,10 @@ static void arm_virt_compat_set(MachineClass *mc) +@@ -131,10 +160,10 @@ static void arm_virt_compat_set(MachineClass *mc) } \ type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); @@ -89,7 +110,31 @@ index 5396e7cb24..903c0f2e9f 100644 /* Number of external interrupt lines to configure the GIC with */ -@@ -2434,6 +2453,7 @@ static void machvirt_init(MachineState *machine) +@@ -1708,14 +1737,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 */ +@@ -2464,6 +2500,7 @@ static void machvirt_init(MachineState *machine) qemu_add_machine_init_done_notifier(&vms->machine_done); } @@ -97,7 +142,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -2491,6 +2528,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp) vms->virt = value; } @@ -105,7 +150,7 @@ index 5396e7cb24..903c0f2e9f 100644 static bool virt_get_highmem(Object *obj, Error **errp) { -@@ -2476,6 +2497,7 @@ static void virt_set_highmem(Object *obj, bool value, Error **errp) +@@ -2506,6 +2544,7 @@ static void virt_set_highmem(Object *obj, bool value, Error **errp) vms->highmem = value; } @@ -113,7 +158,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -2519,6 +2558,7 @@ static void virt_set_compact_highmem(Object *obj, bool value, Error **errp) vms->highmem_compact = value; } @@ -121,7 +166,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -2611,6 +2651,7 @@ static void virt_set_its(Object *obj, bool value, Error **errp) vms->its = value; } @@ -129,7 +174,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -2624,6 +2665,7 @@ static void virt_set_dtb_randomness(Object *obj, bool value, Error **errp) vms->dtb_randomness = value; } @@ -137,7 +182,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -2707,6 +2749,7 @@ static void virt_set_ras(Object *obj, bool value, Error **errp) vms->ras = value; } @@ -145,7 +190,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -2720,6 +2763,7 @@ static void virt_set_mte(Object *obj, bool value, Error **errp) vms->mte = value; } @@ -153,7 +198,7 @@ index 5396e7cb24..903c0f2e9f 100644 static char *virt_get_gic_version(Object *obj, Error **errp) { -@@ -3063,16 +3090,10 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) +@@ -3160,16 +3204,16 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) NULL }; @@ -164,16 +209,19 @@ index 5396e7cb24..903c0f2e9f 100644 - * 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; ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + 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); ++#endif ++ machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); + machine_class_allow_dynamic_sysbus_dev(mc, TYPE_UEFI_VARS_SYSBUS); #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) +@@ -3181,11 +3225,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; @@ -186,7 +234,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -3210,6 +3250,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) NULL, NULL); object_class_property_set_description(oc, "acpi", "Enable ACPI"); @@ -194,7 +242,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -3222,6 +3263,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"); @@ -202,7 +250,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -3229,12 +3271,14 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) "Set on/off to enable/disable using " "physical address space above 32 bits"); @@ -217,7 +265,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -3270,7 +3314,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. " @@ -226,7 +274,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -3290,11 +3334,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"); @@ -240,7 +288,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -3302,6 +3348,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) "Set on/off to enable/disable " "ITS instantiation"); @@ -248,7 +296,7 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -3314,6 +3361,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"); @@ -256,16 +304,46 @@ index 5396e7cb24..903c0f2e9f 100644 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) +@@ -3679,3 +3727,69 @@ 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) ++{ ++ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); ++ ++ /* QEMU 9.1 and earlier have only a stage-1 SMMU, not a nested s1+2 one */ ++ vmc->no_nested_smmu = true; ++ compat_props_add(mc->compat_props, hw_compat_rhel_10_1, hw_compat_rhel_10_1_len); ++} ++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); ++ ++ compat_props_add(mc->compat_props, arm_rhel9_compat, arm_rhel9_compat_len); ++ /* NB: remember to move this line to the *latest* RHEL 9 machine */ ++ compat_props_add(mc->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len); ++} ++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() */ ++ 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); ++ ++ vmc->manufacturer_product_compat = true; +} -+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) +{ @@ -296,6 +374,18 @@ index 5396e7cb24..903c0f2e9f 100644 + vmc->no_highmem_compact = true; +} +DEFINE_VIRT_MACHINE(9, 0, 0) +diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h +index c8e94e6aed..26cfdf1d41 100644 +--- a/include/hw/arm/virt.h ++++ b/include/hw/arm/virt.h +@@ -135,6 +135,7 @@ struct VirtMachineClass { + bool no_tcg_lpa2; + bool no_ns_el2_virt_timer_irq; + bool no_nested_smmu; ++ bool manufacturer_product_compat; + }; + + struct VirtMachineState { -- 2.39.3 diff --git a/0012-Add-downstream-s390x-versioned-s390-ccw-virtio-machi.patch b/0012-Add-downstream-s390x-versioned-s390-ccw-virtio-machi.patch index a684e80..cf21b6b 100644 --- a/0012-Add-downstream-s390x-versioned-s390-ccw-virtio-machi.patch +++ b/0012-Add-downstream-s390x-versioned-s390-ccw-virtio-machi.patch @@ -1,4 +1,4 @@ -From 24d6b22e10c87e9a4bf4df834738f42caa1d5014 Mon Sep 17 00:00:00 2001 +From 68460abb11ff9a65c7e9d988609954c2845d32e4 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 @@ -7,24 +7,34 @@ Adding changes to add RHEL machine types for s390x architecture. Signed-off-by: Miroslav Rezanina -- -Rebase notes(9.1.0 rc0): +Rebase notes(9.1.0): - Convert to new DEFINE_CCW_MACHINE macros -Merged patches (9.1.0 rc0): +Rebase notes (10.0.0): +- Use upstream compat +- Disabled relaxed-translation for older types + +Merged patches (9.1.0): - 043ad5ce97 Add upstream compatibility bits (partial) - 04596b496e s390x: remove deprecated rhel machine types + +Merged patches (10.0.0 rc0): +- 03502faf70 Add upstream compatibility bits (partial) +- d27437e5ba redhat: Add QEMU 9.1 compat handling to the s390x machine types +- 926a9d0ca2 redhat: Add rhel9.6.0 and rhel10.0.0 machine types +- d93fcb3940 virtio-net: disable USO for all RHEL9 (partial) --- - 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(-) + hw/s390x/s390-virtio-ccw.c | 103 +++++++++++++++++++++++++++++-- + target/s390x/cpu_models.c | 11 ++++ + target/s390x/cpu_models.h | 2 + + target/s390x/cpu_models_system.c | 2 + + 4 files changed, 113 insertions(+), 5 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c -index 86bfc9d2eb..451017c50e 100644 +index 5aa5910399..59b545740e 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) +@@ -696,6 +696,7 @@ static void s390_nmi(NMIState *n, int cpu_index, Error **errp) s390_cpu_restart(S390_CPU(cs)); } @@ -32,7 +42,7 @@ index 86bfc9d2eb..451017c50e 100644 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) +@@ -715,6 +716,7 @@ static ram_addr_t s390_fixup_ram_size(ram_addr_t sz) } return newsz; } @@ -40,16 +50,16 @@ index 86bfc9d2eb..451017c50e 100644 static inline bool machine_get_aes_key_wrap(Object *obj, Error **errp) { -@@ -837,7 +839,7 @@ static const TypeInfo ccw_machine_info = { +@@ -893,7 +895,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__) ")"; \ + mc->init = MACHINE_VER_SYM(mach_init, ccw, __VA_ARGS__); \ MACHINE_VER_DEPRECATION(__VA_ARGS__); \ if (latest) { \ - mc->alias = "s390-ccw-virtio"; \ -@@ -864,11 +866,11 @@ static const TypeInfo ccw_machine_info = { +@@ -914,11 +916,11 @@ static const TypeInfo ccw_machine_info = { } \ type_init(MACHINE_VER_SYM(register, ccw, __VA_ARGS__)) @@ -65,19 +75,57 @@ index 86bfc9d2eb..451017c50e 100644 #if 0 /* Disabled for Red Hat Enterprise Linux */ -@@ -1308,6 +1310,59 @@ DEFINE_CCW_MACHINE(2, 4); +@@ -1298,6 +1300,97 @@ DEFINE_CCW_MACHINE(2, 9); #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) ++{ ++ static GlobalProperty compat[] = { ++ { TYPE_S390_PCI_DEVICE, "relaxed-translation", "off", }, ++ }; ++ ++ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); ++ compat_props_add(mc->compat_props, hw_compat_rhel_10_1, hw_compat_rhel_10_1_len); ++} ++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); ++ ++ /* NB: remember to move this line to the *latest* RHEL 9 machine */ ++ compat_props_add(mc->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len); ++} ++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) +{ ++ static GlobalProperty compat[] = { ++ { 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) +{ @@ -126,7 +174,7 @@ index 86bfc9d2eb..451017c50e 100644 { type_register_static(&ccw_machine_info); diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c -index 798c18f940..8afa9af1a5 100644 +index 111d46a59a..156bcf0d22 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -47,6 +47,9 @@ @@ -139,7 +187,7 @@ index 798c18f940..8afa9af1a5 100644 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) +@@ -932,22 +935,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); @@ -183,10 +231,10 @@ index 71d4bc2dd4..d6c7c2cb50 100644 } 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 +diff --git a/target/s390x/cpu_models_system.c b/target/s390x/cpu_models_system.c +index 4351182f72..4074124c44 100644 +--- a/target/s390x/cpu_models_system.c ++++ b/target/s390x/cpu_models_system.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)); diff --git a/0013-Add-downstream-x86_64-versioned-pc-q35-machine-types.patch b/0013-Add-downstream-x86_64-versioned-pc-q35-machine-types.patch index 18058b2..9697d1c 100644 --- a/0013-Add-downstream-x86_64-versioned-pc-q35-machine-types.patch +++ b/0013-Add-downstream-x86_64-versioned-pc-q35-machine-types.patch @@ -1,4 +1,4 @@ -From c8510c21f0fde361d6cbce81bfb2f4acb6941b58 Mon Sep 17 00:00:00 2001 +From 869dc39b548550c0b7b6a2bd8ab13746ec1b50c1 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 @@ -7,33 +7,49 @@ Adding changes to add RHEL machine types for x86_64 architecture. Signed-off-by: Miroslav Rezanina --- -Rebase notes (9.1.0 rc0): +Rebase notes (9.1.0): - 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): +Rebase notes (10.0.0 rc0): +- Do not use bugfix macro for q35 +- Use upstream compat +- Add downstream specific compat +- Fixing rhel-9.4 compat issue + +Merged patches (9.1.0): - 043ad5ce97 Add upstream compatibility bits (partial) + +Merged patches (10.0.0 rc0): +- 03502faf70 Add upstream compatibility bits +- 6be70c681b x86: ensure compatibility of pc-q35-rhel9* +- d6b6ae511c x86: create new pc-q35 machine type for rhel 9.6 +- fcf4da60bd x86: create pc-i440fx machine type for rhel10 +- 4acb295fa2 x86: create pc-q35 machine type for rhel10 +- 0489497df8 x86: remove deprecated rhel machine types +- f53dbf7532 remove stale compat definitions (partial) +- 379e14ba88 pc: q35: Bump max_cpus to 4096 vcpus +- d93fcb3940 virtio-net: disable USO for all RHEL9 (partial) --- hw/i386/fw_cfg.c | 2 +- - hw/i386/pc.c | 159 ++++++++++++++++++++++++++++- - hw/i386/pc_piix.c | 102 ++++++++++++++++++- - hw/i386/pc_q35.c | 204 +++++++++++++++++++++++++++++++++++-- + hw/i386/pc.c | 63 +++++++++++++++++++- + hw/i386/pc_piix.c | 49 +++++++++++++-- + hw/i386/pc_q35.c | 119 ++++++++++++++++++++++++++++++++++--- include/hw/boards.h | 2 + - include/hw/i386/pc.h | 33 ++++++ + include/hw/i386/pc.h | 18 ++++++ target/i386/kvm/kvm-cpu.c | 1 + - target/i386/kvm/kvm.c | 4 + + target/i386/kvm/kvm.c | 4 ++ + tests/qtest/meson.build | 2 +- tests/qtest/pvpanic-test.c | 5 +- - 9 files changed, 499 insertions(+), 13 deletions(-) + 10 files changed, 247 insertions(+), 18 deletions(-) diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c -index 33ef280420..a322709ffa 100644 +index 07df7281d2..8009f5f31f 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, +@@ -75,7 +75,7 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg, if (pcmc->smbios_defaults) { /* These values are guest ABI, do not change */ @@ -43,10 +59,10 @@ index 33ef280420..a322709ffa 100644 } diff --git a/hw/i386/pc.c b/hw/i386/pc.c -index 7779c88a91..a49d346d2e 100644 +index 01d0581f62..5ae388789b 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); +@@ -287,6 +287,65 @@ const size_t pc_compat_2_4_len = G_N_ELEMENTS(pc_compat_2_4); */ #define PC_FW_DATA (0x20000 + 0x8000) @@ -72,6 +88,25 @@ index 7779c88a91..a49d346d2e 100644 +}; +const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_compat); + ++GlobalProperty pc_rhel_10_1_compat[] = { ++ /* pc_rhel_10_1_compat from pc_compat_9_1 */ ++ { "ICH9-LPC", "x-smi-swsmi-timer", "off" }, ++ { "ICH9-LPC", "x-smi-periodic-timer", "off" }, ++ { TYPE_INTEL_IOMMU_DEVICE, "stale-tm", "on" }, ++ { TYPE_INTEL_IOMMU_DEVICE, "aw-bits", "39" }, ++}; ++const size_t pc_rhel_10_1_compat_len = G_N_ELEMENTS(pc_rhel_10_1_compat); ++ ++GlobalProperty pc_rhel_10_0_compat[] = { ++ /* pc_rhel_10_0_compat from pc_compat_9_0 */ ++ { TYPE_X86_CPU, "x-amd-topoext-features-only", "false" }, ++ { TYPE_X86_CPU, "x-l1-cache-per-thread", "false" }, ++ { TYPE_X86_CPU, "guest-phys-bits", "0" }, ++ { "sev-guest", "legacy-vm-type", "on" }, ++ { TYPE_X86_CPU, "legacy-multi-node", "on" }, ++}; ++const size_t pc_rhel_10_0_compat_len = G_N_ELEMENTS(pc_rhel_10_0_compat); ++ +GlobalProperty pc_rhel_9_3_compat[] = { + /* pc_rhel_9_3_compat from pc_compat_8_0 */ + { "virtio-mem", "unplugged-inaccessible", "auto" }, @@ -89,126 +124,11 @@ index 7779c88a91..a49d346d2e 100644 + { "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) +@@ -1780,6 +1839,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); @@ -216,7 +136,7 @@ index 7779c88a91..a49d346d2e 100644 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) +@@ -1787,7 +1847,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; @@ -227,76 +147,55 @@ index 7779c88a91..a49d346d2e 100644 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 +index 1b58988c9a..78e9534a2c 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 "system/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) +@@ -446,11 +447,11 @@ 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_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, false, NULL, major, minor); +#define DEFINE_I440FX_MACHINE(major, minor, micro) \ -+ DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, major, minor, micro); ++ DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, false, NULL, major, minor, micro); + +-#define DEFINE_I440FX_MACHINE_AS_LATEST(major, minor) \ +- DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, true, "pc", major, minor); ++#define DEFINE_I440FX_MACHINE_AS_LATEST(major, minor, micro) \ ++ DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, true, "pc", 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) +@@ -845,3 +846,43 @@ 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) ++static void pc_machine_rhel10_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; ++ 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, @@ -304,57 +203,42 @@ index 67107b174a..5535e1ffbf 100644 + 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); ++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; ++ ++ compat_props_add(m->compat_props, hw_compat_rhel_10_1, ++ hw_compat_rhel_10_1_len); ++ compat_props_add(m->compat_props, pc_rhel_10_1_compat, ++ pc_rhel_10_1_compat_len); ++} ++DEFINE_I440FX_MACHINE_AS_LATEST(10, 0, 0); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c -index 5fb283f2df..2ca9ff3747 100644 +index 97a40a3a9c..2f19204304 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) +@@ -327,11 +327,11 @@ static void pc_q35_init(MachineState *machine) + } + } + +-#define DEFINE_Q35_MACHINE(major, minor) \ +- DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, false, NULL, major, minor); ++#define DEFINE_Q35_MACHINE(major, minor, micro) \ ++ DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, false, NULL, major, minor, micro); + +-#define DEFINE_Q35_MACHINE_AS_LATEST(major, minor) \ +- DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, false, "q35", major, minor); ++#define DEFINE_Q35_MACHINE_AS_LATEST(major, minor, micro) \ ++ DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, false, "q35", major, minor, micro); + + #define DEFINE_Q35_MACHINE_BUGFIX(major, minor, micro) \ + DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, false, NULL, major, minor, micro); +@@ -342,21 +342,21 @@ static void pc_q35_machine_options(MachineClass *m) pcmc->pci_root_uid = 0; pcmc->default_cpu_version = 1; @@ -368,46 +252,85 @@ index 5fb283f2df..2ca9ff3747 100644 m->default_nic = "e1000e"; - m->default_kernel_irqchip_split = false; m->no_floppy = 1; -- m->max_cpus = 4096; + m->max_cpus = 4096; - m->no_parallel = !module_object_class_by_name(TYPE_ISA_PARALLEL); -+ m->max_cpus = 710; + m->no_parallel = 1; ++ m->alias = "q35"; 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"; + machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); + machine_class_allow_dynamic_sysbus_dev(m, TYPE_UEFI_VARS_X64); + 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) +@@ -691,3 +691,104 @@ 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) ++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"; ++ ++ compat_props_add(m->compat_props, hw_compat_rhel_10_1, ++ hw_compat_rhel_10_1_len); ++ compat_props_add(m->compat_props, pc_rhel_10_1_compat, ++ pc_rhel_10_1_compat_len); ++} ++DEFINE_Q35_MACHINE_AS_LATEST(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)"; ++ pcmc->smbios_stream_product = "RHEL"; ++ pcmc->smbios_stream_version = "9.6.0"; ++ ++ /* NB: remember to move this line to the *latest* RHEL 9 machine */ ++ compat_props_add(m->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len); ++} ++ ++DEFINE_Q35_MACHINE(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); ++ ++ /* older RHEL machines continue to support 710 vcpus */ ++ m->max_cpus = 710; + m->desc = "RHEL-9.4.0 PC (Q35 + ICH9, 2009)"; + 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, + hw_compat_rhel_9_5_len); ++ compat_props_add(m->compat_props, pc_rhel_10_0_compat, ++ pc_rhel_10_0_compat_len); +} + -+DEFINE_Q35_MACHINE_BUGFIX(9, 4, 0); ++DEFINE_Q35_MACHINE(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"; + @@ -428,14 +351,13 @@ index 5fb283f2df..2ca9ff3747 100644 + pc_rhel_9_2_compat_len); +} + -+DEFINE_Q35_MACHINE_BUGFIX(9, 2, 0); ++DEFINE_Q35_MACHINE(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; @@ -447,140 +369,12 @@ index 5fb283f2df..2ca9ff3747 100644 + 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); -+ ++DEFINE_Q35_MACHINE(9, 0, 0); diff --git a/include/hw/boards.h b/include/hw/boards.h -index fd5a957cad..3dea5cee73 100644 +index 182c11dc2c..a43847767f 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h -@@ -289,6 +289,8 @@ struct MachineClass { +@@ -309,6 +309,8 @@ struct MachineClass { strList *allowed_dynamic_sysbus_devices; bool auto_enable_numa_with_memhp; bool auto_enable_numa_with_memdev; @@ -590,16 +384,22 @@ index fd5a957cad..3dea5cee73 100644 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 +index e4d32f8aea..5306b6d7cb 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; +@@ -305,6 +305,24 @@ extern const size_t pc_compat_2_5_len; + extern GlobalProperty pc_compat_2_4[]; + extern const size_t pc_compat_2_4_len; +extern GlobalProperty pc_rhel_compat[]; +extern const size_t pc_rhel_compat_len; + ++extern GlobalProperty pc_rhel_10_1_compat[]; ++extern const size_t pc_rhel_10_1_compat_len; ++ ++extern GlobalProperty pc_rhel_10_0_compat[]; ++extern const size_t pc_rhel_10_0_compat_len; ++ +extern GlobalProperty pc_rhel_9_3_compat[]; +extern const size_t pc_rhel_9_3_compat_len; + @@ -608,36 +408,15 @@ index 8776a3c937..8e9597f40f 100644 + +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 +index 6269fa8045..8f455c24e9 100644 --- a/target/i386/kvm/kvm-cpu.c +++ b/target/i386/kvm/kvm-cpu.c -@@ -178,6 +178,7 @@ static PropValue kvm_default_props[] = { +@@ -174,6 +174,7 @@ static PropValue kvm_default_props[] = { { "acpi", "off" }, { "monitor", "off" }, { "svm", "off" }, @@ -646,10 +425,10 @@ index 6bf8dcfc60..684e731cbc 100644 }; diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c -index 2fa88ef1e3..2b28c18693 100644 +index 6c749d4ee8..9cb2512c7c 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c -@@ -4244,6 +4244,7 @@ static int kvm_get_msrs(X86CPU *cpu) +@@ -4366,6 +4366,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; @@ -657,7 +436,7 @@ index 2fa88ef1e3..2b28c18693 100644 kvm_msr_buf_reset(cpu); -@@ -4636,6 +4637,9 @@ static int kvm_get_msrs(X86CPU *cpu) +@@ -4763,6 +4764,9 @@ static int kvm_get_msrs(X86CPU *cpu) break; case MSR_KVM_ASYNC_PF_EN: env->async_pf_en_msr = msrs[i].data; @@ -667,8 +446,28 @@ index 2fa88ef1e3..2b28c18693 100644 break; case MSR_KVM_ASYNC_PF_INT: env->async_pf_int_msr = msrs[i].data; +diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build +index 3136d15e0f..7749ec4b2f 100644 +--- a/tests/qtest/meson.build ++++ b/tests/qtest/meson.build +@@ -49,6 +49,7 @@ qtests_filter = \ + (get_option('default_devices') and host_os != 'windows' ? ['test-filter-mirror'] : []) + \ + (get_option('default_devices') and host_os != 'windows' ? ['test-filter-redirector'] : []) + ++# RHEL: Removed intel-iommu-test as it's not working with 10.0 machine type + qtests_i386 = \ + (slirp.found() ? ['pxe-test'] : []) + \ + qtests_filter + \ +@@ -94,7 +95,6 @@ qtests_i386 = \ + (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \ + (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \ + (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \ +- (config_all_devices.has_key('CONFIG_VTD') ? ['intel-iommu-test'] : []) + \ + (host_os != 'windows' and \ + config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \ + (config_all_devices.has_key('CONFIG_PCIE_PORT') and \ diff --git a/tests/qtest/pvpanic-test.c b/tests/qtest/pvpanic-test.c -index d49d2ba931..c18f63e255 100644 +index 5606baf47b..094c56b0cd 100644 --- a/tests/qtest/pvpanic-test.c +++ b/tests/qtest/pvpanic-test.c @@ -18,7 +18,7 @@ static void test_panic_nopause(void) diff --git a/0014-Revert-meson-temporarily-disable-Wunused-function.patch b/0014-Revert-meson-temporarily-disable-Wunused-function.patch index 426e39f..87b2a80 100644 --- a/0014-Revert-meson-temporarily-disable-Wunused-function.patch +++ b/0014-Revert-meson-temporarily-disable-Wunused-function.patch @@ -1,4 +1,4 @@ -From bd6f1170d3a011c475ec4a8315512c7c190de3e4 Mon Sep 17 00:00:00 2001 +From 54d447640d3c550143e07610a516e4cdf474260e 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" @@ -16,10 +16,10 @@ Signed-off-by: Daniel P. Berrangé 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build -index 2de5ab024f..b3529aa0e1 100644 +index 38ad60fc10..0607c1313b 100644 --- a/meson.build +++ b/meson.build -@@ -651,7 +651,6 @@ warn_flags = [ +@@ -747,7 +747,6 @@ warn_flags = [ '-Wno-string-plus-int', '-Wno-tautological-type-limit-compare', '-Wno-typedef-redefinition', diff --git a/0015-Enable-make-check.patch b/0015-Enable-make-check.patch index 5c5ebc1..de71366 100644 --- a/0015-Enable-make-check.patch +++ b/0015-Enable-make-check.patch @@ -1,4 +1,4 @@ -From 3c4bab07566d32859e227ca1083b0dc64111e3f7 Mon Sep 17 00:00:00 2001 +From bd972a5dfe6cec33302ae52d7503a23b7b8506af Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Wed, 2 Sep 2020 09:39:41 +0200 Subject: Enable make check @@ -9,41 +9,37 @@ 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): +Rebase notes (9.1.0): +- Disable fdc-test - 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' +Rebase notes (10.0.0 rc0) +- Disable mem_addr_space functional test +- Updated removal of q35 test (upstream change) + +Rebase notes (10.0.0): +- Add riscv changes +--- + .distro/qemu-kvm.spec.template | 4 +-- + tests/avocado/reverse_debugging.py | 2 +- + tests/functional/meson.build | 2 +- + tests/functional/test_aarch64_replay.py | 2 +- + tests/functional/test_aarch64_tcg_plugins.py | 4 +-- + tests/qemu-iotests/meson.build | 34 ++++++++++---------- + tests/qemu-iotests/testenv.py | 3 ++ + tests/qtest/bios-tables-test.c | 6 ++++ + 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/machine-none-test.c | 2 +- + tests/qtest/meson.build | 1 - + tests/qtest/pvpanic-test.c | 2 +- + tests/qtest/riscv-csr-test.c | 4 +++ + tests/qtest/virtio-net-failover.c | 1 + + 18 files changed, 45 insertions(+), 32 deletions(-) + diff --git a/tests/avocado/reverse_debugging.py b/tests/avocado/reverse_debugging.py index f24287cd0a..3880b81df6 100644 --- a/tests/avocado/reverse_debugging.py @@ -57,28 +53,54 @@ index f24287cd0a..3880b81df6 100644 """ 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() +diff --git a/tests/functional/meson.build b/tests/functional/meson.build +index 0f8be30fe2..4463f6bb0d 100644 +--- a/tests/functional/meson.build ++++ b/tests/functional/meson.build +@@ -291,7 +291,7 @@ tests_sparc64_system_thorough = [ + + tests_x86_64_system_quick = [ + 'cpu_queries', +- 'mem_addr_space', ++# 'mem_addr_space', + 'migration', + 'pc_cpu_hotplug_props', + 'virtio_version', +diff --git a/tests/functional/test_aarch64_replay.py b/tests/functional/test_aarch64_replay.py +index bd6609d914..ddf93814fd 100755 +--- a/tests/functional/test_aarch64_replay.py ++++ b/tests/functional/test_aarch64_replay.py +@@ -18,7 +18,7 @@ class Aarch64Replay(ReplayKernelBase): + + def test_aarch64_virt(self): + self.set_machine('virt') +- self.cpu = 'cortex-a53' ++ self.cpu = 'cortex-a57' + kernel_path = self.ASSET_KERNEL.fetch() 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() + 'console=ttyAMA0') +diff --git a/tests/functional/test_aarch64_tcg_plugins.py b/tests/functional/test_aarch64_tcg_plugins.py +index 4ea71f5f88..0b1043f3dc 100755 +--- a/tests/functional/test_aarch64_tcg_plugins.py ++++ b/tests/functional/test_aarch64_tcg_plugins.py +@@ -65,7 +65,7 @@ class PluginKernelNormal(PluginKernelBase): + + def test_aarch64_virt_insn(self): + self.set_machine('virt') +- self.cpu='cortex-a53' ++ self.cpu='cortex-a57' + kernel_path = self.ASSET_KERNEL.fetch() kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'console=ttyAMA0') +@@ -91,7 +91,7 @@ def test_aarch64_virt_insn(self): + + def test_aarch64_virt_insn_icount(self): + self.set_machine('virt') +- self.cpu='cortex-a53' ++ self.cpu='cortex-a57' + kernel_path = self.ASSET_KERNEL.fetch() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'console=ttyAMA0') diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build index fad340ad59..3c0d5241f6 100644 --- a/tests/qemu-iotests/meson.build @@ -123,10 +145,10 @@ index fad340ad59..3c0d5241f6 100644 +# endforeach endforeach diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py -index c8848f2ec2..d515e5b8b0 100644 +index 6326e46b7b..bc849ae9cf 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, +@@ -252,6 +252,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}' @@ -136,6 +158,57 @@ index c8848f2ec2..d515e5b8b0 100644 # QEMU_DEFAULT_MACHINE self.qemu_default_machine = get_default_machine(self.qemu_prog) +diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c +index 0a333ec435..e24098fc70 100644 +--- a/tests/qtest/bios-tables-test.c ++++ b/tests/qtest/bios-tables-test.c +@@ -1707,6 +1707,7 @@ static void test_acpi_microvm_ioapic2_tcg(void) + free_test_data(&data); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void test_acpi_riscv64_virt_tcg_numamem(void) + { + test_data data = { +@@ -1732,6 +1733,7 @@ static void test_acpi_riscv64_virt_tcg_numamem(void) + &data); + free_test_data(&data); + } ++#endif /* disabled for RHEL */ + + static void test_acpi_aarch64_virt_tcg_numamem(void) + { +@@ -2085,6 +2087,7 @@ static void test_acpi_microvm_acpi_erst(void) + } + #endif /* CONFIG_POSIX */ + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void test_acpi_riscv64_virt_tcg(void) + { + test_data data = { +@@ -2106,6 +2109,7 @@ static void test_acpi_riscv64_virt_tcg(void) + test_acpi_one("-cpu rva22s64 ", &data); + free_test_data(&data); + } ++#endif /* disabled for RHEL */ + + static void test_acpi_aarch64_virt_tcg(void) + { +@@ -2587,12 +2591,14 @@ int main(int argc, char *argv[]) + qtest_add_func("acpi/virt/viot", test_acpi_aarch64_virt_viot); + } + } ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + } else if (strcmp(arch, "riscv64") == 0) { + if (has_tcg && qtest_has_device("virtio-blk-pci")) { + qtest_add_func("acpi/virt", test_acpi_riscv64_virt_tcg); + qtest_add_func("acpi/virt/numamem", + test_acpi_riscv64_virt_tcg_numamem); + } ++#endif /* disabled for RHEL */ + } + ret = g_test_run(); + boot_sector_cleanup(disk); 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 @@ -176,10 +249,10 @@ index 663bb6c485..2efc43e3f7 100644 "-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 +index 1ddaf7b095..1cb403e90d 100644 --- a/tests/qtest/libqos/meson.build +++ b/tests/qtest/libqos/meson.build -@@ -44,7 +44,7 @@ libqos_srcs = files( +@@ -43,7 +43,7 @@ libqos_srcs = files( 'virtio-rng.c', 'virtio-scsi.c', 'virtio-serial.c', @@ -201,29 +274,33 @@ index 8ac95b89f7..0e118b76eb 100644 "-nographic -monitor none -serial none"); qtest_outl(s, 0xcf8, 0x8000f840); /* PMBASE */ +diff --git a/tests/qtest/machine-none-test.c b/tests/qtest/machine-none-test.c +index b6a87d27ed..423ba12159 100644 +--- a/tests/qtest/machine-none-test.c ++++ b/tests/qtest/machine-none-test.c +@@ -49,7 +49,7 @@ static struct arch2cpu cpus_map[] = { + { "xtensa", "dc233c" }, + { "xtensaeb", "fsf" }, + { "hppa", "hppa" }, +- { "riscv64", "rv64" }, ++ { "riscv64", "max" }, + { "riscv32", "rv32" }, + { "rx", "rx62n" }, + { "loongarch64", "la464"}, diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build -index 2f0d3ef080..134c48c10e 100644 +index 7749ec4b2f..6e2d08acc5 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', +@@ -91,7 +91,6 @@ qtests_i386 = \ + (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) + \ + (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \ + (config_all_devices.has_key('CONFIG_VIRTIO_BALLOON') ? ['virtio-balloon-test'] : []) + \ +- (config_all_devices.has_key('CONFIG_Q35') ? ['q35-test'] : []) + \ + (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \ + (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \ + (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \ diff --git a/tests/qtest/pvpanic-test.c b/tests/qtest/pvpanic-test.c -index c18f63e255..57fb129ae4 100644 +index 094c56b0cd..338f94dcd9 100644 --- a/tests/qtest/pvpanic-test.c +++ b/tests/qtest/pvpanic-test.c @@ -65,7 +65,7 @@ static void test_pvshutdown(void) @@ -235,11 +312,39 @@ index c18f63e255..57fb129ae4 100644 val = qtest_inb(qts, 0x505); g_assert_cmpuint(val, ==, PVPANIC_EVENTS); +diff --git a/tests/qtest/riscv-csr-test.c b/tests/qtest/riscv-csr-test.c +index ff5c29e6c6..cc3b08a976 100644 +--- a/tests/qtest/riscv-csr-test.c ++++ b/tests/qtest/riscv-csr-test.c +@@ -20,6 +20,7 @@ + #define CSR_MVENDORID 0xf11 + #define CSR_MISELECT 0x350 + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void run_test_csr(void) + { + uint64_t res; +@@ -45,12 +46,15 @@ static void run_test_csr(void) + + qtest_quit(qts); + } ++#endif /* disabled for RHEL */ + + int main(int argc, char **argv) + { + g_test_init(&argc, &argv, NULL); + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + qtest_add_func("/cpu/csr", run_test_csr); ++#endif /* disabled for RHEL */ + + return g_test_run(); + } diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c -index 73dfabc272..a9dd304781 100644 +index 5baf81c3e6..aa87bf5698 100644 --- a/tests/qtest/virtio-net-failover.c +++ b/tests/qtest/virtio-net-failover.c -@@ -26,6 +26,7 @@ +@@ -27,6 +27,7 @@ #define PCI_SEL_BASE 0x0010 #define BASE_MACHINE "-M q35 -nodefaults " \ diff --git a/0016-vfio-cap-number-of-devices-that-can-be-assigned.patch b/0016-vfio-cap-number-of-devices-that-can-be-assigned.patch index a492875..adac2b6 100644 --- a/0016-vfio-cap-number-of-devices-that-can-be-assigned.patch +++ b/0016-vfio-cap-number-of-devices-that-can-be-assigned.patch @@ -1,4 +1,4 @@ -From 9813098fb73e899dd1d824f9c1e7e570a87b1771 Mon Sep 17 00:00:00 2001 +From 194c56d4231e0ea6e86c04d905a3941e376c9a55 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 @@ -23,7 +23,7 @@ Signed-off-by: Bandan Das 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c -index 2407720c35..82a47edc89 100644 +index 7f1532fbed..a71fe1ca7a 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -50,6 +50,9 @@ @@ -36,7 +36,7 @@ index 2407720c35..82a47edc89 100644 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) +@@ -2966,10 +2969,33 @@ static void vfio_realize(PCIDevice *pdev, Error **errp) ERRP_GUARD(); VFIOPCIDevice *vdev = VFIO_PCI(pdev); VFIODevice *vbasedev = &vdev->vbasedev; @@ -71,7 +71,7 @@ index 2407720c35..82a47edc89 100644 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[] = { +@@ -3380,6 +3406,9 @@ static const 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), @@ -82,7 +82,7 @@ index 2407720c35..82a47edc89 100644 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 +index d94ecaba68..3854bbcb26 100644 --- a/hw/vfio/pci.h +++ b/hw/vfio/pci.h @@ -142,6 +142,7 @@ struct VFIOPCIDevice { diff --git a/0017-Add-support-statement-to-help-output.patch b/0017-Add-support-statement-to-help-output.patch index 1d3cd3f..862cb9e 100644 --- a/0017-Add-support-statement-to-help-output.patch +++ b/0017-Add-support-statement-to-help-output.patch @@ -1,4 +1,4 @@ -From e46f7b696ec32b18969c9cd7c1553d7d30e489b3 Mon Sep 17 00:00:00 2001 +From f3ef3004dc20bd1d6a1de3797fc46259f6503541 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 @@ -12,10 +12,10 @@ Signed-off-by: Eduardo Habkost 1 file changed, 9 insertions(+) diff --git a/system/vl.c b/system/vl.c -index 01b8b8e77a..5359231bf5 100644 +index ec93988a03..c2bd30dc93 100644 --- a/system/vl.c +++ b/system/vl.c -@@ -877,9 +877,17 @@ static void version(void) +@@ -870,9 +870,17 @@ static void version(void) QEMU_COPYRIGHT "\n"); } @@ -33,7 +33,7 @@ index 01b8b8e77a..5359231bf5 100644 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) +@@ -898,6 +906,7 @@ static void help(int exitcode) "\n" QEMU_HELP_BOTTOM "\n"); diff --git a/0018-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch b/0018-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch index 8226ee1..7c483d1 100644 --- a/0018-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch +++ b/0018-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch @@ -1,4 +1,4 @@ -From 40274d161d20719709d92356077175f93795ea1e Mon Sep 17 00:00:00 2001 +From 5c4d190b3a79b22c86b59929ffe83433074c64a8 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- @@ -27,10 +27,10 @@ index 52d6454b93..d74dbdeca9 100644 .. |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 +index dc694a99a3..5eb668b1e2 100644 --- a/qemu-options.hx +++ b/qemu-options.hx -@@ -3688,11 +3688,11 @@ SRST +@@ -3672,11 +3672,11 @@ SRST :: diff --git a/0019-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch b/0019-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch index ef84e7d..128998f 100644 --- a/0019-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch +++ b/0019-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch @@ -1,4 +1,4 @@ -From 728e3d8a124f4ec51c005ad6867270f3e60df16c Mon Sep 17 00:00:00 2001 +From 1453ce2b1fa98c0d9f952827bc40b3a90d0f70be 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 @@ -25,7 +25,7 @@ Signed-off-by: Kevin Wolf 2 files changed, 7 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c -index 70b19730a3..a4cffb628c 100644 +index 7774e7f090..b6ade4755d 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1358,6 +1358,12 @@ qcow2_do_open(BlockDriverState *bs, QDict *options, int flags, diff --git a/0021-Add-upstream-compatibility-bits.patch b/0021-Add-upstream-compatibility-bits.patch deleted file mode 100644 index 8f0de48..0000000 --- a/0021-Add-upstream-compatibility-bits.patch +++ /dev/null @@ -1,109 +0,0 @@ -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/0022-redhat-Add-QEMU-9.1-compat-handling-to-the-s390x-mac.patch b/0022-redhat-Add-QEMU-9.1-compat-handling-to-the-s390x-mac.patch deleted file mode 100644 index 2353cc5..0000000 --- a/0022-redhat-Add-QEMU-9.1-compat-handling-to-the-s390x-mac.patch +++ /dev/null @@ -1,37 +0,0 @@ -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/0023-redhat-Add-rhel9.6.0-and-rhel10.0.0-machine-types.patch b/0023-redhat-Add-rhel9.6.0-and-rhel10.0.0-machine-types.patch deleted file mode 100644 index 33b6f77..0000000 --- a/0023-redhat-Add-rhel9.6.0-and-rhel10.0.0-machine-types.patch +++ /dev/null @@ -1,66 +0,0 @@ -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/0024-x86-ensure-compatibility-of-pc-q35-rhel9.patch b/0024-x86-ensure-compatibility-of-pc-q35-rhel9.patch deleted file mode 100644 index b1e23de..0000000 --- a/0024-x86-ensure-compatibility-of-pc-q35-rhel9.patch +++ /dev/null @@ -1,28 +0,0 @@ -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/0025-arm-ensure-compatibility-of-virt-rhel9.patch b/0025-arm-ensure-compatibility-of-virt-rhel9.patch deleted file mode 100644 index 2b95ffe..0000000 --- a/0025-arm-ensure-compatibility-of-virt-rhel9.patch +++ /dev/null @@ -1,27 +0,0 @@ -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/kvm-KVM-Define-KVM_MEMSLOTS_NUM_MAX_DEFAULT.patch b/kvm-KVM-Define-KVM_MEMSLOTS_NUM_MAX_DEFAULT.patch deleted file mode 100644 index 14bd08c..0000000 --- a/kvm-KVM-Define-KVM_MEMSLOTS_NUM_MAX_DEFAULT.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 111d70a5bdc3ee0dde0a6def9e0c75ed20b4f093 Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Tue, 17 Sep 2024 12:38:33 -0400 -Subject: [PATCH 6/9] KVM: Define KVM_MEMSLOTS_NUM_MAX_DEFAULT - -RH-Author: Peter Xu -RH-MergeRequest: 285: KVM: Dynamic sized kvm memslots array -RH-Jira: RHEL-57685 -RH-Acked-by: Juraj Marcin -RH-Acked-by: Miroslav Rezanina -RH-Commit: [5/7] e4c2a2c2f3a809c8efb709521c7a94ba0627c69b (peterx/qemu-kvm) - -Make the default max nr_slots a macro, it's only used when KVM reports -nothing. - -Reviewed-by: David Hildenbrand -Signed-off-by: Peter Xu -Link: https://lore.kernel.org/r/20240917163835.194664-3-peterx@redhat.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit b34a908c8f24eedb0a8e5ff486b059b58fd793f4) -Signed-off-by: Peter Xu ---- - accel/kvm/kvm-all.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c -index 38393bc86b..87db0f9494 100644 ---- a/accel/kvm/kvm-all.c -+++ b/accel/kvm/kvm-all.c -@@ -71,6 +71,8 @@ - - /* Default num of memslots to be allocated when VM starts */ - #define KVM_MEMSLOTS_NR_ALLOC_DEFAULT 16 -+/* Default max allowed memslots if kernel reported nothing */ -+#define KVM_MEMSLOTS_NR_MAX_DEFAULT 32 - - struct KVMParkedVcpu { - unsigned long vcpu_id; -@@ -2617,7 +2619,7 @@ static int kvm_init(MachineState *ms) - - /* If unspecified, use the default value */ - if (!s->nr_slots) { -- s->nr_slots = 32; -+ s->nr_slots_max = KVM_MEMSLOTS_NR_MAX_DEFAULT; - } - - s->nr_as = kvm_check_extension(s, KVM_CAP_MULTI_ADDRESS_SPACE); --- -2.39.3 - diff --git a/kvm-KVM-Dynamic-sized-kvm-memslots-array.patch b/kvm-KVM-Dynamic-sized-kvm-memslots-array.patch deleted file mode 100644 index 8fc648d..0000000 --- a/kvm-KVM-Dynamic-sized-kvm-memslots-array.patch +++ /dev/null @@ -1,251 +0,0 @@ -From c77a30265b8d0db43174b040ea82103f8fdb9911 Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Tue, 17 Sep 2024 12:38:32 -0400 -Subject: [PATCH 5/9] KVM: Dynamic sized kvm memslots array - -RH-Author: Peter Xu -RH-MergeRequest: 285: KVM: Dynamic sized kvm memslots array -RH-Jira: RHEL-57685 -RH-Acked-by: Juraj Marcin -RH-Acked-by: Miroslav Rezanina -RH-Commit: [4/7] 46d4abec352a92112e593ea61b7cbf5ce5f94cdc (peterx/qemu-kvm) - -Zhiyi reported an infinite loop issue in VFIO use case. The cause of that -was a separate discussion, however during that I found a regression of -dirty sync slowness when profiling. - -Each KVMMemoryListerner maintains an array of kvm memslots. Currently it's -statically allocated to be the max supported by the kernel. However after -Linux commit 4fc096a99e ("KVM: Raise the maximum number of user memslots"), -the max supported memslots reported now grows to some number large enough -so that it may not be wise to always statically allocate with the max -reported. - -What's worse, QEMU kvm code still walks all the allocated memslots entries -to do any form of lookups. It can drastically slow down all memslot -operations because each of such loop can run over 32K times on the new -kernels. - -Fix this issue by making the memslots to be allocated dynamically. - -Here the initial size was set to 16 because it should cover the basic VM -usages, so that the hope is the majority VM use case may not even need to -grow at all (e.g. if one starts a VM with ./qemu-system-x86_64 by default -it'll consume 9 memslots), however not too large to waste memory. - -There can also be even better way to address this, but so far this is the -simplest and should be already better even than before we grow the max -supported memslots. For example, in the case of above issue when VFIO was -attached on a 32GB system, there are only ~10 memslots used. So it could -be good enough as of now. - -In the above VFIO context, measurement shows that the precopy dirty sync -shrinked from ~86ms to ~3ms after this patch applied. It should also apply -to any KVM enabled VM even without VFIO. - -NOTE: we don't have a FIXES tag for this patch because there's no real -commit that regressed this in QEMU. Such behavior existed for a long time, -but only start to be a problem when the kernel reports very large -nr_slots_max value. However that's pretty common now (the kernel change -was merged in 2021) so we attached cc:stable because we'll want this change -to be backported to stable branches. - -Cc: qemu-stable -Reported-by: Zhiyi Guo -Tested-by: Zhiyi Guo -Signed-off-by: Peter Xu -Acked-by: David Hildenbrand -Reviewed-by: Fabiano Rosas -Link: https://lore.kernel.org/r/20240917163835.194664-2-peterx@redhat.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit 5504a8126115d173687b37e657312a8ffe29fc0c) -Signed-off-by: Peter Xu ---- - accel/kvm/kvm-all.c | 87 +++++++++++++++++++++++++++++++++------- - accel/kvm/trace-events | 1 + - include/sysemu/kvm_int.h | 1 + - 3 files changed, 74 insertions(+), 15 deletions(-) - -diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c -index 8187ad3964..38393bc86b 100644 ---- a/accel/kvm/kvm-all.c -+++ b/accel/kvm/kvm-all.c -@@ -69,6 +69,9 @@ - #define KVM_GUESTDBG_BLOCKIRQ 0 - #endif - -+/* Default num of memslots to be allocated when VM starts */ -+#define KVM_MEMSLOTS_NR_ALLOC_DEFAULT 16 -+ - struct KVMParkedVcpu { - unsigned long vcpu_id; - int kvm_fd; -@@ -165,6 +168,57 @@ void kvm_resample_fd_notify(int gsi) - } - } - -+/** -+ * kvm_slots_grow(): Grow the slots[] array in the KVMMemoryListener -+ * -+ * @kml: The KVMMemoryListener* to grow the slots[] array -+ * @nr_slots_new: The new size of slots[] array -+ * -+ * Returns: True if the array grows larger, false otherwise. -+ */ -+static bool kvm_slots_grow(KVMMemoryListener *kml, unsigned int nr_slots_new) -+{ -+ unsigned int i, cur = kml->nr_slots_allocated; -+ KVMSlot *slots; -+ -+ if (nr_slots_new > kvm_state->nr_slots) { -+ nr_slots_new = kvm_state->nr_slots; -+ } -+ -+ if (cur >= nr_slots_new) { -+ /* Big enough, no need to grow, or we reached max */ -+ return false; -+ } -+ -+ if (cur == 0) { -+ slots = g_new0(KVMSlot, nr_slots_new); -+ } else { -+ assert(kml->slots); -+ slots = g_renew(KVMSlot, kml->slots, nr_slots_new); -+ /* -+ * g_renew() doesn't initialize extended buffers, however kvm -+ * memslots require fields to be zero-initialized. E.g. pointers, -+ * memory_size field, etc. -+ */ -+ memset(&slots[cur], 0x0, sizeof(slots[0]) * (nr_slots_new - cur)); -+ } -+ -+ for (i = cur; i < nr_slots_new; i++) { -+ slots[i].slot = i; -+ } -+ -+ kml->slots = slots; -+ kml->nr_slots_allocated = nr_slots_new; -+ trace_kvm_slots_grow(cur, nr_slots_new); -+ -+ return true; -+} -+ -+static bool kvm_slots_double(KVMMemoryListener *kml) -+{ -+ return kvm_slots_grow(kml, kml->nr_slots_allocated * 2); -+} -+ - unsigned int kvm_get_max_memslots(void) - { - KVMState *s = KVM_STATE(current_accel()); -@@ -193,15 +247,26 @@ unsigned int kvm_get_free_memslots(void) - /* Called with KVMMemoryListener.slots_lock held */ - static KVMSlot *kvm_get_free_slot(KVMMemoryListener *kml) - { -- KVMState *s = kvm_state; -+ unsigned int n; - int i; - -- for (i = 0; i < s->nr_slots; i++) { -+ for (i = 0; i < kml->nr_slots_allocated; i++) { - if (kml->slots[i].memory_size == 0) { - return &kml->slots[i]; - } - } - -+ /* -+ * If no free slots, try to grow first by doubling. Cache the old size -+ * here to avoid another round of search: if the grow succeeded, it -+ * means slots[] now must have the existing "n" slots occupied, -+ * followed by one or more free slots starting from slots[n]. -+ */ -+ n = kml->nr_slots_allocated; -+ if (kvm_slots_double(kml)) { -+ return &kml->slots[n]; -+ } -+ - return NULL; - } - -@@ -222,10 +287,9 @@ static KVMSlot *kvm_lookup_matching_slot(KVMMemoryListener *kml, - hwaddr start_addr, - hwaddr size) - { -- KVMState *s = kvm_state; - int i; - -- for (i = 0; i < s->nr_slots; i++) { -+ for (i = 0; i < kml->nr_slots_allocated; i++) { - KVMSlot *mem = &kml->slots[i]; - - if (start_addr == mem->start_addr && size == mem->memory_size) { -@@ -267,7 +331,7 @@ int kvm_physical_memory_addr_from_host(KVMState *s, void *ram, - int i, ret = 0; - - kvm_slots_lock(); -- for (i = 0; i < s->nr_slots; i++) { -+ for (i = 0; i < kml->nr_slots_allocated; i++) { - KVMSlot *mem = &kml->slots[i]; - - if (ram >= mem->ram && ram < mem->ram + mem->memory_size) { -@@ -1071,7 +1135,7 @@ static int kvm_physical_log_clear(KVMMemoryListener *kml, - - kvm_slots_lock(); - -- for (i = 0; i < s->nr_slots; i++) { -+ for (i = 0; i < kml->nr_slots_allocated; i++) { - mem = &kml->slots[i]; - /* Discard slots that are empty or do not overlap the section */ - if (!mem->memory_size || -@@ -1719,12 +1783,8 @@ static void kvm_log_sync_global(MemoryListener *l, bool last_stage) - /* Flush all kernel dirty addresses into KVMSlot dirty bitmap */ - kvm_dirty_ring_flush(); - -- /* -- * TODO: make this faster when nr_slots is big while there are -- * only a few used slots (small VMs). -- */ - kvm_slots_lock(); -- for (i = 0; i < s->nr_slots; i++) { -+ for (i = 0; i < kml->nr_slots_allocated; i++) { - mem = &kml->slots[i]; - if (mem->memory_size && mem->flags & KVM_MEM_LOG_DIRTY_PAGES) { - kvm_slot_sync_dirty_pages(mem); -@@ -1839,12 +1899,9 @@ void kvm_memory_listener_register(KVMState *s, KVMMemoryListener *kml, - { - int i; - -- kml->slots = g_new0(KVMSlot, s->nr_slots); - kml->as_id = as_id; - -- for (i = 0; i < s->nr_slots; i++) { -- kml->slots[i].slot = i; -- } -+ kvm_slots_grow(kml, KVM_MEMSLOTS_NR_ALLOC_DEFAULT); - - QSIMPLEQ_INIT(&kml->transaction_add); - QSIMPLEQ_INIT(&kml->transaction_del); -diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events -index 37626c1ac5..ad2ae6fca5 100644 ---- a/accel/kvm/trace-events -+++ b/accel/kvm/trace-events -@@ -36,3 +36,4 @@ kvm_io_window_exit(void) "" - kvm_run_exit_system_event(int cpu_index, uint32_t event_type) "cpu_index %d, system_even_type %"PRIu32 - kvm_convert_memory(uint64_t start, uint64_t size, const char *msg) "start 0x%" PRIx64 " size 0x%" PRIx64 " %s" - kvm_memory_fault(uint64_t start, uint64_t size, uint64_t flags) "start 0x%" PRIx64 " size 0x%" PRIx64 " flags 0x%" PRIx64 -+kvm_slots_grow(unsigned int old, unsigned int new) "%u -> %u" -diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h -index 1d8fb1473b..48e496b3d4 100644 ---- a/include/sysemu/kvm_int.h -+++ b/include/sysemu/kvm_int.h -@@ -46,6 +46,7 @@ typedef struct KVMMemoryListener { - MemoryListener listener; - KVMSlot *slots; - unsigned int nr_used_slots; -+ unsigned int nr_slots_allocated; - int as_id; - QSIMPLEQ_HEAD(, KVMMemoryUpdate) transaction_add; - QSIMPLEQ_HEAD(, KVMMemoryUpdate) transaction_del; --- -2.39.3 - diff --git a/kvm-KVM-Rename-KVMMemoryListener.nr_used_slots-to-nr_slo.patch b/kvm-KVM-Rename-KVMMemoryListener.nr_used_slots-to-nr_slo.patch deleted file mode 100644 index 544247a..0000000 --- a/kvm-KVM-Rename-KVMMemoryListener.nr_used_slots-to-nr_slo.patch +++ /dev/null @@ -1,73 +0,0 @@ -From b1d082cfad79245ac0ffed45f723092388d1cf45 Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Tue, 17 Sep 2024 12:38:34 -0400 -Subject: [PATCH 7/9] KVM: Rename KVMMemoryListener.nr_used_slots to - nr_slots_used - -RH-Author: Peter Xu -RH-MergeRequest: 285: KVM: Dynamic sized kvm memslots array -RH-Jira: RHEL-57685 -RH-Acked-by: Juraj Marcin -RH-Acked-by: Miroslav Rezanina -RH-Commit: [6/7] ed173123ee23edcf62a6c1940ca74cdfd6b545e9 (peterx/qemu-kvm) - -This will make all nr_slots counters to be named in the same manner. - -Reviewed-by: David Hildenbrand -Signed-off-by: Peter Xu -Link: https://lore.kernel.org/r/20240917163835.194664-4-peterx@redhat.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit dbdc00ba5b136bba80d850f61cc79a9cafaae1cd) -Signed-off-by: Peter Xu ---- - accel/kvm/kvm-all.c | 6 +++--- - include/sysemu/kvm_int.h | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c -index 87db0f9494..e99aaba486 100644 ---- a/accel/kvm/kvm-all.c -+++ b/accel/kvm/kvm-all.c -@@ -239,7 +239,7 @@ unsigned int kvm_get_free_memslots(void) - if (!s->as[i].ml) { - continue; - } -- used_slots = MAX(used_slots, s->as[i].ml->nr_used_slots); -+ used_slots = MAX(used_slots, s->as[i].ml->nr_slots_used); - } - kvm_slots_unlock(); - -@@ -1516,7 +1516,7 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, - } - start_addr += slot_size; - size -= slot_size; -- kml->nr_used_slots--; -+ kml->nr_slots_used--; - } while (size); - return; - } -@@ -1555,7 +1555,7 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml, - ram_start_offset += slot_size; - ram += slot_size; - size -= slot_size; -- kml->nr_used_slots++; -+ kml->nr_slots_used++; - } while (size); - } - -diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h -index 48e496b3d4..b705dfc9b4 100644 ---- a/include/sysemu/kvm_int.h -+++ b/include/sysemu/kvm_int.h -@@ -45,7 +45,7 @@ typedef struct KVMMemoryUpdate { - typedef struct KVMMemoryListener { - MemoryListener listener; - KVMSlot *slots; -- unsigned int nr_used_slots; -+ unsigned int nr_slots_used; - unsigned int nr_slots_allocated; - int as_id; - QSIMPLEQ_HEAD(, KVMMemoryUpdate) transaction_add; --- -2.39.3 - diff --git a/kvm-KVM-Rename-KVMState-nr_slots-to-nr_slots_max.patch b/kvm-KVM-Rename-KVMState-nr_slots-to-nr_slots_max.patch deleted file mode 100644 index 92b46cc..0000000 --- a/kvm-KVM-Rename-KVMState-nr_slots-to-nr_slots_max.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 891fb13363d168760cd21d0c57368e1a413cad27 Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Tue, 17 Sep 2024 12:38:35 -0400 -Subject: [PATCH 8/9] KVM: Rename KVMState->nr_slots to nr_slots_max - -RH-Author: Peter Xu -RH-MergeRequest: 285: KVM: Dynamic sized kvm memslots array -RH-Jira: RHEL-57685 -RH-Acked-by: Juraj Marcin -RH-Acked-by: Miroslav Rezanina -RH-Commit: [7/7] 7a1b28f04ee6a2c80b07db241fc88cb40f54e376 (peterx/qemu-kvm) - -This value used to reflect the maximum supported memslots from KVM kernel. -Rename it to be clearer. - -Reviewed-by: David Hildenbrand -Signed-off-by: Peter Xu -Link: https://lore.kernel.org/r/20240917163835.194664-5-peterx@redhat.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit 943c742868c739c0b14fd996bad3adf744156fec) -Signed-off-by: Peter Xu ---- - accel/kvm/kvm-all.c | 12 ++++++------ - include/sysemu/kvm_int.h | 4 ++-- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c -index e99aaba486..dc6253895d 100644 ---- a/accel/kvm/kvm-all.c -+++ b/accel/kvm/kvm-all.c -@@ -183,8 +183,8 @@ static bool kvm_slots_grow(KVMMemoryListener *kml, unsigned int nr_slots_new) - unsigned int i, cur = kml->nr_slots_allocated; - KVMSlot *slots; - -- if (nr_slots_new > kvm_state->nr_slots) { -- nr_slots_new = kvm_state->nr_slots; -+ if (nr_slots_new > kvm_state->nr_slots_max) { -+ nr_slots_new = kvm_state->nr_slots_max; - } - - if (cur >= nr_slots_new) { -@@ -225,7 +225,7 @@ unsigned int kvm_get_max_memslots(void) - { - KVMState *s = KVM_STATE(current_accel()); - -- return s->nr_slots; -+ return s->nr_slots_max; - } - - unsigned int kvm_get_free_memslots(void) -@@ -243,7 +243,7 @@ unsigned int kvm_get_free_memslots(void) - } - kvm_slots_unlock(); - -- return s->nr_slots - used_slots; -+ return s->nr_slots_max - used_slots; - } - - /* Called with KVMMemoryListener.slots_lock held */ -@@ -2615,10 +2615,10 @@ static int kvm_init(MachineState *ms) - (kvm_supported_memory_attributes & KVM_MEMORY_ATTRIBUTE_PRIVATE); - - kvm_immediate_exit = kvm_check_extension(s, KVM_CAP_IMMEDIATE_EXIT); -- s->nr_slots = kvm_check_extension(s, KVM_CAP_NR_MEMSLOTS); -+ s->nr_slots_max = kvm_check_extension(s, KVM_CAP_NR_MEMSLOTS); - - /* If unspecified, use the default value */ -- if (!s->nr_slots) { -+ if (!s->nr_slots_max) { - s->nr_slots_max = KVM_MEMSLOTS_NR_MAX_DEFAULT; - } - -diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h -index b705dfc9b4..2c57194b6b 100644 ---- a/include/sysemu/kvm_int.h -+++ b/include/sysemu/kvm_int.h -@@ -103,8 +103,8 @@ struct KVMDirtyRingReaper { - struct KVMState - { - AccelState parent_obj; -- -- int nr_slots; -+ /* Max number of KVM slots supported */ -+ int nr_slots_max; - int fd; - int vmfd; - int coalesced_mmio; --- -2.39.3 - diff --git a/kvm-RH-Author-Shaoqin-Huang-shahuang-redhat.com.patch b/kvm-RH-Author-Shaoqin-Huang-shahuang-redhat.com.patch deleted file mode 100644 index f1ddc9b..0000000 --- a/kvm-RH-Author-Shaoqin-Huang-shahuang-redhat.com.patch +++ /dev/null @@ -1,76 +0,0 @@ -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/kvm-accel-kvm-check-for-KVM_CAP_READONLY_MEM-on-VM.patch b/kvm-accel-kvm-check-for-KVM_CAP_READONLY_MEM-on-VM.patch deleted file mode 100644 index 6724ead..0000000 --- a/kvm-accel-kvm-check-for-KVM_CAP_READONLY_MEM-on-VM.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 2b4558ec338adde1b9735128bb8d2f81db303a93 Mon Sep 17 00:00:00 2001 -From: Avadhut Naik -Date: Wed, 23 Oct 2024 12:25:28 -0500 -Subject: [PATCH 01/38] accel/kvm: check for KVM_CAP_READONLY_MEM on VM - -RH-Author: avnaik1 -RH-MergeRequest: 276: accel/kvm: check for KVM_CAP_READONLY_MEM on VM -RH-Jira: RHEL-58928 -RH-Acked-by: Paolo Bonzini -RH-Acked-by: Vitaly Kuznetsov -RH-Commit: [1/1] 1d392a9e47e68bb71dc44635c494d161585a885c (avnaik1/avnaik-qemu-kvm-fork) - -JIRA: https://issues.redhat.com/browse/RHEL-58928 - -commit 64e0e63ea16aa0122dc0c41a0679da0ae4616208 -Author: Tom Dohrmann -Date: Tue Sep 3 06:29:53 2024 +0000 - - accel/kvm: check for KVM_CAP_READONLY_MEM on VM - - KVM_CAP_READONLY_MEM used to be a global capability, but with the - introduction of AMD SEV-SNP confidential VMs, this extension is not - always available on all VM types [1,2]. - - Query the extension on the VM level instead of on the KVM level. - - [1] https://patchwork.kernel.org/project/kvm/patch/20240809190319.1710470-2-seanjc@google.com/ - [2] https://patchwork.kernel.org/project/kvm/patch/20240902144219.3716974-1-erbse.13@gmx.de/ - - Cc: Paolo Bonzini - Signed-off-by: Tom Dohrmann - Link: https://lore.kernel.org/r/20240903062953.3926498-1-erbse.13@gmx.de - Cc: qemu-stable@nongnu.org - Signed-off-by: Paolo Bonzini - -Signed-off-by: Avadhut Naik ---- - accel/kvm/kvm-all.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c -index 75d11a07b2..acc23092e7 100644 ---- a/accel/kvm/kvm-all.c -+++ b/accel/kvm/kvm-all.c -@@ -2603,7 +2603,7 @@ static int kvm_init(MachineState *ms) - } - - kvm_readonly_mem_allowed = -- (kvm_check_extension(s, KVM_CAP_READONLY_MEM) > 0); -+ (kvm_vm_check_extension(s, KVM_CAP_READONLY_MEM) > 0); - - kvm_resamplefds_allowed = - (kvm_check_extension(s, KVM_CAP_IRQFD_RESAMPLE) > 0); --- -2.39.3 - diff --git a/kvm-accel-kvm-refactor-dirty-ring-setup.patch b/kvm-accel-kvm-refactor-dirty-ring-setup.patch deleted file mode 100644 index eb6eb23..0000000 --- a/kvm-accel-kvm-refactor-dirty-ring-setup.patch +++ /dev/null @@ -1,144 +0,0 @@ -From 00a2dbf483a077bb31b1c9f70cced36319d22628 Mon Sep 17 00:00:00 2001 -From: Ani Sinha -Date: Thu, 12 Sep 2024 11:48:38 +0530 -Subject: [PATCH 4/9] accel/kvm: refactor dirty ring setup - -RH-Author: Peter Xu -RH-MergeRequest: 285: KVM: Dynamic sized kvm memslots array -RH-Jira: RHEL-57685 -RH-Acked-by: Juraj Marcin -RH-Acked-by: Miroslav Rezanina -RH-Commit: [3/7] 94f345d1e7ad6437dd2ce67ca7cad224c67aa48f (peterx/qemu-kvm) - -Refactor setting up of dirty ring code in kvm_init() so that is can be -reused in the future patchsets. - -Signed-off-by: Ani Sinha -Link: https://lore.kernel.org/r/20240912061838.4501-1-anisinha@redhat.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit 28ed7f9761eb273e7dedcfdc0507d158106d0451) -Signed-off-by: Peter Xu ---- - accel/kvm/kvm-all.c | 88 +++++++++++++++++++++++++-------------------- - 1 file changed, 50 insertions(+), 38 deletions(-) - -diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c -index d86d1b515a..8187ad3964 100644 ---- a/accel/kvm/kvm-all.c -+++ b/accel/kvm/kvm-all.c -@@ -2439,6 +2439,55 @@ static int find_kvm_machine_type(MachineState *ms) - return type; - } - -+static int kvm_setup_dirty_ring(KVMState *s) -+{ -+ uint64_t dirty_log_manual_caps; -+ int ret; -+ -+ /* -+ * Enable KVM dirty ring if supported, otherwise fall back to -+ * dirty logging mode -+ */ -+ ret = kvm_dirty_ring_init(s); -+ if (ret < 0) { -+ return ret; -+ } -+ -+ /* -+ * KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is not needed when dirty ring is -+ * enabled. More importantly, KVM_DIRTY_LOG_INITIALLY_SET will assume no -+ * page is wr-protected initially, which is against how kvm dirty ring is -+ * usage - kvm dirty ring requires all pages are wr-protected at the very -+ * beginning. Enabling this feature for dirty ring causes data corruption. -+ * -+ * TODO: Without KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 and kvm clear dirty log, -+ * we may expect a higher stall time when starting the migration. In the -+ * future we can enable KVM_CLEAR_DIRTY_LOG to work with dirty ring too: -+ * instead of clearing dirty bit, it can be a way to explicitly wr-protect -+ * guest pages. -+ */ -+ if (!s->kvm_dirty_ring_size) { -+ dirty_log_manual_caps = -+ kvm_check_extension(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2); -+ dirty_log_manual_caps &= (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE | -+ KVM_DIRTY_LOG_INITIALLY_SET); -+ s->manual_dirty_log_protect = dirty_log_manual_caps; -+ if (dirty_log_manual_caps) { -+ ret = kvm_vm_enable_cap(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0, -+ dirty_log_manual_caps); -+ if (ret) { -+ warn_report("Trying to enable capability %"PRIu64" of " -+ "KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 but failed. " -+ "Falling back to the legacy mode. ", -+ dirty_log_manual_caps); -+ s->manual_dirty_log_protect = 0; -+ } -+ } -+ } -+ -+ return 0; -+} -+ - static int kvm_init(MachineState *ms) - { - MachineClass *mc = MACHINE_GET_CLASS(ms); -@@ -2458,7 +2507,6 @@ static int kvm_init(MachineState *ms) - const KVMCapabilityInfo *missing_cap; - int ret; - int type; -- uint64_t dirty_log_manual_caps; - - qemu_mutex_init(&kml_slots_lock); - -@@ -2570,47 +2618,11 @@ static int kvm_init(MachineState *ms) - s->coalesced_pio = s->coalesced_mmio && - kvm_check_extension(s, KVM_CAP_COALESCED_PIO); - -- /* -- * Enable KVM dirty ring if supported, otherwise fall back to -- * dirty logging mode -- */ -- ret = kvm_dirty_ring_init(s); -+ ret = kvm_setup_dirty_ring(s); - if (ret < 0) { - goto err; - } - -- /* -- * KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 is not needed when dirty ring is -- * enabled. More importantly, KVM_DIRTY_LOG_INITIALLY_SET will assume no -- * page is wr-protected initially, which is against how kvm dirty ring is -- * usage - kvm dirty ring requires all pages are wr-protected at the very -- * beginning. Enabling this feature for dirty ring causes data corruption. -- * -- * TODO: Without KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 and kvm clear dirty log, -- * we may expect a higher stall time when starting the migration. In the -- * future we can enable KVM_CLEAR_DIRTY_LOG to work with dirty ring too: -- * instead of clearing dirty bit, it can be a way to explicitly wr-protect -- * guest pages. -- */ -- if (!s->kvm_dirty_ring_size) { -- dirty_log_manual_caps = -- kvm_check_extension(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2); -- dirty_log_manual_caps &= (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE | -- KVM_DIRTY_LOG_INITIALLY_SET); -- s->manual_dirty_log_protect = dirty_log_manual_caps; -- if (dirty_log_manual_caps) { -- ret = kvm_vm_enable_cap(s, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, 0, -- dirty_log_manual_caps); -- if (ret) { -- warn_report("Trying to enable capability %"PRIu64" of " -- "KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 but failed. " -- "Falling back to the legacy mode. ", -- dirty_log_manual_caps); -- s->manual_dirty_log_protect = 0; -- } -- } -- } -- - #ifdef KVM_CAP_VCPU_EVENTS - s->vcpu_events = kvm_check_extension(s, KVM_CAP_VCPU_EVENTS); - #endif --- -2.39.3 - diff --git a/kvm-arm-create-new-virt-machine-type-for-rhel-9.6.patch b/kvm-arm-create-new-virt-machine-type-for-rhel-9.6.patch deleted file mode 100644 index f32bd03..0000000 --- a/kvm-arm-create-new-virt-machine-type-for-rhel-9.6.patch +++ /dev/null @@ -1,49 +0,0 @@ -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/kvm-arm-create-virt-machine-type-for-rhel10.patch b/kvm-arm-create-virt-machine-type-for-rhel10.patch deleted file mode 100644 index 422f99a..0000000 --- a/kvm-arm-create-virt-machine-type-for-rhel10.patch +++ /dev/null @@ -1,45 +0,0 @@ -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/kvm-arm-disable-pauth-for-virt-rhel9-in-RHEL10.patch b/kvm-arm-disable-pauth-for-virt-rhel9-in-RHEL10.patch deleted file mode 100644 index 0e08a43..0000000 --- a/kvm-arm-disable-pauth-for-virt-rhel9-in-RHEL10.patch +++ /dev/null @@ -1,60 +0,0 @@ -From d36ac428991e700dd5cec62dfa16f1d414a9dda8 Mon Sep 17 00:00:00 2001 -From: Sebastian Ott -Date: Fri, 17 Jan 2025 05:50:54 -0500 -Subject: [PATCH 6/6] arm: disable pauth for virt-rhel9* in RHEL10 - -RH-Author: Sebastian Ott -RH-MergeRequest: 327: arm: disable pauth for virt-rhel9* in RHEL10 -RH-Jira: RHEL-71761 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Eric Auger -RH-Acked-by: Kashyap Chamarthy -RH-Acked-by: Gavin Shan -RH-Commit: [1/1] fef388b1aafce66fa1a176739264bca49596bb94 (seott1/cos-qemu-kvm) - -RHEL9 kernels have pauth disabled while RHEL10 has it enabled, -since qemu will setup the VM/VCPU with pauth when KVM supports it -the guest visible ID registers will differ between RHEL9 and RHEL10 -(on a host with pauth support) leading to migration / upgrade failures. - -Fix this by disabling pauth for virt-rhel9* machine types in RHEL10. - -Signed-off-by: Sebastian Ott -JIRA: https://issues.redhat.com/browse/RHEL-71761 ---- - hw/arm/virt.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/hw/arm/virt.c b/hw/arm/virt.c -index 6d55bba241..55bd92e6d0 100644 ---- a/hw/arm/virt.c -+++ b/hw/arm/virt.c -@@ -90,6 +90,16 @@ static GlobalProperty arm_virt_compat[] = { - }; - static const size_t arm_virt_compat_len = G_N_ELEMENTS(arm_virt_compat); - -+/* -+ * RHEL9 kernels have pauth disabled while RHEL10 has it enabled, -+ * since qemu will setup the VM with pauth when KVM supports it we -+ * have to disable it for virt-rhel9* to support upgrades / migration. -+ */ -+GlobalProperty arm_rhel9_compat[] = { -+ {TYPE_ARM_CPU, "pauth", "off", .optional = true}, -+}; -+const size_t arm_rhel9_compat_len = G_N_ELEMENTS(arm_rhel9_compat); -+ - /* - * This variable is for changes to properties that are RHEL specific, - * different to the current upstream and to be applied to the latest -@@ -3596,6 +3606,8 @@ static void virt_rhel_machine_9_6_0_options(MachineClass *mc) - { - virt_rhel_machine_10_0_0_options(mc); - -+ compat_props_add(mc->compat_props, arm_rhel9_compat, arm_rhel9_compat_len); -+ - /* NB: remember to move this line to the *latest* RHEL 9 machine */ - compat_props_add(mc->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len); - } --- -2.39.3 - diff --git a/kvm-block-Add-active-field-to-BlockDeviceInfo.patch b/kvm-block-Add-active-field-to-BlockDeviceInfo.patch deleted file mode 100644 index 107dc6f..0000000 --- a/kvm-block-Add-active-field-to-BlockDeviceInfo.patch +++ /dev/null @@ -1,317 +0,0 @@ -From 01973563401bf804505e36fecf0c229fd548eda4 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:13:52 +0100 -Subject: [PATCH 07/22] block: Add 'active' field to BlockDeviceInfo - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [7/22] 944b834b1aa3138d87bdbfce3c9fce105bd09a9d (kmwolf/centos-qemu-kvm) - -This allows querying from QMP (and also HMP) whether an image is -currently active or inactive (in the sense of BDRV_O_INACTIVE). - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Message-ID: <20250204211407.381505-2-kwolf@redhat.com> -Signed-off-by: Kevin Wolf -(cherry picked from commit aec81049c2daa8a97b89e59f03733b21ae0f8c2d) -Signed-off-by: Kevin Wolf ---- - block.c | 4 ++++ - block/monitor/block-hmp-cmds.c | 5 +++-- - block/qapi.c | 1 + - include/block/block-global-state.h | 3 +++ - qapi/block-core.json | 6 +++++- - tests/qemu-iotests/184.out | 2 ++ - tests/qemu-iotests/191.out | 16 ++++++++++++++++ - tests/qemu-iotests/273.out | 5 +++++ - 8 files changed, 39 insertions(+), 3 deletions(-) - -diff --git a/block.c b/block.c -index c317de9eaa..c94d78eefd 100644 ---- a/block.c -+++ b/block.c -@@ -6824,6 +6824,10 @@ void bdrv_init_with_whitelist(void) - bdrv_init(); - } - -+bool bdrv_is_inactive(BlockDriverState *bs) { -+ return bs->open_flags & BDRV_O_INACTIVE; -+} -+ - int bdrv_activate(BlockDriverState *bs, Error **errp) - { - BdrvChild *child, *parent; -diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c -index bdf2eb50b6..cc832549e1 100644 ---- a/block/monitor/block-hmp-cmds.c -+++ b/block/monitor/block-hmp-cmds.c -@@ -630,11 +630,12 @@ static void print_block_info(Monitor *mon, BlockInfo *info, - } - - if (inserted) { -- monitor_printf(mon, ": %s (%s%s%s)\n", -+ monitor_printf(mon, ": %s (%s%s%s%s)\n", - inserted->file, - inserted->drv, - inserted->ro ? ", read-only" : "", -- inserted->encrypted ? ", encrypted" : ""); -+ inserted->encrypted ? ", encrypted" : "", -+ inserted->active ? "" : ", inactive"); - } else { - monitor_printf(mon, ": [not inserted]\n"); - } -diff --git a/block/qapi.c b/block/qapi.c -index 2b5793f1d9..709170e63d 100644 ---- a/block/qapi.c -+++ b/block/qapi.c -@@ -63,6 +63,7 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk, - info->file = g_strdup(bs->filename); - info->ro = bdrv_is_read_only(bs); - info->drv = g_strdup(bs->drv->format_name); -+ info->active = !bdrv_is_inactive(bs); - info->encrypted = bs->encrypted; - - info->cache = g_new(BlockdevCacheInfo, 1); -diff --git a/include/block/block-global-state.h b/include/block/block-global-state.h -index bd7cecd1cf..a826bf5f78 100644 ---- a/include/block/block-global-state.h -+++ b/include/block/block-global-state.h -@@ -175,6 +175,9 @@ BlockDriverState * GRAPH_RDLOCK - check_to_replace_node(BlockDriverState *parent_bs, const char *node_name, - Error **errp); - -+ -+bool GRAPH_RDLOCK bdrv_is_inactive(BlockDriverState *bs); -+ - int no_coroutine_fn GRAPH_RDLOCK - bdrv_activate(BlockDriverState *bs, Error **errp); - -diff --git a/qapi/block-core.json b/qapi/block-core.json -index aa40d44f1d..92af032744 100644 ---- a/qapi/block-core.json -+++ b/qapi/block-core.json -@@ -486,6 +486,10 @@ - # @backing_file_depth: number of files in the backing file chain - # (since: 1.2) - # -+# @active: true if the backend is active; typical cases for inactive backends -+# are on the migration source instance after migration completes and on the -+# destination before it completes. (since: 10.0) -+# - # @encrypted: true if the backing device is encrypted - # - # @detect_zeroes: detect and optimize zero writes (Since 2.1) -@@ -556,7 +560,7 @@ - { 'struct': 'BlockDeviceInfo', - 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str', - '*backing_file': 'str', 'backing_file_depth': 'int', -- 'encrypted': 'bool', -+ 'active': 'bool', 'encrypted': 'bool', - 'detect_zeroes': 'BlockdevDetectZeroesOptions', - 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int', - 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int', -diff --git a/tests/qemu-iotests/184.out b/tests/qemu-iotests/184.out -index e8f631f853..52692b6b3b 100644 ---- a/tests/qemu-iotests/184.out -+++ b/tests/qemu-iotests/184.out -@@ -26,6 +26,7 @@ Testing: - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "backing-image": { - "virtual-size": 1073741824, -@@ -59,6 +60,7 @@ Testing: - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 1073741824, - "filename": "null-co://", -diff --git a/tests/qemu-iotests/191.out b/tests/qemu-iotests/191.out -index c3309e4bc6..2a72ca7106 100644 ---- a/tests/qemu-iotests/191.out -+++ b/tests/qemu-iotests/191.out -@@ -114,6 +114,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "backing-image": { - "virtual-size": 67108864, -@@ -155,6 +156,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 197120, - "filename": "TEST_DIR/t.IMGFMT.ovl2", -@@ -183,6 +185,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "backing-image": { - "virtual-size": 67108864, -@@ -224,6 +227,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 197120, - "filename": "TEST_DIR/t.IMGFMT", -@@ -252,6 +256,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "backing-image": { - "virtual-size": 67108864, -@@ -293,6 +298,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 393216, - "filename": "TEST_DIR/t.IMGFMT.mid", -@@ -321,6 +327,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 67108864, - "filename": "TEST_DIR/t.IMGFMT.base", -@@ -350,6 +357,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 393216, - "filename": "TEST_DIR/t.IMGFMT.base", -@@ -521,6 +529,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "backing-image": { - "virtual-size": 67108864, -@@ -562,6 +571,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 197120, - "filename": "TEST_DIR/t.IMGFMT.ovl2", -@@ -590,6 +600,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "backing-image": { - "backing-image": { -@@ -642,6 +653,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 197120, - "filename": "TEST_DIR/t.IMGFMT.ovl3", -@@ -670,6 +682,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 67108864, - "filename": "TEST_DIR/t.IMGFMT.base", -@@ -699,6 +712,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 393216, - "filename": "TEST_DIR/t.IMGFMT.base", -@@ -727,6 +741,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "backing-image": { - "virtual-size": 67108864, -@@ -768,6 +783,7 @@ wrote 65536/65536 bytes at offset 1048576 - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 197120, - "filename": "TEST_DIR/t.IMGFMT", -diff --git a/tests/qemu-iotests/273.out b/tests/qemu-iotests/273.out -index 71843f02de..c19753c685 100644 ---- a/tests/qemu-iotests/273.out -+++ b/tests/qemu-iotests/273.out -@@ -23,6 +23,7 @@ Testing: -blockdev file,node-name=base,filename=TEST_DIR/t.IMGFMT.base -blockdev - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "backing-image": { - "backing-image": { -@@ -74,6 +75,7 @@ Testing: -blockdev file,node-name=base,filename=TEST_DIR/t.IMGFMT.base -blockdev - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 197120, - "filename": "TEST_DIR/t.IMGFMT", -@@ -102,6 +104,7 @@ Testing: -blockdev file,node-name=base,filename=TEST_DIR/t.IMGFMT.base -blockdev - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "backing-image": { - "virtual-size": 197120, -@@ -142,6 +145,7 @@ Testing: -blockdev file,node-name=base,filename=TEST_DIR/t.IMGFMT.base -blockdev - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 197120, - "filename": "TEST_DIR/t.IMGFMT.mid", -@@ -170,6 +174,7 @@ Testing: -blockdev file,node-name=base,filename=TEST_DIR/t.IMGFMT.base -blockdev - { - "iops_rd": 0, - "detect_zeroes": "off", -+ "active": true, - "image": { - "virtual-size": 197120, - "filename": "TEST_DIR/t.IMGFMT.base", --- -2.39.3 - diff --git a/kvm-block-Add-blockdev-set-active-QMP-command.patch b/kvm-block-Add-blockdev-set-active-QMP-command.patch deleted file mode 100644 index 0a25c9f..0000000 --- a/kvm-block-Add-blockdev-set-active-QMP-command.patch +++ /dev/null @@ -1,187 +0,0 @@ -From d2cb8b847b6f88b4cbabea12a0b62f323d9000ff Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:13:59 +0100 -Subject: [PATCH 14/22] block: Add blockdev-set-active QMP command - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [14/22] 0fbba1347acea9983b4fb3d35d1a4c00a09e5579 (kmwolf/centos-qemu-kvm) - -The system emulator tries to automatically activate and inactivate block -nodes at the right point during migration. However, there are still -cases where it's necessary that the user can do this manually. - -Images are only activated on the destination VM of a migration when the -VM is actually resumed. If the VM was paused, this doesn't happen -automatically. The user may want to perform some operation on a block -device (e.g. taking a snapshot or starting a block job) without also -resuming the VM yet. This is an example where a manual command is -necessary. - -Another example is VM migration when the image files are opened by an -external qemu-storage-daemon instance on each side. In this case, the -process that needs to hand over the images isn't even part of the -migration and can't know when the migration completes. Management tools -need a way to explicitly inactivate images on the source and activate -them on the destination. - -This adds a new blockdev-set-active QMP command that lets the user -change the status of individual nodes (this is necessary in -qemu-storage-daemon because it could be serving multiple VMs and only -one of them migrates at a time). For convenience, operating on all -devices (like QEMU does automatically during migration) is offered as an -option, too, and can be used in the context of single VM. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Message-ID: <20250204211407.381505-9-kwolf@redhat.com> -Signed-off-by: Kevin Wolf -(cherry picked from commit 8cd37207f8a90c5f995283ecf95f1cb5f7518a77) -Signed-off-by: Kevin Wolf ---- - block.c | 21 ++++++++++++++++++++ - blockdev.c | 32 ++++++++++++++++++++++++++++++ - include/block/block-global-state.h | 3 +++ - qapi/block-core.json | 32 ++++++++++++++++++++++++++++++ - 4 files changed, 88 insertions(+) - -diff --git a/block.c b/block.c -index fd2ac177ef..2140a5d3b7 100644 ---- a/block.c -+++ b/block.c -@@ -7052,6 +7052,27 @@ bdrv_inactivate_recurse(BlockDriverState *bs, bool top_level) - return 0; - } - -+int bdrv_inactivate(BlockDriverState *bs, Error **errp) -+{ -+ int ret; -+ -+ GLOBAL_STATE_CODE(); -+ GRAPH_RDLOCK_GUARD_MAINLOOP(); -+ -+ if (bdrv_has_bds_parent(bs, true)) { -+ error_setg(errp, "Node has active parent node"); -+ return -EPERM; -+ } -+ -+ ret = bdrv_inactivate_recurse(bs, true); -+ if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to inactivate node"); -+ return ret; -+ } -+ -+ return 0; -+} -+ - int bdrv_inactivate_all(void) - { - BlockDriverState *bs = NULL; -diff --git a/blockdev.c b/blockdev.c -index 81430122df..70046b6690 100644 ---- a/blockdev.c -+++ b/blockdev.c -@@ -3468,6 +3468,38 @@ void qmp_blockdev_del(const char *node_name, Error **errp) - bdrv_unref(bs); - } - -+void qmp_blockdev_set_active(const char *node_name, bool active, Error **errp) -+{ -+ int ret; -+ -+ GLOBAL_STATE_CODE(); -+ GRAPH_RDLOCK_GUARD_MAINLOOP(); -+ -+ if (!node_name) { -+ if (active) { -+ bdrv_activate_all(errp); -+ } else { -+ ret = bdrv_inactivate_all(); -+ if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to inactivate all nodes"); -+ } -+ } -+ } else { -+ BlockDriverState *bs = bdrv_find_node(node_name); -+ if (!bs) { -+ error_setg(errp, "Failed to find node with node-name='%s'", -+ node_name); -+ return; -+ } -+ -+ if (active) { -+ bdrv_activate(bs, errp); -+ } else { -+ bdrv_inactivate(bs, errp); -+ } -+ } -+} -+ - static BdrvChild * GRAPH_RDLOCK - bdrv_find_child(BlockDriverState *parent_bs, const char *child_name) - { -diff --git a/include/block/block-global-state.h b/include/block/block-global-state.h -index a826bf5f78..9be34b3c99 100644 ---- a/include/block/block-global-state.h -+++ b/include/block/block-global-state.h -@@ -184,6 +184,9 @@ bdrv_activate(BlockDriverState *bs, Error **errp); - int coroutine_fn no_co_wrapper_bdrv_rdlock - bdrv_co_activate(BlockDriverState *bs, Error **errp); - -+int no_coroutine_fn -+bdrv_inactivate(BlockDriverState *bs, Error **errp); -+ - void bdrv_activate_all(Error **errp); - int bdrv_inactivate_all(void); - -diff --git a/qapi/block-core.json b/qapi/block-core.json -index 6ec603aa6f..c1af3d1f7d 100644 ---- a/qapi/block-core.json -+++ b/qapi/block-core.json -@@ -4930,6 +4930,38 @@ - { 'command': 'blockdev-del', 'data': { 'node-name': 'str' }, - 'allow-preconfig': true } - -+## -+# @blockdev-set-active: -+# -+# Activate or inactivate a block device. Use this to manage the handover of -+# block devices on migration with qemu-storage-daemon. -+# -+# Activating a node automatically activates all of its child nodes first. -+# Inactivating a node automatically inactivates any of its child nodes that are -+# not in use by a still active node. -+# -+# @node-name: Name of the graph node to activate or inactivate. By default, all -+# nodes are affected by the operation. -+# -+# @active: true if the nodes should be active when the command returns success, -+# false if they should be inactive. -+# -+# Since: 10.0 -+# -+# .. qmp-example:: -+# -+# -> { "execute": "blockdev-set-active", -+# "arguments": { -+# "node-name": "node0", -+# "active": false -+# } -+# } -+# <- { "return": {} } -+## -+{ 'command': 'blockdev-set-active', -+ 'data': { '*node-name': 'str', 'active': 'bool' }, -+ 'allow-preconfig': true } -+ - ## - # @BlockdevCreateOptionsFile: - # --- -2.39.3 - diff --git a/kvm-block-Add-option-to-create-inactive-nodes.patch b/kvm-block-Add-option-to-create-inactive-nodes.patch deleted file mode 100644 index 6b42315..0000000 --- a/kvm-block-Add-option-to-create-inactive-nodes.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 990a468ee87adc98bb53d859b52c8a5c7bbb8524 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:13:58 +0100 -Subject: [PATCH 13/22] block: Add option to create inactive nodes - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [13/22] 4e5d2d86502ac5ace83f2abe4a48abfba188256d (kmwolf/centos-qemu-kvm) - -In QEMU, nodes are automatically created inactive while expecting an -incoming migration (i.e. RUN_STATE_INMIGRATE). In qemu-storage-daemon, -the notion of runstates doesn't exist. It also wouldn't necessarily make -sense to introduce it because a single daemon can serve multiple VMs -that can be in different states. - -Therefore, allow the user to explicitly open images as inactive with a -new option. The default is as before: Nodes are usually active, except -when created during RUN_STATE_INMIGRATE. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Message-ID: <20250204211407.381505-8-kwolf@redhat.com> -Signed-off-by: Kevin Wolf -(cherry picked from commit faecd16fe5c65a25b5b55b5edbe4322cec5a9d96) -Signed-off-by: Kevin Wolf ---- - block.c | 9 +++++++++ - include/block/block-common.h | 1 + - qapi/block-core.json | 6 ++++++ - 3 files changed, 16 insertions(+) - -diff --git a/block.c b/block.c -index bedd54deaa..fd2ac177ef 100644 ---- a/block.c -+++ b/block.c -@@ -1573,6 +1573,10 @@ static void update_flags_from_options(int *flags, QemuOpts *opts) - if (qemu_opt_get_bool_del(opts, BDRV_OPT_AUTO_READ_ONLY, false)) { - *flags |= BDRV_O_AUTO_RDONLY; - } -+ -+ if (!qemu_opt_get_bool_del(opts, BDRV_OPT_ACTIVE, true)) { -+ *flags |= BDRV_O_INACTIVE; -+ } - } - - static void update_options_from_flags(QDict *options, int flags) -@@ -1799,6 +1803,11 @@ QemuOptsList bdrv_runtime_opts = { - .type = QEMU_OPT_BOOL, - .help = "Ignore flush requests", - }, -+ { -+ .name = BDRV_OPT_ACTIVE, -+ .type = QEMU_OPT_BOOL, -+ .help = "Node is activated", -+ }, - { - .name = BDRV_OPT_READ_ONLY, - .type = QEMU_OPT_BOOL, -diff --git a/include/block/block-common.h b/include/block/block-common.h -index 338fe5ff7a..7030669f04 100644 ---- a/include/block/block-common.h -+++ b/include/block/block-common.h -@@ -257,6 +257,7 @@ typedef enum { - #define BDRV_OPT_AUTO_READ_ONLY "auto-read-only" - #define BDRV_OPT_DISCARD "discard" - #define BDRV_OPT_FORCE_SHARE "force-share" -+#define BDRV_OPT_ACTIVE "active" - - - #define BDRV_SECTOR_BITS 9 -diff --git a/qapi/block-core.json b/qapi/block-core.json -index 92af032744..6ec603aa6f 100644 ---- a/qapi/block-core.json -+++ b/qapi/block-core.json -@@ -4668,6 +4668,11 @@ - # - # @cache: cache-related options - # -+# @active: whether the block node should be activated (default: true). -+# Having inactive block nodes is useful primarily for migration because it -+# allows opening an image on the destination while the source is still -+# holding locks for it. (Since 10.0) -+# - # @read-only: whether the block device should be read-only (default: - # false). Note that some block drivers support only read-only - # access, either generally or in certain configurations. In this -@@ -4694,6 +4699,7 @@ - '*node-name': 'str', - '*discard': 'BlockdevDiscardOptions', - '*cache': 'BlockdevCacheOptions', -+ '*active': 'bool', - '*read-only': 'bool', - '*auto-read-only': 'bool', - '*force-share': 'bool', --- -2.39.3 - diff --git a/kvm-block-Allow-inactivating-already-inactive-nodes.patch b/kvm-block-Allow-inactivating-already-inactive-nodes.patch deleted file mode 100644 index a31520b..0000000 --- a/kvm-block-Allow-inactivating-already-inactive-nodes.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 87507aae02f0b381c658a71777baad6fe3129485 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:13:53 +0100 -Subject: [PATCH 08/22] block: Allow inactivating already inactive nodes - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [8/22] 5247551bb2cc2ac51ce28f690f30b0f54c9abef5 (kmwolf/centos-qemu-kvm) - -What we wanted to catch with the assertion is cases where the recursion -finds that a child was inactive before its parent. This should never -happen. But if the user tries to inactivate an image that is already -inactive, that's harmless and we don't want to fail the assertion. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Message-ID: <20250204211407.381505-3-kwolf@redhat.com> -Signed-off-by: Kevin Wolf -(cherry picked from commit a6490ec9d56b9e95a13918813585a3a9891710bc) -Signed-off-by: Kevin Wolf ---- - block.c | 16 ++++++++++++---- - 1 file changed, 12 insertions(+), 4 deletions(-) - -diff --git a/block.c b/block.c -index c94d78eefd..a2aa454312 100644 ---- a/block.c -+++ b/block.c -@@ -6959,7 +6959,8 @@ bdrv_has_bds_parent(BlockDriverState *bs, bool only_active) - return false; - } - --static int GRAPH_RDLOCK bdrv_inactivate_recurse(BlockDriverState *bs) -+static int GRAPH_RDLOCK -+bdrv_inactivate_recurse(BlockDriverState *bs, bool top_level) - { - BdrvChild *child, *parent; - int ret; -@@ -6977,7 +6978,14 @@ static int GRAPH_RDLOCK bdrv_inactivate_recurse(BlockDriverState *bs) - return 0; - } - -- assert(!(bs->open_flags & BDRV_O_INACTIVE)); -+ /* -+ * Inactivating an already inactive node on user request is harmless, but if -+ * a child is already inactive before its parent, that's bad. -+ */ -+ if (bs->open_flags & BDRV_O_INACTIVE) { -+ assert(top_level); -+ return 0; -+ } - - /* Inactivate this node */ - if (bs->drv->bdrv_inactivate) { -@@ -7014,7 +7022,7 @@ static int GRAPH_RDLOCK bdrv_inactivate_recurse(BlockDriverState *bs) - - /* Recursively inactivate children */ - QLIST_FOREACH(child, &bs->children, next) { -- ret = bdrv_inactivate_recurse(child->bs); -+ ret = bdrv_inactivate_recurse(child->bs, false); - if (ret < 0) { - return ret; - } -@@ -7039,7 +7047,7 @@ int bdrv_inactivate_all(void) - if (bdrv_has_bds_parent(bs, false)) { - continue; - } -- ret = bdrv_inactivate_recurse(bs); -+ ret = bdrv_inactivate_recurse(bs, true); - if (ret < 0) { - bdrv_next_cleanup(&it); - break; --- -2.39.3 - diff --git a/kvm-block-Don-t-attach-inactive-child-to-active-node.patch b/kvm-block-Don-t-attach-inactive-child-to-active-node.patch deleted file mode 100644 index 32bcd1d..0000000 --- a/kvm-block-Don-t-attach-inactive-child-to-active-node.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 85c5bd4a41fec70482b634ae2d3bb3c56631e337 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:13:56 +0100 -Subject: [PATCH 11/22] block: Don't attach inactive child to active node - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [11/22] 7148d3e16eeda8a6142aedeab245a88b879b37b8 (kmwolf/centos-qemu-kvm) - -An active node makes unrestricted use of its children and would possibly -run into assertion failures when it operates on an inactive child node. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Message-ID: <20250204211407.381505-6-kwolf@redhat.com> -Signed-off-by: Kevin Wolf -(cherry picked from commit 9b81361aedcc47905de5e91f68221de89c6f5467) -Signed-off-by: Kevin Wolf ---- - block.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/block.c b/block.c -index a2aa454312..41e72e6965 100644 ---- a/block.c -+++ b/block.c -@@ -3183,6 +3183,11 @@ bdrv_attach_child_noperm(BlockDriverState *parent_bs, - child_bs->node_name, child_name, parent_bs->node_name); - return NULL; - } -+ if (bdrv_is_inactive(child_bs) && !bdrv_is_inactive(parent_bs)) { -+ error_setg(errp, "Inactive '%s' can't be a %s child of active '%s'", -+ child_bs->node_name, child_name, parent_bs->node_name); -+ return NULL; -+ } - - bdrv_get_cumulative_perm(parent_bs, &perm, &shared_perm); - bdrv_child_perm(parent_bs, child_bs, NULL, child_role, NULL, --- -2.39.3 - diff --git a/kvm-block-Drain-nodes-before-inactivating-them.patch b/kvm-block-Drain-nodes-before-inactivating-them.patch deleted file mode 100644 index f931c50..0000000 --- a/kvm-block-Drain-nodes-before-inactivating-them.patch +++ /dev/null @@ -1,52 +0,0 @@ -From e7fa06c5ad14fc4df863265ca4723c9b74368682 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:14:02 +0100 -Subject: [PATCH 17/22] block: Drain nodes before inactivating them - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [17/22] 64b1f9168b91793dcf3cf1df39e4799c7dc0f73c (kmwolf/centos-qemu-kvm) - -So far the assumption has always been that if we try to inactivate a -node, it is already idle. This doesn't hold true any more if we allow -inactivating exported nodes because we can't know when new external -requests come in. - -Drain the node around setting BDRV_O_INACTIVE so that requests can't -start operating on an active node and then in the middle it suddenly -becomes inactive. With this change, it's enough for exports to check -for new requests that they operate on an active node (or, like reads, -are allowed even on an inactive node). - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Message-ID: <20250204211407.381505-12-kwolf@redhat.com> -Reviewed-by: Stefan Hajnoczi -Reviewed-by: Eric Blake -Signed-off-by: Kevin Wolf -(cherry picked from commit 2849092a0024405e74c96f0a5ec41bb182ec8538) -Signed-off-by: Kevin Wolf ---- - block.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/block.c b/block.c -index 2140a5d3b7..38cb8481a8 100644 ---- a/block.c -+++ b/block.c -@@ -7032,7 +7032,9 @@ bdrv_inactivate_recurse(BlockDriverState *bs, bool top_level) - return -EPERM; - } - -+ bdrv_drained_begin(bs); - bs->open_flags |= BDRV_O_INACTIVE; -+ bdrv_drained_end(bs); - - /* - * Update permissions, they may differ for inactive nodes. --- -2.39.3 - diff --git a/kvm-block-Fix-crash-on-block_resize-on-inactive-node.patch b/kvm-block-Fix-crash-on-block_resize-on-inactive-node.patch deleted file mode 100644 index 3f5a967..0000000 --- a/kvm-block-Fix-crash-on-block_resize-on-inactive-node.patch +++ /dev/null @@ -1,68 +0,0 @@ -From fcf20a7c75d01009701fd960247ff76914280e1a Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:13:57 +0100 -Subject: [PATCH 12/22] block: Fix crash on block_resize on inactive node - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [12/22] 9edc182c7ac587b0eaea836203b77d94b4d9bd80 (kmwolf/centos-qemu-kvm) - -In order for block_resize to fail gracefully on an inactive node instead -of crashing with an assertion failure in bdrv_co_write_req_prepare() -(called from bdrv_co_truncate()), we need to check for inactive nodes -also when they are attached as a root node and make sure that -BLK_PERM_RESIZE isn't among the permissions allowed for inactive nodes. -To this effect, don't enumerate the permissions that are incompatible -with inactive nodes any more, but allow only BLK_PERM_CONSISTENT_READ -for them. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Message-ID: <20250204211407.381505-7-kwolf@redhat.com> -Signed-off-by: Kevin Wolf -(cherry picked from commit 8c2c72a33581987af8d8c484d03af3cd69b9e10a) -Signed-off-by: Kevin Wolf ---- - block.c | 7 +++++++ - block/block-backend.c | 2 +- - 2 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/block.c b/block.c -index 41e72e6965..bedd54deaa 100644 ---- a/block.c -+++ b/block.c -@@ -3077,6 +3077,13 @@ bdrv_attach_child_common(BlockDriverState *child_bs, - assert(child_class->get_parent_desc); - GLOBAL_STATE_CODE(); - -+ if (bdrv_is_inactive(child_bs) && (perm & ~BLK_PERM_CONSISTENT_READ)) { -+ g_autofree char *perm_names = bdrv_perm_names(perm); -+ error_setg(errp, "Permission '%s' unavailable on inactive node", -+ perm_names); -+ return NULL; -+ } -+ - new_child = g_new(BdrvChild, 1); - *new_child = (BdrvChild) { - .bs = NULL, -diff --git a/block/block-backend.c b/block/block-backend.c -index db6f9b92a3..356db1b703 100644 ---- a/block/block-backend.c -+++ b/block/block-backend.c -@@ -253,7 +253,7 @@ static bool blk_can_inactivate(BlockBackend *blk) - * guest. For block job BBs that satisfy this, we can just allow - * it. This is the case for mirror job source, which is required - * by libvirt non-shared block migration. */ -- if (!(blk->perm & (BLK_PERM_WRITE | BLK_PERM_WRITE_UNCHANGED))) { -+ if (!(blk->perm & ~BLK_PERM_CONSISTENT_READ)) { - return true; - } - --- -2.39.3 - diff --git a/kvm-block-Inactivate-external-snapshot-overlays-when-nec.patch b/kvm-block-Inactivate-external-snapshot-overlays-when-nec.patch deleted file mode 100644 index cbd4d87..0000000 --- a/kvm-block-Inactivate-external-snapshot-overlays-when-nec.patch +++ /dev/null @@ -1,68 +0,0 @@ -From b0b5dbd95c73a5cd4173c11d283f6144f0d78e04 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:13:54 +0100 -Subject: [PATCH 09/22] block: Inactivate external snapshot overlays when - necessary - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [9/22] 82aa17e6d5009c0a89fb884afbf408ae2f4c5478 (kmwolf/centos-qemu-kvm) - -Putting an active block node on top of an inactive one is strictly -speaking an invalid configuration and the next patch will turn it into a -hard error. - -However, taking a snapshot while disk images are inactive after -completing migration has an important use case: After migrating to a -file, taking an external snapshot is what is needed to take a full VM -snapshot. - -In order for this to keep working after the later patches, change -creating a snapshot such that it automatically inactivates an overlay -that is added on top of an already inactive node. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Message-ID: <20250204211407.381505-4-kwolf@redhat.com> -Signed-off-by: Kevin Wolf -(cherry picked from commit e80210ffb24c4e47650344ba77ce3ed354af596c) -Signed-off-by: Kevin Wolf ---- - blockdev.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/blockdev.c b/blockdev.c -index 835064ed03..81430122df 100644 ---- a/blockdev.c -+++ b/blockdev.c -@@ -1497,6 +1497,22 @@ static void external_snapshot_action(TransactionAction *action, - return; - } - -+ /* -+ * Older QEMU versions have allowed adding an active parent node to an -+ * inactive child node. This is unsafe in the general case, but there is an -+ * important use case, which is taking a VM snapshot with migration to file -+ * and then adding an external snapshot while the VM is still stopped and -+ * images are inactive. Requiring the user to explicitly create the overlay -+ * as inactive would break compatibility, so just do it automatically here -+ * to keep this working. -+ */ -+ if (bdrv_is_inactive(state->old_bs) && !bdrv_is_inactive(state->new_bs)) { -+ ret = bdrv_inactivate(state->new_bs, errp); -+ if (ret < 0) { -+ return; -+ } -+ } -+ - ret = bdrv_append(state->new_bs, state->old_bs, errp); - if (ret < 0) { - return; --- -2.39.3 - diff --git a/kvm-block-Support-inactive-nodes-in-blk_insert_bs.patch b/kvm-block-Support-inactive-nodes-in-blk_insert_bs.patch deleted file mode 100644 index 97d6651..0000000 --- a/kvm-block-Support-inactive-nodes-in-blk_insert_bs.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 1c4cdab823e271cea3bb980eb0b2714f3474c7fa Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:14:00 +0100 -Subject: [PATCH 15/22] block: Support inactive nodes in blk_insert_bs() - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [15/22] fed3cf8ea4bd443ff9bf52328650b43e3ce3150d (kmwolf/centos-qemu-kvm) - -Device models have a relatively complex way to set up their block -backends, in which blk_attach_dev() sets blk->disable_perm = true. -We want to support inactive images in exports, too, so that -qemu-storage-daemon can be used with migration. Because they don't use -blk_attach_dev(), they need another way to set this flag. The most -convenient is to do this automatically when an inactive node is attached -to a BlockBackend that can be inactivated. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Message-ID: <20250204211407.381505-10-kwolf@redhat.com> -Signed-off-by: Kevin Wolf -(cherry picked from commit c1c5c7cc4ef6c45ca769c640566fd40d2cb7d5c1) -Signed-off-by: Kevin Wolf ---- - block/block-backend.c | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/block/block-backend.c b/block/block-backend.c -index 356db1b703..4a5a1c1f6a 100644 ---- a/block/block-backend.c -+++ b/block/block-backend.c -@@ -909,14 +909,24 @@ void blk_remove_bs(BlockBackend *blk) - int blk_insert_bs(BlockBackend *blk, BlockDriverState *bs, Error **errp) - { - ThrottleGroupMember *tgm = &blk->public.throttle_group_member; -+ uint64_t perm, shared_perm; - - GLOBAL_STATE_CODE(); - bdrv_ref(bs); - bdrv_graph_wrlock(); -+ -+ if ((bs->open_flags & BDRV_O_INACTIVE) && blk_can_inactivate(blk)) { -+ blk->disable_perm = true; -+ perm = 0; -+ shared_perm = BLK_PERM_ALL; -+ } else { -+ perm = blk->perm; -+ shared_perm = blk->shared_perm; -+ } -+ - blk->root = bdrv_root_attach_child(bs, "root", &child_root, - BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, -- blk->perm, blk->shared_perm, -- blk, errp); -+ perm, shared_perm, blk, errp); - bdrv_graph_wrunlock(); - if (blk->root == NULL) { - return -EPERM; --- -2.39.3 - diff --git a/kvm-block-export-Add-option-to-allow-export-of-inactive-.patch b/kvm-block-export-Add-option-to-allow-export-of-inactive-.patch deleted file mode 100644 index b775673..0000000 --- a/kvm-block-export-Add-option-to-allow-export-of-inactive-.patch +++ /dev/null @@ -1,135 +0,0 @@ -From f4e875181720552ebdb9530e533fbad96b8d01d2 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:14:03 +0100 -Subject: [PATCH 18/22] block/export: Add option to allow export of inactive - nodes - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [18/22] 0a2723f830936a67fbcc4ee1ee7e846468adc77b (kmwolf/centos-qemu-kvm) - -Add an option in BlockExportOptions to allow creating an export on an -inactive node without activating the node. This mode needs to be -explicitly supported by the export type (so that it doesn't perform any -operations that are forbidden for inactive nodes), so this patch alone -doesn't allow this option to be successfully used yet. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Message-ID: <20250204211407.381505-13-kwolf@redhat.com> -Signed-off-by: Kevin Wolf -(cherry picked from commit 1600ef01ab1296ca8230daa6bc41ba983751f646) -Signed-off-by: Kevin Wolf ---- - block/export/export.c | 31 +++++++++++++++++++++---------- - include/block/export.h | 3 +++ - qapi/block-export.json | 10 +++++++++- - 3 files changed, 33 insertions(+), 11 deletions(-) - -diff --git a/block/export/export.c b/block/export/export.c -index 23a86efcdb..71af65b3e5 100644 ---- a/block/export/export.c -+++ b/block/export/export.c -@@ -75,6 +75,7 @@ static const BlockExportDriver *blk_exp_find_driver(BlockExportType type) - BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp) - { - bool fixed_iothread = export->has_fixed_iothread && export->fixed_iothread; -+ bool allow_inactive = export->has_allow_inactive && export->allow_inactive; - const BlockExportDriver *drv; - BlockExport *exp = NULL; - BlockDriverState *bs; -@@ -138,17 +139,24 @@ BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp) - } - } - -- /* -- * Block exports are used for non-shared storage migration. Make sure -- * that BDRV_O_INACTIVE is cleared and the image is ready for write -- * access since the export could be available before migration handover. -- * ctx was acquired in the caller. -- */ - bdrv_graph_rdlock_main_loop(); -- ret = bdrv_activate(bs, errp); -- if (ret < 0) { -- bdrv_graph_rdunlock_main_loop(); -- goto fail; -+ if (allow_inactive) { -+ if (!drv->supports_inactive) { -+ error_setg(errp, "Export type does not support inactive exports"); -+ bdrv_graph_rdunlock_main_loop(); -+ goto fail; -+ } -+ } else { -+ /* -+ * Block exports are used for non-shared storage migration. Make sure -+ * that BDRV_O_INACTIVE is cleared and the image is ready for write -+ * access since the export could be available before migration handover. -+ */ -+ ret = bdrv_activate(bs, errp); -+ if (ret < 0) { -+ bdrv_graph_rdunlock_main_loop(); -+ goto fail; -+ } - } - bdrv_graph_rdunlock_main_loop(); - -@@ -162,6 +170,9 @@ BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp) - if (!fixed_iothread) { - blk_set_allow_aio_context_change(blk, true); - } -+ if (allow_inactive) { -+ blk_set_force_allow_inactivate(blk); -+ } - - ret = blk_insert_bs(blk, bs, errp); - if (ret < 0) { -diff --git a/include/block/export.h b/include/block/export.h -index f2fe0f8078..4bd9531d4d 100644 ---- a/include/block/export.h -+++ b/include/block/export.h -@@ -29,6 +29,9 @@ typedef struct BlockExportDriver { - */ - size_t instance_size; - -+ /* True if the export type supports running on an inactive node */ -+ bool supports_inactive; -+ - /* Creates and starts a new block export */ - int (*create)(BlockExport *, BlockExportOptions *, Error **); - -diff --git a/qapi/block-export.json b/qapi/block-export.json -index ce33fe378d..117b05d13c 100644 ---- a/qapi/block-export.json -+++ b/qapi/block-export.json -@@ -372,6 +372,13 @@ - # cannot be moved to the iothread. The default is false. - # (since: 5.2) - # -+# @allow-inactive: If true, the export allows the exported node to be inactive. -+# If it is created for an inactive block node, the node remains inactive. If -+# the export type doesn't support running on an inactive node, an error is -+# returned. If false, inactive block nodes are automatically activated before -+# creating the export and trying to inactivate them later fails. -+# (since: 10.0; default: false) -+# - # Since: 4.2 - ## - { 'union': 'BlockExportOptions', -@@ -381,7 +388,8 @@ - '*iothread': 'str', - 'node-name': 'str', - '*writable': 'bool', -- '*writethrough': 'bool' }, -+ '*writethrough': 'bool', -+ '*allow-inactive': 'bool' }, - 'discriminator': 'type', - 'data': { - 'nbd': 'BlockExportOptionsNbd', --- -2.39.3 - diff --git a/kvm-block-export-Don-t-ignore-image-activation-error-in-.patch b/kvm-block-export-Don-t-ignore-image-activation-error-in-.patch deleted file mode 100644 index 8e57ff7..0000000 --- a/kvm-block-export-Don-t-ignore-image-activation-error-in-.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 7e3b7fff56e0f8f16a898e7d22789ffad4166aca Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:14:01 +0100 -Subject: [PATCH 16/22] block/export: Don't ignore image activation error in - blk_exp_add() - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [16/22] 3318a1c7eb1707a8a0b01a0c6edbd69deada8ca7 (kmwolf/centos-qemu-kvm) - -Currently, block exports can't handle inactive images correctly. -Incoming write requests would run into assertion failures. Make sure -that we return an error when creating an export can't activate the -image. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Message-ID: <20250204211407.381505-11-kwolf@redhat.com> -Signed-off-by: Kevin Wolf -(cherry picked from commit 69f28176ca0af850db23a1c6364f0c8525b20801) -Signed-off-by: Kevin Wolf ---- - block/export/export.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/block/export/export.c b/block/export/export.c -index 6d51ae8ed7..23a86efcdb 100644 ---- a/block/export/export.c -+++ b/block/export/export.c -@@ -145,7 +145,11 @@ BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp) - * ctx was acquired in the caller. - */ - bdrv_graph_rdlock_main_loop(); -- bdrv_activate(bs, NULL); -+ ret = bdrv_activate(bs, errp); -+ if (ret < 0) { -+ bdrv_graph_rdunlock_main_loop(); -+ goto fail; -+ } - bdrv_graph_rdunlock_main_loop(); - - perm = BLK_PERM_CONSISTENT_READ; --- -2.39.3 - diff --git a/kvm-docs-system-Update-documentation-for-s390x-IPL.patch b/kvm-docs-system-Update-documentation-for-s390x-IPL.patch deleted file mode 100644 index f0060a6..0000000 --- a/kvm-docs-system-Update-documentation-for-s390x-IPL.patch +++ /dev/null @@ -1,76 +0,0 @@ -From f1359f43bbc61f31c292ca1770688b6db6b959af Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:52 -0400 -Subject: [PATCH 20/38] docs/system: Update documentation for s390x IPL -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [19/23] 8dfc0357ec42e9baac741670f6e7da3127de0e50 (thuth/qemu-kvm-cs9) - -Update docs to show that s390x PC BIOS can support more than one boot device. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-19-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 0bd107138ff0b171e3cd314dbc200950bcab2b05) ---- - docs/system/bootindex.rst | 7 ++++--- - docs/system/s390x/bootdevices.rst | 9 ++++++--- - 2 files changed, 10 insertions(+), 6 deletions(-) - -diff --git a/docs/system/bootindex.rst b/docs/system/bootindex.rst -index 8b057f812f..988f7b3beb 100644 ---- a/docs/system/bootindex.rst -+++ b/docs/system/bootindex.rst -@@ -49,10 +49,11 @@ Limitations - ----------- - - Some firmware has limitations on which devices can be considered for --booting. For instance, the PC BIOS boot specification allows only one --disk to be bootable. If boot from disk fails for some reason, the BIOS -+booting. For instance, the x86 PC BIOS boot specification allows only one -+disk to be bootable. If boot from disk fails for some reason, the x86 BIOS - won't retry booting from other disk. It can still try to boot from --floppy or net, though. -+floppy or net, though. In the case of s390x BIOS, the BIOS will try up to -+8 total devices, any number of which may be disks. - - Sometimes, firmware cannot map the device path QEMU wants firmware to - boot from to a boot method. It doesn't happen for devices the firmware -diff --git a/docs/system/s390x/bootdevices.rst b/docs/system/s390x/bootdevices.rst -index c97efb8fc0..1a1a764c1c 100644 ---- a/docs/system/s390x/bootdevices.rst -+++ b/docs/system/s390x/bootdevices.rst -@@ -6,9 +6,7 @@ Booting with bootindex parameter - - For classical mainframe guests (i.e. LPAR or z/VM installations), you always - have to explicitly specify the disk where you want to boot from (or "IPL" from, --in s390x-speak -- IPL means "Initial Program Load"). In particular, there can --also be only one boot device according to the architecture specification, thus --specifying multiple boot devices is not possible (yet). -+in s390x-speak -- IPL means "Initial Program Load"). - - So for booting an s390x guest in QEMU, you should always mark the - device where you want to boot from with the ``bootindex`` property, for -@@ -17,6 +15,11 @@ example:: - qemu-system-s390x -drive if=none,id=dr1,file=guest.qcow2 \ - -device virtio-blk,drive=dr1,bootindex=1 - -+Multiple devices may have a bootindex. The lowest bootindex is assigned to the -+device to IPL first. If the IPL fails for the first, the device with the second -+lowest bootindex will be tried and so on until IPL is successful or there are no -+remaining boot devices to try. -+ - For booting from a CD-ROM ISO image (which needs to include El-Torito boot - information in order to be bootable), it is recommended to specify a ``scsi-cd`` - device, for example like this:: --- -2.39.3 - diff --git a/kvm-docs-system-bootindex-Make-it-clear-that-s390x-can-a.patch b/kvm-docs-system-bootindex-Make-it-clear-that-s390x-can-a.patch deleted file mode 100644 index 0aff652..0000000 --- a/kvm-docs-system-bootindex-Make-it-clear-that-s390x-can-a.patch +++ /dev/null @@ -1,41 +0,0 @@ -From ba9b7c8375aac784fbe23beaeb91484ddd8e6829 Mon Sep 17 00:00:00 2001 -From: Thomas Huth -Date: Mon, 11 Nov 2024 11:55:06 +0100 -Subject: [PATCH 3/9] docs/system/bootindex: Make it clear that s390x can also - boot from virtio-net - -RH-Author: Thomas Huth -RH-MergeRequest: 297: [c10s] Fixes for the new s390x "boot order" feature -RH-Jira: RHEL-68444 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [2/8] ae20c66e424d64840012b4725166a1bde2579cbc (thuth/qemu-kvm-cs9) - -Let's make it clear that s390x can also boot from virtio-net, to avoid -that people think that s390x can only boot from disk devices. - -Reported-by: Boris Fiuczynski -Message-ID: <20241111105506.264640-1-thuth@redhat.com> -Reviewed-by: Prasad Pandit -Reviewed-by: Boris Fiuczynski -Signed-off-by: Thomas Huth -(cherry picked from commit b8c5fdc6588f82d95807be0eb2215d215a3ba16e) ---- - docs/system/bootindex.rst | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/docs/system/bootindex.rst b/docs/system/bootindex.rst -index 988f7b3beb..5e1b33ee22 100644 ---- a/docs/system/bootindex.rst -+++ b/docs/system/bootindex.rst -@@ -53,7 +53,7 @@ booting. For instance, the x86 PC BIOS boot specification allows only one - disk to be bootable. If boot from disk fails for some reason, the x86 BIOS - won't retry booting from other disk. It can still try to boot from - floppy or net, though. In the case of s390x BIOS, the BIOS will try up to --8 total devices, any number of which may be disks. -+8 total devices, any number of which may be disks or virtio-net devices. - - Sometimes, firmware cannot map the device path QEMU wants firmware to - boot from to a boot method. It doesn't happen for devices the firmware --- -2.39.3 - diff --git a/kvm-docs-system-s390x-bootdevices-Update-loadparm-docume.patch b/kvm-docs-system-s390x-bootdevices-Update-loadparm-docume.patch deleted file mode 100644 index 2ab3221..0000000 --- a/kvm-docs-system-s390x-bootdevices-Update-loadparm-docume.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 3c57b3a6d48d7ddad44b67fdf9ccaebc40e5c125 Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Thu, 14 Nov 2024 19:27:42 -0500 -Subject: [PATCH 2/9] docs/system/s390x/bootdevices: Update loadparm - documentation - -RH-Author: Thomas Huth -RH-MergeRequest: 297: [c10s] Fixes for the new s390x "boot order" feature -RH-Jira: RHEL-68444 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/8] bd74a0794bf0f2872061850ca410bab819c6a0d6 (thuth/qemu-kvm-cs9) - -Update documentation to include per-device loadparm support. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241115002742.3576842-1-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 0271fdc650b212533b8aeaecbedfe8ccf6bbbef3) ---- - docs/system/s390x/bootdevices.rst | 24 +++++++++++++++++++++++- - 1 file changed, 23 insertions(+), 1 deletion(-) - -diff --git a/docs/system/s390x/bootdevices.rst b/docs/system/s390x/bootdevices.rst -index 1a1a764c1c..97b3914785 100644 ---- a/docs/system/s390x/bootdevices.rst -+++ b/docs/system/s390x/bootdevices.rst -@@ -79,7 +79,29 @@ The second way to use this parameter is to use a number in the range from 0 - to 31. The numbers that can be used here correspond to the numbers that are - shown when using the ``PROMPT`` option, and the s390-ccw bios will then try - to automatically boot the kernel that is associated with the given number. --Note that ``0`` can be used to boot the default entry. -+Note that ``0`` can be used to boot the default entry. If the machine -+``loadparm`` is not assigned a value, then the default entry is used. -+ -+By default, the machine ``loadparm`` applies to all boot devices. If multiple -+devices are assigned a ``bootindex`` and the ``loadparm`` is to be different -+between them, an independent ``loadparm`` may be assigned on a per-device basis. -+ -+An example guest using per-device ``loadparm``:: -+ -+ qemu-system-s390x -drive if=none,id=dr1,file=primary.qcow2 \ -+ -device virtio-blk,drive=dr1,bootindex=1 \ -+ -drive if=none,id=dr2,file=secondary.qcow2 \ -+ -device virtio-blk,drive=dr2,bootindex=2,loadparm=3 -+ -+In this case, the primary boot device will attempt to IPL using the default -+entry (because no ``loadparm`` is specified for this device or for the -+machine). If that device fails to boot, the secondary device will attempt to -+IPL using entry number 3. -+ -+If a ``loadparm`` is specified on both the machine and a device, the per-device -+value will superseded the machine value. Per-device ``loadparm`` values are -+only used for devices with an assigned ``bootindex``. The machine ``loadparm`` -+is used when attempting to boot without a ``bootindex``. - - - Booting from a network device --- -2.39.3 - diff --git a/kvm-docs-system-s390x-bootdevices-Update-the-documentati.patch b/kvm-docs-system-s390x-bootdevices-Update-the-documentati.patch deleted file mode 100644 index 808cd33..0000000 --- a/kvm-docs-system-s390x-bootdevices-Update-the-documentati.patch +++ /dev/null @@ -1,66 +0,0 @@ -From c8e615cf130743ee95a61d7e21bb4b753eb082fb Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:40 -0400 -Subject: [PATCH 08/38] docs/system/s390x/bootdevices: Update the documentation - about network booting -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [7/23] 52d357df45400b983e17cc6b1eeac691131bf5e5 (thuth/qemu-kvm-cs9) - -Remove the information about the separate s390-netboot.img from -the documentation. - -Co-authored by: Thomas Huth -Signed-off-by: Jared Rossi -Message-ID: <20241020012953.1380075-7-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit ab2691b6c7ff360875e0af86ff463278f17786f5) ---- - docs/system/s390x/bootdevices.rst | 20 +++++++------------- - 1 file changed, 7 insertions(+), 13 deletions(-) - -diff --git a/docs/system/s390x/bootdevices.rst b/docs/system/s390x/bootdevices.rst -index 1a7a18b43b..c97efb8fc0 100644 ---- a/docs/system/s390x/bootdevices.rst -+++ b/docs/system/s390x/bootdevices.rst -@@ -82,23 +82,17 @@ Note that ``0`` can be used to boot the default entry. - Booting from a network device - ----------------------------- - --Beside the normal guest firmware (which is loaded from the file ``s390-ccw.img`` --in the data directory of QEMU, or via the ``-bios`` option), QEMU ships with --a small TFTP network bootloader firmware for virtio-net-ccw devices, too. This --firmware is loaded from a file called ``s390-netboot.img`` in the QEMU data --directory. In case you want to load it from a different filename instead, --you can specify it via the ``-global s390-ipl.netboot_fw=filename`` --command line option. -- --The ``bootindex`` property is especially important for booting via the network. --If you don't specify the ``bootindex`` property here, the network bootloader --firmware code won't get loaded into the guest memory so that the network boot --will fail. For a successful network boot, try something like this:: -+The firmware that ships with QEMU includes a small TFTP network bootloader -+for virtio-net-ccw devices. The ``bootindex`` property is especially -+important for booting via the network. If you don't specify the ``bootindex`` -+property here, the network bootloader won't be taken into consideration and -+the network boot will fail. For a successful network boot, try something -+like this:: - - qemu-system-s390x -netdev user,id=n1,tftp=...,bootfile=... \ - -device virtio-net-ccw,netdev=n1,bootindex=1 - --The network bootloader firmware also has basic support for pxelinux.cfg-style -+The network bootloader also has basic support for pxelinux.cfg-style - configuration files. See the `PXELINUX Configuration page - `__ - for details how to set up the configuration file on your TFTP server. --- -2.39.3 - diff --git a/kvm-hostmem-Apply-merge-property-after-the-memory-region.patch b/kvm-hostmem-Apply-merge-property-after-the-memory-region.patch deleted file mode 100644 index 1f6c8ed..0000000 --- a/kvm-hostmem-Apply-merge-property-after-the-memory-region.patch +++ /dev/null @@ -1,61 +0,0 @@ -From d0163127a47250170e01e39f48250a2725f531c0 Mon Sep 17 00:00:00 2001 -From: Gavin Shan -Date: Tue, 1 Oct 2024 16:58:57 +1000 -Subject: [PATCH] hostmem: Apply merge property after the memory region is - initialized - -RH-Author: Gavin Shan -RH-MergeRequest: 272: hostmem: Apply merge property after the memory region is initialized -RH-Jira: RHEL-58936 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Eric Auger -RH-Acked-by: David Hildenbrand -RH-Commit: [1/1] aa47bedf64698b277bb8835f4689d4f1d5eca53c (gwshan/qemu-centos) - -JIRA: https://issues.redhat.com/browse/RHEL-58936 - -The semantic change has been introduced by commit 5becdc0ab0 ("hostmem: -simplify the code for merge and dump properties") even it clarifies that -no senmatic change has been introduced. After the commit, the merge -property can be applied even the corresponding memory region isn't -initialized yet. This leads to crash dump by the following command -lines. - - # /home/gavin/sandbox/qemu.main/build/qemu-system-aarch64 \ - -accel kvm -machine virt -cpu host \ - -object memory-backend-ram,id=mem-memN0,size=4096M,merge=off - : - qemu-system-aarch64: ../system/memory.c:2419: memory_region_get_ram_ptr: \ - Assertion `mr->ram_block' failed. - -Fix it by applying the merge property only when the memory region is -initialized. - -Message-ID: <20240915233117.478169-1-gshan@redhat.com> -Fixes: 5becdc0ab083 ("hostmem: simplify the code for merge and dump properties") -Reported-by: Zhenyu Zhang -Tested-by: Zhenyu Zhang -Signed-off-by: Gavin Shan -Signed-off-by: David Hildenbrand -(cherry picked from commit 78c8f780d3f0d6d17aa93d6f99ff72960080fdd7) -Signed-off-by: Gavin Shan ---- - backends/hostmem.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/backends/hostmem.c b/backends/hostmem.c -index 4e5576a4ad..181446626a 100644 ---- a/backends/hostmem.c -+++ b/backends/hostmem.c -@@ -178,7 +178,7 @@ static void host_memory_backend_set_merge(Object *obj, bool value, Error **errp) - return; - } - -- if (!host_memory_backend_mr_inited(backend) && -+ if (host_memory_backend_mr_inited(backend) && - value != backend->merge) { - void *ptr = memory_region_get_ram_ptr(&backend->mr); - uint64_t sz = memory_region_size(&backend->mr); --- -2.39.3 - diff --git a/kvm-hw-Add-loadparm-property-to-scsi-disk-devices-for-bo.patch b/kvm-hw-Add-loadparm-property-to-scsi-disk-devices-for-bo.patch deleted file mode 100644 index 0e7d032..0000000 --- a/kvm-hw-Add-loadparm-property-to-scsi-disk-devices-for-bo.patch +++ /dev/null @@ -1,217 +0,0 @@ -From 4c90ff4c0b48df312c10defba45c9f182b535524 Mon Sep 17 00:00:00 2001 -From: Thomas Huth -Date: Fri, 15 Nov 2024 15:12:02 +0100 -Subject: [PATCH 5/9] hw: Add "loadparm" property to scsi disk devices for - booting on s390x - -RH-Author: Thomas Huth -RH-MergeRequest: 297: [c10s] Fixes for the new s390x "boot order" feature -RH-Jira: RHEL-68444 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [4/8] 4b5e2afa65f7a529e0bb5509b36c9bf81894caee (thuth/qemu-kvm-cs9) - -While adding the new flexible boot order feature on s390x recently, -we missed to add the "loadparm" property to the scsi-hd and scsi-cd -devices. This property is required on s390x to pass the information -to the boot loader about which kernel should be started or whether -the boot menu should be shown. But even more serious: The missing -property is now causing trouble with the corresponding libvirt patches -that assume that the "loadparm" property is either settable for all -bootable devices (when the "boot order" feature is implemented in -QEMU), or none (meaning the behaviour of older QEMUs that only allowed -one "loadparm" at the machine level). To fix this broken situation, -let's implement the "loadparm" property in for the SCSI devices, too. - -Message-ID: <20241115141202.1877294-1-thuth@redhat.com> -Acked-by: Eric Farman -Signed-off-by: Thomas Huth -(cherry picked from commit 429442e52d94f890fa194a151e8cd649b04e9e63) ---- - hw/core/qdev-properties-system.c | 26 +++++++++++++++++ - hw/s390x/ipl.c | 19 ++++--------- - hw/scsi/scsi-disk.c | 43 +++++++++++++++++++++++++++++ - include/hw/qdev-properties-system.h | 3 ++ - 4 files changed, 78 insertions(+), 13 deletions(-) - -diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c -index f13350b4fb..5cd527cdba 100644 ---- a/hw/core/qdev-properties-system.c -+++ b/hw/core/qdev-properties-system.c -@@ -58,6 +58,32 @@ static bool check_prop_still_unset(Object *obj, const char *name, - return false; - } - -+bool qdev_prop_sanitize_s390x_loadparm(uint8_t *loadparm, const char *str, -+ Error **errp) -+{ -+ int i, len; -+ -+ len = strlen(str); -+ if (len > 8) { -+ error_setg(errp, "'loadparm' can only contain up to 8 characters"); -+ return false; -+ } -+ -+ for (i = 0; i < len; i++) { -+ uint8_t c = qemu_toupper(str[i]); /* mimic HMC */ -+ -+ if (qemu_isalnum(c) || c == '.' || c == ' ') { -+ loadparm[i] = c; -+ } else { -+ error_setg(errp, -+ "invalid character in 'loadparm': '%c' (ASCII 0x%02x)", -+ c, c); -+ return false; -+ } -+ } -+ -+ return true; -+} - - /* --- drive --- */ - -diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c -index 5fbd43c346..8101825dfe 100644 ---- a/hw/s390x/ipl.c -+++ b/hw/s390x/ipl.c -@@ -418,21 +418,9 @@ static uint64_t s390_ipl_map_iplb_chain(IplParameterBlock *iplb_chain) - - void s390_ipl_fmt_loadparm(uint8_t *loadparm, char *str, Error **errp) - { -- int i; -- - /* Initialize the loadparm with spaces */ - memset(loadparm, ' ', LOADPARM_LEN); -- for (i = 0; i < LOADPARM_LEN && str[i]; i++) { -- uint8_t c = qemu_toupper(str[i]); /* mimic HMC */ -- -- if (qemu_isalnum(c) || c == '.' || c == ' ') { -- loadparm[i] = c; -- } else { -- error_setg(errp, "LOADPARM: invalid character '%c' (ASCII 0x%02x)", -- c, c); -- return; -- } -- } -+ qdev_prop_sanitize_s390x_loadparm(loadparm, str, errp); - } - - void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t *ebcdic_lp) -@@ -452,6 +440,7 @@ static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) - SCSIDevice *sd; - int devtype; - uint8_t *lp; -+ g_autofree void *scsi_lp = NULL; - - /* - * Currently allow IPL only from CCW devices. -@@ -463,6 +452,10 @@ static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) - switch (devtype) { - case CCW_DEVTYPE_SCSI: - sd = SCSI_DEVICE(dev_st); -+ scsi_lp = object_property_get_str(OBJECT(sd), "loadparm", NULL); -+ if (scsi_lp && strlen(scsi_lp) > 0) { -+ lp = scsi_lp; -+ } - iplb->len = cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN); - iplb->blk0_len = - cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN - S390_IPLB_HEADER_LEN); -diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c -index 4d94b2b816..7566a5f531 100644 ---- a/hw/scsi/scsi-disk.c -+++ b/hw/scsi/scsi-disk.c -@@ -32,6 +32,7 @@ - #include "migration/vmstate.h" - #include "hw/scsi/emulation.h" - #include "scsi/constants.h" -+#include "sysemu/arch_init.h" - #include "sysemu/block-backend.h" - #include "sysemu/blockdev.h" - #include "hw/block/block.h" -@@ -111,6 +112,7 @@ struct SCSIDiskState { - char *vendor; - char *product; - char *device_id; -+ char *loadparm; /* only for s390x */ - bool tray_open; - bool tray_locked; - /* -@@ -3135,6 +3137,43 @@ BlockAIOCB *scsi_dma_writev(int64_t offset, QEMUIOVector *iov, - return blk_aio_pwritev(s->qdev.conf.blk, offset, iov, 0, cb, cb_opaque); - } - -+static char *scsi_property_get_loadparm(Object *obj, Error **errp) -+{ -+ return g_strdup(SCSI_DISK_BASE(obj)->loadparm); -+} -+ -+static void scsi_property_set_loadparm(Object *obj, const char *value, -+ Error **errp) -+{ -+ void *lp_str; -+ -+ if (object_property_get_int(obj, "bootindex", NULL) < 0) { -+ error_setg(errp, "'loadparm' is only valid for boot devices"); -+ return; -+ } -+ -+ lp_str = g_malloc0(strlen(value)); -+ if (!qdev_prop_sanitize_s390x_loadparm(lp_str, value, errp)) { -+ g_free(lp_str); -+ return; -+ } -+ SCSI_DISK_BASE(obj)->loadparm = lp_str; -+} -+ -+static void scsi_property_add_specifics(DeviceClass *dc) -+{ -+ ObjectClass *oc = OBJECT_CLASS(dc); -+ -+ /* The loadparm property is only supported on s390x */ -+ if (arch_type & QEMU_ARCH_S390X) { -+ object_class_property_add_str(oc, "loadparm", -+ scsi_property_get_loadparm, -+ scsi_property_set_loadparm); -+ object_class_property_set_description(oc, "loadparm", -+ "load parameter (s390x only)"); -+ } -+} -+ - static void scsi_disk_base_class_initfn(ObjectClass *klass, void *data) - { - DeviceClass *dc = DEVICE_CLASS(klass); -@@ -3218,6 +3257,8 @@ static void scsi_hd_class_initfn(ObjectClass *klass, void *data) - dc->desc = "virtual SCSI disk"; - device_class_set_props(dc, scsi_hd_properties); - dc->vmsd = &vmstate_scsi_disk_state; -+ -+ scsi_property_add_specifics(dc); - } - - static const TypeInfo scsi_hd_info = { -@@ -3258,6 +3299,8 @@ static void scsi_cd_class_initfn(ObjectClass *klass, void *data) - dc->desc = "virtual SCSI CD-ROM"; - device_class_set_props(dc, scsi_cd_properties); - dc->vmsd = &vmstate_scsi_disk_state; -+ -+ scsi_property_add_specifics(dc); - } - - static const TypeInfo scsi_cd_info = { -diff --git a/include/hw/qdev-properties-system.h b/include/hw/qdev-properties-system.h -index 438f65389f..88e4257ad0 100644 ---- a/include/hw/qdev-properties-system.h -+++ b/include/hw/qdev-properties-system.h -@@ -3,6 +3,9 @@ - - #include "hw/qdev-properties.h" - -+bool qdev_prop_sanitize_s390x_loadparm(uint8_t *loadparm, const char *str, -+ Error **errp); -+ - extern const PropertyInfo qdev_prop_chr; - extern const PropertyInfo qdev_prop_macaddr; - extern const PropertyInfo qdev_prop_reserved_region; --- -2.39.3 - diff --git a/kvm-hw-char-pl011-Use-correct-masks-for-IBRD-and-FBRD.patch b/kvm-hw-char-pl011-Use-correct-masks-for-IBRD-and-FBRD.patch deleted file mode 100644 index 22d55ce..0000000 --- a/kvm-hw-char-pl011-Use-correct-masks-for-IBRD-and-FBRD.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 133805a36691de83f0ca29165a2312d5ad4f0757 Mon Sep 17 00:00:00 2001 -From: Peter Maydell -Date: Mon, 14 Oct 2024 17:05:53 +0100 -Subject: [PATCH 18/18] hw/char/pl011: Use correct masks for IBRD and FBRD -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: sansshar -RH-MergeRequest: 311: hw/char/pl011: Use correct masks for IBRD and FBRD -RH-Jira: RHEL-67108 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/1] e615ca34db8ee95533eba8cd671d620112e80cfb (sansshar/qemu-kvm-centos) - -JIRA: RHEL-67108 -Brew build id: 5099404 - -In commit b88cfee90268cad we defined masks for the IBRD and FBRD -integer and fractional baud rate divider registers, to prevent the -guest from writing invalid values which could cause division-by-zero. -Unfortunately we got the mask values the wrong way around: the FBRD -register is six bits and the IBRD register is 16 bits, not -vice-versa. - -You would only run into this bug if you programmed the UART to a baud -rate of less than 9600, because for 9600 baud and above the IBRD -value will fit into 6 bits, as per the table in - https://developer.arm.com/documentation/ddi0183/g/programmers-model/register-descriptions/fractional-baud-rate-register--uartfbrd - -The only visible effects would be that the value read back from -the register by the guest would be truncated, and we would -print an incorrect baud rate in the debug logs. - -Cc: qemu-stable@nongnu.org -Fixes: b88cfee90268 ("hw/char/pl011: Avoid division-by-zero in pl011_get_baudrate()") -Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2610 -Signed-off-by: Peter Maydell -Reviewed-by: Alex Bennée -Reviewed-by: Philippe Mathieu-Daudé -Reviewed-by: Gavin Shan -Message-id: 20241007144732.2491331-1-peter.maydell@linaro.org -(cherry picked from commit cd247eae16ab1b9ce97fd34c000c1b883feeda45) -Signed-off-by: Sana Sharma ---- - hw/char/pl011.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/hw/char/pl011.c b/hw/char/pl011.c -index f8078aa216..949e9d0e0d 100644 ---- a/hw/char/pl011.c -+++ b/hw/char/pl011.c -@@ -88,10 +88,10 @@ DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr) - #define CR_LBE (1 << 7) - - /* Integer Baud Rate Divider, UARTIBRD */ --#define IBRD_MASK 0x3f -+#define IBRD_MASK 0xffff - - /* Fractional Baud Rate Divider, UARTFBRD */ --#define FBRD_MASK 0xffff -+#define FBRD_MASK 0x3f - - static const unsigned char pl011_id_arm[8] = - { 0x11, 0x10, 0x14, 0x00, 0x0d, 0xf0, 0x05, 0xb1 }; --- -2.39.3 - diff --git a/kvm-hw-s390x-Build-an-IPLB-for-each-boot-device.patch b/kvm-hw-s390x-Build-an-IPLB-for-each-boot-device.patch deleted file mode 100644 index dafdddc..0000000 --- a/kvm-hw-s390x-Build-an-IPLB-for-each-boot-device.patch +++ /dev/null @@ -1,270 +0,0 @@ -From 416ee0a87ee4bfedf07bc37d328066375b36fdc1 Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:49 -0400 -Subject: [PATCH 17/38] hw/s390x: Build an IPLB for each boot device -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [16/23] 40a579b400cebd1470bb632869ad4a5581e3c41f (thuth/qemu-kvm-cs9) - -Build an IPLB for any device with a bootindex (up to a maximum of 8 devices). - -The IPLB chain is placed immediately before the BIOS in memory. Because this -is not a fixed address, the location of the next IPLB and number of remaining -boot devices is stored in the QIPL global variable for possible later access by -the guest during IPL. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-16-jrossi@linux.ibm.com> -[thuth: Fix endianness problem when accessing the qipl structure] -Signed-off-by: Thomas Huth -(cherry picked from commit 0927875e704e93ace03bb7533c0877bf97e4bda9) ---- - hw/s390x/ipl.c | 129 ++++++++++++++++++++++++++++-------- - hw/s390x/ipl.h | 1 + - include/hw/s390x/ipl/qipl.h | 4 +- - 3 files changed, 105 insertions(+), 29 deletions(-) - -diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c -index d83832d975..f4576f8822 100644 ---- a/hw/s390x/ipl.c -+++ b/hw/s390x/ipl.c -@@ -56,6 +56,13 @@ static bool iplb_extended_needed(void *opaque) - return ipl->iplbext_migration; - } - -+/* Place the IPLB chain immediately before the BIOS in memory */ -+static uint64_t find_iplb_chain_addr(uint64_t bios_addr, uint16_t count) -+{ -+ return (bios_addr & TARGET_PAGE_MASK) -+ - (count * sizeof(IplParameterBlock)); -+} -+ - static const VMStateDescription vmstate_iplb_extended = { - .name = "ipl/iplb_extended", - .version_id = 0, -@@ -398,6 +405,17 @@ static CcwDevice *s390_get_ccw_device(DeviceState *dev_st, int *devtype) - return ccw_dev; - } - -+static uint64_t s390_ipl_map_iplb_chain(IplParameterBlock *iplb_chain) -+{ -+ S390IPLState *ipl = get_ipl_device(); -+ uint16_t count = be16_to_cpu(ipl->qipl.chain_len); -+ uint64_t len = sizeof(IplParameterBlock) * count; -+ uint64_t chain_addr = find_iplb_chain_addr(ipl->bios_start_addr, count); -+ -+ cpu_physical_memory_write(chain_addr, iplb_chain, len); -+ return chain_addr; -+} -+ - void s390_ipl_fmt_loadparm(uint8_t *loadparm, char *str, Error **errp) - { - int i; -@@ -428,54 +446,51 @@ void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t *ebcdic_lp) - } - } - --static bool s390_gen_initial_iplb(S390IPLState *ipl) -+static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) - { -- DeviceState *dev_st; -+ S390IPLState *ipl = get_ipl_device(); - CcwDevice *ccw_dev = NULL; - SCSIDevice *sd; - int devtype; - uint8_t *lp; - -- dev_st = get_boot_device(0); -- if (dev_st) { -- ccw_dev = s390_get_ccw_device(dev_st, &devtype); -- } -- - /* - * Currently allow IPL only from CCW devices. - */ -+ ccw_dev = s390_get_ccw_device(dev_st, &devtype); - if (ccw_dev) { - lp = ccw_dev->loadparm; - - switch (devtype) { - case CCW_DEVTYPE_SCSI: - sd = SCSI_DEVICE(dev_st); -- ipl->iplb.len = cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN); -- ipl->iplb.blk0_len = -+ iplb->len = cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN); -+ iplb->blk0_len = - cpu_to_be32(S390_IPLB_MIN_QEMU_SCSI_LEN - S390_IPLB_HEADER_LEN); -- ipl->iplb.pbt = S390_IPL_TYPE_QEMU_SCSI; -- ipl->iplb.scsi.lun = cpu_to_be32(sd->lun); -- ipl->iplb.scsi.target = cpu_to_be16(sd->id); -- ipl->iplb.scsi.channel = cpu_to_be16(sd->channel); -- ipl->iplb.scsi.devno = cpu_to_be16(ccw_dev->sch->devno); -- ipl->iplb.scsi.ssid = ccw_dev->sch->ssid & 3; -+ iplb->pbt = S390_IPL_TYPE_QEMU_SCSI; -+ iplb->scsi.lun = cpu_to_be32(sd->lun); -+ iplb->scsi.target = cpu_to_be16(sd->id); -+ iplb->scsi.channel = cpu_to_be16(sd->channel); -+ iplb->scsi.devno = cpu_to_be16(ccw_dev->sch->devno); -+ iplb->scsi.ssid = ccw_dev->sch->ssid & 3; - break; - case CCW_DEVTYPE_VFIO: -- ipl->iplb.len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN); -- ipl->iplb.pbt = S390_IPL_TYPE_CCW; -- ipl->iplb.ccw.devno = cpu_to_be16(ccw_dev->sch->devno); -- ipl->iplb.ccw.ssid = ccw_dev->sch->ssid & 3; -+ iplb->len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN); -+ iplb->pbt = S390_IPL_TYPE_CCW; -+ iplb->ccw.devno = cpu_to_be16(ccw_dev->sch->devno); -+ iplb->ccw.ssid = ccw_dev->sch->ssid & 3; - break; - case CCW_DEVTYPE_VIRTIO_NET: -+ /* The S390IPLState netboot is true if ANY IPLB may use netboot */ - ipl->netboot = true; - /* Fall through to CCW_DEVTYPE_VIRTIO case */ - case CCW_DEVTYPE_VIRTIO: -- ipl->iplb.len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN); -- ipl->iplb.blk0_len = -+ iplb->len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN); -+ iplb->blk0_len = - cpu_to_be32(S390_IPLB_MIN_CCW_LEN - S390_IPLB_HEADER_LEN); -- ipl->iplb.pbt = S390_IPL_TYPE_CCW; -- ipl->iplb.ccw.devno = cpu_to_be16(ccw_dev->sch->devno); -- ipl->iplb.ccw.ssid = ccw_dev->sch->ssid & 3; -+ iplb->pbt = S390_IPL_TYPE_CCW; -+ iplb->ccw.devno = cpu_to_be16(ccw_dev->sch->devno); -+ iplb->ccw.ssid = ccw_dev->sch->ssid & 3; - break; - } - -@@ -484,8 +499,8 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) - lp = S390_CCW_MACHINE(qdev_get_machine())->loadparm; - } - -- s390_ipl_convert_loadparm((char *)lp, ipl->iplb.loadparm); -- ipl->iplb.flags |= DIAG308_FLAGS_LP_VALID; -+ s390_ipl_convert_loadparm((char *)lp, iplb->loadparm); -+ iplb->flags |= DIAG308_FLAGS_LP_VALID; - - return true; - } -@@ -493,6 +508,62 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) - return false; - } - -+static bool s390_init_all_iplbs(S390IPLState *ipl) -+{ -+ int iplb_num = 0; -+ IplParameterBlock iplb_chain[7]; -+ DeviceState *dev_st = get_boot_device(0); -+ Object *machine = qdev_get_machine(); -+ -+ /* -+ * Parse the boot devices. Generate an IPLB for only the first boot device -+ * which will later be set with DIAG308. -+ */ -+ if (!dev_st) { -+ ipl->qipl.chain_len = 0; -+ return false; -+ } -+ -+ /* If no machine loadparm was defined fill it with spaces */ -+ if (memcmp(S390_CCW_MACHINE(machine)->loadparm, NO_LOADPARM, 8) == 0) { -+ object_property_set_str(machine, "loadparm", " ", NULL); -+ } -+ -+ iplb_num = 1; -+ s390_build_iplb(dev_st, &ipl->iplb); -+ -+ /* Index any fallback boot devices */ -+ while (get_boot_device(iplb_num)) { -+ iplb_num++; -+ } -+ -+ if (iplb_num > MAX_BOOT_DEVS) { -+ warn_report("Excess boot devices defined! %d boot devices found, " -+ "but only the first %d will be considered.", -+ iplb_num, MAX_BOOT_DEVS); -+ -+ iplb_num = MAX_BOOT_DEVS; -+ } -+ -+ ipl->qipl.chain_len = cpu_to_be16(iplb_num - 1); -+ -+ /* -+ * Build fallback IPLBs for any boot devices above index 0, up to a -+ * maximum amount as defined in ipl.h -+ */ -+ if (iplb_num > 1) { -+ /* Start at 1 because the IPLB for boot index 0 is not chained */ -+ for (int i = 1; i < iplb_num; i++) { -+ dev_st = get_boot_device(i); -+ s390_build_iplb(dev_st, &iplb_chain[i - 1]); -+ } -+ -+ ipl->qipl.next_iplb = cpu_to_be64(s390_ipl_map_iplb_chain(iplb_chain)); -+ } -+ -+ return iplb_num; -+} -+ - static bool is_virtio_ccw_device_of_type(IplParameterBlock *iplb, - int virtio_id) - { -@@ -620,7 +691,7 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) - * this is the original boot device's SCSI - * so restore IPL parameter info from it - */ -- ipl->iplb_valid = s390_gen_initial_iplb(ipl); -+ ipl->iplb_valid = s390_build_iplb(get_boot_device(0), &ipl->iplb); - } - } - if (reset_type == S390_RESET_MODIFIED_CLEAR || -@@ -714,7 +785,9 @@ void s390_ipl_prepare_cpu(S390CPU *cpu) - if (!ipl->kernel || ipl->iplb_valid) { - cpu->env.psw.addr = ipl->bios_start_addr; - if (!ipl->iplb_valid) { -- ipl->iplb_valid = s390_gen_initial_iplb(ipl); -+ ipl->iplb_valid = s390_init_all_iplbs(ipl); -+ } else { -+ ipl->qipl.chain_len = 0; - } - } - s390_ipl_set_boot_menu(ipl); -diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h -index b670bad551..54eb48fd6e 100644 ---- a/hw/s390x/ipl.h -+++ b/hw/s390x/ipl.h -@@ -20,6 +20,7 @@ - #include "qom/object.h" - - #define DIAG308_FLAGS_LP_VALID 0x80 -+#define MAX_BOOT_DEVS 8 /* Max number of devices that may have a bootindex */ - - void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t *ebcdic_lp); - void s390_ipl_fmt_loadparm(uint8_t *loadparm, char *str, Error **errp); -diff --git a/include/hw/s390x/ipl/qipl.h b/include/hw/s390x/ipl/qipl.h -index b67d2ae061..1da4f75aa8 100644 ---- a/include/hw/s390x/ipl/qipl.h -+++ b/include/hw/s390x/ipl/qipl.h -@@ -32,7 +32,9 @@ struct QemuIplParameters { - uint8_t reserved1[3]; - uint64_t reserved2; - uint32_t boot_menu_timeout; -- uint8_t reserved3[12]; -+ uint8_t reserved3[2]; -+ uint16_t chain_len; -+ uint64_t next_iplb; - } QEMU_PACKED; - typedef struct QemuIplParameters QemuIplParameters; - --- -2.39.3 - diff --git a/kvm-hw-s390x-Remove-the-possibility-to-load-the-s390-net.patch b/kvm-hw-s390x-Remove-the-possibility-to-load-the-s390-net.patch deleted file mode 100644 index 6329706..0000000 --- a/kvm-hw-s390x-Remove-the-possibility-to-load-the-s390-net.patch +++ /dev/null @@ -1,201 +0,0 @@ -From 36f64f38b39f2a2e0f0682f62f669d5e23074875 Mon Sep 17 00:00:00 2001 -From: Thomas Huth -Date: Thu, 20 Jun 2024 16:59:28 +0200 -Subject: [PATCH 06/38] hw/s390x: Remove the possibility to load the - s390-netboot.img binary -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [5/23] ff245b81b45ddd3a78343d1a8cfdd725a8255d87 (thuth/qemu-kvm-cs9) - -Since the netboot code has now been merged into the main s390-ccw.img -binary, we don't need the separate s390-netboot.img anymore. Remove -it and the code that was responsible for loading it. - -Message-Id: <20240621082422.136217-6-thuth@redhat.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 188e255bf8ed68fa64bcb63577cb100eeb326254) ---- - hw/s390x/ipl.c | 55 -------------------------------------- - hw/s390x/ipl.h | 12 +++------ - hw/s390x/s390-virtio-ccw.c | 10 ++----- - pc-bios/meson.build | 1 - - 4 files changed, 6 insertions(+), 72 deletions(-) - -diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c -index 9362de0b6f..8a0a3e6961 100644 ---- a/hw/s390x/ipl.c -+++ b/hw/s390x/ipl.c -@@ -288,7 +288,6 @@ static Property s390_ipl_properties[] = { - DEFINE_PROP_STRING("initrd", S390IPLState, initrd), - DEFINE_PROP_STRING("cmdline", S390IPLState, cmdline), - DEFINE_PROP_STRING("firmware", S390IPLState, firmware), -- DEFINE_PROP_STRING("netboot_fw", S390IPLState, netboot_fw), - DEFINE_PROP_BOOL("enforce_bios", S390IPLState, enforce_bios, false), - DEFINE_PROP_BOOL("iplbext_migration", S390IPLState, iplbext_migration, - true), -@@ -480,56 +479,6 @@ int s390_ipl_set_loadparm(uint8_t *loadparm) - return -1; - } - --static int load_netboot_image(Error **errp) --{ -- MachineState *ms = MACHINE(qdev_get_machine()); -- S390IPLState *ipl = get_ipl_device(); -- char *netboot_filename; -- MemoryRegion *sysmem = get_system_memory(); -- MemoryRegion *mr = NULL; -- void *ram_ptr = NULL; -- int img_size = -1; -- -- mr = memory_region_find(sysmem, 0, 1).mr; -- if (!mr) { -- error_setg(errp, "Failed to find memory region at address 0"); -- return -1; -- } -- -- ram_ptr = memory_region_get_ram_ptr(mr); -- if (!ram_ptr) { -- error_setg(errp, "No RAM found"); -- goto unref_mr; -- } -- -- netboot_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, ipl->netboot_fw); -- if (netboot_filename == NULL) { -- error_setg(errp, "Could not find network bootloader '%s'", -- ipl->netboot_fw); -- goto unref_mr; -- } -- -- img_size = load_elf_ram(netboot_filename, NULL, NULL, NULL, -- &ipl->start_addr, -- NULL, NULL, NULL, 1, EM_S390, 0, 0, NULL, -- false); -- -- if (img_size < 0) { -- img_size = load_image_size(netboot_filename, ram_ptr, ms->ram_size); -- ipl->start_addr = KERN_IMAGE_START; -- } -- -- if (img_size < 0) { -- error_setg(errp, "Failed to load network bootloader"); -- } -- -- g_free(netboot_filename); -- --unref_mr: -- memory_region_unref(mr); -- return img_size; --} -- - static bool is_virtio_ccw_device_of_type(IplParameterBlock *iplb, - int virtio_id) - { -@@ -754,10 +703,6 @@ void s390_ipl_prepare_cpu(S390CPU *cpu) - ipl->iplb_valid = s390_gen_initial_iplb(ipl); - } - } -- if (ipl->netboot) { -- load_netboot_image(&error_fatal); -- ipl->qipl.netboot_start_addr = cpu_to_be64(ipl->start_addr); -- } - s390_ipl_set_boot_menu(ipl); - s390_ipl_prepare_qipl(cpu); - } -diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h -index 57cd125769..b2105b616a 100644 ---- a/hw/s390x/ipl.h -+++ b/hw/s390x/ipl.h -@@ -134,11 +134,8 @@ void s390_ipl_clear_reset_request(void); - /* - * The QEMU IPL Parameters will be stored at absolute address - * 204 (0xcc) which means it is 32-bit word aligned but not -- * double-word aligned. -- * Placement of data fields in this area must account for -- * their alignment needs. E.g., netboot_start_address must -- * have an offset of 4 + n * 8 bytes within the struct in order -- * to keep it double-word aligned. -+ * double-word aligned. Placement of 64-bit data fields in this -+ * area must account for their alignment needs. - * The total size of the struct must never exceed 28 bytes. - * This definition must be kept in sync with the definition - * in pc-bios/s390-ccw/iplb.h. -@@ -146,9 +143,9 @@ void s390_ipl_clear_reset_request(void); - struct QemuIplParameters { - uint8_t qipl_flags; - uint8_t reserved1[3]; -- uint64_t netboot_start_addr; -+ uint64_t reserved2; - uint32_t boot_menu_timeout; -- uint8_t reserved2[12]; -+ uint8_t reserved3[12]; - } QEMU_PACKED; - typedef struct QemuIplParameters QemuIplParameters; - -@@ -178,7 +175,6 @@ struct S390IPLState { - char *initrd; - char *cmdline; - char *firmware; -- char *netboot_fw; - uint8_t cssid; - uint8_t ssid; - uint16_t devno; -diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c -index b61392bac1..29a89a0c31 100644 ---- a/hw/s390x/s390-virtio-ccw.c -+++ b/hw/s390x/s390-virtio-ccw.c -@@ -197,11 +197,10 @@ static void s390_memory_init(MemoryRegion *ram) - static void s390_init_ipl_dev(const char *kernel_filename, - const char *kernel_cmdline, - const char *initrd_filename, const char *firmware, -- const char *netboot_fw, bool enforce_bios) -+ bool enforce_bios) - { - Object *new = object_new(TYPE_S390_IPL); - DeviceState *dev = DEVICE(new); -- char *netboot_fw_prop; - - if (kernel_filename) { - qdev_prop_set_string(dev, "kernel", kernel_filename); -@@ -212,11 +211,6 @@ static void s390_init_ipl_dev(const char *kernel_filename, - qdev_prop_set_string(dev, "cmdline", kernel_cmdline); - qdev_prop_set_string(dev, "firmware", firmware); - qdev_prop_set_bit(dev, "enforce_bios", enforce_bios); -- netboot_fw_prop = object_property_get_str(new, "netboot_fw", &error_abort); -- if (!strlen(netboot_fw_prop)) { -- qdev_prop_set_string(dev, "netboot_fw", netboot_fw); -- } -- g_free(netboot_fw_prop); - object_property_add_child(qdev_get_machine(), TYPE_S390_IPL, - new); - object_unref(new); -@@ -284,7 +278,7 @@ static void ccw_init(MachineState *machine) - s390_init_ipl_dev(machine->kernel_filename, machine->kernel_cmdline, - machine->initrd_filename, - machine->firmware ?: "s390-ccw.img", -- "s390-netboot.img", true); -+ true); - - dev = qdev_new(TYPE_S390_PCI_HOST_BRIDGE); - object_property_add_child(qdev_get_machine(), TYPE_S390_PCI_HOST_BRIDGE, -diff --git a/pc-bios/meson.build b/pc-bios/meson.build -index 8602b45b9b..ea85c54c86 100644 ---- a/pc-bios/meson.build -+++ b/pc-bios/meson.build -@@ -66,7 +66,6 @@ blobs = [ - 'kvmvapic.bin', - 'pvh.bin', - 's390-ccw.img', -- 's390-netboot.img', - 'slof.bin', - 'skiboot.lid', - 'palcode-clipper', --- -2.39.3 - diff --git a/kvm-hw-s390x-Restrict-loadparm-property-to-devices-that-.patch b/kvm-hw-s390x-Restrict-loadparm-property-to-devices-that-.patch deleted file mode 100644 index 3df6be5..0000000 --- a/kvm-hw-s390x-Restrict-loadparm-property-to-devices-that-.patch +++ /dev/null @@ -1,112 +0,0 @@ -From b9950c32c2845c9592650df49183c431a4190e7f Mon Sep 17 00:00:00 2001 -From: Thomas Huth -Date: Wed, 13 Nov 2024 12:47:41 +0100 -Subject: [PATCH 4/9] hw/s390x: Restrict "loadparm" property to devices that - can be used for booting -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 297: [c10s] Fixes for the new s390x "boot order" feature -RH-Jira: RHEL-68444 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [3/8] 7b0fee6a1508649d66b913e6ebf23b4af29628dd (thuth/qemu-kvm-cs9) - -Commit bb185de423 ("s390x: Add individual loadparm assignment to -CCW device") added a "loadparm" property to all CCW devices. This -was a little bit unfortunate, since this property is only useful -for devices that can be used for booting, but certainly it is not -useful for devices like virtio-gpu or virtio-tablet. - -Thus let's restrict the property to CCW devices that we can boot from -(i.e. virtio-block, virtio-net and vfio-ccw devices). - -Message-ID: <20241113114741.681096-1-thuth@redhat.com> -Reviewed-by: Philippe Mathieu-Daudé -Reviewed-by: Jared Rossi -Signed-off-by: Thomas Huth -(cherry picked from commit 6e7c96ae61e0542e97d385084f1f2281a0331054) ---- - hw/s390x/ccw-device.c | 4 +--- - hw/s390x/ccw-device.h | 5 +++++ - hw/s390x/virtio-ccw-blk.c | 1 + - hw/s390x/virtio-ccw-net.c | 1 + - hw/vfio/ccw.c | 1 + - 5 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c -index 4e54f34b1c..d7bb364579 100644 ---- a/hw/s390x/ccw-device.c -+++ b/hw/s390x/ccw-device.c -@@ -73,7 +73,7 @@ static void ccw_device_set_loadparm(Object *obj, Visitor *v, - s390_ipl_fmt_loadparm(dev->loadparm, val, errp); - } - --static const PropertyInfo ccw_loadparm = { -+const PropertyInfo ccw_loadparm = { - .name = "ccw_loadparm", - .description = "Up to 8 chars in set of [A-Za-z0-9. ] to pass" - " to the guest loader/kernel", -@@ -85,8 +85,6 @@ static Property ccw_device_properties[] = { - DEFINE_PROP_CSS_DEV_ID("devno", CcwDevice, devno), - DEFINE_PROP_CSS_DEV_ID_RO("dev_id", CcwDevice, dev_id), - DEFINE_PROP_CSS_DEV_ID_RO("subch_id", CcwDevice, subch_id), -- DEFINE_PROP("loadparm", CcwDevice, loadparm, ccw_loadparm, -- typeof(uint8_t[8])), - DEFINE_PROP_END_OF_LIST(), - }; - -diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h -index 1e1737c0f3..4439feb140 100644 ---- a/hw/s390x/ccw-device.h -+++ b/hw/s390x/ccw-device.h -@@ -51,4 +51,9 @@ static inline CcwDevice *to_ccw_dev_fast(DeviceState *d) - - OBJECT_DECLARE_TYPE(CcwDevice, CCWDeviceClass, CCW_DEVICE) - -+extern const PropertyInfo ccw_loadparm; -+ -+#define DEFINE_PROP_CCW_LOADPARM(_n, _s, _f) \ -+ DEFINE_PROP(_n, _s, _f, ccw_loadparm, typeof(uint8_t[8])) -+ - #endif -diff --git a/hw/s390x/virtio-ccw-blk.c b/hw/s390x/virtio-ccw-blk.c -index 8e0e58b77d..2364432c6e 100644 ---- a/hw/s390x/virtio-ccw-blk.c -+++ b/hw/s390x/virtio-ccw-blk.c -@@ -48,6 +48,7 @@ static Property virtio_ccw_blk_properties[] = { - VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), - DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, - VIRTIO_CCW_MAX_REV), -+ DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm), - DEFINE_PROP_END_OF_LIST(), - }; - -diff --git a/hw/s390x/virtio-ccw-net.c b/hw/s390x/virtio-ccw-net.c -index 484e617659..a4a3f65c7e 100644 ---- a/hw/s390x/virtio-ccw-net.c -+++ b/hw/s390x/virtio-ccw-net.c -@@ -51,6 +51,7 @@ static Property virtio_ccw_net_properties[] = { - VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), - DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev, - VIRTIO_CCW_MAX_REV), -+ DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm), - DEFINE_PROP_END_OF_LIST(), - }; - -diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c -index 115862f430..99f16614ad 100644 ---- a/hw/vfio/ccw.c -+++ b/hw/vfio/ccw.c -@@ -662,6 +662,7 @@ static Property vfio_ccw_properties[] = { - DEFINE_PROP_LINK("iommufd", VFIOCCWDevice, vdev.iommufd, - TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), - #endif -+ DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm), - DEFINE_PROP_END_OF_LIST(), - }; - --- -2.39.3 - diff --git a/kvm-hw-s390x-ipl-Provide-more-memory-to-the-s390-ccw.img.patch b/kvm-hw-s390x-ipl-Provide-more-memory-to-the-s390-ccw.img.patch deleted file mode 100644 index cea6973..0000000 --- a/kvm-hw-s390x-ipl-Provide-more-memory-to-the-s390-ccw.img.patch +++ /dev/null @@ -1,61 +0,0 @@ -From ce0d8bc163952ce177c37ea431cacf60889017f2 Mon Sep 17 00:00:00 2001 -From: Thomas Huth -Date: Fri, 21 Jun 2024 10:24:17 +0200 -Subject: [PATCH 02/38] hw/s390x/ipl: Provide more memory to the s390-ccw.img - firmware -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/23] c33a2769b041e62285eb7840f8a7c05ac32aca7b (thuth/qemu-kvm-cs9) - -We are going to link the SLOF libc into the s390-ccw.img, and this -libc needs more memory for providing space for malloc() and friends. -Thus bump the memory size that we reserve for the bios to 3 MiB -instead of only 2 MiB. While we're at it, add a proper check that -there is really enough memory assigned to the machine before blindly -using it. - -Message-ID: <20240621082422.136217-3-thuth@redhat.com> -Signed-off-by: Thomas Huth -(cherry picked from commit abaabb2e601adfe296a64471746a997eabcc607f) ---- - hw/s390x/ipl.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c -index e934bf89d1..9362de0b6f 100644 ---- a/hw/s390x/ipl.c -+++ b/hw/s390x/ipl.c -@@ -45,6 +45,7 @@ - #define INITRD_PARM_START 0x010408UL - #define PARMFILE_START 0x001000UL - #define ZIPL_IMAGE_START 0x009000UL -+#define BIOS_MAX_SIZE 0x300000UL - #define IPL_PSW_MASK (PSW_MASK_32 | PSW_MASK_64) - - static bool iplb_extended_needed(void *opaque) -@@ -144,7 +145,14 @@ static void s390_ipl_realize(DeviceState *dev, Error **errp) - * even if an external kernel has been defined. - */ - if (!ipl->kernel || ipl->enforce_bios) { -- uint64_t fwbase = (MIN(ms->ram_size, 0x80000000U) - 0x200000) & ~0xffffUL; -+ uint64_t fwbase; -+ -+ if (ms->ram_size < BIOS_MAX_SIZE) { -+ error_setg(errp, "not enough RAM to load the BIOS file"); -+ return; -+ } -+ -+ fwbase = (MIN(ms->ram_size, 0x80000000U) - BIOS_MAX_SIZE) & ~0xffffUL; - - bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, ipl->firmware); - if (bios_filename == NULL) { --- -2.39.3 - diff --git a/kvm-hw-virtio-fix-crash-in-processing-balloon-stats.patch b/kvm-hw-virtio-fix-crash-in-processing-balloon-stats.patch deleted file mode 100644 index 31bbbbe..0000000 --- a/kvm-hw-virtio-fix-crash-in-processing-balloon-stats.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 58ad1bbfe399cecf0f05ebc70d2d3189fb78851d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= -Date: Fri, 29 Nov 2024 13:55:05 +0000 -Subject: [PATCH 2/4] hw/virtio: fix crash in processing balloon stats -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 322: hw/virtio: fix crash in processing balloon stats -RH-Jira: RHEL-73835 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Daniel P. Berrangé -RH-Commit: [1/1] 7a0f9b816b1ce5f82ae6d0f4686fbb2ca0632e00 (thuth/qemu-kvm-cs9) - -balloon_stats_get_all will iterate over guest stats upto the max -VIRTIO_BALLOON_S_NR value, calling visit_type_uint64 to populate -the QObject dict. The dict keys are obtained from the static -array balloon_stat_names which is VIRTIO_BALLOON_S_NR in size. - -Unfortunately the way that array is declared results in any -unassigned stats getting a NULL name, which will then cause -visit_type_uint64 to trigger an assert in qobject_output_add_obj. - -The balloon_stat_names array was fortunately fully populated with -names until recently: - - commit 0d2eeef77a33315187df8519491a900bde4a3d83 - Author: Bibo Mao - Date: Mon Oct 28 10:38:09 2024 +0800 - - linux-headers: Update to Linux v6.12-rc5 - -pulled a change to include/standard-headers/linux/virtio_balloon.h -which increased VIRTIO_BALLOON_S_NR by 6, and failed to add the new -names to balloon_stat_names. - -This commit fills in the missing names, and uses a static assert to -guarantee that any future changes to VIRTIO_BALLOON_S_NR will cause -a build failure until balloon_stat_names is updated. - -This problem was detected by the Cockpit Project's automated -integration tests on QEMU 9.2.0-rc1. - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2329448 -Fixes: 0d2eeef77a3 ("linux-headers: Update to Linux v6.12-rc5") -Reported-by: Martin Pitt -Reviewed-by: Richard W.M. Jones -Signed-off-by: Daniel P. Berrangé -Reviewed-by: David Hildenbrand -Reviewed-by: Michael Tokarev -Acked-by: Michael S. Tsirkin -Message-ID: <20241129135507.699030-2-berrange@redhat.com> -Signed-off-by: Philippe Mathieu-Daudé -(cherry picked from commit bff1050a5630ce5da6f43ed002725d52140bb9e6) -Signed-off-by: Thomas Huth ---- - hw/virtio/virtio-balloon.c | 16 +++++++++++++++- - 1 file changed, 15 insertions(+), 1 deletion(-) - -diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c -index 609e39a821..afd2ad6dd6 100644 ---- a/hw/virtio/virtio-balloon.c -+++ b/hw/virtio/virtio-balloon.c -@@ -167,19 +167,33 @@ static void balloon_deflate_page(VirtIOBalloon *balloon, - } - } - -+/* -+ * All stats upto VIRTIO_BALLOON_S_NR /must/ have a -+ * non-NULL name declared here, since these are used -+ * as keys for populating the QDict with stats -+ */ - static const char *balloon_stat_names[] = { - [VIRTIO_BALLOON_S_SWAP_IN] = "stat-swap-in", - [VIRTIO_BALLOON_S_SWAP_OUT] = "stat-swap-out", - [VIRTIO_BALLOON_S_MAJFLT] = "stat-major-faults", - [VIRTIO_BALLOON_S_MINFLT] = "stat-minor-faults", - [VIRTIO_BALLOON_S_MEMFREE] = "stat-free-memory", -+ - [VIRTIO_BALLOON_S_MEMTOT] = "stat-total-memory", - [VIRTIO_BALLOON_S_AVAIL] = "stat-available-memory", - [VIRTIO_BALLOON_S_CACHES] = "stat-disk-caches", - [VIRTIO_BALLOON_S_HTLB_PGALLOC] = "stat-htlb-pgalloc", - [VIRTIO_BALLOON_S_HTLB_PGFAIL] = "stat-htlb-pgfail", -- [VIRTIO_BALLOON_S_NR] = NULL -+ -+ [VIRTIO_BALLOON_S_OOM_KILL] = "stat-oom-kills", -+ [VIRTIO_BALLOON_S_ALLOC_STALL] = "stat-alloc-stalls", -+ [VIRTIO_BALLOON_S_ASYNC_SCAN] = "stat-async-scans", -+ [VIRTIO_BALLOON_S_DIRECT_SCAN] = "stat-direct-scans", -+ [VIRTIO_BALLOON_S_ASYNC_RECLAIM] = "stat-async-reclaims", -+ -+ [VIRTIO_BALLOON_S_DIRECT_RECLAIM] = "stat-direct-reclaims", - }; -+G_STATIC_ASSERT(G_N_ELEMENTS(balloon_stat_names) == VIRTIO_BALLOON_S_NR); - - /* - * reset_stats - Mark all items in the stats array as unset --- -2.39.3 - diff --git a/kvm-include-hw-s390x-Add-include-files-for-common-IPL-st.patch b/kvm-include-hw-s390x-Add-include-files-for-common-IPL-st.patch deleted file mode 100644 index da7e469..0000000 --- a/kvm-include-hw-s390x-Add-include-files-for-common-IPL-st.patch +++ /dev/null @@ -1,402 +0,0 @@ -From cd805347076eb3d977ad0779d98a019f5abfaa74 Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:47 -0400 -Subject: [PATCH 15/38] include/hw/s390x: Add include files for common IPL - structs -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [14/23] 54bcccfb27e230494b492eede1e074732b4efc17 (thuth/qemu-kvm-cs9) - -Currently, structures defined in both hw/s390x/ipl.h and pc-bios/s390-ccw/iplb.h -must be kept in sync, which is prone to error. Instead, create a new directory -at include/hw/s390x/ipl/ to contain the definitions that must be shared. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-14-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit ba3658adc80a9370257a9c4e114829ec691311e3) ---- - hw/s390x/ipl.h | 104 +----------------------------- - include/hw/s390x/ipl/qipl.h | 123 ++++++++++++++++++++++++++++++++++++ - pc-bios/s390-ccw/Makefile | 2 +- - pc-bios/s390-ccw/iplb.h | 84 ++---------------------- - 4 files changed, 130 insertions(+), 183 deletions(-) - create mode 100644 include/hw/s390x/ipl/qipl.h - -diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h -index b2105b616a..fa394c339d 100644 ---- a/hw/s390x/ipl.h -+++ b/hw/s390x/ipl.h -@@ -16,95 +16,11 @@ - #include "cpu.h" - #include "exec/address-spaces.h" - #include "hw/qdev-core.h" -+#include "hw/s390x/ipl/qipl.h" - #include "qom/object.h" - --struct IPLBlockPVComp { -- uint64_t tweak_pref; -- uint64_t addr; -- uint64_t size; --} QEMU_PACKED; --typedef struct IPLBlockPVComp IPLBlockPVComp; -- --struct IPLBlockPV { -- uint8_t reserved18[87]; /* 0x18 */ -- uint8_t version; /* 0x6f */ -- uint32_t reserved70; /* 0x70 */ -- uint32_t num_comp; /* 0x74 */ -- uint64_t pv_header_addr; /* 0x78 */ -- uint64_t pv_header_len; /* 0x80 */ -- struct IPLBlockPVComp components[0]; --} QEMU_PACKED; --typedef struct IPLBlockPV IPLBlockPV; -- --struct IplBlockCcw { -- uint8_t reserved0[85]; -- uint8_t ssid; -- uint16_t devno; -- uint8_t vm_flags; -- uint8_t reserved3[3]; -- uint32_t vm_parm_len; -- uint8_t nss_name[8]; -- uint8_t vm_parm[64]; -- uint8_t reserved4[8]; --} QEMU_PACKED; --typedef struct IplBlockCcw IplBlockCcw; -- --struct IplBlockFcp { -- uint8_t reserved1[305 - 1]; -- uint8_t opt; -- uint8_t reserved2[3]; -- uint16_t reserved3; -- uint16_t devno; -- uint8_t reserved4[4]; -- uint64_t wwpn; -- uint64_t lun; -- uint32_t bootprog; -- uint8_t reserved5[12]; -- uint64_t br_lba; -- uint32_t scp_data_len; -- uint8_t reserved6[260]; -- uint8_t scp_data[0]; --} QEMU_PACKED; --typedef struct IplBlockFcp IplBlockFcp; -- --struct IplBlockQemuScsi { -- uint32_t lun; -- uint16_t target; -- uint16_t channel; -- uint8_t reserved0[77]; -- uint8_t ssid; -- uint16_t devno; --} QEMU_PACKED; --typedef struct IplBlockQemuScsi IplBlockQemuScsi; -- - #define DIAG308_FLAGS_LP_VALID 0x80 - --union IplParameterBlock { -- struct { -- uint32_t len; -- uint8_t reserved0[3]; -- uint8_t version; -- uint32_t blk0_len; -- uint8_t pbt; -- uint8_t flags; -- uint16_t reserved01; -- uint8_t loadparm[8]; -- union { -- IplBlockCcw ccw; -- IplBlockFcp fcp; -- IPLBlockPV pv; -- IplBlockQemuScsi scsi; -- }; -- } QEMU_PACKED; -- struct { -- uint8_t reserved1[110]; -- uint16_t devno; -- uint8_t reserved2[88]; -- uint8_t reserved_ext[4096 - 200]; -- } QEMU_PACKED; --} QEMU_PACKED; --typedef union IplParameterBlock IplParameterBlock; -- - int s390_ipl_set_loadparm(uint8_t *loadparm); - void s390_ipl_update_diag308(IplParameterBlock *iplb); - int s390_ipl_prepare_pv_header(Error **errp); -@@ -131,24 +47,6 @@ void s390_ipl_clear_reset_request(void); - #define QIPL_FLAG_BM_OPTS_CMD 0x80 - #define QIPL_FLAG_BM_OPTS_ZIPL 0x40 - --/* -- * The QEMU IPL Parameters will be stored at absolute address -- * 204 (0xcc) which means it is 32-bit word aligned but not -- * double-word aligned. Placement of 64-bit data fields in this -- * area must account for their alignment needs. -- * The total size of the struct must never exceed 28 bytes. -- * This definition must be kept in sync with the definition -- * in pc-bios/s390-ccw/iplb.h. -- */ --struct QemuIplParameters { -- uint8_t qipl_flags; -- uint8_t reserved1[3]; -- uint64_t reserved2; -- uint32_t boot_menu_timeout; -- uint8_t reserved3[12]; --} QEMU_PACKED; --typedef struct QemuIplParameters QemuIplParameters; -- - #define TYPE_S390_IPL "s390-ipl" - OBJECT_DECLARE_SIMPLE_TYPE(S390IPLState, S390_IPL) - -diff --git a/include/hw/s390x/ipl/qipl.h b/include/hw/s390x/ipl/qipl.h -new file mode 100644 -index 0000000000..0ef04af027 ---- /dev/null -+++ b/include/hw/s390x/ipl/qipl.h -@@ -0,0 +1,123 @@ -+/* -+ * S/390 boot structures -+ * -+ * Copyright 2024 IBM Corp. -+ * Author(s): Jared Rossi -+ * -+ * This work is licensed under the terms of the GNU GPL, version 2 or (at -+ * your option) any later version. See the COPYING file in the top-level -+ * directory. -+ */ -+ -+#ifndef S390X_QIPL_H -+#define S390X_QIPL_H -+ -+/* Boot Menu flags */ -+#define QIPL_FLAG_BM_OPTS_CMD 0x80 -+#define QIPL_FLAG_BM_OPTS_ZIPL 0x40 -+ -+#define QIPL_ADDRESS 0xcc -+#define LOADPARM_LEN 8 -+ -+/* -+ * The QEMU IPL Parameters will be stored at absolute address -+ * 204 (0xcc) which means it is 32-bit word aligned but not -+ * double-word aligned. Placement of 64-bit data fields in this -+ * area must account for their alignment needs. -+ * The total size of the struct must never exceed 28 bytes. -+ */ -+struct QemuIplParameters { -+ uint8_t qipl_flags; -+ uint8_t reserved1[3]; -+ uint64_t reserved2; -+ uint32_t boot_menu_timeout; -+ uint8_t reserved3[12]; -+} QEMU_PACKED; -+typedef struct QemuIplParameters QemuIplParameters; -+ -+struct IPLBlockPVComp { -+ uint64_t tweak_pref; -+ uint64_t addr; -+ uint64_t size; -+} QEMU_PACKED; -+typedef struct IPLBlockPVComp IPLBlockPVComp; -+ -+struct IPLBlockPV { -+ uint8_t reserved18[87]; /* 0x18 */ -+ uint8_t version; /* 0x6f */ -+ uint32_t reserved70; /* 0x70 */ -+ uint32_t num_comp; /* 0x74 */ -+ uint64_t pv_header_addr; /* 0x78 */ -+ uint64_t pv_header_len; /* 0x80 */ -+ struct IPLBlockPVComp components[0]; -+} QEMU_PACKED; -+typedef struct IPLBlockPV IPLBlockPV; -+ -+struct IplBlockCcw { -+ uint8_t reserved0[85]; -+ uint8_t ssid; -+ uint16_t devno; -+ uint8_t vm_flags; -+ uint8_t reserved3[3]; -+ uint32_t vm_parm_len; -+ uint8_t nss_name[8]; -+ uint8_t vm_parm[64]; -+ uint8_t reserved4[8]; -+} QEMU_PACKED; -+typedef struct IplBlockCcw IplBlockCcw; -+ -+struct IplBlockFcp { -+ uint8_t reserved1[305 - 1]; -+ uint8_t opt; -+ uint8_t reserved2[3]; -+ uint16_t reserved3; -+ uint16_t devno; -+ uint8_t reserved4[4]; -+ uint64_t wwpn; -+ uint64_t lun; -+ uint32_t bootprog; -+ uint8_t reserved5[12]; -+ uint64_t br_lba; -+ uint32_t scp_data_len; -+ uint8_t reserved6[260]; -+ uint8_t scp_data[0]; -+} QEMU_PACKED; -+typedef struct IplBlockFcp IplBlockFcp; -+ -+struct IplBlockQemuScsi { -+ uint32_t lun; -+ uint16_t target; -+ uint16_t channel; -+ uint8_t reserved0[77]; -+ uint8_t ssid; -+ uint16_t devno; -+} QEMU_PACKED; -+typedef struct IplBlockQemuScsi IplBlockQemuScsi; -+ -+union IplParameterBlock { -+ struct { -+ uint32_t len; -+ uint8_t reserved0[3]; -+ uint8_t version; -+ uint32_t blk0_len; -+ uint8_t pbt; -+ uint8_t flags; -+ uint16_t reserved01; -+ uint8_t loadparm[LOADPARM_LEN]; -+ union { -+ IplBlockCcw ccw; -+ IplBlockFcp fcp; -+ IPLBlockPV pv; -+ IplBlockQemuScsi scsi; -+ }; -+ } QEMU_PACKED; -+ struct { -+ uint8_t reserved1[110]; -+ uint16_t devno; -+ uint8_t reserved2[88]; -+ uint8_t reserved_ext[4096 - 200]; -+ } QEMU_PACKED; -+} QEMU_PACKED; -+typedef union IplParameterBlock IplParameterBlock; -+ -+#endif -diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile -index 27cbb354af..db9e8f0892 100644 ---- a/pc-bios/s390-ccw/Makefile -+++ b/pc-bios/s390-ccw/Makefile -@@ -3,7 +3,7 @@ all: build-all - @true - - include config-host.mak --CFLAGS = -O2 -g -+CFLAGS = -O2 -g -I $(SRC_PATH)/../../include/hw/s390x/ipl - MAKEFLAGS += -rR - - GIT_SUBMODULES = roms/SLOF -diff --git a/pc-bios/s390-ccw/iplb.h b/pc-bios/s390-ccw/iplb.h -index 3758698468..16643f5879 100644 ---- a/pc-bios/s390-ccw/iplb.h -+++ b/pc-bios/s390-ccw/iplb.h -@@ -12,88 +12,14 @@ - #ifndef IPLB_H - #define IPLB_H - --#define LOADPARM_LEN 8 -+#ifndef QEMU_PACKED -+#define QEMU_PACKED __attribute__((packed)) -+#endif - --struct IplBlockCcw { -- uint8_t reserved0[85]; -- uint8_t ssid; -- uint16_t devno; -- uint8_t vm_flags; -- uint8_t reserved3[3]; -- uint32_t vm_parm_len; -- uint8_t nss_name[8]; -- uint8_t vm_parm[64]; -- uint8_t reserved4[8]; --} __attribute__ ((packed)); --typedef struct IplBlockCcw IplBlockCcw; -- --struct IplBlockFcp { -- uint8_t reserved1[305 - 1]; -- uint8_t opt; -- uint8_t reserved2[3]; -- uint16_t reserved3; -- uint16_t devno; -- uint8_t reserved4[4]; -- uint64_t wwpn; -- uint64_t lun; -- uint32_t bootprog; -- uint8_t reserved5[12]; -- uint64_t br_lba; -- uint32_t scp_data_len; -- uint8_t reserved6[260]; -- uint8_t scp_data[]; --} __attribute__ ((packed)); --typedef struct IplBlockFcp IplBlockFcp; -- --struct IplBlockQemuScsi { -- uint32_t lun; -- uint16_t target; -- uint16_t channel; -- uint8_t reserved0[77]; -- uint8_t ssid; -- uint16_t devno; --} __attribute__ ((packed)); --typedef struct IplBlockQemuScsi IplBlockQemuScsi; -- --struct IplParameterBlock { -- uint32_t len; -- uint8_t reserved0[3]; -- uint8_t version; -- uint32_t blk0_len; -- uint8_t pbt; -- uint8_t flags; -- uint16_t reserved01; -- uint8_t loadparm[LOADPARM_LEN]; -- union { -- IplBlockCcw ccw; -- IplBlockFcp fcp; -- IplBlockQemuScsi scsi; -- }; --} __attribute__ ((packed)); --typedef struct IplParameterBlock IplParameterBlock; -- --extern IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); -- --#define QIPL_ADDRESS 0xcc -- --/* Boot Menu flags */ --#define QIPL_FLAG_BM_OPTS_CMD 0x80 --#define QIPL_FLAG_BM_OPTS_ZIPL 0x40 -- --/* -- * This definition must be kept in sync with the definition -- * in hw/s390x/ipl.h -- */ --struct QemuIplParameters { -- uint8_t qipl_flags; -- uint8_t reserved1[3]; -- uint64_t reserved2; -- uint32_t boot_menu_timeout; -- uint8_t reserved3[12]; --} __attribute__ ((packed)); --typedef struct QemuIplParameters QemuIplParameters; -+#include - - extern QemuIplParameters qipl; -+extern IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); - - #define S390_IPL_TYPE_FCP 0x00 - #define S390_IPL_TYPE_CCW 0x02 --- -2.39.3 - diff --git a/kvm-iotests-Add-NBD-based-tests-for-inactive-nodes.patch b/kvm-iotests-Add-NBD-based-tests-for-inactive-nodes.patch deleted file mode 100644 index d1911fc..0000000 --- a/kvm-iotests-Add-NBD-based-tests-for-inactive-nodes.patch +++ /dev/null @@ -1,609 +0,0 @@ -From 693f96281609b133244802fbb77f8e35061a1648 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:14:07 +0100 -Subject: [PATCH 22/22] iotests: Add (NBD-based) tests for inactive nodes - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [22/22] 4715b88d95aefc8b7fdf74f3acb4a45811faea39 (kmwolf/centos-qemu-kvm) - -This tests different types of operations on inactive block nodes -(including graph changes, block jobs and NBD exports) to make sure that -users manually activating and inactivating nodes doesn't break things. - -Support for inactive nodes in other export types will have to come with -separate test cases because they have different dependencies like blkio -or root permissions and we don't want to disable this basic test when -they are not fulfilled. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Message-ID: <20250204211407.381505-17-kwolf@redhat.com> -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Signed-off-by: Kevin Wolf -(cherry picked from commit bbf105ef3cc48fff282789e9bf56b7a81e1407bd) -Signed-off-by: Kevin Wolf ---- - tests/qemu-iotests/iotests.py | 4 + - tests/qemu-iotests/tests/inactive-node-nbd | 303 ++++++++++++++++++ - .../qemu-iotests/tests/inactive-node-nbd.out | 239 ++++++++++++++ - 3 files changed, 546 insertions(+) - create mode 100755 tests/qemu-iotests/tests/inactive-node-nbd - create mode 100644 tests/qemu-iotests/tests/inactive-node-nbd.out - -diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py -index 1a42aa1416..c8cb028c2d 100644 ---- a/tests/qemu-iotests/iotests.py -+++ b/tests/qemu-iotests/iotests.py -@@ -913,6 +913,10 @@ def add_incoming(self, addr): - self._args.append(addr) - return self - -+ def add_paused(self): -+ self._args.append('-S') -+ return self -+ - def hmp(self, command_line: str, use_log: bool = False) -> QMPMessage: - cmd = 'human-monitor-command' - kwargs: Dict[str, Any] = {'command-line': command_line} -diff --git a/tests/qemu-iotests/tests/inactive-node-nbd b/tests/qemu-iotests/tests/inactive-node-nbd -new file mode 100755 -index 0000000000..a95b37e796 ---- /dev/null -+++ b/tests/qemu-iotests/tests/inactive-node-nbd -@@ -0,0 +1,303 @@ -+#!/usr/bin/env python3 -+# group: rw quick -+# -+# Copyright (C) Red Hat, Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+# Creator/Owner: Kevin Wolf -+ -+import iotests -+ -+from iotests import QemuIoInteractive -+from iotests import filter_qemu_io, filter_qtest, filter_qmp_testfiles -+ -+iotests.script_initialize(supported_fmts=['generic'], -+ supported_protocols=['file'], -+ supported_platforms=['linux']) -+ -+def get_export(node_name='disk-fmt', allow_inactive=None): -+ exp = { -+ 'id': 'exp0', -+ 'type': 'nbd', -+ 'node-name': node_name, -+ 'writable': True, -+ } -+ -+ if allow_inactive is not None: -+ exp['allow-inactive'] = allow_inactive -+ -+ return exp -+ -+def node_is_active(_vm, node_name): -+ nodes = _vm.cmd('query-named-block-nodes', flat=True) -+ node = next(n for n in nodes if n['node-name'] == node_name) -+ return node['active'] -+ -+with iotests.FilePath('disk.img') as path, \ -+ iotests.FilePath('snap.qcow2') as snap_path, \ -+ iotests.FilePath('snap2.qcow2') as snap2_path, \ -+ iotests.FilePath('target.img') as target_path, \ -+ iotests.FilePath('nbd.sock', base_dir=iotests.sock_dir) as nbd_sock, \ -+ iotests.VM() as vm: -+ -+ img_size = '10M' -+ -+ iotests.log('Preparing disk...') -+ iotests.qemu_img_create('-f', iotests.imgfmt, path, img_size) -+ iotests.qemu_img_create('-f', iotests.imgfmt, target_path, img_size) -+ -+ iotests.qemu_img_create('-f', 'qcow2', '-b', path, '-F', iotests.imgfmt, -+ snap_path) -+ iotests.qemu_img_create('-f', 'qcow2', '-b', snap_path, '-F', 'qcow2', -+ snap2_path) -+ -+ iotests.log('Launching VM...') -+ vm.add_blockdev(f'file,node-name=disk-file,filename={path}') -+ vm.add_blockdev(f'{iotests.imgfmt},file=disk-file,node-name=disk-fmt,' -+ 'active=off') -+ vm.add_blockdev(f'file,node-name=target-file,filename={target_path}') -+ vm.add_blockdev(f'{iotests.imgfmt},file=target-file,node-name=target-fmt') -+ vm.add_blockdev(f'file,node-name=snap-file,filename={snap_path}') -+ vm.add_blockdev(f'file,node-name=snap2-file,filename={snap2_path}') -+ -+ # Actually running the VM activates all images -+ vm.add_paused() -+ -+ vm.launch() -+ vm.qmp_log('nbd-server-start', -+ addr={'type': 'unix', 'data':{'path': nbd_sock}}, -+ filters=[filter_qmp_testfiles]) -+ -+ iotests.log('\n=== Creating export of inactive node ===') -+ -+ iotests.log('\nExports activate nodes without allow-inactive') -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ vm.qmp_log('block-export-add', **get_export()) -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ vm.qmp_log('query-block-exports') -+ vm.qmp_log('block-export-del', id='exp0') -+ vm.event_wait('BLOCK_EXPORT_DELETED') -+ vm.qmp_log('query-block-exports') -+ -+ iotests.log('\nExports activate nodes with allow-inactive=false') -+ vm.qmp_log('blockdev-set-active', node_name='disk-fmt', active=False) -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ vm.qmp_log('block-export-add', **get_export(allow_inactive=False)) -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ vm.qmp_log('query-block-exports') -+ vm.qmp_log('block-export-del', id='exp0') -+ vm.event_wait('BLOCK_EXPORT_DELETED') -+ vm.qmp_log('query-block-exports') -+ -+ iotests.log('\nExport leaves nodes inactive with allow-inactive=true') -+ vm.qmp_log('blockdev-set-active', node_name='disk-fmt', active=False) -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ vm.qmp_log('block-export-add', **get_export(allow_inactive=True)) -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ vm.qmp_log('query-block-exports') -+ vm.qmp_log('block-export-del', id='exp0') -+ vm.event_wait('BLOCK_EXPORT_DELETED') -+ vm.qmp_log('query-block-exports') -+ -+ iotests.log('\n=== Inactivating node with existing export ===') -+ -+ iotests.log('\nInactivating nodes with an export fails without ' -+ 'allow-inactive') -+ vm.qmp_log('blockdev-set-active', node_name='disk-fmt', active=True) -+ vm.qmp_log('block-export-add', **get_export(node_name='disk-fmt')) -+ vm.qmp_log('blockdev-set-active', node_name='disk-fmt', active=False) -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ vm.qmp_log('query-block-exports') -+ vm.qmp_log('block-export-del', id='exp0') -+ vm.event_wait('BLOCK_EXPORT_DELETED') -+ vm.qmp_log('query-block-exports') -+ -+ iotests.log('\nInactivating nodes with an export fails with ' -+ 'allow-inactive=false') -+ vm.qmp_log('blockdev-set-active', node_name='disk-fmt', active=True) -+ vm.qmp_log('block-export-add', -+ **get_export(node_name='disk-fmt', allow_inactive=False)) -+ vm.qmp_log('blockdev-set-active', node_name='disk-fmt', active=False) -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ vm.qmp_log('query-block-exports') -+ vm.qmp_log('block-export-del', id='exp0') -+ vm.event_wait('BLOCK_EXPORT_DELETED') -+ vm.qmp_log('query-block-exports') -+ -+ iotests.log('\nInactivating nodes with an export works with ' -+ 'allow-inactive=true') -+ vm.qmp_log('blockdev-set-active', node_name='disk-fmt', active=True) -+ vm.qmp_log('block-export-add', -+ **get_export(node_name='disk-fmt', allow_inactive=True)) -+ vm.qmp_log('blockdev-set-active', node_name='disk-fmt', active=False) -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ vm.qmp_log('query-block-exports') -+ vm.qmp_log('block-export-del', id='exp0') -+ vm.event_wait('BLOCK_EXPORT_DELETED') -+ vm.qmp_log('query-block-exports') -+ -+ iotests.log('\n=== Inactive nodes with parent ===') -+ -+ iotests.log('\nInactivating nodes with an active parent fails') -+ vm.qmp_log('blockdev-set-active', node_name='disk-fmt', active=True) -+ vm.qmp_log('blockdev-set-active', node_name='disk-file', active=False) -+ iotests.log('disk-file active: %s' % node_is_active(vm, 'disk-file')) -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ -+ iotests.log('\nInactivating nodes with an inactive parent works') -+ vm.qmp_log('blockdev-set-active', node_name='disk-fmt', active=False) -+ vm.qmp_log('blockdev-set-active', node_name='disk-file', active=False) -+ iotests.log('disk-file active: %s' % node_is_active(vm, 'disk-file')) -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ -+ iotests.log('\nCreating active parent node with an inactive child fails') -+ vm.qmp_log('blockdev-add', driver='raw', file='disk-fmt', -+ node_name='disk-filter') -+ vm.qmp_log('blockdev-add', driver='raw', file='disk-fmt', -+ node_name='disk-filter', active=True) -+ -+ iotests.log('\nCreating inactive parent node with an inactive child works') -+ vm.qmp_log('blockdev-add', driver='raw', file='disk-fmt', -+ node_name='disk-filter', active=False) -+ vm.qmp_log('blockdev-del', node_name='disk-filter') -+ -+ iotests.log('\n=== Resizing an inactive node ===') -+ vm.qmp_log('block_resize', node_name='disk-fmt', size=16*1024*1024) -+ -+ iotests.log('\n=== Taking a snapshot of an inactive node ===') -+ -+ iotests.log('\nActive overlay over inactive backing file automatically ' -+ 'makes both inactive for compatibility') -+ vm.qmp_log('blockdev-add', driver='qcow2', node_name='snap-fmt', -+ file='snap-file', backing=None) -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ iotests.log('snap-fmt active: %s' % node_is_active(vm, 'snap-fmt')) -+ vm.qmp_log('blockdev-snapshot', node='disk-fmt', overlay='snap-fmt') -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ iotests.log('snap-fmt active: %s' % node_is_active(vm, 'snap-fmt')) -+ vm.qmp_log('blockdev-del', node_name='snap-fmt') -+ -+ iotests.log('\nInactive overlay over inactive backing file just works') -+ vm.qmp_log('blockdev-add', driver='qcow2', node_name='snap-fmt', -+ file='snap-file', backing=None, active=False) -+ vm.qmp_log('blockdev-snapshot', node='disk-fmt', overlay='snap-fmt') -+ -+ iotests.log('\n=== Block jobs with inactive nodes ===') -+ -+ iotests.log('\nStreaming into an inactive node') -+ vm.qmp_log('block-stream', device='snap-fmt', -+ filters=[iotests.filter_qmp_generated_node_ids]) -+ -+ iotests.log('\nCommitting an inactive root node (active commit)') -+ vm.qmp_log('block-commit', job_id='job0', device='snap-fmt', -+ filters=[iotests.filter_qmp_generated_node_ids]) -+ -+ iotests.log('\nCommitting an inactive intermediate node to inactive base') -+ vm.qmp_log('blockdev-add', driver='qcow2', node_name='snap2-fmt', -+ file='snap2-file', backing='snap-fmt', active=False) -+ -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ iotests.log('snap-fmt active: %s' % node_is_active(vm, 'snap-fmt')) -+ iotests.log('snap2-fmt active: %s' % node_is_active(vm, 'snap2-fmt')) -+ -+ vm.qmp_log('block-commit', job_id='job0', device='snap2-fmt', -+ top_node='snap-fmt', -+ filters=[iotests.filter_qmp_generated_node_ids]) -+ -+ iotests.log('\nCommitting an inactive intermediate node to active base') -+ vm.qmp_log('blockdev-set-active', node_name='disk-fmt', active=True) -+ vm.qmp_log('block-commit', job_id='job0', device='snap2-fmt', -+ top_node='snap-fmt', -+ filters=[iotests.filter_qmp_generated_node_ids]) -+ -+ iotests.log('\nMirror from inactive source to active target') -+ vm.qmp_log('blockdev-mirror', job_id='job0', device='snap2-fmt', -+ target='target-fmt', sync='full', -+ filters=[iotests.filter_qmp_generated_node_ids]) -+ -+ iotests.log('\nMirror from active source to inactive target') -+ -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ iotests.log('snap-fmt active: %s' % node_is_active(vm, 'snap-fmt')) -+ iotests.log('snap2-fmt active: %s' % node_is_active(vm, 'snap2-fmt')) -+ iotests.log('target-fmt active: %s' % node_is_active(vm, 'target-fmt')) -+ -+ # Activating snap2-fmt recursively activates the whole backing chain -+ vm.qmp_log('blockdev-set-active', node_name='snap2-fmt', active=True) -+ vm.qmp_log('blockdev-set-active', node_name='target-fmt', active=False) -+ -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ iotests.log('snap-fmt active: %s' % node_is_active(vm, 'snap-fmt')) -+ iotests.log('snap2-fmt active: %s' % node_is_active(vm, 'snap2-fmt')) -+ iotests.log('target-fmt active: %s' % node_is_active(vm, 'target-fmt')) -+ -+ vm.qmp_log('blockdev-mirror', job_id='job0', device='snap2-fmt', -+ target='target-fmt', sync='full', -+ filters=[iotests.filter_qmp_generated_node_ids]) -+ -+ iotests.log('\nBackup from active source to inactive target') -+ -+ vm.qmp_log('blockdev-backup', job_id='job0', device='snap2-fmt', -+ target='target-fmt', sync='full', -+ filters=[iotests.filter_qmp_generated_node_ids]) -+ -+ iotests.log('\nBackup from inactive source to active target') -+ -+ # Inactivating snap2-fmt recursively inactivates the whole backing chain -+ vm.qmp_log('blockdev-set-active', node_name='snap2-fmt', active=False) -+ vm.qmp_log('blockdev-set-active', node_name='target-fmt', active=True) -+ -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ iotests.log('snap-fmt active: %s' % node_is_active(vm, 'snap-fmt')) -+ iotests.log('snap2-fmt active: %s' % node_is_active(vm, 'snap2-fmt')) -+ iotests.log('target-fmt active: %s' % node_is_active(vm, 'target-fmt')) -+ -+ vm.qmp_log('blockdev-backup', job_id='job0', device='snap2-fmt', -+ target='target-fmt', sync='full', -+ filters=[iotests.filter_qmp_generated_node_ids]) -+ -+ iotests.log('\n=== Accessing export on inactive node ===') -+ -+ # Use the target node because it has the right image format and isn't the -+ # (read-only) backing file of a qcow2 node -+ vm.qmp_log('blockdev-set-active', node_name='target-fmt', active=False) -+ vm.qmp_log('block-export-add', -+ **get_export(node_name='target-fmt', allow_inactive=True)) -+ -+ # The read should succeed, everything else should fail gracefully -+ qemu_io = QemuIoInteractive('-f', 'raw', -+ f'nbd+unix:///target-fmt?socket={nbd_sock}') -+ iotests.log(qemu_io.cmd('read 0 64k'), filters=[filter_qemu_io]) -+ iotests.log(qemu_io.cmd('write 0 64k'), filters=[filter_qemu_io]) -+ iotests.log(qemu_io.cmd('write -z 0 64k'), filters=[filter_qemu_io]) -+ iotests.log(qemu_io.cmd('write -zu 0 64k'), filters=[filter_qemu_io]) -+ iotests.log(qemu_io.cmd('discard 0 64k'), filters=[filter_qemu_io]) -+ iotests.log(qemu_io.cmd('flush'), filters=[filter_qemu_io]) -+ iotests.log(qemu_io.cmd('map'), filters=[filter_qemu_io]) -+ qemu_io.close() -+ -+ iotests.log('\n=== Resuming VM activates all images ===') -+ vm.qmp_log('cont') -+ -+ iotests.log('disk-fmt active: %s' % node_is_active(vm, 'disk-fmt')) -+ iotests.log('snap-fmt active: %s' % node_is_active(vm, 'snap-fmt')) -+ iotests.log('snap2-fmt active: %s' % node_is_active(vm, 'snap2-fmt')) -+ iotests.log('target-fmt active: %s' % node_is_active(vm, 'target-fmt')) -+ -+ iotests.log('\nShutting down...') -+ vm.shutdown() -+ log = vm.get_log() -+ if log: -+ iotests.log(log, [filter_qtest, filter_qemu_io]) -diff --git a/tests/qemu-iotests/tests/inactive-node-nbd.out b/tests/qemu-iotests/tests/inactive-node-nbd.out -new file mode 100644 -index 0000000000..a458b4fc05 ---- /dev/null -+++ b/tests/qemu-iotests/tests/inactive-node-nbd.out -@@ -0,0 +1,239 @@ -+Preparing disk... -+Launching VM... -+{"execute": "nbd-server-start", "arguments": {"addr": {"data": {"path": "SOCK_DIR/PID-nbd.sock"}, "type": "unix"}}} -+{"return": {}} -+ -+=== Creating export of inactive node === -+ -+Exports activate nodes without allow-inactive -+disk-fmt active: False -+{"execute": "block-export-add", "arguments": {"id": "exp0", "node-name": "disk-fmt", "type": "nbd", "writable": true}} -+{"return": {}} -+disk-fmt active: True -+{"execute": "query-block-exports", "arguments": {}} -+{"return": [{"id": "exp0", "node-name": "disk-fmt", "shutting-down": false, "type": "nbd"}]} -+{"execute": "block-export-del", "arguments": {"id": "exp0"}} -+{"return": {}} -+{"execute": "query-block-exports", "arguments": {}} -+{"return": []} -+ -+Exports activate nodes with allow-inactive=false -+{"execute": "blockdev-set-active", "arguments": {"active": false, "node-name": "disk-fmt"}} -+{"return": {}} -+disk-fmt active: False -+{"execute": "block-export-add", "arguments": {"allow-inactive": false, "id": "exp0", "node-name": "disk-fmt", "type": "nbd", "writable": true}} -+{"return": {}} -+disk-fmt active: True -+{"execute": "query-block-exports", "arguments": {}} -+{"return": [{"id": "exp0", "node-name": "disk-fmt", "shutting-down": false, "type": "nbd"}]} -+{"execute": "block-export-del", "arguments": {"id": "exp0"}} -+{"return": {}} -+{"execute": "query-block-exports", "arguments": {}} -+{"return": []} -+ -+Export leaves nodes inactive with allow-inactive=true -+{"execute": "blockdev-set-active", "arguments": {"active": false, "node-name": "disk-fmt"}} -+{"return": {}} -+disk-fmt active: False -+{"execute": "block-export-add", "arguments": {"allow-inactive": true, "id": "exp0", "node-name": "disk-fmt", "type": "nbd", "writable": true}} -+{"return": {}} -+disk-fmt active: False -+{"execute": "query-block-exports", "arguments": {}} -+{"return": [{"id": "exp0", "node-name": "disk-fmt", "shutting-down": false, "type": "nbd"}]} -+{"execute": "block-export-del", "arguments": {"id": "exp0"}} -+{"return": {}} -+{"execute": "query-block-exports", "arguments": {}} -+{"return": []} -+ -+=== Inactivating node with existing export === -+ -+Inactivating nodes with an export fails without allow-inactive -+{"execute": "blockdev-set-active", "arguments": {"active": true, "node-name": "disk-fmt"}} -+{"return": {}} -+{"execute": "block-export-add", "arguments": {"id": "exp0", "node-name": "disk-fmt", "type": "nbd", "writable": true}} -+{"return": {}} -+{"execute": "blockdev-set-active", "arguments": {"active": false, "node-name": "disk-fmt"}} -+{"error": {"class": "GenericError", "desc": "Failed to inactivate node: Operation not permitted"}} -+disk-fmt active: True -+{"execute": "query-block-exports", "arguments": {}} -+{"return": [{"id": "exp0", "node-name": "disk-fmt", "shutting-down": false, "type": "nbd"}]} -+{"execute": "block-export-del", "arguments": {"id": "exp0"}} -+{"return": {}} -+{"execute": "query-block-exports", "arguments": {}} -+{"return": []} -+ -+Inactivating nodes with an export fails with allow-inactive=false -+{"execute": "blockdev-set-active", "arguments": {"active": true, "node-name": "disk-fmt"}} -+{"return": {}} -+{"execute": "block-export-add", "arguments": {"allow-inactive": false, "id": "exp0", "node-name": "disk-fmt", "type": "nbd", "writable": true}} -+{"return": {}} -+{"execute": "blockdev-set-active", "arguments": {"active": false, "node-name": "disk-fmt"}} -+{"error": {"class": "GenericError", "desc": "Failed to inactivate node: Operation not permitted"}} -+disk-fmt active: True -+{"execute": "query-block-exports", "arguments": {}} -+{"return": [{"id": "exp0", "node-name": "disk-fmt", "shutting-down": false, "type": "nbd"}]} -+{"execute": "block-export-del", "arguments": {"id": "exp0"}} -+{"return": {}} -+{"execute": "query-block-exports", "arguments": {}} -+{"return": []} -+ -+Inactivating nodes with an export works with allow-inactive=true -+{"execute": "blockdev-set-active", "arguments": {"active": true, "node-name": "disk-fmt"}} -+{"return": {}} -+{"execute": "block-export-add", "arguments": {"allow-inactive": true, "id": "exp0", "node-name": "disk-fmt", "type": "nbd", "writable": true}} -+{"return": {}} -+{"execute": "blockdev-set-active", "arguments": {"active": false, "node-name": "disk-fmt"}} -+{"return": {}} -+disk-fmt active: False -+{"execute": "query-block-exports", "arguments": {}} -+{"return": [{"id": "exp0", "node-name": "disk-fmt", "shutting-down": false, "type": "nbd"}]} -+{"execute": "block-export-del", "arguments": {"id": "exp0"}} -+{"return": {}} -+{"execute": "query-block-exports", "arguments": {}} -+{"return": []} -+ -+=== Inactive nodes with parent === -+ -+Inactivating nodes with an active parent fails -+{"execute": "blockdev-set-active", "arguments": {"active": true, "node-name": "disk-fmt"}} -+{"return": {}} -+{"execute": "blockdev-set-active", "arguments": {"active": false, "node-name": "disk-file"}} -+{"error": {"class": "GenericError", "desc": "Node has active parent node"}} -+disk-file active: True -+disk-fmt active: True -+ -+Inactivating nodes with an inactive parent works -+{"execute": "blockdev-set-active", "arguments": {"active": false, "node-name": "disk-fmt"}} -+{"return": {}} -+{"execute": "blockdev-set-active", "arguments": {"active": false, "node-name": "disk-file"}} -+{"return": {}} -+disk-file active: False -+disk-fmt active: False -+ -+Creating active parent node with an inactive child fails -+{"execute": "blockdev-add", "arguments": {"driver": "raw", "file": "disk-fmt", "node-name": "disk-filter"}} -+{"error": {"class": "GenericError", "desc": "Inactive 'disk-fmt' can't be a file child of active 'disk-filter'"}} -+{"execute": "blockdev-add", "arguments": {"active": true, "driver": "raw", "file": "disk-fmt", "node-name": "disk-filter"}} -+{"error": {"class": "GenericError", "desc": "Inactive 'disk-fmt' can't be a file child of active 'disk-filter'"}} -+ -+Creating inactive parent node with an inactive child works -+{"execute": "blockdev-add", "arguments": {"active": false, "driver": "raw", "file": "disk-fmt", "node-name": "disk-filter"}} -+{"return": {}} -+{"execute": "blockdev-del", "arguments": {"node-name": "disk-filter"}} -+{"return": {}} -+ -+=== Resizing an inactive node === -+{"execute": "block_resize", "arguments": {"node-name": "disk-fmt", "size": 16777216}} -+{"error": {"class": "GenericError", "desc": "Permission 'resize' unavailable on inactive node"}} -+ -+=== Taking a snapshot of an inactive node === -+ -+Active overlay over inactive backing file automatically makes both inactive for compatibility -+{"execute": "blockdev-add", "arguments": {"backing": null, "driver": "qcow2", "file": "snap-file", "node-name": "snap-fmt"}} -+{"return": {}} -+disk-fmt active: False -+snap-fmt active: True -+{"execute": "blockdev-snapshot", "arguments": {"node": "disk-fmt", "overlay": "snap-fmt"}} -+{"return": {}} -+disk-fmt active: False -+snap-fmt active: False -+{"execute": "blockdev-del", "arguments": {"node-name": "snap-fmt"}} -+{"return": {}} -+ -+Inactive overlay over inactive backing file just works -+{"execute": "blockdev-add", "arguments": {"active": false, "backing": null, "driver": "qcow2", "file": "snap-file", "node-name": "snap-fmt"}} -+{"return": {}} -+{"execute": "blockdev-snapshot", "arguments": {"node": "disk-fmt", "overlay": "snap-fmt"}} -+{"return": {}} -+ -+=== Block jobs with inactive nodes === -+ -+Streaming into an inactive node -+{"execute": "block-stream", "arguments": {"device": "snap-fmt"}} -+{"error": {"class": "GenericError", "desc": "Could not create node: Inactive 'snap-fmt' can't be a file child of active 'NODE_NAME'"}} -+ -+Committing an inactive root node (active commit) -+{"execute": "block-commit", "arguments": {"device": "snap-fmt", "job-id": "job0"}} -+{"error": {"class": "GenericError", "desc": "Inactive 'snap-fmt' can't be a backing child of active 'NODE_NAME'"}} -+ -+Committing an inactive intermediate node to inactive base -+{"execute": "blockdev-add", "arguments": {"active": false, "backing": "snap-fmt", "driver": "qcow2", "file": "snap2-file", "node-name": "snap2-fmt"}} -+{"return": {}} -+disk-fmt active: False -+snap-fmt active: False -+snap2-fmt active: False -+{"execute": "block-commit", "arguments": {"device": "snap2-fmt", "job-id": "job0", "top-node": "snap-fmt"}} -+{"error": {"class": "GenericError", "desc": "Inactive 'snap-fmt' can't be a backing child of active 'NODE_NAME'"}} -+ -+Committing an inactive intermediate node to active base -+{"execute": "blockdev-set-active", "arguments": {"active": true, "node-name": "disk-fmt"}} -+{"return": {}} -+{"execute": "block-commit", "arguments": {"device": "snap2-fmt", "job-id": "job0", "top-node": "snap-fmt"}} -+{"error": {"class": "GenericError", "desc": "Inactive 'snap-fmt' can't be a backing child of active 'NODE_NAME'"}} -+ -+Mirror from inactive source to active target -+{"execute": "blockdev-mirror", "arguments": {"device": "snap2-fmt", "job-id": "job0", "sync": "full", "target": "target-fmt"}} -+{"error": {"class": "GenericError", "desc": "Inactive 'snap2-fmt' can't be a backing child of active 'NODE_NAME'"}} -+ -+Mirror from active source to inactive target -+disk-fmt active: True -+snap-fmt active: False -+snap2-fmt active: False -+target-fmt active: True -+{"execute": "blockdev-set-active", "arguments": {"active": true, "node-name": "snap2-fmt"}} -+{"return": {}} -+{"execute": "blockdev-set-active", "arguments": {"active": false, "node-name": "target-fmt"}} -+{"return": {}} -+disk-fmt active: True -+snap-fmt active: True -+snap2-fmt active: True -+target-fmt active: False -+{"execute": "blockdev-mirror", "arguments": {"device": "snap2-fmt", "job-id": "job0", "sync": "full", "target": "target-fmt"}} -+{"error": {"class": "GenericError", "desc": "Permission 'write' unavailable on inactive node"}} -+ -+Backup from active source to inactive target -+{"execute": "blockdev-backup", "arguments": {"device": "snap2-fmt", "job-id": "job0", "sync": "full", "target": "target-fmt"}} -+{"error": {"class": "GenericError", "desc": "Could not create node: Inactive 'target-fmt' can't be a target child of active 'NODE_NAME'"}} -+ -+Backup from inactive source to active target -+{"execute": "blockdev-set-active", "arguments": {"active": false, "node-name": "snap2-fmt"}} -+{"return": {}} -+{"execute": "blockdev-set-active", "arguments": {"active": true, "node-name": "target-fmt"}} -+{"return": {}} -+disk-fmt active: False -+snap-fmt active: False -+snap2-fmt active: False -+target-fmt active: True -+{"execute": "blockdev-backup", "arguments": {"device": "snap2-fmt", "job-id": "job0", "sync": "full", "target": "target-fmt"}} -+{"error": {"class": "GenericError", "desc": "Could not create node: Inactive 'snap2-fmt' can't be a file child of active 'NODE_NAME'"}} -+ -+=== Accessing export on inactive node === -+{"execute": "blockdev-set-active", "arguments": {"active": false, "node-name": "target-fmt"}} -+{"return": {}} -+{"execute": "block-export-add", "arguments": {"allow-inactive": true, "id": "exp0", "node-name": "target-fmt", "type": "nbd", "writable": true}} -+{"return": {}} -+read 65536/65536 bytes at offset 0 -+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -+ -+write failed: Operation not permitted -+ -+write failed: Operation not permitted -+ -+write failed: Operation not permitted -+ -+discard failed: Operation not permitted -+ -+ -+qemu-io: Failed to get allocation status: Operation not permitted -+ -+ -+=== Resuming VM activates all images === -+{"execute": "cont", "arguments": {}} -+{"return": {}} -+disk-fmt active: True -+snap-fmt active: True -+snap2-fmt active: True -+target-fmt active: True -+ -+Shutting down... -+ --- -2.39.3 - diff --git a/kvm-iotests-Add-filter_qtest.patch b/kvm-iotests-Add-filter_qtest.patch deleted file mode 100644 index 3b2d259..0000000 --- a/kvm-iotests-Add-filter_qtest.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 30350ce735c55c416d98a566370bc43b7358ee1d Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:14:05 +0100 -Subject: [PATCH 20/22] iotests: Add filter_qtest() - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [20/22] 46aecb1c268dcf666c8c7ef8e0d2f3fecaa934e2 (kmwolf/centos-qemu-kvm) - -The open-coded form of this filter has been copied into enough tests -that it's better to move it into iotests.py. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Message-ID: <20250204211407.381505-15-kwolf@redhat.com> -Reviewed-by: Stefan Hajnoczi -Signed-off-by: Kevin Wolf -(cherry picked from commit ed26db83673f4a190332d2a378e2f6e342b8904d) -Signed-off-by: Kevin Wolf ---- - tests/qemu-iotests/041 | 4 +--- - tests/qemu-iotests/165 | 4 +--- - tests/qemu-iotests/iotests.py | 4 ++++ - tests/qemu-iotests/tests/copy-before-write | 3 +-- - tests/qemu-iotests/tests/migrate-bitmaps-test | 7 +++---- - 5 files changed, 10 insertions(+), 12 deletions(-) - -diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 -index 98d17b1388..8452845f44 100755 ---- a/tests/qemu-iotests/041 -+++ b/tests/qemu-iotests/041 -@@ -1100,10 +1100,8 @@ class TestRepairQuorum(iotests.QMPTestCase): - - # Check the full error message now - self.vm.shutdown() -- log = self.vm.get_log() -- log = re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', log) -+ log = iotests.filter_qtest(self.vm.get_log()) - log = re.sub(r'^Formatting.*\n', '', log) -- log = re.sub(r'\n\[I \+\d+\.\d+\] CLOSED\n?$', '', log) - log = re.sub(r'^%s: ' % os.path.basename(iotests.qemu_prog), '', log) - - self.assertEqual(log, -diff --git a/tests/qemu-iotests/165 b/tests/qemu-iotests/165 -index b24907a62f..b3b1709d71 100755 ---- a/tests/qemu-iotests/165 -+++ b/tests/qemu-iotests/165 -@@ -82,9 +82,7 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase): - self.vm.shutdown() - - #catch 'Persistent bitmaps are lost' possible error -- log = self.vm.get_log() -- log = re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', log) -- log = re.sub(r'\[I \+\d+\.\d+\] CLOSED\n?$', '', log) -+ log = iotests.filter_qtest(self.vm.get_log()) - if log: - print(log) - -diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py -index ea48af4a7b..1a42aa1416 100644 ---- a/tests/qemu-iotests/iotests.py -+++ b/tests/qemu-iotests/iotests.py -@@ -701,6 +701,10 @@ def _filter(_key, value): - def filter_nbd_exports(output: str) -> str: - return re.sub(r'((min|opt|max) block): [0-9]+', r'\1: XXX', output) - -+def filter_qtest(output: str) -> str: -+ output = re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', output) -+ output = re.sub(r'\n?\[I \+\d+\.\d+\] CLOSED\n?$', '', output) -+ return output - - Msg = TypeVar('Msg', Dict[str, Any], List[Any], str) - -diff --git a/tests/qemu-iotests/tests/copy-before-write b/tests/qemu-iotests/tests/copy-before-write -index d33bea577d..498c558008 100755 ---- a/tests/qemu-iotests/tests/copy-before-write -+++ b/tests/qemu-iotests/tests/copy-before-write -@@ -95,8 +95,7 @@ class TestCbwError(iotests.QMPTestCase): - - self.vm.shutdown() - log = self.vm.get_log() -- log = re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', log) -- log = re.sub(r'\[I \+\d+\.\d+\] CLOSED\n?$', '', log) -+ log = iotests.filter_qtest(log) - log = iotests.filter_qemu_io(log) - return log - -diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-test b/tests/qemu-iotests/tests/migrate-bitmaps-test -index f98e721e97..8fb4099201 100755 ---- a/tests/qemu-iotests/tests/migrate-bitmaps-test -+++ b/tests/qemu-iotests/tests/migrate-bitmaps-test -@@ -122,11 +122,10 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase): - - # catch 'Could not reopen qcow2 layer: Bitmap already exists' - # possible error -- log = self.vm_a.get_log() -- log = re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', log) -- log = re.sub(r'^(wrote .* bytes at offset .*\n.*KiB.*ops.*sec.*\n){3}', -+ log = iotests.filter_qtest(self.vm_a.get_log()) -+ log = re.sub(r'^(wrote .* bytes at offset .*\n' -+ r'.*KiB.*ops.*sec.*\n?){3}', - '', log) -- log = re.sub(r'\[I \+\d+\.\d+\] CLOSED\n?$', '', log) - self.assertEqual(log, '') - - # test that bitmap is still persistent --- -2.39.3 - diff --git a/kvm-iotests-Add-qsd-migrate-case.patch b/kvm-iotests-Add-qsd-migrate-case.patch deleted file mode 100644 index 67eca02..0000000 --- a/kvm-iotests-Add-qsd-migrate-case.patch +++ /dev/null @@ -1,244 +0,0 @@ -From 10bfceb42fa5a7cb0cd0286e85f63da3bed3d806 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:14:06 +0100 -Subject: [PATCH 21/22] iotests: Add qsd-migrate case - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [21/22] 50e7160617762ec15cc63f4062d47d65268c551a (kmwolf/centos-qemu-kvm) - -Test that it's possible to migrate a VM that uses an image on shared -storage through qemu-storage-daemon. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Message-ID: <20250204211407.381505-16-kwolf@redhat.com> -Reviewed-by: Stefan Hajnoczi -Signed-off-by: Kevin Wolf -(cherry picked from commit 3ea437ab3d561ca79b95a34c5128e370de4738e3) -Signed-off-by: Kevin Wolf ---- - tests/qemu-iotests/tests/qsd-migrate | 140 +++++++++++++++++++++++ - tests/qemu-iotests/tests/qsd-migrate.out | 59 ++++++++++ - 2 files changed, 199 insertions(+) - create mode 100755 tests/qemu-iotests/tests/qsd-migrate - create mode 100644 tests/qemu-iotests/tests/qsd-migrate.out - -diff --git a/tests/qemu-iotests/tests/qsd-migrate b/tests/qemu-iotests/tests/qsd-migrate -new file mode 100755 -index 0000000000..de17562cb0 ---- /dev/null -+++ b/tests/qemu-iotests/tests/qsd-migrate -@@ -0,0 +1,140 @@ -+#!/usr/bin/env python3 -+# group: rw quick -+# -+# Copyright (C) Red Hat, Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+# Creator/Owner: Kevin Wolf -+ -+import iotests -+ -+from iotests import filter_qemu_io, filter_qtest -+ -+iotests.script_initialize(supported_fmts=['generic'], -+ supported_protocols=['file'], -+ supported_platforms=['linux']) -+ -+with iotests.FilePath('disk.img') as path, \ -+ iotests.FilePath('nbd-src.sock', base_dir=iotests.sock_dir) as nbd_src, \ -+ iotests.FilePath('nbd-dst.sock', base_dir=iotests.sock_dir) as nbd_dst, \ -+ iotests.FilePath('migrate.sock', base_dir=iotests.sock_dir) as mig_sock, \ -+ iotests.VM(path_suffix="-src") as vm_src, \ -+ iotests.VM(path_suffix="-dst") as vm_dst: -+ -+ img_size = '10M' -+ -+ iotests.log('Preparing disk...') -+ iotests.qemu_img_create('-f', iotests.imgfmt, path, img_size) -+ -+ iotests.log('Launching source QSD...') -+ qsd_src = iotests.QemuStorageDaemon( -+ '--blockdev', f'file,node-name=disk-file,filename={path}', -+ '--blockdev', f'{iotests.imgfmt},file=disk-file,node-name=disk-fmt', -+ '--nbd-server', f'addr.type=unix,addr.path={nbd_src}', -+ '--export', 'nbd,id=exp0,node-name=disk-fmt,writable=true,' -+ 'allow-inactive=true', -+ qmp=True, -+ ) -+ -+ iotests.log('Launching source VM...') -+ vm_src.add_args('-blockdev', f'nbd,node-name=disk,server.type=unix,' -+ f'server.path={nbd_src},export=disk-fmt') -+ vm_src.add_args('-device', 'virtio-blk,drive=disk,id=virtio0') -+ vm_src.launch() -+ -+ iotests.log('Launching destination QSD...') -+ qsd_dst = iotests.QemuStorageDaemon( -+ '--blockdev', f'file,node-name=disk-file,filename={path},active=off', -+ '--blockdev', f'{iotests.imgfmt},file=disk-file,node-name=disk-fmt,' -+ f'active=off', -+ '--nbd-server', f'addr.type=unix,addr.path={nbd_dst}', -+ '--export', 'nbd,id=exp0,node-name=disk-fmt,writable=true,' -+ 'allow-inactive=true', -+ qmp=True, -+ instance_id='b', -+ ) -+ -+ iotests.log('Launching destination VM...') -+ vm_dst.add_args('-blockdev', f'nbd,node-name=disk,server.type=unix,' -+ f'server.path={nbd_dst},export=disk-fmt') -+ vm_dst.add_args('-device', 'virtio-blk,drive=disk,id=virtio0') -+ vm_dst.add_args('-incoming', f'unix:{mig_sock}') -+ vm_dst.launch() -+ -+ iotests.log('\nTest I/O on the source') -+ vm_src.hmp_qemu_io('virtio0/virtio-backend', 'write -P 0x11 0 4k', -+ use_log=True, qdev=True) -+ vm_src.hmp_qemu_io('virtio0/virtio-backend', 'read -P 0x11 0 4k', -+ use_log=True, qdev=True) -+ -+ iotests.log('\nStarting migration...') -+ -+ mig_caps = [ -+ {'capability': 'events', 'state': True}, -+ {'capability': 'pause-before-switchover', 'state': True}, -+ ] -+ vm_src.qmp_log('migrate-set-capabilities', capabilities=mig_caps) -+ vm_dst.qmp_log('migrate-set-capabilities', capabilities=mig_caps) -+ vm_src.qmp_log('migrate', uri=f'unix:{mig_sock}', -+ filters=[iotests.filter_qmp_testfiles]) -+ -+ vm_src.event_wait('MIGRATION', -+ match={'data': {'status': 'pre-switchover'}}) -+ -+ iotests.log('\nPre-switchover: Reconfigure QSD instances') -+ -+ iotests.log(qsd_src.qmp('blockdev-set-active', {'active': False})) -+ -+ # Reading is okay from both sides while the image is inactive. Note that -+ # the destination may have stale data until it activates the image, though. -+ vm_src.hmp_qemu_io('virtio0/virtio-backend', 'read -P 0x11 0 4k', -+ use_log=True, qdev=True) -+ vm_dst.hmp_qemu_io('virtio0/virtio-backend', 'read 0 4k', -+ use_log=True, qdev=True) -+ -+ iotests.log(qsd_dst.qmp('blockdev-set-active', {'active': True})) -+ -+ iotests.log('\nCompleting migration...') -+ -+ vm_src.qmp_log('migrate-continue', state='pre-switchover') -+ vm_dst.event_wait('MIGRATION', match={'data': {'status': 'completed'}}) -+ -+ iotests.log('\nTest I/O on the destination') -+ -+ # Now the destination must see what the source wrote -+ vm_dst.hmp_qemu_io('virtio0/virtio-backend', 'read -P 0x11 0 4k', -+ use_log=True, qdev=True) -+ -+ # And be able to overwrite it -+ vm_dst.hmp_qemu_io('virtio0/virtio-backend', 'write -P 0x22 0 4k', -+ use_log=True, qdev=True) -+ vm_dst.hmp_qemu_io('virtio0/virtio-backend', 'read -P 0x22 0 4k', -+ use_log=True, qdev=True) -+ -+ iotests.log('\nDone') -+ -+ vm_src.shutdown() -+ iotests.log('\n--- vm_src log ---') -+ log = vm_src.get_log() -+ if log: -+ iotests.log(log, [filter_qtest, filter_qemu_io]) -+ qsd_src.stop() -+ -+ vm_dst.shutdown() -+ iotests.log('\n--- vm_dst log ---') -+ log = vm_dst.get_log() -+ if log: -+ iotests.log(log, [filter_qtest, filter_qemu_io]) -+ qsd_dst.stop() -diff --git a/tests/qemu-iotests/tests/qsd-migrate.out b/tests/qemu-iotests/tests/qsd-migrate.out -new file mode 100644 -index 0000000000..4a5241e5d4 ---- /dev/null -+++ b/tests/qemu-iotests/tests/qsd-migrate.out -@@ -0,0 +1,59 @@ -+Preparing disk... -+Launching source QSD... -+Launching source VM... -+Launching destination QSD... -+Launching destination VM... -+ -+Test I/O on the source -+{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-io -d virtio0/virtio-backend \"write -P 0x11 0 4k\""}} -+{"return": ""} -+{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-io -d virtio0/virtio-backend \"read -P 0x11 0 4k\""}} -+{"return": ""} -+ -+Starting migration... -+{"execute": "migrate-set-capabilities", "arguments": {"capabilities": [{"capability": "events", "state": true}, {"capability": "pause-before-switchover", "state": true}]}} -+{"return": {}} -+{"execute": "migrate-set-capabilities", "arguments": {"capabilities": [{"capability": "events", "state": true}, {"capability": "pause-before-switchover", "state": true}]}} -+{"return": {}} -+{"execute": "migrate", "arguments": {"uri": "unix:SOCK_DIR/PID-migrate.sock"}} -+{"return": {}} -+ -+Pre-switchover: Reconfigure QSD instances -+{"return": {}} -+{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-io -d virtio0/virtio-backend \"read -P 0x11 0 4k\""}} -+{"return": ""} -+{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-io -d virtio0/virtio-backend \"read 0 4k\""}} -+{"return": ""} -+{"return": {}} -+ -+Completing migration... -+{"execute": "migrate-continue", "arguments": {"state": "pre-switchover"}} -+{"return": {}} -+ -+Test I/O on the destination -+{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-io -d virtio0/virtio-backend \"read -P 0x11 0 4k\""}} -+{"return": ""} -+{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-io -d virtio0/virtio-backend \"write -P 0x22 0 4k\""}} -+{"return": ""} -+{"execute": "human-monitor-command", "arguments": {"command-line": "qemu-io -d virtio0/virtio-backend \"read -P 0x22 0 4k\""}} -+{"return": ""} -+ -+Done -+ -+--- vm_src log --- -+wrote 4096/4096 bytes at offset 0 -+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -+read 4096/4096 bytes at offset 0 -+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -+read 4096/4096 bytes at offset 0 -+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -+ -+--- vm_dst log --- -+read 4096/4096 bytes at offset 0 -+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -+read 4096/4096 bytes at offset 0 -+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -+wrote 4096/4096 bytes at offset 0 -+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -+read 4096/4096 bytes at offset 0 -+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) --- -2.39.3 - diff --git a/kvm-kvm-Allow-kvm_arch_get-put_registers-to-accept-Error.patch b/kvm-kvm-Allow-kvm_arch_get-put_registers-to-accept-Error.patch deleted file mode 100644 index f6eb21f..0000000 --- a/kvm-kvm-Allow-kvm_arch_get-put_registers-to-accept-Error.patch +++ /dev/null @@ -1,287 +0,0 @@ -From 74964784ffb9a0ad307eddafddd6b47f596ca3c1 Mon Sep 17 00:00:00 2001 -From: Julia Suvorova -Date: Fri, 27 Sep 2024 12:47:40 +0200 -Subject: [PATCH 28/38] kvm: Allow kvm_arch_get/put_registers to accept Error** - -RH-Author: Julia Suvorova -RH-MergeRequest: 287: kvm: Allow kvm_arch_get/put_registers to accept Error** -RH-Jira: RHEL-20574 -RH-Acked-by: Juraj Marcin -RH-Acked-by: Peter Xu -RH-Commit: [1/2] 7b1d8bf84339f908358f3fe3e392b1950aaa881d - -This is necessary to provide discernible error messages to the caller. - -Signed-off-by: Julia Suvorova -Reviewed-by: Peter Xu -Link: https://lore.kernel.org/r/20240927104743.218468-2-jusual@redhat.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit a1676bb3047f28b292ecbce3a378ccc0b4721d47) ---- - accel/kvm/kvm-all.c | 41 +++++++++++++++++++++++++++++--------- - include/sysemu/kvm.h | 4 ++-- - target/arm/kvm.c | 4 ++-- - target/i386/kvm/kvm.c | 4 ++-- - target/loongarch/kvm/kvm.c | 4 ++-- - target/mips/kvm.c | 4 ++-- - target/ppc/kvm.c | 4 ++-- - target/riscv/kvm/kvm-cpu.c | 4 ++-- - target/s390x/kvm/kvm.c | 4 ++-- - 9 files changed, 48 insertions(+), 25 deletions(-) - -diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c -index acc23092e7..c7f1cc64b6 100644 ---- a/accel/kvm/kvm-all.c -+++ b/accel/kvm/kvm-all.c -@@ -2766,9 +2766,15 @@ void kvm_flush_coalesced_mmio_buffer(void) - static void do_kvm_cpu_synchronize_state(CPUState *cpu, run_on_cpu_data arg) - { - if (!cpu->vcpu_dirty && !kvm_state->guest_state_protected) { -- int ret = kvm_arch_get_registers(cpu); -+ Error *err = NULL; -+ int ret = kvm_arch_get_registers(cpu, &err); - if (ret) { -- error_report("Failed to get registers: %s", strerror(-ret)); -+ if (err) { -+ error_reportf_err(err, "Failed to synchronize CPU state: "); -+ } else { -+ error_report("Failed to get registers: %s", strerror(-ret)); -+ } -+ - cpu_dump_state(cpu, stderr, CPU_DUMP_CODE); - vm_stop(RUN_STATE_INTERNAL_ERROR); - } -@@ -2786,9 +2792,15 @@ void kvm_cpu_synchronize_state(CPUState *cpu) - - static void do_kvm_cpu_synchronize_post_reset(CPUState *cpu, run_on_cpu_data arg) - { -- int ret = kvm_arch_put_registers(cpu, KVM_PUT_RESET_STATE); -+ Error *err = NULL; -+ int ret = kvm_arch_put_registers(cpu, KVM_PUT_RESET_STATE, &err); - if (ret) { -- error_report("Failed to put registers after reset: %s", strerror(-ret)); -+ if (err) { -+ error_reportf_err(err, "Restoring resisters after reset: "); -+ } else { -+ error_report("Failed to put registers after reset: %s", -+ strerror(-ret)); -+ } - cpu_dump_state(cpu, stderr, CPU_DUMP_CODE); - vm_stop(RUN_STATE_INTERNAL_ERROR); - } -@@ -2803,9 +2815,15 @@ void kvm_cpu_synchronize_post_reset(CPUState *cpu) - - static void do_kvm_cpu_synchronize_post_init(CPUState *cpu, run_on_cpu_data arg) - { -- int ret = kvm_arch_put_registers(cpu, KVM_PUT_FULL_STATE); -+ Error *err = NULL; -+ int ret = kvm_arch_put_registers(cpu, KVM_PUT_FULL_STATE, &err); - if (ret) { -- error_report("Failed to put registers after init: %s", strerror(-ret)); -+ if (err) { -+ error_reportf_err(err, "Putting registers after init: "); -+ } else { -+ error_report("Failed to put registers after init: %s", -+ strerror(-ret)); -+ } - exit(1); - } - -@@ -2995,10 +3013,15 @@ int kvm_cpu_exec(CPUState *cpu) - MemTxAttrs attrs; - - if (cpu->vcpu_dirty) { -- ret = kvm_arch_put_registers(cpu, KVM_PUT_RUNTIME_STATE); -+ Error *err = NULL; -+ ret = kvm_arch_put_registers(cpu, KVM_PUT_RUNTIME_STATE, &err); - if (ret) { -- error_report("Failed to put registers after init: %s", -- strerror(-ret)); -+ if (err) { -+ error_reportf_err(err, "Putting registers after init: "); -+ } else { -+ error_report("Failed to put registers after init: %s", -+ strerror(-ret)); -+ } - ret = -1; - break; - } -diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h -index 9cf14ca3d5..d9ad723f78 100644 ---- a/include/sysemu/kvm.h -+++ b/include/sysemu/kvm.h -@@ -359,7 +359,7 @@ int kvm_arch_handle_exit(CPUState *cpu, struct kvm_run *run); - - int kvm_arch_process_async_events(CPUState *cpu); - --int kvm_arch_get_registers(CPUState *cpu); -+int kvm_arch_get_registers(CPUState *cpu, Error **errp); - - /* state subset only touched by the VCPU itself during runtime */ - #define KVM_PUT_RUNTIME_STATE 1 -@@ -368,7 +368,7 @@ int kvm_arch_get_registers(CPUState *cpu); - /* full state set, modified during initialization or on vmload */ - #define KVM_PUT_FULL_STATE 3 - --int kvm_arch_put_registers(CPUState *cpu, int level); -+int kvm_arch_put_registers(CPUState *cpu, int level, Error **errp); - - int kvm_arch_get_default_type(MachineState *ms); - -diff --git a/target/arm/kvm.c b/target/arm/kvm.c -index 849e2e21b3..f1f1b5b375 100644 ---- a/target/arm/kvm.c -+++ b/target/arm/kvm.c -@@ -2042,7 +2042,7 @@ static int kvm_arch_put_sve(CPUState *cs) - return 0; - } - --int kvm_arch_put_registers(CPUState *cs, int level) -+int kvm_arch_put_registers(CPUState *cs, int level, Error **errp) - { - uint64_t val; - uint32_t fpr; -@@ -2226,7 +2226,7 @@ static int kvm_arch_get_sve(CPUState *cs) - return 0; - } - --int kvm_arch_get_registers(CPUState *cs) -+int kvm_arch_get_registers(CPUState *cs, Error **errp) - { - uint64_t val; - unsigned int el; -diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c -index 2b28c18693..423e6922d8 100644 ---- a/target/i386/kvm/kvm.c -+++ b/target/i386/kvm/kvm.c -@@ -5121,7 +5121,7 @@ static int kvm_get_nested_state(X86CPU *cpu) - return ret; - } - --int kvm_arch_put_registers(CPUState *cpu, int level) -+int kvm_arch_put_registers(CPUState *cpu, int level, Error **errp) - { - X86CPU *x86_cpu = X86_CPU(cpu); - int ret; -@@ -5209,7 +5209,7 @@ int kvm_arch_put_registers(CPUState *cpu, int level) - return 0; - } - --int kvm_arch_get_registers(CPUState *cs) -+int kvm_arch_get_registers(CPUState *cs, Error **errp) - { - X86CPU *cpu = X86_CPU(cs); - int ret; -diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c -index e1be6a6959..9204d4295d 100644 ---- a/target/loongarch/kvm/kvm.c -+++ b/target/loongarch/kvm/kvm.c -@@ -585,7 +585,7 @@ static int kvm_loongarch_put_cpucfg(CPUState *cs) - return ret; - } - --int kvm_arch_get_registers(CPUState *cs) -+int kvm_arch_get_registers(CPUState *cs, Error **errp) - { - int ret; - -@@ -613,7 +613,7 @@ int kvm_arch_get_registers(CPUState *cs) - return ret; - } - --int kvm_arch_put_registers(CPUState *cs, int level) -+int kvm_arch_put_registers(CPUState *cs, int level, Error **errp) - { - int ret; - -diff --git a/target/mips/kvm.c b/target/mips/kvm.c -index a631ab544f..a98798c669 100644 ---- a/target/mips/kvm.c -+++ b/target/mips/kvm.c -@@ -1172,7 +1172,7 @@ static int kvm_mips_get_cp0_registers(CPUState *cs) - return ret; - } - --int kvm_arch_put_registers(CPUState *cs, int level) -+int kvm_arch_put_registers(CPUState *cs, int level, Error **errp) - { - CPUMIPSState *env = cpu_env(cs); - struct kvm_regs regs; -@@ -1207,7 +1207,7 @@ int kvm_arch_put_registers(CPUState *cs, int level) - return ret; - } - --int kvm_arch_get_registers(CPUState *cs) -+int kvm_arch_get_registers(CPUState *cs, Error **errp) - { - CPUMIPSState *env = cpu_env(cs); - int ret = 0; -diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c -index 907dba60d1..3efc28f18b 100644 ---- a/target/ppc/kvm.c -+++ b/target/ppc/kvm.c -@@ -900,7 +900,7 @@ int kvmppc_put_books_sregs(PowerPCCPU *cpu) - return kvm_vcpu_ioctl(CPU(cpu), KVM_SET_SREGS, &sregs); - } - --int kvm_arch_put_registers(CPUState *cs, int level) -+int kvm_arch_put_registers(CPUState *cs, int level, Error **errp) - { - PowerPCCPU *cpu = POWERPC_CPU(cs); - CPUPPCState *env = &cpu->env; -@@ -1205,7 +1205,7 @@ static int kvmppc_get_books_sregs(PowerPCCPU *cpu) - return 0; - } - --int kvm_arch_get_registers(CPUState *cs) -+int kvm_arch_get_registers(CPUState *cs, Error **errp) - { - PowerPCCPU *cpu = POWERPC_CPU(cs); - CPUPPCState *env = &cpu->env; -diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c -index f6e3156b8d..2bfb112be0 100644 ---- a/target/riscv/kvm/kvm-cpu.c -+++ b/target/riscv/kvm/kvm-cpu.c -@@ -1192,7 +1192,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = { - KVM_CAP_LAST_INFO - }; - --int kvm_arch_get_registers(CPUState *cs) -+int kvm_arch_get_registers(CPUState *cs, Error **errp) - { - int ret = 0; - -@@ -1237,7 +1237,7 @@ int kvm_riscv_sync_mpstate_to_kvm(RISCVCPU *cpu, int state) - return 0; - } - --int kvm_arch_put_registers(CPUState *cs, int level) -+int kvm_arch_put_registers(CPUState *cs, int level, Error **errp) - { - int ret = 0; - -diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c -index 94181d9281..8ffe0159d8 100644 ---- a/target/s390x/kvm/kvm.c -+++ b/target/s390x/kvm/kvm.c -@@ -472,7 +472,7 @@ static int can_sync_regs(CPUState *cs, int regs) - #define KVM_SYNC_REQUIRED_REGS (KVM_SYNC_GPRS | KVM_SYNC_ACRS | \ - KVM_SYNC_CRS | KVM_SYNC_PREFIX) - --int kvm_arch_put_registers(CPUState *cs, int level) -+int kvm_arch_put_registers(CPUState *cs, int level, Error **errp) - { - CPUS390XState *env = cpu_env(cs); - struct kvm_fpu fpu = {}; -@@ -598,7 +598,7 @@ int kvm_arch_put_registers(CPUState *cs, int level) - return 0; - } - --int kvm_arch_get_registers(CPUState *cs) -+int kvm_arch_get_registers(CPUState *cs, Error **errp) - { - CPUS390XState *env = cpu_env(cs); - struct kvm_fpu fpu; --- -2.39.3 - diff --git a/kvm-kvm-refactor-core-virtual-machine-creation-into-its-.patch b/kvm-kvm-refactor-core-virtual-machine-creation-into-its-.patch deleted file mode 100644 index fa633bb..0000000 --- a/kvm-kvm-refactor-core-virtual-machine-creation-into-its-.patch +++ /dev/null @@ -1,144 +0,0 @@ -From 67180363bdc1898462f90e16c1909db7331cc5e2 Mon Sep 17 00:00:00 2001 -From: Ani Sinha -Date: Thu, 8 Aug 2024 17:08:38 +0530 -Subject: [PATCH 3/9] kvm: refactor core virtual machine creation into its own - function - -RH-Author: Peter Xu -RH-MergeRequest: 285: KVM: Dynamic sized kvm memslots array -RH-Jira: RHEL-57685 -RH-Acked-by: Juraj Marcin -RH-Acked-by: Miroslav Rezanina -RH-Commit: [2/7] a783111d9a2ef6590103543f1bd103bf90052872 (peterx/qemu-kvm) - -Refactoring the core logic around KVM_CREATE_VM into its own separate function -so that it can be called from other functions in subsequent patches. There is -no functional change in this patch. - -CC: pbonzini@redhat.com -CC: zhao1.liu@intel.com -Signed-off-by: Ani Sinha -Link: https://lore.kernel.org/r/20240808113838.1697366-1-anisinha@redhat.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit 67388078da1cf6dac89e5a7c748cca3444d49690) -Signed-off-by: Peter Xu ---- - accel/kvm/kvm-all.c | 89 ++++++++++++++++++++++++++++----------------- - 1 file changed, 56 insertions(+), 33 deletions(-) - -diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c -index 7432a54f39..d86d1b515a 100644 ---- a/accel/kvm/kvm-all.c -+++ b/accel/kvm/kvm-all.c -@@ -2385,6 +2385,60 @@ uint32_t kvm_dirty_ring_size(void) - return kvm_state->kvm_dirty_ring_size; - } - -+static int do_kvm_create_vm(MachineState *ms, int type) -+{ -+ KVMState *s; -+ int ret; -+ -+ s = KVM_STATE(ms->accelerator); -+ -+ do { -+ ret = kvm_ioctl(s, KVM_CREATE_VM, type); -+ } while (ret == -EINTR); -+ -+ if (ret < 0) { -+ error_report("ioctl(KVM_CREATE_VM) failed: %s", strerror(-ret)); -+ -+#ifdef TARGET_S390X -+ if (ret == -EINVAL) { -+ error_printf("Host kernel setup problem detected." -+ " Please verify:\n"); -+ error_printf("- for kernels supporting the" -+ " switch_amode or user_mode parameters, whether"); -+ error_printf(" user space is running in primary address space\n"); -+ error_printf("- for kernels supporting the vm.allocate_pgste" -+ " sysctl, whether it is enabled\n"); -+ } -+#elif defined(TARGET_PPC) -+ if (ret == -EINVAL) { -+ error_printf("PPC KVM module is not loaded. Try modprobe kvm_%s.\n", -+ (type == 2) ? "pr" : "hv"); -+ } -+#endif -+ } -+ -+ return ret; -+} -+ -+static int find_kvm_machine_type(MachineState *ms) -+{ -+ MachineClass *mc = MACHINE_GET_CLASS(ms); -+ int type; -+ -+ if (object_property_find(OBJECT(current_machine), "kvm-type")) { -+ g_autofree char *kvm_type; -+ kvm_type = object_property_get_str(OBJECT(current_machine), -+ "kvm-type", -+ &error_abort); -+ type = mc->kvm_type(ms, kvm_type); -+ } else if (mc->kvm_type) { -+ type = mc->kvm_type(ms, NULL); -+ } else { -+ type = kvm_arch_get_default_type(ms); -+ } -+ return type; -+} -+ - static int kvm_init(MachineState *ms) - { - MachineClass *mc = MACHINE_GET_CLASS(ms); -@@ -2467,45 +2521,14 @@ static int kvm_init(MachineState *ms) - } - s->as = g_new0(struct KVMAs, s->nr_as); - -- if (object_property_find(OBJECT(current_machine), "kvm-type")) { -- g_autofree char *kvm_type = object_property_get_str(OBJECT(current_machine), -- "kvm-type", -- &error_abort); -- type = mc->kvm_type(ms, kvm_type); -- } else if (mc->kvm_type) { -- type = mc->kvm_type(ms, NULL); -- } else { -- type = kvm_arch_get_default_type(ms); -- } -- -+ type = find_kvm_machine_type(ms); - if (type < 0) { - ret = -EINVAL; - goto err; - } - -- do { -- ret = kvm_ioctl(s, KVM_CREATE_VM, type); -- } while (ret == -EINTR); -- -+ ret = do_kvm_create_vm(ms, type); - if (ret < 0) { -- error_report("ioctl(KVM_CREATE_VM) failed: %s", strerror(-ret)); -- --#ifdef TARGET_S390X -- if (ret == -EINVAL) { -- error_printf("Host kernel setup problem detected." -- " Please verify:\n"); -- error_printf("- for kernels supporting the" -- " switch_amode or user_mode parameters, whether"); -- error_printf(" user space is running in primary address space\n"); -- error_printf("- for kernels supporting the vm.allocate_pgste" -- " sysctl, whether it is enabled\n"); -- } --#elif defined(TARGET_PPC) -- if (ret == -EINVAL) { -- error_printf("PPC KVM module is not loaded. Try modprobe kvm_%s.\n", -- (type == 2) ? "pr" : "hv"); -- } --#endif - goto err; - } - --- -2.39.3 - diff --git a/kvm-kvm-replace-fprintf-with-error_report-printf-in-kvm_.patch b/kvm-kvm-replace-fprintf-with-error_report-printf-in-kvm_.patch deleted file mode 100644 index 7f7a756..0000000 --- a/kvm-kvm-replace-fprintf-with-error_report-printf-in-kvm_.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 522e19dd84eb5c4d88b3b70193ee104f67a5b89d Mon Sep 17 00:00:00 2001 -From: Ani Sinha -Date: Wed, 28 Aug 2024 18:15:39 +0530 -Subject: [PATCH 2/9] kvm: replace fprintf with error_report()/printf() in - kvm_init() - -RH-Author: Peter Xu -RH-MergeRequest: 285: KVM: Dynamic sized kvm memslots array -RH-Jira: RHEL-57685 -RH-Acked-by: Juraj Marcin -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/7] 6c1230a6d5033d928817df9458938a675058e995 (peterx/qemu-kvm) - -error_report() is more appropriate for error situations. Replace fprintf with -error_report() and error_printf() as appropriate. Some improvement in error -reporting also happens as a part of this change. For example: - -From: -$ ./qemu-system-x86_64 --accel kvm -Could not access KVM kernel module: No such file or directory - -To: -$ ./qemu-system-x86_64 --accel kvm -qemu-system-x86_64: --accel kvm: Could not access KVM kernel module: No such file or directory - -CC: qemu-trivial@nongnu.org -CC: zhao1.liu@intel.com -CC: armbru@redhat.com -Reviewed-by: Zhao Liu -Reviewed-by: Markus Armbruster -Signed-off-by: Ani Sinha -Link: https://lore.kernel.org/r/20240828124539.62672-1-anisinha@redhat.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit 804dfbe3ef5e950328b162ae85741be2e228544f) -Signed-off-by: Peter Xu ---- - accel/kvm/kvm-all.c | 40 ++++++++++++++++++---------------------- - 1 file changed, 18 insertions(+), 22 deletions(-) - -diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c -index c7f1cc64b6..7432a54f39 100644 ---- a/accel/kvm/kvm-all.c -+++ b/accel/kvm/kvm-all.c -@@ -2427,7 +2427,7 @@ static int kvm_init(MachineState *ms) - QLIST_INIT(&s->kvm_parked_vcpus); - s->fd = qemu_open_old(s->device ?: "/dev/kvm", O_RDWR); - if (s->fd == -1) { -- fprintf(stderr, "Could not access KVM kernel module: %m\n"); -+ error_report("Could not access KVM kernel module: %m"); - ret = -errno; - goto err; - } -@@ -2437,13 +2437,13 @@ static int kvm_init(MachineState *ms) - if (ret >= 0) { - ret = -EINVAL; - } -- fprintf(stderr, "kvm version too old\n"); -+ error_report("kvm version too old"); - goto err; - } - - if (ret > KVM_API_VERSION) { - ret = -EINVAL; -- fprintf(stderr, "kvm version not supported\n"); -+ error_report("kvm version not supported"); - goto err; - } - -@@ -2488,26 +2488,22 @@ static int kvm_init(MachineState *ms) - } while (ret == -EINTR); - - if (ret < 0) { -- fprintf(stderr, "ioctl(KVM_CREATE_VM) failed: %d %s\n", -ret, -- strerror(-ret)); -+ error_report("ioctl(KVM_CREATE_VM) failed: %s", strerror(-ret)); - - #ifdef TARGET_S390X - if (ret == -EINVAL) { -- fprintf(stderr, -- "Host kernel setup problem detected. Please verify:\n"); -- fprintf(stderr, "- for kernels supporting the switch_amode or" -- " user_mode parameters, whether\n"); -- fprintf(stderr, -- " user space is running in primary address space\n"); -- fprintf(stderr, -- "- for kernels supporting the vm.allocate_pgste sysctl, " -- "whether it is enabled\n"); -+ error_printf("Host kernel setup problem detected." -+ " Please verify:\n"); -+ error_printf("- for kernels supporting the" -+ " switch_amode or user_mode parameters, whether"); -+ error_printf(" user space is running in primary address space\n"); -+ error_printf("- for kernels supporting the vm.allocate_pgste" -+ " sysctl, whether it is enabled\n"); - } - #elif defined(TARGET_PPC) - if (ret == -EINVAL) { -- fprintf(stderr, -- "PPC KVM module is not loaded. Try modprobe kvm_%s.\n", -- (type == 2) ? "pr" : "hv"); -+ error_printf("PPC KVM module is not loaded. Try modprobe kvm_%s.\n", -+ (type == 2) ? "pr" : "hv"); - } - #endif - goto err; -@@ -2526,9 +2522,9 @@ static int kvm_init(MachineState *ms) - nc->name, nc->num, soft_vcpus_limit); - - if (nc->num > hard_vcpus_limit) { -- fprintf(stderr, "Number of %s cpus requested (%d) exceeds " -- "the maximum cpus supported by KVM (%d)\n", -- nc->name, nc->num, hard_vcpus_limit); -+ error_report("Number of %s cpus requested (%d) exceeds " -+ "the maximum cpus supported by KVM (%d)", -+ nc->name, nc->num, hard_vcpus_limit); - exit(1); - } - } -@@ -2542,8 +2538,8 @@ static int kvm_init(MachineState *ms) - } - if (missing_cap) { - ret = -EINVAL; -- fprintf(stderr, "kvm does not support %s\n%s", -- missing_cap->name, upgrade_note); -+ error_report("kvm does not support %s", missing_cap->name); -+ error_printf("%s", upgrade_note); - goto err; - } - --- -2.39.3 - diff --git a/kvm-linux-headers-Update-to-Linux-6.13-rc1.patch b/kvm-linux-headers-Update-to-Linux-6.13-rc1.patch deleted file mode 100644 index f6f6574..0000000 --- a/kvm-linux-headers-Update-to-Linux-6.13-rc1.patch +++ /dev/null @@ -1,1099 +0,0 @@ -From 46aeae3bd6fad36c985dbd1a7cb2dde613fbc60b Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:42 +0100 -Subject: [PATCH 07/18] linux-headers: Update to Linux 6.13-rc1 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [7/16] f729f38c4bcd5eb773d8387f45292a6f7aa26c5c (thuth/qemu-kvm-cs9) - -This linux headers update includes required changes for -the gen17 CPU model. - -Signed-off-by: Hendrik Brueckner -Suggested-by: Thomas Huth -Message-ID: <20241206122751.189721-7-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 44fe383c274174405da79f5fcb028e39fe688036) ---- - include/standard-headers/drm/drm_fourcc.h | 1 + - include/standard-headers/linux/ethtool.h | 5 + - include/standard-headers/linux/pci_regs.h | 38 ++- - .../standard-headers/linux/virtio_crypto.h | 1 + - include/standard-headers/linux/virtio_pci.h | 131 ++++++++++ - linux-headers/asm-arm64/kvm.h | 6 + - linux-headers/asm-arm64/unistd_64.h | 4 + - linux-headers/asm-generic/mman-common.h | 3 + - linux-headers/asm-generic/mman.h | 4 + - linux-headers/asm-generic/unistd.h | 11 +- - linux-headers/asm-loongarch/kvm.h | 20 ++ - linux-headers/asm-loongarch/unistd_64.h | 4 + - linux-headers/asm-mips/mman.h | 3 + - linux-headers/asm-mips/unistd_n32.h | 4 + - linux-headers/asm-mips/unistd_n64.h | 4 + - linux-headers/asm-mips/unistd_o32.h | 4 + - linux-headers/asm-powerpc/unistd_32.h | 4 + - linux-headers/asm-powerpc/unistd_64.h | 4 + - linux-headers/asm-riscv/kvm.h | 4 + - linux-headers/asm-riscv/unistd_32.h | 4 + - linux-headers/asm-riscv/unistd_64.h | 4 + - linux-headers/asm-s390/kvm.h | 3 +- - linux-headers/asm-s390/unistd_32.h | 4 + - linux-headers/asm-s390/unistd_64.h | 4 + - linux-headers/asm-x86/kvm.h | 1 + - linux-headers/asm-x86/mman.h | 3 - - linux-headers/asm-x86/unistd_32.h | 4 + - linux-headers/asm-x86/unistd_64.h | 4 + - linux-headers/asm-x86/unistd_x32.h | 4 + - linux-headers/linux/iommufd.h | 224 +++++++++++++++++- - linux-headers/linux/kvm.h | 8 + - linux-headers/linux/psci.h | 5 + - linux-headers/linux/vfio.h | 2 +- - 33 files changed, 506 insertions(+), 23 deletions(-) - -diff --git a/include/standard-headers/drm/drm_fourcc.h b/include/standard-headers/drm/drm_fourcc.h -index d4a2231306..708647776f 100644 ---- a/include/standard-headers/drm/drm_fourcc.h -+++ b/include/standard-headers/drm/drm_fourcc.h -@@ -1515,6 +1515,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) - * 64K_D_2D on GFX12 is identical to 64K_D on GFX11. - */ - #define AMD_FMT_MOD_TILE_GFX9_64K_D 10 -+#define AMD_FMT_MOD_TILE_GFX9_4K_D_X 22 - #define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25 - #define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26 - #define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27 -diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-headers/linux/ethtool.h -index b05e84825b..67c47912e5 100644 ---- a/include/standard-headers/linux/ethtool.h -+++ b/include/standard-headers/linux/ethtool.h -@@ -2526,6 +2526,11 @@ struct ethtool_link_settings { - uint8_t master_slave_state; - uint8_t rate_matching; - uint32_t reserved[7]; -+ /* Linux builds with -Wflex-array-member-not-at-end but does -+ * not use the "link_mode_masks" member. Leave it defined for -+ * userspace for now, and when userspace wants to start using -+ * -Wfamnae, we'll need a new solution. -+ */ - uint32_t link_mode_masks[]; - /* layout of link_mode_masks fields: - * uint32_t map_supported[link_mode_masks_nwords]; -diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-headers/linux/pci_regs.h -index 12323b3334..1601c7ed5f 100644 ---- a/include/standard-headers/linux/pci_regs.h -+++ b/include/standard-headers/linux/pci_regs.h -@@ -340,7 +340,8 @@ - #define PCI_MSIX_ENTRY_UPPER_ADDR 0x4 /* Message Upper Address */ - #define PCI_MSIX_ENTRY_DATA 0x8 /* Message Data */ - #define PCI_MSIX_ENTRY_VECTOR_CTRL 0xc /* Vector Control */ --#define PCI_MSIX_ENTRY_CTRL_MASKBIT 0x00000001 -+#define PCI_MSIX_ENTRY_CTRL_MASKBIT 0x00000001 /* Mask Bit */ -+#define PCI_MSIX_ENTRY_CTRL_ST 0xffff0000 /* Steering Tag */ - - /* CompactPCI Hotswap Register */ - -@@ -659,6 +660,7 @@ - #define PCI_EXP_DEVCAP2_ATOMIC_COMP64 0x00000100 /* 64b AtomicOp completion */ - #define PCI_EXP_DEVCAP2_ATOMIC_COMP128 0x00000200 /* 128b AtomicOp completion */ - #define PCI_EXP_DEVCAP2_LTR 0x00000800 /* Latency tolerance reporting */ -+#define PCI_EXP_DEVCAP2_TPH_COMP_MASK 0x00003000 /* TPH completer support */ - #define PCI_EXP_DEVCAP2_OBFF_MASK 0x000c0000 /* OBFF support mechanism */ - #define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */ - #define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */ -@@ -678,6 +680,7 @@ - #define PCI_EXP_DEVSTA2 0x2a /* Device Status 2 */ - #define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V2 0x2c /* end of v2 EPs w/o link */ - #define PCI_EXP_LNKCAP2 0x2c /* Link Capabilities 2 */ -+#define PCI_EXP_LNKCAP2_SLS 0x000000fe /* Supported Link Speeds Vector */ - #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */ - #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */ - #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */ -@@ -1023,15 +1026,34 @@ - #define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */ - #define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */ - -+/* TPH Completer Support */ -+#define PCI_EXP_DEVCAP2_TPH_COMP_NONE 0x0 /* None */ -+#define PCI_EXP_DEVCAP2_TPH_COMP_TPH_ONLY 0x1 /* TPH only */ -+#define PCI_EXP_DEVCAP2_TPH_COMP_EXT_TPH 0x3 /* TPH and Extended TPH */ -+ - /* TPH Requester */ - #define PCI_TPH_CAP 4 /* capability register */ --#define PCI_TPH_CAP_LOC_MASK 0x600 /* location mask */ --#define PCI_TPH_LOC_NONE 0x000 /* no location */ --#define PCI_TPH_LOC_CAP 0x200 /* in capability */ --#define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */ --#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* ST table mask */ --#define PCI_TPH_CAP_ST_SHIFT 16 /* ST table shift */ --#define PCI_TPH_BASE_SIZEOF 0xc /* size with no ST table */ -+#define PCI_TPH_CAP_ST_NS 0x00000001 /* No ST Mode Supported */ -+#define PCI_TPH_CAP_ST_IV 0x00000002 /* Interrupt Vector Mode Supported */ -+#define PCI_TPH_CAP_ST_DS 0x00000004 /* Device Specific Mode Supported */ -+#define PCI_TPH_CAP_EXT_TPH 0x00000100 /* Ext TPH Requester Supported */ -+#define PCI_TPH_CAP_LOC_MASK 0x00000600 /* ST Table Location */ -+#define PCI_TPH_LOC_NONE 0x00000000 /* Not present */ -+#define PCI_TPH_LOC_CAP 0x00000200 /* In capability */ -+#define PCI_TPH_LOC_MSIX 0x00000400 /* In MSI-X */ -+#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* ST Table Size */ -+#define PCI_TPH_CAP_ST_SHIFT 16 /* ST Table Size shift */ -+#define PCI_TPH_BASE_SIZEOF 0xc /* Size with no ST table */ -+ -+#define PCI_TPH_CTRL 8 /* control register */ -+#define PCI_TPH_CTRL_MODE_SEL_MASK 0x00000007 /* ST Mode Select */ -+#define PCI_TPH_ST_NS_MODE 0x0 /* No ST Mode */ -+#define PCI_TPH_ST_IV_MODE 0x1 /* Interrupt Vector Mode */ -+#define PCI_TPH_ST_DS_MODE 0x2 /* Device Specific Mode */ -+#define PCI_TPH_CTRL_REQ_EN_MASK 0x00000300 /* TPH Requester Enable */ -+#define PCI_TPH_REQ_DISABLE 0x0 /* No TPH requests allowed */ -+#define PCI_TPH_REQ_TPH_ONLY 0x1 /* TPH only requests allowed */ -+#define PCI_TPH_REQ_EXT_TPH 0x3 /* Extended TPH requests allowed */ - - /* Downstream Port Containment */ - #define PCI_EXP_DPC_CAP 0x04 /* DPC Capability */ -diff --git a/include/standard-headers/linux/virtio_crypto.h b/include/standard-headers/linux/virtio_crypto.h -index 68066dafb6..4d350ae595 100644 ---- a/include/standard-headers/linux/virtio_crypto.h -+++ b/include/standard-headers/linux/virtio_crypto.h -@@ -329,6 +329,7 @@ struct virtio_crypto_op_header { - VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x00) - #define VIRTIO_CRYPTO_AKCIPHER_DECRYPT \ - VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x01) -+ /* akcipher sign/verify opcodes are deprecated */ - #define VIRTIO_CRYPTO_AKCIPHER_SIGN \ - VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x02) - #define VIRTIO_CRYPTO_AKCIPHER_VERIFY \ -diff --git a/include/standard-headers/linux/virtio_pci.h b/include/standard-headers/linux/virtio_pci.h -index 4010216103..b177ed8972 100644 ---- a/include/standard-headers/linux/virtio_pci.h -+++ b/include/standard-headers/linux/virtio_pci.h -@@ -40,6 +40,7 @@ - #define _LINUX_VIRTIO_PCI_H - - #include "standard-headers/linux/types.h" -+#include "standard-headers/linux/kernel.h" - - #ifndef VIRTIO_PCI_NO_LEGACY - -@@ -240,6 +241,17 @@ struct virtio_pci_cfg_cap { - #define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ 0x5 - #define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO 0x6 - -+/* Device parts access commands. */ -+#define VIRTIO_ADMIN_CMD_CAP_ID_LIST_QUERY 0x7 -+#define VIRTIO_ADMIN_CMD_DEVICE_CAP_GET 0x8 -+#define VIRTIO_ADMIN_CMD_DRIVER_CAP_SET 0x9 -+#define VIRTIO_ADMIN_CMD_RESOURCE_OBJ_CREATE 0xa -+#define VIRTIO_ADMIN_CMD_RESOURCE_OBJ_DESTROY 0xd -+#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_GET 0xe -+#define VIRTIO_ADMIN_CMD_DEV_PARTS_GET 0xf -+#define VIRTIO_ADMIN_CMD_DEV_PARTS_SET 0x10 -+#define VIRTIO_ADMIN_CMD_DEV_MODE_SET 0x11 -+ - struct virtio_admin_cmd_hdr { - uint16_t opcode; - /* -@@ -286,4 +298,123 @@ struct virtio_admin_cmd_notify_info_result { - struct virtio_admin_cmd_notify_info_data entries[VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO]; - }; - -+#define VIRTIO_DEV_PARTS_CAP 0x0000 -+ -+struct virtio_dev_parts_cap { -+ uint8_t get_parts_resource_objects_limit; -+ uint8_t set_parts_resource_objects_limit; -+}; -+ -+#define MAX_CAP_ID __KERNEL_DIV_ROUND_UP(VIRTIO_DEV_PARTS_CAP + 1, 64) -+ -+struct virtio_admin_cmd_query_cap_id_result { -+ uint64_t supported_caps[MAX_CAP_ID]; -+}; -+ -+struct virtio_admin_cmd_cap_get_data { -+ uint16_t id; -+ uint8_t reserved[6]; -+}; -+ -+struct virtio_admin_cmd_cap_set_data { -+ uint16_t id; -+ uint8_t reserved[6]; -+ uint8_t cap_specific_data[]; -+}; -+ -+struct virtio_admin_cmd_resource_obj_cmd_hdr { -+ uint16_t type; -+ uint8_t reserved[2]; -+ uint32_t id; /* Indicates unique resource object id per resource object type */ -+}; -+ -+struct virtio_admin_cmd_resource_obj_create_data { -+ struct virtio_admin_cmd_resource_obj_cmd_hdr hdr; -+ uint64_t flags; -+ uint8_t resource_obj_specific_data[]; -+}; -+ -+#define VIRTIO_RESOURCE_OBJ_DEV_PARTS 0 -+ -+#define VIRTIO_RESOURCE_OBJ_DEV_PARTS_TYPE_GET 0 -+#define VIRTIO_RESOURCE_OBJ_DEV_PARTS_TYPE_SET 1 -+ -+struct virtio_resource_obj_dev_parts { -+ uint8_t type; -+ uint8_t reserved[7]; -+}; -+ -+#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_TYPE_SIZE 0 -+#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_TYPE_COUNT 1 -+#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_TYPE_LIST 2 -+ -+struct virtio_admin_cmd_dev_parts_metadata_data { -+ struct virtio_admin_cmd_resource_obj_cmd_hdr hdr; -+ uint8_t type; -+ uint8_t reserved[7]; -+}; -+ -+#define VIRTIO_DEV_PART_F_OPTIONAL 0 -+ -+struct virtio_dev_part_hdr { -+ uint16_t part_type; -+ uint8_t flags; -+ uint8_t reserved; -+ union { -+ struct { -+ uint32_t offset; -+ uint32_t reserved; -+ } pci_common_cfg; -+ struct { -+ uint16_t index; -+ uint8_t reserved[6]; -+ } vq_index; -+ } selector; -+ uint32_t length; -+}; -+ -+struct virtio_dev_part { -+ struct virtio_dev_part_hdr hdr; -+ uint8_t value[]; -+}; -+ -+struct virtio_admin_cmd_dev_parts_metadata_result { -+ union { -+ struct { -+ uint32_t size; -+ uint32_t reserved; -+ } parts_size; -+ struct { -+ uint32_t count; -+ uint32_t reserved; -+ } hdr_list_count; -+ struct { -+ uint32_t count; -+ uint32_t reserved; -+ struct virtio_dev_part_hdr hdrs[]; -+ } hdr_list; -+ }; -+}; -+ -+#define VIRTIO_ADMIN_CMD_DEV_PARTS_GET_TYPE_SELECTED 0 -+#define VIRTIO_ADMIN_CMD_DEV_PARTS_GET_TYPE_ALL 1 -+ -+struct virtio_admin_cmd_dev_parts_get_data { -+ struct virtio_admin_cmd_resource_obj_cmd_hdr hdr; -+ uint8_t type; -+ uint8_t reserved[7]; -+ struct virtio_dev_part_hdr hdr_list[]; -+}; -+ -+struct virtio_admin_cmd_dev_parts_set_data { -+ struct virtio_admin_cmd_resource_obj_cmd_hdr hdr; -+ struct virtio_dev_part parts[]; -+}; -+ -+#define VIRTIO_ADMIN_CMD_DEV_MODE_F_STOPPED 0 -+ -+struct virtio_admin_cmd_dev_mode_set_data { -+ uint8_t flags; -+}; -+ - #endif -diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h -index 2af9931ae9..dccd5d965f 100644 ---- a/linux-headers/asm-arm64/kvm.h -+++ b/linux-headers/asm-arm64/kvm.h -@@ -473,6 +473,12 @@ enum { - */ - #define KVM_SYSTEM_EVENT_RESET_FLAG_PSCI_RESET2 (1ULL << 0) - -+/* -+ * Shutdown caused by a PSCI v1.3 SYSTEM_OFF2 call. -+ * Valid only when the system event has a type of KVM_SYSTEM_EVENT_SHUTDOWN. -+ */ -+#define KVM_SYSTEM_EVENT_SHUTDOWN_FLAG_PSCI_OFF2 (1ULL << 0) -+ - /* run->fail_entry.hardware_entry_failure_reason codes. */ - #define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED (1ULL << 0) - -diff --git a/linux-headers/asm-arm64/unistd_64.h b/linux-headers/asm-arm64/unistd_64.h -index 99a1d70459..d4e90fff76 100644 ---- a/linux-headers/asm-arm64/unistd_64.h -+++ b/linux-headers/asm-arm64/unistd_64.h -@@ -319,6 +319,10 @@ - #define __NR_lsm_set_self_attr 460 - #define __NR_lsm_list_modules 461 - #define __NR_mseal 462 -+#define __NR_setxattrat 463 -+#define __NR_getxattrat 464 -+#define __NR_listxattrat 465 -+#define __NR_removexattrat 466 - - - #endif /* _ASM_UNISTD_64_H */ -diff --git a/linux-headers/asm-generic/mman-common.h b/linux-headers/asm-generic/mman-common.h -index 6ce1f1ceb4..1ea2c4c33b 100644 ---- a/linux-headers/asm-generic/mman-common.h -+++ b/linux-headers/asm-generic/mman-common.h -@@ -79,6 +79,9 @@ - - #define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */ - -+#define MADV_GUARD_INSTALL 102 /* fatal signal on access to range */ -+#define MADV_GUARD_REMOVE 103 /* unguard range */ -+ - /* compatibility flags */ - #define MAP_FILE 0 - -diff --git a/linux-headers/asm-generic/mman.h b/linux-headers/asm-generic/mman.h -index 57e8195d0b..5e3d61ddbd 100644 ---- a/linux-headers/asm-generic/mman.h -+++ b/linux-headers/asm-generic/mman.h -@@ -19,4 +19,8 @@ - #define MCL_FUTURE 2 /* lock all future mappings */ - #define MCL_ONFAULT 4 /* lock all pages that are faulted in */ - -+#define SHADOW_STACK_SET_TOKEN (1ULL << 0) /* Set up a restore token in the shadow stack */ -+#define SHADOW_STACK_SET_MARKER (1ULL << 1) /* Set up a top of stack marker in the shadow stack */ -+ -+ - #endif /* __ASM_GENERIC_MMAN_H */ -diff --git a/linux-headers/asm-generic/unistd.h b/linux-headers/asm-generic/unistd.h -index 5bf6148cac..88dc393c2b 100644 ---- a/linux-headers/asm-generic/unistd.h -+++ b/linux-headers/asm-generic/unistd.h -@@ -841,8 +841,17 @@ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules) - #define __NR_mseal 462 - __SYSCALL(__NR_mseal, sys_mseal) - -+#define __NR_setxattrat 463 -+__SYSCALL(__NR_setxattrat, sys_setxattrat) -+#define __NR_getxattrat 464 -+__SYSCALL(__NR_getxattrat, sys_getxattrat) -+#define __NR_listxattrat 465 -+__SYSCALL(__NR_listxattrat, sys_listxattrat) -+#define __NR_removexattrat 466 -+__SYSCALL(__NR_removexattrat, sys_removexattrat) -+ - #undef __NR_syscalls --#define __NR_syscalls 463 -+#define __NR_syscalls 467 - - /* - * 32 bit systems traditionally used different -diff --git a/linux-headers/asm-loongarch/kvm.h b/linux-headers/asm-loongarch/kvm.h -index 70d89070bf..5f354f5c68 100644 ---- a/linux-headers/asm-loongarch/kvm.h -+++ b/linux-headers/asm-loongarch/kvm.h -@@ -8,6 +8,8 @@ - - #include - -+#define __KVM_HAVE_IRQ_LINE -+ - /* - * KVM LoongArch specific structures and definitions. - * -@@ -132,4 +134,22 @@ struct kvm_iocsr_entry { - #define KVM_IRQCHIP_NUM_PINS 64 - #define KVM_MAX_CORES 256 - -+#define KVM_DEV_LOONGARCH_IPI_GRP_REGS 0x40000001 -+ -+#define KVM_DEV_LOONGARCH_EXTIOI_GRP_REGS 0x40000002 -+ -+#define KVM_DEV_LOONGARCH_EXTIOI_GRP_SW_STATUS 0x40000003 -+#define KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_NUM_CPU 0x0 -+#define KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_FEATURE 0x1 -+#define KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_STATE 0x2 -+ -+#define KVM_DEV_LOONGARCH_EXTIOI_GRP_CTRL 0x40000004 -+#define KVM_DEV_LOONGARCH_EXTIOI_CTRL_INIT_NUM_CPU 0x0 -+#define KVM_DEV_LOONGARCH_EXTIOI_CTRL_INIT_FEATURE 0x1 -+#define KVM_DEV_LOONGARCH_EXTIOI_CTRL_LOAD_FINISHED 0x3 -+ -+#define KVM_DEV_LOONGARCH_PCH_PIC_GRP_REGS 0x40000005 -+#define KVM_DEV_LOONGARCH_PCH_PIC_GRP_CTRL 0x40000006 -+#define KVM_DEV_LOONGARCH_PCH_PIC_CTRL_INIT 0 -+ - #endif /* __UAPI_ASM_LOONGARCH_KVM_H */ -diff --git a/linux-headers/asm-loongarch/unistd_64.h b/linux-headers/asm-loongarch/unistd_64.h -index 887ea50cca..23fb96a8a7 100644 ---- a/linux-headers/asm-loongarch/unistd_64.h -+++ b/linux-headers/asm-loongarch/unistd_64.h -@@ -315,6 +315,10 @@ - #define __NR_lsm_set_self_attr 460 - #define __NR_lsm_list_modules 461 - #define __NR_mseal 462 -+#define __NR_setxattrat 463 -+#define __NR_getxattrat 464 -+#define __NR_listxattrat 465 -+#define __NR_removexattrat 466 - - - #endif /* _ASM_UNISTD_64_H */ -diff --git a/linux-headers/asm-mips/mman.h b/linux-headers/asm-mips/mman.h -index 9c48d9a21a..b700dae28c 100644 ---- a/linux-headers/asm-mips/mman.h -+++ b/linux-headers/asm-mips/mman.h -@@ -105,6 +105,9 @@ - - #define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */ - -+#define MADV_GUARD_INSTALL 102 /* fatal signal on access to range */ -+#define MADV_GUARD_REMOVE 103 /* unguard range */ -+ - /* compatibility flags */ - #define MAP_FILE 0 - -diff --git a/linux-headers/asm-mips/unistd_n32.h b/linux-headers/asm-mips/unistd_n32.h -index fc93b3be30..9a75719644 100644 ---- a/linux-headers/asm-mips/unistd_n32.h -+++ b/linux-headers/asm-mips/unistd_n32.h -@@ -391,5 +391,9 @@ - #define __NR_lsm_set_self_attr (__NR_Linux + 460) - #define __NR_lsm_list_modules (__NR_Linux + 461) - #define __NR_mseal (__NR_Linux + 462) -+#define __NR_setxattrat (__NR_Linux + 463) -+#define __NR_getxattrat (__NR_Linux + 464) -+#define __NR_listxattrat (__NR_Linux + 465) -+#define __NR_removexattrat (__NR_Linux + 466) - - #endif /* _ASM_UNISTD_N32_H */ -diff --git a/linux-headers/asm-mips/unistd_n64.h b/linux-headers/asm-mips/unistd_n64.h -index e72a3eb2c9..7086783b0c 100644 ---- a/linux-headers/asm-mips/unistd_n64.h -+++ b/linux-headers/asm-mips/unistd_n64.h -@@ -367,5 +367,9 @@ - #define __NR_lsm_set_self_attr (__NR_Linux + 460) - #define __NR_lsm_list_modules (__NR_Linux + 461) - #define __NR_mseal (__NR_Linux + 462) -+#define __NR_setxattrat (__NR_Linux + 463) -+#define __NR_getxattrat (__NR_Linux + 464) -+#define __NR_listxattrat (__NR_Linux + 465) -+#define __NR_removexattrat (__NR_Linux + 466) - - #endif /* _ASM_UNISTD_N64_H */ -diff --git a/linux-headers/asm-mips/unistd_o32.h b/linux-headers/asm-mips/unistd_o32.h -index b86eb0786c..b3825823e4 100644 ---- a/linux-headers/asm-mips/unistd_o32.h -+++ b/linux-headers/asm-mips/unistd_o32.h -@@ -437,5 +437,9 @@ - #define __NR_lsm_set_self_attr (__NR_Linux + 460) - #define __NR_lsm_list_modules (__NR_Linux + 461) - #define __NR_mseal (__NR_Linux + 462) -+#define __NR_setxattrat (__NR_Linux + 463) -+#define __NR_getxattrat (__NR_Linux + 464) -+#define __NR_listxattrat (__NR_Linux + 465) -+#define __NR_removexattrat (__NR_Linux + 466) - - #endif /* _ASM_UNISTD_O32_H */ -diff --git a/linux-headers/asm-powerpc/unistd_32.h b/linux-headers/asm-powerpc/unistd_32.h -index 28627b6546..38ee4dc35d 100644 ---- a/linux-headers/asm-powerpc/unistd_32.h -+++ b/linux-headers/asm-powerpc/unistd_32.h -@@ -444,6 +444,10 @@ - #define __NR_lsm_set_self_attr 460 - #define __NR_lsm_list_modules 461 - #define __NR_mseal 462 -+#define __NR_setxattrat 463 -+#define __NR_getxattrat 464 -+#define __NR_listxattrat 465 -+#define __NR_removexattrat 466 - - - #endif /* _ASM_UNISTD_32_H */ -diff --git a/linux-headers/asm-powerpc/unistd_64.h b/linux-headers/asm-powerpc/unistd_64.h -index 1fc42a8300..5e5f156834 100644 ---- a/linux-headers/asm-powerpc/unistd_64.h -+++ b/linux-headers/asm-powerpc/unistd_64.h -@@ -416,6 +416,10 @@ - #define __NR_lsm_set_self_attr 460 - #define __NR_lsm_list_modules 461 - #define __NR_mseal 462 -+#define __NR_setxattrat 463 -+#define __NR_getxattrat 464 -+#define __NR_listxattrat 465 -+#define __NR_removexattrat 466 - - - #endif /* _ASM_UNISTD_64_H */ -diff --git a/linux-headers/asm-riscv/kvm.h b/linux-headers/asm-riscv/kvm.h -index e97db32964..3482c9a73d 100644 ---- a/linux-headers/asm-riscv/kvm.h -+++ b/linux-headers/asm-riscv/kvm.h -@@ -175,6 +175,10 @@ enum KVM_RISCV_ISA_EXT_ID { - KVM_RISCV_ISA_EXT_ZCF, - KVM_RISCV_ISA_EXT_ZCMOP, - KVM_RISCV_ISA_EXT_ZAWRS, -+ KVM_RISCV_ISA_EXT_SMNPM, -+ KVM_RISCV_ISA_EXT_SSNPM, -+ KVM_RISCV_ISA_EXT_SVADE, -+ KVM_RISCV_ISA_EXT_SVADU, - KVM_RISCV_ISA_EXT_MAX, - }; - -diff --git a/linux-headers/asm-riscv/unistd_32.h b/linux-headers/asm-riscv/unistd_32.h -index 9625743dfd..74f6127aed 100644 ---- a/linux-headers/asm-riscv/unistd_32.h -+++ b/linux-headers/asm-riscv/unistd_32.h -@@ -310,6 +310,10 @@ - #define __NR_lsm_set_self_attr 460 - #define __NR_lsm_list_modules 461 - #define __NR_mseal 462 -+#define __NR_setxattrat 463 -+#define __NR_getxattrat 464 -+#define __NR_listxattrat 465 -+#define __NR_removexattrat 466 - - - #endif /* _ASM_UNISTD_32_H */ -diff --git a/linux-headers/asm-riscv/unistd_64.h b/linux-headers/asm-riscv/unistd_64.h -index 95bca8ae81..bb6a15a2ec 100644 ---- a/linux-headers/asm-riscv/unistd_64.h -+++ b/linux-headers/asm-riscv/unistd_64.h -@@ -320,6 +320,10 @@ - #define __NR_lsm_set_self_attr 460 - #define __NR_lsm_list_modules 461 - #define __NR_mseal 462 -+#define __NR_setxattrat 463 -+#define __NR_getxattrat 464 -+#define __NR_listxattrat 465 -+#define __NR_removexattrat 466 - - - #endif /* _ASM_UNISTD_64_H */ -diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h -index 684c4e1205..ab5a6bce59 100644 ---- a/linux-headers/asm-s390/kvm.h -+++ b/linux-headers/asm-s390/kvm.h -@@ -469,7 +469,8 @@ struct kvm_s390_vm_cpu_subfunc { - __u8 kdsa[16]; /* with MSA9 */ - __u8 sortl[32]; /* with STFLE.150 */ - __u8 dfltcc[32]; /* with STFLE.151 */ -- __u8 reserved[1728]; -+ __u8 pfcr[16]; /* with STFLE.201 */ -+ __u8 reserved[1712]; - }; - - #define KVM_S390_VM_CPU_PROCESSOR_UV_FEAT_GUEST 6 -diff --git a/linux-headers/asm-s390/unistd_32.h b/linux-headers/asm-s390/unistd_32.h -index 7706c21b87..620201cb36 100644 ---- a/linux-headers/asm-s390/unistd_32.h -+++ b/linux-headers/asm-s390/unistd_32.h -@@ -435,5 +435,9 @@ - #define __NR_lsm_set_self_attr 460 - #define __NR_lsm_list_modules 461 - #define __NR_mseal 462 -+#define __NR_setxattrat 463 -+#define __NR_getxattrat 464 -+#define __NR_listxattrat 465 -+#define __NR_removexattrat 466 - - #endif /* _ASM_S390_UNISTD_32_H */ -diff --git a/linux-headers/asm-s390/unistd_64.h b/linux-headers/asm-s390/unistd_64.h -index 62082d592d..e7e4a10aaf 100644 ---- a/linux-headers/asm-s390/unistd_64.h -+++ b/linux-headers/asm-s390/unistd_64.h -@@ -383,5 +383,9 @@ - #define __NR_lsm_set_self_attr 460 - #define __NR_lsm_list_modules 461 - #define __NR_mseal 462 -+#define __NR_setxattrat 463 -+#define __NR_getxattrat 464 -+#define __NR_listxattrat 465 -+#define __NR_removexattrat 466 - - #endif /* _ASM_S390_UNISTD_64_H */ -diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h -index 4711ef2c3d..96589490c4 100644 ---- a/linux-headers/asm-x86/kvm.h -+++ b/linux-headers/asm-x86/kvm.h -@@ -438,6 +438,7 @@ struct kvm_sync_regs { - #define KVM_X86_QUIRK_FIX_HYPERCALL_INSN (1 << 5) - #define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6) - #define KVM_X86_QUIRK_SLOT_ZAP_ALL (1 << 7) -+#define KVM_X86_QUIRK_STUFF_FEATURE_MSRS (1 << 8) - - #define KVM_STATE_NESTED_FORMAT_VMX 0 - #define KVM_STATE_NESTED_FORMAT_SVM 1 -diff --git a/linux-headers/asm-x86/mman.h b/linux-headers/asm-x86/mman.h -index 46cdc941f9..ac1e627721 100644 ---- a/linux-headers/asm-x86/mman.h -+++ b/linux-headers/asm-x86/mman.h -@@ -5,9 +5,6 @@ - #define MAP_32BIT 0x40 /* only give out 32bit addresses */ - #define MAP_ABOVE4G 0x80 /* only map above 4GB */ - --/* Flags for map_shadow_stack(2) */ --#define SHADOW_STACK_SET_TOKEN (1ULL << 0) /* Set up a restore token in the shadow stack */ -- - #include - - #endif /* _ASM_X86_MMAN_H */ -diff --git a/linux-headers/asm-x86/unistd_32.h b/linux-headers/asm-x86/unistd_32.h -index fb7b8b169b..a2eb492a75 100644 ---- a/linux-headers/asm-x86/unistd_32.h -+++ b/linux-headers/asm-x86/unistd_32.h -@@ -453,6 +453,10 @@ - #define __NR_lsm_set_self_attr 460 - #define __NR_lsm_list_modules 461 - #define __NR_mseal 462 -+#define __NR_setxattrat 463 -+#define __NR_getxattrat 464 -+#define __NR_listxattrat 465 -+#define __NR_removexattrat 466 - - - #endif /* _ASM_UNISTD_32_H */ -diff --git a/linux-headers/asm-x86/unistd_64.h b/linux-headers/asm-x86/unistd_64.h -index 24c979be54..2f5fc400f5 100644 ---- a/linux-headers/asm-x86/unistd_64.h -+++ b/linux-headers/asm-x86/unistd_64.h -@@ -376,6 +376,10 @@ - #define __NR_lsm_set_self_attr 460 - #define __NR_lsm_list_modules 461 - #define __NR_mseal 462 -+#define __NR_setxattrat 463 -+#define __NR_getxattrat 464 -+#define __NR_listxattrat 465 -+#define __NR_removexattrat 466 - - - #endif /* _ASM_UNISTD_64_H */ -diff --git a/linux-headers/asm-x86/unistd_x32.h b/linux-headers/asm-x86/unistd_x32.h -index c23dd21a2d..fecd832e7f 100644 ---- a/linux-headers/asm-x86/unistd_x32.h -+++ b/linux-headers/asm-x86/unistd_x32.h -@@ -329,6 +329,10 @@ - #define __NR_lsm_set_self_attr (__X32_SYSCALL_BIT + 460) - #define __NR_lsm_list_modules (__X32_SYSCALL_BIT + 461) - #define __NR_mseal (__X32_SYSCALL_BIT + 462) -+#define __NR_setxattrat (__X32_SYSCALL_BIT + 463) -+#define __NR_getxattrat (__X32_SYSCALL_BIT + 464) -+#define __NR_listxattrat (__X32_SYSCALL_BIT + 465) -+#define __NR_removexattrat (__X32_SYSCALL_BIT + 466) - #define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512) - #define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513) - #define __NR_ioctl (__X32_SYSCALL_BIT + 514) -diff --git a/linux-headers/linux/iommufd.h b/linux-headers/linux/iommufd.h -index 782baf477f..37aae16502 100644 ---- a/linux-headers/linux/iommufd.h -+++ b/linux-headers/linux/iommufd.h -@@ -51,6 +51,10 @@ enum { - IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP = 0x8c, - IOMMUFD_CMD_HWPT_INVALIDATE = 0x8d, - IOMMUFD_CMD_FAULT_QUEUE_ALLOC = 0x8e, -+ IOMMUFD_CMD_IOAS_MAP_FILE = 0x8f, -+ IOMMUFD_CMD_VIOMMU_ALLOC = 0x90, -+ IOMMUFD_CMD_VDEVICE_ALLOC = 0x91, -+ IOMMUFD_CMD_IOAS_CHANGE_PROCESS = 0x92, - }; - - /** -@@ -213,6 +217,30 @@ struct iommu_ioas_map { - }; - #define IOMMU_IOAS_MAP _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_MAP) - -+/** -+ * struct iommu_ioas_map_file - ioctl(IOMMU_IOAS_MAP_FILE) -+ * @size: sizeof(struct iommu_ioas_map_file) -+ * @flags: same as for iommu_ioas_map -+ * @ioas_id: same as for iommu_ioas_map -+ * @fd: the memfd to map -+ * @start: byte offset from start of file to map from -+ * @length: same as for iommu_ioas_map -+ * @iova: same as for iommu_ioas_map -+ * -+ * Set an IOVA mapping from a memfd file. All other arguments and semantics -+ * match those of IOMMU_IOAS_MAP. -+ */ -+struct iommu_ioas_map_file { -+ __u32 size; -+ __u32 flags; -+ __u32 ioas_id; -+ __s32 fd; -+ __aligned_u64 start; -+ __aligned_u64 length; -+ __aligned_u64 iova; -+}; -+#define IOMMU_IOAS_MAP_FILE _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_MAP_FILE) -+ - /** - * struct iommu_ioas_copy - ioctl(IOMMU_IOAS_COPY) - * @size: sizeof(struct iommu_ioas_copy) -@@ -359,11 +387,19 @@ struct iommu_vfio_ioas { - * enforced on device attachment - * @IOMMU_HWPT_FAULT_ID_VALID: The fault_id field of hwpt allocation data is - * valid. -+ * @IOMMU_HWPT_ALLOC_PASID: Requests a domain that can be used with PASID. The -+ * domain can be attached to any PASID on the device. -+ * Any domain attached to the non-PASID part of the -+ * device must also be flaged, otherwise attaching a -+ * PASID will blocked. -+ * If IOMMU does not support PASID it will return -+ * error (-EOPNOTSUPP). - */ - enum iommufd_hwpt_alloc_flags { - IOMMU_HWPT_ALLOC_NEST_PARENT = 1 << 0, - IOMMU_HWPT_ALLOC_DIRTY_TRACKING = 1 << 1, - IOMMU_HWPT_FAULT_ID_VALID = 1 << 2, -+ IOMMU_HWPT_ALLOC_PASID = 1 << 3, - }; - - /** -@@ -394,14 +430,36 @@ struct iommu_hwpt_vtd_s1 { - __u32 __reserved; - }; - -+/** -+ * struct iommu_hwpt_arm_smmuv3 - ARM SMMUv3 nested STE -+ * (IOMMU_HWPT_DATA_ARM_SMMUV3) -+ * -+ * @ste: The first two double words of the user space Stream Table Entry for -+ * the translation. Must be little-endian. -+ * Allowed fields: (Refer to "5.2 Stream Table Entry" in SMMUv3 HW Spec) -+ * - word-0: V, Cfg, S1Fmt, S1ContextPtr, S1CDMax -+ * - word-1: EATS, S1DSS, S1CIR, S1COR, S1CSH, S1STALLD -+ * -+ * -EIO will be returned if @ste is not legal or contains any non-allowed field. -+ * Cfg can be used to select a S1, Bypass or Abort configuration. A Bypass -+ * nested domain will translate the same as the nesting parent. The S1 will -+ * install a Context Descriptor Table pointing at userspace memory translated -+ * by the nesting parent. -+ */ -+struct iommu_hwpt_arm_smmuv3 { -+ __aligned_le64 ste[2]; -+}; -+ - /** - * enum iommu_hwpt_data_type - IOMMU HWPT Data Type - * @IOMMU_HWPT_DATA_NONE: no data - * @IOMMU_HWPT_DATA_VTD_S1: Intel VT-d stage-1 page table -+ * @IOMMU_HWPT_DATA_ARM_SMMUV3: ARM SMMUv3 Context Descriptor Table - */ - enum iommu_hwpt_data_type { - IOMMU_HWPT_DATA_NONE = 0, - IOMMU_HWPT_DATA_VTD_S1 = 1, -+ IOMMU_HWPT_DATA_ARM_SMMUV3 = 2, - }; - - /** -@@ -409,7 +467,7 @@ enum iommu_hwpt_data_type { - * @size: sizeof(struct iommu_hwpt_alloc) - * @flags: Combination of enum iommufd_hwpt_alloc_flags - * @dev_id: The device to allocate this HWPT for -- * @pt_id: The IOAS or HWPT to connect this HWPT to -+ * @pt_id: The IOAS or HWPT or vIOMMU to connect this HWPT to - * @out_hwpt_id: The ID of the new HWPT - * @__reserved: Must be 0 - * @data_type: One of enum iommu_hwpt_data_type -@@ -428,11 +486,13 @@ enum iommu_hwpt_data_type { - * IOMMU_HWPT_DATA_NONE. The HWPT can be allocated as a parent HWPT for a - * nesting configuration by passing IOMMU_HWPT_ALLOC_NEST_PARENT via @flags. - * -- * A user-managed nested HWPT will be created from a given parent HWPT via -- * @pt_id, in which the parent HWPT must be allocated previously via the -- * same ioctl from a given IOAS (@pt_id). In this case, the @data_type -- * must be set to a pre-defined type corresponding to an I/O page table -- * type supported by the underlying IOMMU hardware. -+ * A user-managed nested HWPT will be created from a given vIOMMU (wrapping a -+ * parent HWPT) or a parent HWPT via @pt_id, in which the parent HWPT must be -+ * allocated previously via the same ioctl from a given IOAS (@pt_id). In this -+ * case, the @data_type must be set to a pre-defined type corresponding to an -+ * I/O page table type supported by the underlying IOMMU hardware. The device -+ * via @dev_id and the vIOMMU via @pt_id must be associated to the same IOMMU -+ * instance. - * - * If the @data_type is set to IOMMU_HWPT_DATA_NONE, @data_len and - * @data_uptr should be zero. Otherwise, both @data_len and @data_uptr -@@ -484,15 +544,50 @@ struct iommu_hw_info_vtd { - __aligned_u64 ecap_reg; - }; - -+/** -+ * struct iommu_hw_info_arm_smmuv3 - ARM SMMUv3 hardware information -+ * (IOMMU_HW_INFO_TYPE_ARM_SMMUV3) -+ * -+ * @flags: Must be set to 0 -+ * @__reserved: Must be 0 -+ * @idr: Implemented features for ARM SMMU Non-secure programming interface -+ * @iidr: Information about the implementation and implementer of ARM SMMU, -+ * and architecture version supported -+ * @aidr: ARM SMMU architecture version -+ * -+ * For the details of @idr, @iidr and @aidr, please refer to the chapters -+ * from 6.3.1 to 6.3.6 in the SMMUv3 Spec. -+ * -+ * User space should read the underlying ARM SMMUv3 hardware information for -+ * the list of supported features. -+ * -+ * Note that these values reflect the raw HW capability, without any insight if -+ * any required kernel driver support is present. Bits may be set indicating the -+ * HW has functionality that is lacking kernel software support, such as BTM. If -+ * a VMM is using this information to construct emulated copies of these -+ * registers it should only forward bits that it knows it can support. -+ * -+ * In future, presence of required kernel support will be indicated in flags. -+ */ -+struct iommu_hw_info_arm_smmuv3 { -+ __u32 flags; -+ __u32 __reserved; -+ __u32 idr[6]; -+ __u32 iidr; -+ __u32 aidr; -+}; -+ - /** - * enum iommu_hw_info_type - IOMMU Hardware Info Types - * @IOMMU_HW_INFO_TYPE_NONE: Used by the drivers that do not report hardware - * info - * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type -+ * @IOMMU_HW_INFO_TYPE_ARM_SMMUV3: ARM SMMUv3 iommu info type - */ - enum iommu_hw_info_type { - IOMMU_HW_INFO_TYPE_NONE = 0, - IOMMU_HW_INFO_TYPE_INTEL_VTD = 1, -+ IOMMU_HW_INFO_TYPE_ARM_SMMUV3 = 2, - }; - - /** -@@ -627,9 +722,11 @@ struct iommu_hwpt_get_dirty_bitmap { - * enum iommu_hwpt_invalidate_data_type - IOMMU HWPT Cache Invalidation - * Data Type - * @IOMMU_HWPT_INVALIDATE_DATA_VTD_S1: Invalidation data for VTD_S1 -+ * @IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3: Invalidation data for ARM SMMUv3 - */ - enum iommu_hwpt_invalidate_data_type { - IOMMU_HWPT_INVALIDATE_DATA_VTD_S1 = 0, -+ IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3 = 1, - }; - - /** -@@ -668,10 +765,32 @@ struct iommu_hwpt_vtd_s1_invalidate { - __u32 __reserved; - }; - -+/** -+ * struct iommu_viommu_arm_smmuv3_invalidate - ARM SMMUv3 cahce invalidation -+ * (IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3) -+ * @cmd: 128-bit cache invalidation command that runs in SMMU CMDQ. -+ * Must be little-endian. -+ * -+ * Supported command list only when passing in a vIOMMU via @hwpt_id: -+ * CMDQ_OP_TLBI_NSNH_ALL -+ * CMDQ_OP_TLBI_NH_VA -+ * CMDQ_OP_TLBI_NH_VAA -+ * CMDQ_OP_TLBI_NH_ALL -+ * CMDQ_OP_TLBI_NH_ASID -+ * CMDQ_OP_ATC_INV -+ * CMDQ_OP_CFGI_CD -+ * CMDQ_OP_CFGI_CD_ALL -+ * -+ * -EIO will be returned if the command is not supported. -+ */ -+struct iommu_viommu_arm_smmuv3_invalidate { -+ __aligned_le64 cmd[2]; -+}; -+ - /** - * struct iommu_hwpt_invalidate - ioctl(IOMMU_HWPT_INVALIDATE) - * @size: sizeof(struct iommu_hwpt_invalidate) -- * @hwpt_id: ID of a nested HWPT for cache invalidation -+ * @hwpt_id: ID of a nested HWPT or a vIOMMU, for cache invalidation - * @data_uptr: User pointer to an array of driver-specific cache invalidation - * data. - * @data_type: One of enum iommu_hwpt_invalidate_data_type, defining the data -@@ -682,8 +801,11 @@ struct iommu_hwpt_vtd_s1_invalidate { - * Output the number of requests successfully handled by kernel. - * @__reserved: Must be 0. - * -- * Invalidate the iommu cache for user-managed page table. Modifications on a -- * user-managed page table should be followed by this operation to sync cache. -+ * Invalidate iommu cache for user-managed page table or vIOMMU. Modifications -+ * on a user-managed page table should be followed by this operation, if a HWPT -+ * is passed in via @hwpt_id. Other caches, such as device cache or descriptor -+ * cache can be flushed if a vIOMMU is passed in via the @hwpt_id field. -+ * - * Each ioctl can support one or more cache invalidation requests in the array - * that has a total size of @entry_len * @entry_num. - * -@@ -797,4 +919,88 @@ struct iommu_fault_alloc { - __u32 out_fault_fd; - }; - #define IOMMU_FAULT_QUEUE_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_FAULT_QUEUE_ALLOC) -+ -+/** -+ * enum iommu_viommu_type - Virtual IOMMU Type -+ * @IOMMU_VIOMMU_TYPE_DEFAULT: Reserved for future use -+ * @IOMMU_VIOMMU_TYPE_ARM_SMMUV3: ARM SMMUv3 driver specific type -+ */ -+enum iommu_viommu_type { -+ IOMMU_VIOMMU_TYPE_DEFAULT = 0, -+ IOMMU_VIOMMU_TYPE_ARM_SMMUV3 = 1, -+}; -+ -+/** -+ * struct iommu_viommu_alloc - ioctl(IOMMU_VIOMMU_ALLOC) -+ * @size: sizeof(struct iommu_viommu_alloc) -+ * @flags: Must be 0 -+ * @type: Type of the virtual IOMMU. Must be defined in enum iommu_viommu_type -+ * @dev_id: The device's physical IOMMU will be used to back the virtual IOMMU -+ * @hwpt_id: ID of a nesting parent HWPT to associate to -+ * @out_viommu_id: Output virtual IOMMU ID for the allocated object -+ * -+ * Allocate a virtual IOMMU object, representing the underlying physical IOMMU's -+ * virtualization support that is a security-isolated slice of the real IOMMU HW -+ * that is unique to a specific VM. Operations global to the IOMMU are connected -+ * to the vIOMMU, such as: -+ * - Security namespace for guest owned ID, e.g. guest-controlled cache tags -+ * - Non-device-affiliated event reporting, e.g. invalidation queue errors -+ * - Access to a sharable nesting parent pagetable across physical IOMMUs -+ * - Virtualization of various platforms IDs, e.g. RIDs and others -+ * - Delivery of paravirtualized invalidation -+ * - Direct assigned invalidation queues -+ * - Direct assigned interrupts -+ */ -+struct iommu_viommu_alloc { -+ __u32 size; -+ __u32 flags; -+ __u32 type; -+ __u32 dev_id; -+ __u32 hwpt_id; -+ __u32 out_viommu_id; -+}; -+#define IOMMU_VIOMMU_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VIOMMU_ALLOC) -+ -+/** -+ * struct iommu_vdevice_alloc - ioctl(IOMMU_VDEVICE_ALLOC) -+ * @size: sizeof(struct iommu_vdevice_alloc) -+ * @viommu_id: vIOMMU ID to associate with the virtual device -+ * @dev_id: The physical device to allocate a virtual instance on the vIOMMU -+ * @out_vdevice_id: Object handle for the vDevice. Pass to IOMMU_DESTORY -+ * @virt_id: Virtual device ID per vIOMMU, e.g. vSID of ARM SMMUv3, vDeviceID -+ * of AMD IOMMU, and vRID of a nested Intel VT-d to a Context Table -+ * -+ * Allocate a virtual device instance (for a physical device) against a vIOMMU. -+ * This instance holds the device's information (related to its vIOMMU) in a VM. -+ */ -+struct iommu_vdevice_alloc { -+ __u32 size; -+ __u32 viommu_id; -+ __u32 dev_id; -+ __u32 out_vdevice_id; -+ __aligned_u64 virt_id; -+}; -+#define IOMMU_VDEVICE_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VDEVICE_ALLOC) -+ -+/** -+ * struct iommu_ioas_change_process - ioctl(VFIO_IOAS_CHANGE_PROCESS) -+ * @size: sizeof(struct iommu_ioas_change_process) -+ * @__reserved: Must be 0 -+ * -+ * This transfers pinned memory counts for every memory map in every IOAS -+ * in the context to the current process. This only supports maps created -+ * with IOMMU_IOAS_MAP_FILE, and returns EINVAL if other maps are present. -+ * If the ioctl returns a failure status, then nothing is changed. -+ * -+ * This API is useful for transferring operation of a device from one process -+ * to another, such as during userland live update. -+ */ -+struct iommu_ioas_change_process { -+ __u32 size; -+ __u32 __reserved; -+}; -+ -+#define IOMMU_IOAS_CHANGE_PROCESS \ -+ _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_CHANGE_PROCESS) -+ - #endif -diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h -index 49dd1b30ce..3bcd4eabe3 100644 ---- a/linux-headers/linux/kvm.h -+++ b/linux-headers/linux/kvm.h -@@ -1150,7 +1150,15 @@ enum kvm_device_type { - #define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME - KVM_DEV_TYPE_RISCV_AIA, - #define KVM_DEV_TYPE_RISCV_AIA KVM_DEV_TYPE_RISCV_AIA -+ KVM_DEV_TYPE_LOONGARCH_IPI, -+#define KVM_DEV_TYPE_LOONGARCH_IPI KVM_DEV_TYPE_LOONGARCH_IPI -+ KVM_DEV_TYPE_LOONGARCH_EIOINTC, -+#define KVM_DEV_TYPE_LOONGARCH_EIOINTC KVM_DEV_TYPE_LOONGARCH_EIOINTC -+ KVM_DEV_TYPE_LOONGARCH_PCHPIC, -+#define KVM_DEV_TYPE_LOONGARCH_PCHPIC KVM_DEV_TYPE_LOONGARCH_PCHPIC -+ - KVM_DEV_TYPE_MAX, -+ - }; - - struct kvm_vfio_spapr_tce { -diff --git a/linux-headers/linux/psci.h b/linux-headers/linux/psci.h -index 74f3cb5007..a982afd498 100644 ---- a/linux-headers/linux/psci.h -+++ b/linux-headers/linux/psci.h -@@ -59,6 +59,7 @@ - #define PSCI_1_1_FN_SYSTEM_RESET2 PSCI_0_2_FN(18) - #define PSCI_1_1_FN_MEM_PROTECT PSCI_0_2_FN(19) - #define PSCI_1_1_FN_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN(20) -+#define PSCI_1_3_FN_SYSTEM_OFF2 PSCI_0_2_FN(21) - - #define PSCI_1_0_FN64_CPU_DEFAULT_SUSPEND PSCI_0_2_FN64(12) - #define PSCI_1_0_FN64_NODE_HW_STATE PSCI_0_2_FN64(13) -@@ -68,6 +69,7 @@ - - #define PSCI_1_1_FN64_SYSTEM_RESET2 PSCI_0_2_FN64(18) - #define PSCI_1_1_FN64_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN64(20) -+#define PSCI_1_3_FN64_SYSTEM_OFF2 PSCI_0_2_FN64(21) - - /* PSCI v0.2 power state encoding for CPU_SUSPEND function */ - #define PSCI_0_2_POWER_STATE_ID_MASK 0xffff -@@ -100,6 +102,9 @@ - #define PSCI_1_1_RESET_TYPE_SYSTEM_WARM_RESET 0 - #define PSCI_1_1_RESET_TYPE_VENDOR_START 0x80000000U - -+/* PSCI v1.3 hibernate type for SYSTEM_OFF2 */ -+#define PSCI_1_3_OFF_TYPE_HIBERNATE_OFF BIT(0) -+ - /* PSCI version decoding (independent of PSCI version) */ - #define PSCI_VERSION_MAJOR_SHIFT 16 - #define PSCI_VERSION_MINOR_MASK \ -diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h -index b4be37b225..1b5e254d6a 100644 ---- a/linux-headers/linux/vfio.h -+++ b/linux-headers/linux/vfio.h -@@ -35,7 +35,7 @@ - #define VFIO_EEH 5 - - /* Two-stage IOMMU */ --#define VFIO_TYPE1_NESTING_IOMMU 6 /* Implies v2 */ -+#define __VFIO_RESERVED_TYPE1_NESTING_IOMMU 6 /* Implies v2 */ - - #define VFIO_SPAPR_TCE_v2_IOMMU 7 - --- -2.39.3 - diff --git a/kvm-linux-headers-Update-to-Linux-v6.12-rc5.patch b/kvm-linux-headers-Update-to-Linux-v6.12-rc5.patch deleted file mode 100644 index b548ab3..0000000 --- a/kvm-linux-headers-Update-to-Linux-v6.12-rc5.patch +++ /dev/null @@ -1,2559 +0,0 @@ -From d49c6a77649755fac29dce957795338942f58ac4 Mon Sep 17 00:00:00 2001 -From: Bibo Mao -Date: Mon, 28 Oct 2024 10:38:09 +0800 -Subject: [PATCH 01/18] linux-headers: Update to Linux v6.12-rc5 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [1/16] b28ecec9551a4850d48d48522088ef4eef6f30ad (thuth/qemu-kvm-cs9) - -update linux-headers to v6.12-rc5. Pass to compile on aarch64, arm, -loongarch64, x86_64, i386, riscv64,riscv32 softmmu and linux-user. - -Signed-off-by: Bibo Mao -Acked-by: Song Gao -Message-Id: <20241028023809.1554405-4-maobibo@loongson.cn> -Signed-off-by: Song Gao -(cherry picked from commit 0d2eeef77a33315187df8519491a900bde4a3d83) -Signed-off-by: Thomas Huth ---- - include/standard-headers/drm/drm_fourcc.h | 43 +++ - include/standard-headers/linux/const.h | 17 + - include/standard-headers/linux/ethtool.h | 226 ++++++++++++ - include/standard-headers/linux/fuse.h | 22 +- - .../linux/input-event-codes.h | 2 + - include/standard-headers/linux/pci_regs.h | 41 ++- - .../standard-headers/linux/virtio_balloon.h | 16 +- - include/standard-headers/linux/virtio_gpu.h | 1 + - linux-headers/asm-arm64/mman.h | 9 + - linux-headers/asm-arm64/unistd.h | 25 +- - linux-headers/asm-arm64/unistd_64.h | 324 +++++++++++++++++ - linux-headers/asm-generic/unistd.h | 6 +- - linux-headers/asm-loongarch/kvm.h | 24 ++ - linux-headers/asm-loongarch/kvm_para.h | 21 ++ - linux-headers/asm-loongarch/unistd.h | 4 +- - linux-headers/asm-loongarch/unistd_64.h | 320 +++++++++++++++++ - linux-headers/asm-riscv/kvm.h | 7 + - linux-headers/asm-riscv/unistd.h | 41 +-- - linux-headers/asm-riscv/unistd_32.h | 315 +++++++++++++++++ - linux-headers/asm-riscv/unistd_64.h | 325 ++++++++++++++++++ - linux-headers/asm-x86/kvm.h | 2 + - linux-headers/asm-x86/unistd_64.h | 1 + - linux-headers/asm-x86/unistd_x32.h | 1 + - linux-headers/linux/bits.h | 3 + - linux-headers/linux/const.h | 17 + - linux-headers/linux/iommufd.h | 143 +++++++- - linux-headers/linux/kvm.h | 23 +- - linux-headers/linux/mman.h | 1 + - linux-headers/linux/psp-sev.h | 28 ++ - 29 files changed, 1915 insertions(+), 93 deletions(-) - create mode 100644 linux-headers/asm-arm64/unistd_64.h - create mode 100644 linux-headers/asm-loongarch/kvm_para.h - create mode 100644 linux-headers/asm-loongarch/unistd_64.h - create mode 100644 linux-headers/asm-riscv/unistd_32.h - create mode 100644 linux-headers/asm-riscv/unistd_64.h - -diff --git a/include/standard-headers/drm/drm_fourcc.h b/include/standard-headers/drm/drm_fourcc.h -index b72917073d..d4a2231306 100644 ---- a/include/standard-headers/drm/drm_fourcc.h -+++ b/include/standard-headers/drm/drm_fourcc.h -@@ -701,6 +701,31 @@ extern "C" { - */ - #define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS_CC fourcc_mod_code(INTEL, 15) - -+/* -+ * Intel Color Control Surfaces (CCS) for graphics ver. 20 unified compression -+ * on integrated graphics -+ * -+ * The main surface is Tile 4 and at plane index 0. For semi-planar formats -+ * like NV12, the Y and UV planes are Tile 4 and are located at plane indices -+ * 0 and 1, respectively. The CCS for all planes are stored outside of the -+ * GEM object in a reserved memory area dedicated for the storage of the -+ * CCS data for all compressible GEM objects. -+ */ -+#define I915_FORMAT_MOD_4_TILED_LNL_CCS fourcc_mod_code(INTEL, 16) -+ -+/* -+ * Intel Color Control Surfaces (CCS) for graphics ver. 20 unified compression -+ * on discrete graphics -+ * -+ * The main surface is Tile 4 and at plane index 0. For semi-planar formats -+ * like NV12, the Y and UV planes are Tile 4 and are located at plane indices -+ * 0 and 1, respectively. The CCS for all planes are stored outside of the -+ * GEM object in a reserved memory area dedicated for the storage of the -+ * CCS data for all compressible GEM objects. The GEM object must be stored in -+ * contiguous memory with a size aligned to 64KB -+ */ -+#define I915_FORMAT_MOD_4_TILED_BMG_CCS fourcc_mod_code(INTEL, 17) -+ - /* - * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks - * -@@ -1475,6 +1500,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) - #define AMD_FMT_MOD_TILE_VER_GFX10 2 - #define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3 - #define AMD_FMT_MOD_TILE_VER_GFX11 4 -+#define AMD_FMT_MOD_TILE_VER_GFX12 5 - - /* - * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical -@@ -1485,6 +1511,8 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) - /* - * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has - * GFX9 as canonical version. -+ * -+ * 64K_D_2D on GFX12 is identical to 64K_D on GFX11. - */ - #define AMD_FMT_MOD_TILE_GFX9_64K_D 10 - #define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25 -@@ -1492,6 +1520,21 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) - #define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27 - #define AMD_FMT_MOD_TILE_GFX11_256K_R_X 31 - -+/* Gfx12 swizzle modes: -+ * 0 - LINEAR -+ * 1 - 256B_2D - 2D block dimensions -+ * 2 - 4KB_2D -+ * 3 - 64KB_2D -+ * 4 - 256KB_2D -+ * 5 - 4KB_3D - 3D block dimensions -+ * 6 - 64KB_3D -+ * 7 - 256KB_3D -+ */ -+#define AMD_FMT_MOD_TILE_GFX12_256B_2D 1 -+#define AMD_FMT_MOD_TILE_GFX12_4K_2D 2 -+#define AMD_FMT_MOD_TILE_GFX12_64K_2D 3 -+#define AMD_FMT_MOD_TILE_GFX12_256K_2D 4 -+ - #define AMD_FMT_MOD_DCC_BLOCK_64B 0 - #define AMD_FMT_MOD_DCC_BLOCK_128B 1 - #define AMD_FMT_MOD_DCC_BLOCK_256B 2 -diff --git a/include/standard-headers/linux/const.h b/include/standard-headers/linux/const.h -index 1eb84b5087..2122610de7 100644 ---- a/include/standard-headers/linux/const.h -+++ b/include/standard-headers/linux/const.h -@@ -28,6 +28,23 @@ - #define _BITUL(x) (_UL(1) << (x)) - #define _BITULL(x) (_ULL(1) << (x)) - -+#if !defined(__ASSEMBLY__) -+/* -+ * Missing __asm__ support -+ * -+ * __BIT128() would not work in the __asm__ code, as it shifts an -+ * 'unsigned __init128' data type as direct representation of -+ * 128 bit constants is not supported in the gcc compiler, as -+ * they get silently truncated. -+ * -+ * TODO: Please revisit this implementation when gcc compiler -+ * starts representing 128 bit constants directly like long -+ * and unsigned long etc. Subsequently drop the comment for -+ * GENMASK_U128() which would then start supporting __asm__ code. -+ */ -+#define _BIT128(x) ((unsigned __int128)(1) << (x)) -+#endif -+ - #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1) - #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) - -diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-headers/linux/ethtool.h -index b0b4b68410..b05e84825b 100644 ---- a/include/standard-headers/linux/ethtool.h -+++ b/include/standard-headers/linux/ethtool.h -@@ -752,6 +752,197 @@ enum ethtool_module_power_mode { - ETHTOOL_MODULE_POWER_MODE_HIGH, - }; - -+/** -+ * enum ethtool_c33_pse_ext_state - groups of PSE extended states -+ * functions. IEEE 802.3-2022 33.2.4.4 Variables -+ * -+ * @ETHTOOL_C33_PSE_EXT_STATE_ERROR_CONDITION: Group of error_condition states -+ * @ETHTOOL_C33_PSE_EXT_STATE_MR_MPS_VALID: Group of mr_mps_valid states -+ * @ETHTOOL_C33_PSE_EXT_STATE_MR_PSE_ENABLE: Group of mr_pse_enable states -+ * @ETHTOOL_C33_PSE_EXT_STATE_OPTION_DETECT_TED: Group of option_detect_ted -+ * states -+ * @ETHTOOL_C33_PSE_EXT_STATE_OPTION_VPORT_LIM: Group of option_vport_lim states -+ * @ETHTOOL_C33_PSE_EXT_STATE_OVLD_DETECTED: Group of ovld_detected states -+ * @ETHTOOL_C33_PSE_EXT_STATE_PD_DLL_POWER_TYPE: Group of pd_dll_power_type -+ * states -+ * @ETHTOOL_C33_PSE_EXT_STATE_POWER_NOT_AVAILABLE: Group of power_not_available -+ * states -+ * @ETHTOOL_C33_PSE_EXT_STATE_SHORT_DETECTED: Group of short_detected states -+ */ -+enum ethtool_c33_pse_ext_state { -+ ETHTOOL_C33_PSE_EXT_STATE_ERROR_CONDITION = 1, -+ ETHTOOL_C33_PSE_EXT_STATE_MR_MPS_VALID, -+ ETHTOOL_C33_PSE_EXT_STATE_MR_PSE_ENABLE, -+ ETHTOOL_C33_PSE_EXT_STATE_OPTION_DETECT_TED, -+ ETHTOOL_C33_PSE_EXT_STATE_OPTION_VPORT_LIM, -+ ETHTOOL_C33_PSE_EXT_STATE_OVLD_DETECTED, -+ ETHTOOL_C33_PSE_EXT_STATE_PD_DLL_POWER_TYPE, -+ ETHTOOL_C33_PSE_EXT_STATE_POWER_NOT_AVAILABLE, -+ ETHTOOL_C33_PSE_EXT_STATE_SHORT_DETECTED, -+}; -+ -+/** -+ * enum ethtool_c33_pse_ext_substate_mr_mps_valid - mr_mps_valid states -+ * functions. IEEE 802.3-2022 33.2.4.4 Variables -+ * -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_DETECTED_UNDERLOAD: Underload -+ * state -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_CONNECTION_OPEN: Port is not -+ * connected -+ * -+ * The PSE monitors either the DC or AC Maintain Power Signature -+ * (MPS, see 33.2.9.1). This variable indicates the presence or absence of -+ * a valid MPS. -+ */ -+enum ethtool_c33_pse_ext_substate_mr_mps_valid { -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_DETECTED_UNDERLOAD = 1, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_CONNECTION_OPEN, -+}; -+ -+/** -+ * enum ethtool_c33_pse_ext_substate_error_condition - error_condition states -+ * functions. IEEE 802.3-2022 33.2.4.4 Variables -+ * -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_NON_EXISTING_PORT: Non-existing -+ * port number -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNDEFINED_PORT: Undefined port -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_INTERNAL_HW_FAULT: Internal -+ * hardware fault -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_COMM_ERROR_AFTER_FORCE_ON: -+ * Communication error after force on -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNKNOWN_PORT_STATUS: Unknown -+ * port status -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_TURN_OFF: Host -+ * crash turn off -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_FORCE_SHUTDOWN: -+ * Host crash force shutdown -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_CONFIG_CHANGE: Configuration -+ * change -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_DETECTED_OVER_TEMP: Over -+ * temperature detected -+ * -+ * error_condition is a variable indicating the status of -+ * implementation-specific fault conditions or optionally other system faults -+ * that prevent the PSE from meeting the specifications in Table 33–11 and that -+ * require the PSE not to source power. These error conditions are different -+ * from those monitored by the state diagrams in Figure 33–10. -+ */ -+enum ethtool_c33_pse_ext_substate_error_condition { -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_NON_EXISTING_PORT = 1, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNDEFINED_PORT, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_INTERNAL_HW_FAULT, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_COMM_ERROR_AFTER_FORCE_ON, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNKNOWN_PORT_STATUS, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_TURN_OFF, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_FORCE_SHUTDOWN, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_CONFIG_CHANGE, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_DETECTED_OVER_TEMP, -+}; -+ -+/** -+ * enum ethtool_c33_pse_ext_substate_mr_pse_enable - mr_pse_enable states -+ * functions. IEEE 802.3-2022 33.2.4.4 Variables -+ * -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_PSE_ENABLE_DISABLE_PIN_ACTIVE: Disable -+ * pin active -+ * -+ * mr_pse_enable is control variable that selects PSE operation and test -+ * functions. -+ */ -+enum ethtool_c33_pse_ext_substate_mr_pse_enable { -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_PSE_ENABLE_DISABLE_PIN_ACTIVE = 1, -+}; -+ -+/** -+ * enum ethtool_c33_pse_ext_substate_option_detect_ted - option_detect_ted -+ * states functions. IEEE 802.3-2022 33.2.4.4 Variables -+ * -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_DET_IN_PROCESS: Detection -+ * in process -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_CONNECTION_CHECK_ERROR: -+ * Connection check error -+ * -+ * option_detect_ted is a variable indicating if detection can be performed -+ * by the PSE during the ted_timer interval. -+ */ -+enum ethtool_c33_pse_ext_substate_option_detect_ted { -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_DET_IN_PROCESS = 1, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_CONNECTION_CHECK_ERROR, -+}; -+ -+/** -+ * enum ethtool_c33_pse_ext_substate_option_vport_lim - option_vport_lim states -+ * functions. IEEE 802.3-2022 33.2.4.4 Variables -+ * -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_HIGH_VOLTAGE: Main supply -+ * voltage is high -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_LOW_VOLTAGE: Main supply -+ * voltage is low -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_VOLTAGE_INJECTION: Voltage -+ * injection into the port -+ * -+ * option_vport_lim is an optional variable indicates if VPSE is out of the -+ * operating range during normal operating state. -+ */ -+enum ethtool_c33_pse_ext_substate_option_vport_lim { -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_HIGH_VOLTAGE = 1, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_LOW_VOLTAGE, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_VOLTAGE_INJECTION, -+}; -+ -+/** -+ * enum ethtool_c33_pse_ext_substate_ovld_detected - ovld_detected states -+ * functions. IEEE 802.3-2022 33.2.4.4 Variables -+ * -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OVLD_DETECTED_OVERLOAD: Overload state -+ * -+ * ovld_detected is a variable indicating if the PSE output current has been -+ * in an overload condition (see 33.2.7.6) for at least TCUT of a one-second -+ * sliding time. -+ */ -+enum ethtool_c33_pse_ext_substate_ovld_detected { -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_OVLD_DETECTED_OVERLOAD = 1, -+}; -+ -+/** -+ * enum ethtool_c33_pse_ext_substate_power_not_available - power_not_available -+ * states functions. IEEE 802.3-2022 33.2.4.4 Variables -+ * -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_BUDGET_EXCEEDED: Power -+ * budget exceeded for the controller -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PORT_PW_LIMIT_EXCEEDS_CONTROLLER_BUDGET: -+ * Configured port power limit exceeded controller power budget -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PD_REQUEST_EXCEEDS_PORT_LIMIT: -+ * Power request from PD exceeds port limit -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_HW_PW_LIMIT: Power -+ * denied due to Hardware power limit -+ * -+ * power_not_available is a variable that is asserted in an -+ * implementation-dependent manner when the PSE is no longer capable of -+ * sourcing sufficient power to support the attached PD. Sufficient power -+ * is defined by classification; see 33.2.6. -+ */ -+enum ethtool_c33_pse_ext_substate_power_not_available { -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_BUDGET_EXCEEDED = 1, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PORT_PW_LIMIT_EXCEEDS_CONTROLLER_BUDGET, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PD_REQUEST_EXCEEDS_PORT_LIMIT, -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_HW_PW_LIMIT, -+}; -+ -+/** -+ * enum ethtool_c33_pse_ext_substate_short_detected - short_detected states -+ * functions. IEEE 802.3-2022 33.2.4.4 Variables -+ * -+ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_SHORT_DETECTED_SHORT_CONDITION: Short -+ * condition was detected -+ * -+ * short_detected is a variable indicating if the PSE output current has been -+ * in a short circuit condition for TLIM within a sliding window (see 33.2.7.7). -+ */ -+enum ethtool_c33_pse_ext_substate_short_detected { -+ ETHTOOL_C33_PSE_EXT_SUBSTATE_SHORT_DETECTED_SHORT_CONDITION = 1, -+}; -+ - /** - * enum ethtool_pse_types - Types of PSE controller. - * @ETHTOOL_PSE_UNKNOWN: Type of PSE controller is unknown -@@ -877,6 +1068,24 @@ enum ethtool_mm_verify_status { - ETHTOOL_MM_VERIFY_STATUS_DISABLED, - }; - -+/** -+ * enum ethtool_module_fw_flash_status - plug-in module firmware flashing status -+ * @ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED: The firmware flashing process has -+ * started. -+ * @ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS: The firmware flashing process -+ * is in progress. -+ * @ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED: The firmware flashing process was -+ * completed successfully. -+ * @ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR: The firmware flashing process was -+ * stopped due to an error. -+ */ -+enum ethtool_module_fw_flash_status { -+ ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED = 1, -+ ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS, -+ ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED, -+ ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR, -+}; -+ - /** - * struct ethtool_gstrings - string set for data tagging - * @cmd: Command number = %ETHTOOL_GSTRINGS -@@ -1845,6 +2054,7 @@ enum ethtool_link_mode_bit_indices { - ETHTOOL_LINK_MODE_10baseT1S_Full_BIT = 99, - ETHTOOL_LINK_MODE_10baseT1S_Half_BIT = 100, - ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT = 101, -+ ETHTOOL_LINK_MODE_10baseT1BRR_Full_BIT = 102, - - /* must be last entry */ - __ETHTOOL_LINK_MODE_MASK_NBITS -@@ -2323,4 +2533,20 @@ struct ethtool_link_settings { - * uint32_t map_lp_advertising[link_mode_masks_nwords]; - */ - }; -+ -+/** -+ * enum phy_upstream - Represents the upstream component a given PHY device -+ * is connected to, as in what is on the other end of the MII bus. Most PHYs -+ * will be attached to an Ethernet MAC controller, but in some cases, there's -+ * an intermediate PHY used as a media-converter, which will driver another -+ * MII interface as its output. -+ * @PHY_UPSTREAM_MAC: Upstream component is a MAC (a switch port, -+ * or ethernet controller) -+ * @PHY_UPSTREAM_PHY: Upstream component is a PHY (likely a media converter) -+ */ -+enum phy_upstream { -+ PHY_UPSTREAM_MAC, -+ PHY_UPSTREAM_PHY, -+}; -+ - #endif /* _LINUX_ETHTOOL_H */ -diff --git a/include/standard-headers/linux/fuse.h b/include/standard-headers/linux/fuse.h -index bac9dbc49f..889e12ad15 100644 ---- a/include/standard-headers/linux/fuse.h -+++ b/include/standard-headers/linux/fuse.h -@@ -217,6 +217,9 @@ - * - add backing_id to fuse_open_out, add FOPEN_PASSTHROUGH open flag - * - add FUSE_NO_EXPORT_SUPPORT init flag - * - add FUSE_NOTIFY_RESEND, add FUSE_HAS_RESEND init flag -+ * -+ * 7.41 -+ * - add FUSE_ALLOW_IDMAP - */ - - #ifndef _LINUX_FUSE_H -@@ -248,7 +251,7 @@ - #define FUSE_KERNEL_VERSION 7 - - /** Minor version number of this interface */ --#define FUSE_KERNEL_MINOR_VERSION 40 -+#define FUSE_KERNEL_MINOR_VERSION 41 - - /** The node ID of the root inode */ - #define FUSE_ROOT_ID 1 -@@ -417,6 +420,7 @@ struct fuse_file_lock { - * FUSE_NO_EXPORT_SUPPORT: explicitly disable export support - * FUSE_HAS_RESEND: kernel supports resending pending requests, and the high bit - * of the request ID indicates resend requests -+ * FUSE_ALLOW_IDMAP: allow creation of idmapped mounts - */ - #define FUSE_ASYNC_READ (1 << 0) - #define FUSE_POSIX_LOCKS (1 << 1) -@@ -462,6 +466,7 @@ struct fuse_file_lock { - - /* Obsolete alias for FUSE_DIRECT_IO_ALLOW_MMAP */ - #define FUSE_DIRECT_IO_RELAX FUSE_DIRECT_IO_ALLOW_MMAP -+#define FUSE_ALLOW_IDMAP (1ULL << 40) - - /** - * CUSE INIT request/reply flags -@@ -980,6 +985,21 @@ struct fuse_fallocate_in { - */ - #define FUSE_UNIQUE_RESEND (1ULL << 63) - -+/** -+ * This value will be set by the kernel to -+ * (struct fuse_in_header).{uid,gid} fields in -+ * case when: -+ * - fuse daemon enabled FUSE_ALLOW_IDMAP -+ * - idmapping information is not available and uid/gid -+ * can not be mapped in accordance with an idmapping. -+ * -+ * Note: an idmapping information always available -+ * for inode creation operations like: -+ * FUSE_MKNOD, FUSE_SYMLINK, FUSE_MKDIR, FUSE_TMPFILE, -+ * FUSE_CREATE and FUSE_RENAME2 (with RENAME_WHITEOUT). -+ */ -+#define FUSE_INVALID_UIDGID ((uint32_t)(-1)) -+ - struct fuse_in_header { - uint32_t len; - uint32_t opcode; -diff --git a/include/standard-headers/linux/input-event-codes.h b/include/standard-headers/linux/input-event-codes.h -index 2221b0c383..50b2b7497e 100644 ---- a/include/standard-headers/linux/input-event-codes.h -+++ b/include/standard-headers/linux/input-event-codes.h -@@ -618,6 +618,8 @@ - #define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */ - #define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */ - #define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */ -+#define KEY_ACCESSIBILITY 0x24e /* Toggles the system bound accessibility UI/command (HUTRR116) */ -+#define KEY_DO_NOT_DISTURB 0x24f /* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/ - - #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ - #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ -diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-headers/linux/pci_regs.h -index 94c00996e6..12323b3334 100644 ---- a/include/standard-headers/linux/pci_regs.h -+++ b/include/standard-headers/linux/pci_regs.h -@@ -634,9 +634,11 @@ - #define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */ - #define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */ - #define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */ --#define PCI_EXP_RTCTL_CRSSVE 0x0010 /* CRS Software Visibility Enable */ -+#define PCI_EXP_RTCTL_RRS_SVE 0x0010 /* Config RRS Software Visibility Enable */ -+#define PCI_EXP_RTCTL_CRSSVE PCI_EXP_RTCTL_RRS_SVE /* compatibility */ - #define PCI_EXP_RTCAP 0x1e /* Root Capabilities */ --#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */ -+#define PCI_EXP_RTCAP_RRS_SV 0x0001 /* Config RRS Software Visibility */ -+#define PCI_EXP_RTCAP_CRSVIS PCI_EXP_RTCAP_RRS_SV /* compatibility */ - #define PCI_EXP_RTSTA 0x20 /* Root Status */ - #define PCI_EXP_RTSTA_PME_RQ_ID 0x0000ffff /* PME Requester ID */ - #define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */ -@@ -740,6 +742,7 @@ - #define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */ - #define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */ - #define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */ -+#define PCI_EXT_CAP_ID_NPEM 0x29 /* Native PCIe Enclosure Management */ - #define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */ - #define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */ - #define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE -@@ -1121,6 +1124,40 @@ - #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0 - #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4 - -+/* Native PCIe Enclosure Management */ -+#define PCI_NPEM_CAP 0x04 /* NPEM capability register */ -+#define PCI_NPEM_CAP_CAPABLE 0x00000001 /* NPEM Capable */ -+ -+#define PCI_NPEM_CTRL 0x08 /* NPEM control register */ -+#define PCI_NPEM_CTRL_ENABLE 0x00000001 /* NPEM Enable */ -+ -+/* -+ * Native PCIe Enclosure Management indication bits and Reset command bit -+ * are corresponding for capability and control registers. -+ */ -+#define PCI_NPEM_CMD_RESET 0x00000002 /* Reset Command */ -+#define PCI_NPEM_IND_OK 0x00000004 /* OK */ -+#define PCI_NPEM_IND_LOCATE 0x00000008 /* Locate */ -+#define PCI_NPEM_IND_FAIL 0x00000010 /* Fail */ -+#define PCI_NPEM_IND_REBUILD 0x00000020 /* Rebuild */ -+#define PCI_NPEM_IND_PFA 0x00000040 /* Predicted Failure Analysis */ -+#define PCI_NPEM_IND_HOTSPARE 0x00000080 /* Hot Spare */ -+#define PCI_NPEM_IND_ICA 0x00000100 /* In Critical Array */ -+#define PCI_NPEM_IND_IFA 0x00000200 /* In Failed Array */ -+#define PCI_NPEM_IND_IDT 0x00000400 /* Device Type */ -+#define PCI_NPEM_IND_DISABLED 0x00000800 /* Disabled */ -+#define PCI_NPEM_IND_SPEC_0 0x01000000 -+#define PCI_NPEM_IND_SPEC_1 0x02000000 -+#define PCI_NPEM_IND_SPEC_2 0x04000000 -+#define PCI_NPEM_IND_SPEC_3 0x08000000 -+#define PCI_NPEM_IND_SPEC_4 0x10000000 -+#define PCI_NPEM_IND_SPEC_5 0x20000000 -+#define PCI_NPEM_IND_SPEC_6 0x40000000 -+#define PCI_NPEM_IND_SPEC_7 0x80000000 -+ -+#define PCI_NPEM_STATUS 0x0c /* NPEM status register */ -+#define PCI_NPEM_STATUS_CC 0x00000001 /* Command Completed */ -+ - /* Data Object Exchange */ - #define PCI_DOE_CAP 0x04 /* DOE Capabilities Register */ - #define PCI_DOE_CAP_INT_SUP 0x00000001 /* Interrupt Support */ -diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/standard-headers/linux/virtio_balloon.h -index f343bfefd8..3121cd2e0e 100644 ---- a/include/standard-headers/linux/virtio_balloon.h -+++ b/include/standard-headers/linux/virtio_balloon.h -@@ -71,7 +71,13 @@ struct virtio_balloon_config { - #define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ - #define VIRTIO_BALLOON_S_HTLB_PGALLOC 8 /* Hugetlb page allocations */ - #define VIRTIO_BALLOON_S_HTLB_PGFAIL 9 /* Hugetlb page allocation failures */ --#define VIRTIO_BALLOON_S_NR 10 -+#define VIRTIO_BALLOON_S_OOM_KILL 10 /* OOM killer invocations */ -+#define VIRTIO_BALLOON_S_ALLOC_STALL 11 /* Stall count of memory allocatoin */ -+#define VIRTIO_BALLOON_S_ASYNC_SCAN 12 /* Amount of memory scanned asynchronously */ -+#define VIRTIO_BALLOON_S_DIRECT_SCAN 13 /* Amount of memory scanned directly */ -+#define VIRTIO_BALLOON_S_ASYNC_RECLAIM 14 /* Amount of memory reclaimed asynchronously */ -+#define VIRTIO_BALLOON_S_DIRECT_RECLAIM 15 /* Amount of memory reclaimed directly */ -+#define VIRTIO_BALLOON_S_NR 16 - - #define VIRTIO_BALLOON_S_NAMES_WITH_PREFIX(VIRTIO_BALLOON_S_NAMES_prefix) { \ - VIRTIO_BALLOON_S_NAMES_prefix "swap-in", \ -@@ -83,7 +89,13 @@ struct virtio_balloon_config { - VIRTIO_BALLOON_S_NAMES_prefix "available-memory", \ - VIRTIO_BALLOON_S_NAMES_prefix "disk-caches", \ - VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-allocations", \ -- VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures" \ -+ VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures", \ -+ VIRTIO_BALLOON_S_NAMES_prefix "oom-kills", \ -+ VIRTIO_BALLOON_S_NAMES_prefix "alloc-stalls", \ -+ VIRTIO_BALLOON_S_NAMES_prefix "async-scans", \ -+ VIRTIO_BALLOON_S_NAMES_prefix "direct-scans", \ -+ VIRTIO_BALLOON_S_NAMES_prefix "async-reclaims", \ -+ VIRTIO_BALLOON_S_NAMES_prefix "direct-reclaims" \ - } - - #define VIRTIO_BALLOON_S_NAMES VIRTIO_BALLOON_S_NAMES_WITH_PREFIX("") -diff --git a/include/standard-headers/linux/virtio_gpu.h b/include/standard-headers/linux/virtio_gpu.h -index 2db643ed8f..6459fdb9fb 100644 ---- a/include/standard-headers/linux/virtio_gpu.h -+++ b/include/standard-headers/linux/virtio_gpu.h -@@ -311,6 +311,7 @@ struct virtio_gpu_cmd_submit { - #define VIRTIO_GPU_CAPSET_VIRGL2 2 - /* 3 is reserved for gfxstream */ - #define VIRTIO_GPU_CAPSET_VENUS 4 -+#define VIRTIO_GPU_CAPSET_DRM 6 - - /* VIRTIO_GPU_CMD_GET_CAPSET_INFO */ - struct virtio_gpu_get_capset_info { -diff --git a/linux-headers/asm-arm64/mman.h b/linux-headers/asm-arm64/mman.h -index d0dbfe9587..7b500a3a7b 100644 ---- a/linux-headers/asm-arm64/mman.h -+++ b/linux-headers/asm-arm64/mman.h -@@ -7,4 +7,13 @@ - #define PROT_BTI 0x10 /* BTI guarded page */ - #define PROT_MTE 0x20 /* Normal Tagged mapping */ - -+/* Override any generic PKEY permission defines */ -+#define PKEY_DISABLE_EXECUTE 0x4 -+#define PKEY_DISABLE_READ 0x8 -+#undef PKEY_ACCESS_MASK -+#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\ -+ PKEY_DISABLE_WRITE |\ -+ PKEY_DISABLE_READ |\ -+ PKEY_DISABLE_EXECUTE) -+ - #endif /* ! _UAPI__ASM_MMAN_H */ -diff --git a/linux-headers/asm-arm64/unistd.h b/linux-headers/asm-arm64/unistd.h -index ce2ee8f1e3..df36f23876 100644 ---- a/linux-headers/asm-arm64/unistd.h -+++ b/linux-headers/asm-arm64/unistd.h -@@ -1,25 +1,2 @@ - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ --/* -- * Copyright (C) 2012 ARM Ltd. -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License version 2 as -- * published by the Free Software Foundation. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program. If not, see . -- */ -- --#define __ARCH_WANT_RENAMEAT --#define __ARCH_WANT_NEW_STAT --#define __ARCH_WANT_SET_GET_RLIMIT --#define __ARCH_WANT_TIME32_SYSCALLS --#define __ARCH_WANT_SYS_CLONE3 --#define __ARCH_WANT_MEMFD_SECRET -- --#include -+#include -diff --git a/linux-headers/asm-arm64/unistd_64.h b/linux-headers/asm-arm64/unistd_64.h -new file mode 100644 -index 0000000000..99a1d70459 ---- /dev/null -+++ b/linux-headers/asm-arm64/unistd_64.h -@@ -0,0 +1,324 @@ -+#ifndef _ASM_UNISTD_64_H -+#define _ASM_UNISTD_64_H -+ -+#define __NR_io_setup 0 -+#define __NR_io_destroy 1 -+#define __NR_io_submit 2 -+#define __NR_io_cancel 3 -+#define __NR_io_getevents 4 -+#define __NR_setxattr 5 -+#define __NR_lsetxattr 6 -+#define __NR_fsetxattr 7 -+#define __NR_getxattr 8 -+#define __NR_lgetxattr 9 -+#define __NR_fgetxattr 10 -+#define __NR_listxattr 11 -+#define __NR_llistxattr 12 -+#define __NR_flistxattr 13 -+#define __NR_removexattr 14 -+#define __NR_lremovexattr 15 -+#define __NR_fremovexattr 16 -+#define __NR_getcwd 17 -+#define __NR_lookup_dcookie 18 -+#define __NR_eventfd2 19 -+#define __NR_epoll_create1 20 -+#define __NR_epoll_ctl 21 -+#define __NR_epoll_pwait 22 -+#define __NR_dup 23 -+#define __NR_dup3 24 -+#define __NR_fcntl 25 -+#define __NR_inotify_init1 26 -+#define __NR_inotify_add_watch 27 -+#define __NR_inotify_rm_watch 28 -+#define __NR_ioctl 29 -+#define __NR_ioprio_set 30 -+#define __NR_ioprio_get 31 -+#define __NR_flock 32 -+#define __NR_mknodat 33 -+#define __NR_mkdirat 34 -+#define __NR_unlinkat 35 -+#define __NR_symlinkat 36 -+#define __NR_linkat 37 -+#define __NR_renameat 38 -+#define __NR_umount2 39 -+#define __NR_mount 40 -+#define __NR_pivot_root 41 -+#define __NR_nfsservctl 42 -+#define __NR_statfs 43 -+#define __NR_fstatfs 44 -+#define __NR_truncate 45 -+#define __NR_ftruncate 46 -+#define __NR_fallocate 47 -+#define __NR_faccessat 48 -+#define __NR_chdir 49 -+#define __NR_fchdir 50 -+#define __NR_chroot 51 -+#define __NR_fchmod 52 -+#define __NR_fchmodat 53 -+#define __NR_fchownat 54 -+#define __NR_fchown 55 -+#define __NR_openat 56 -+#define __NR_close 57 -+#define __NR_vhangup 58 -+#define __NR_pipe2 59 -+#define __NR_quotactl 60 -+#define __NR_getdents64 61 -+#define __NR_lseek 62 -+#define __NR_read 63 -+#define __NR_write 64 -+#define __NR_readv 65 -+#define __NR_writev 66 -+#define __NR_pread64 67 -+#define __NR_pwrite64 68 -+#define __NR_preadv 69 -+#define __NR_pwritev 70 -+#define __NR_sendfile 71 -+#define __NR_pselect6 72 -+#define __NR_ppoll 73 -+#define __NR_signalfd4 74 -+#define __NR_vmsplice 75 -+#define __NR_splice 76 -+#define __NR_tee 77 -+#define __NR_readlinkat 78 -+#define __NR_newfstatat 79 -+#define __NR_fstat 80 -+#define __NR_sync 81 -+#define __NR_fsync 82 -+#define __NR_fdatasync 83 -+#define __NR_sync_file_range 84 -+#define __NR_timerfd_create 85 -+#define __NR_timerfd_settime 86 -+#define __NR_timerfd_gettime 87 -+#define __NR_utimensat 88 -+#define __NR_acct 89 -+#define __NR_capget 90 -+#define __NR_capset 91 -+#define __NR_personality 92 -+#define __NR_exit 93 -+#define __NR_exit_group 94 -+#define __NR_waitid 95 -+#define __NR_set_tid_address 96 -+#define __NR_unshare 97 -+#define __NR_futex 98 -+#define __NR_set_robust_list 99 -+#define __NR_get_robust_list 100 -+#define __NR_nanosleep 101 -+#define __NR_getitimer 102 -+#define __NR_setitimer 103 -+#define __NR_kexec_load 104 -+#define __NR_init_module 105 -+#define __NR_delete_module 106 -+#define __NR_timer_create 107 -+#define __NR_timer_gettime 108 -+#define __NR_timer_getoverrun 109 -+#define __NR_timer_settime 110 -+#define __NR_timer_delete 111 -+#define __NR_clock_settime 112 -+#define __NR_clock_gettime 113 -+#define __NR_clock_getres 114 -+#define __NR_clock_nanosleep 115 -+#define __NR_syslog 116 -+#define __NR_ptrace 117 -+#define __NR_sched_setparam 118 -+#define __NR_sched_setscheduler 119 -+#define __NR_sched_getscheduler 120 -+#define __NR_sched_getparam 121 -+#define __NR_sched_setaffinity 122 -+#define __NR_sched_getaffinity 123 -+#define __NR_sched_yield 124 -+#define __NR_sched_get_priority_max 125 -+#define __NR_sched_get_priority_min 126 -+#define __NR_sched_rr_get_interval 127 -+#define __NR_restart_syscall 128 -+#define __NR_kill 129 -+#define __NR_tkill 130 -+#define __NR_tgkill 131 -+#define __NR_sigaltstack 132 -+#define __NR_rt_sigsuspend 133 -+#define __NR_rt_sigaction 134 -+#define __NR_rt_sigprocmask 135 -+#define __NR_rt_sigpending 136 -+#define __NR_rt_sigtimedwait 137 -+#define __NR_rt_sigqueueinfo 138 -+#define __NR_rt_sigreturn 139 -+#define __NR_setpriority 140 -+#define __NR_getpriority 141 -+#define __NR_reboot 142 -+#define __NR_setregid 143 -+#define __NR_setgid 144 -+#define __NR_setreuid 145 -+#define __NR_setuid 146 -+#define __NR_setresuid 147 -+#define __NR_getresuid 148 -+#define __NR_setresgid 149 -+#define __NR_getresgid 150 -+#define __NR_setfsuid 151 -+#define __NR_setfsgid 152 -+#define __NR_times 153 -+#define __NR_setpgid 154 -+#define __NR_getpgid 155 -+#define __NR_getsid 156 -+#define __NR_setsid 157 -+#define __NR_getgroups 158 -+#define __NR_setgroups 159 -+#define __NR_uname 160 -+#define __NR_sethostname 161 -+#define __NR_setdomainname 162 -+#define __NR_getrlimit 163 -+#define __NR_setrlimit 164 -+#define __NR_getrusage 165 -+#define __NR_umask 166 -+#define __NR_prctl 167 -+#define __NR_getcpu 168 -+#define __NR_gettimeofday 169 -+#define __NR_settimeofday 170 -+#define __NR_adjtimex 171 -+#define __NR_getpid 172 -+#define __NR_getppid 173 -+#define __NR_getuid 174 -+#define __NR_geteuid 175 -+#define __NR_getgid 176 -+#define __NR_getegid 177 -+#define __NR_gettid 178 -+#define __NR_sysinfo 179 -+#define __NR_mq_open 180 -+#define __NR_mq_unlink 181 -+#define __NR_mq_timedsend 182 -+#define __NR_mq_timedreceive 183 -+#define __NR_mq_notify 184 -+#define __NR_mq_getsetattr 185 -+#define __NR_msgget 186 -+#define __NR_msgctl 187 -+#define __NR_msgrcv 188 -+#define __NR_msgsnd 189 -+#define __NR_semget 190 -+#define __NR_semctl 191 -+#define __NR_semtimedop 192 -+#define __NR_semop 193 -+#define __NR_shmget 194 -+#define __NR_shmctl 195 -+#define __NR_shmat 196 -+#define __NR_shmdt 197 -+#define __NR_socket 198 -+#define __NR_socketpair 199 -+#define __NR_bind 200 -+#define __NR_listen 201 -+#define __NR_accept 202 -+#define __NR_connect 203 -+#define __NR_getsockname 204 -+#define __NR_getpeername 205 -+#define __NR_sendto 206 -+#define __NR_recvfrom 207 -+#define __NR_setsockopt 208 -+#define __NR_getsockopt 209 -+#define __NR_shutdown 210 -+#define __NR_sendmsg 211 -+#define __NR_recvmsg 212 -+#define __NR_readahead 213 -+#define __NR_brk 214 -+#define __NR_munmap 215 -+#define __NR_mremap 216 -+#define __NR_add_key 217 -+#define __NR_request_key 218 -+#define __NR_keyctl 219 -+#define __NR_clone 220 -+#define __NR_execve 221 -+#define __NR_mmap 222 -+#define __NR_fadvise64 223 -+#define __NR_swapon 224 -+#define __NR_swapoff 225 -+#define __NR_mprotect 226 -+#define __NR_msync 227 -+#define __NR_mlock 228 -+#define __NR_munlock 229 -+#define __NR_mlockall 230 -+#define __NR_munlockall 231 -+#define __NR_mincore 232 -+#define __NR_madvise 233 -+#define __NR_remap_file_pages 234 -+#define __NR_mbind 235 -+#define __NR_get_mempolicy 236 -+#define __NR_set_mempolicy 237 -+#define __NR_migrate_pages 238 -+#define __NR_move_pages 239 -+#define __NR_rt_tgsigqueueinfo 240 -+#define __NR_perf_event_open 241 -+#define __NR_accept4 242 -+#define __NR_recvmmsg 243 -+#define __NR_wait4 260 -+#define __NR_prlimit64 261 -+#define __NR_fanotify_init 262 -+#define __NR_fanotify_mark 263 -+#define __NR_name_to_handle_at 264 -+#define __NR_open_by_handle_at 265 -+#define __NR_clock_adjtime 266 -+#define __NR_syncfs 267 -+#define __NR_setns 268 -+#define __NR_sendmmsg 269 -+#define __NR_process_vm_readv 270 -+#define __NR_process_vm_writev 271 -+#define __NR_kcmp 272 -+#define __NR_finit_module 273 -+#define __NR_sched_setattr 274 -+#define __NR_sched_getattr 275 -+#define __NR_renameat2 276 -+#define __NR_seccomp 277 -+#define __NR_getrandom 278 -+#define __NR_memfd_create 279 -+#define __NR_bpf 280 -+#define __NR_execveat 281 -+#define __NR_userfaultfd 282 -+#define __NR_membarrier 283 -+#define __NR_mlock2 284 -+#define __NR_copy_file_range 285 -+#define __NR_preadv2 286 -+#define __NR_pwritev2 287 -+#define __NR_pkey_mprotect 288 -+#define __NR_pkey_alloc 289 -+#define __NR_pkey_free 290 -+#define __NR_statx 291 -+#define __NR_io_pgetevents 292 -+#define __NR_rseq 293 -+#define __NR_kexec_file_load 294 -+#define __NR_pidfd_send_signal 424 -+#define __NR_io_uring_setup 425 -+#define __NR_io_uring_enter 426 -+#define __NR_io_uring_register 427 -+#define __NR_open_tree 428 -+#define __NR_move_mount 429 -+#define __NR_fsopen 430 -+#define __NR_fsconfig 431 -+#define __NR_fsmount 432 -+#define __NR_fspick 433 -+#define __NR_pidfd_open 434 -+#define __NR_clone3 435 -+#define __NR_close_range 436 -+#define __NR_openat2 437 -+#define __NR_pidfd_getfd 438 -+#define __NR_faccessat2 439 -+#define __NR_process_madvise 440 -+#define __NR_epoll_pwait2 441 -+#define __NR_mount_setattr 442 -+#define __NR_quotactl_fd 443 -+#define __NR_landlock_create_ruleset 444 -+#define __NR_landlock_add_rule 445 -+#define __NR_landlock_restrict_self 446 -+#define __NR_memfd_secret 447 -+#define __NR_process_mrelease 448 -+#define __NR_futex_waitv 449 -+#define __NR_set_mempolicy_home_node 450 -+#define __NR_cachestat 451 -+#define __NR_fchmodat2 452 -+#define __NR_map_shadow_stack 453 -+#define __NR_futex_wake 454 -+#define __NR_futex_wait 455 -+#define __NR_futex_requeue 456 -+#define __NR_statmount 457 -+#define __NR_listmount 458 -+#define __NR_lsm_get_self_attr 459 -+#define __NR_lsm_set_self_attr 460 -+#define __NR_lsm_list_modules 461 -+#define __NR_mseal 462 -+ -+ -+#endif /* _ASM_UNISTD_64_H */ -diff --git a/linux-headers/asm-generic/unistd.h b/linux-headers/asm-generic/unistd.h -index d983c48a3b..5bf6148cac 100644 ---- a/linux-headers/asm-generic/unistd.h -+++ b/linux-headers/asm-generic/unistd.h -@@ -737,7 +737,7 @@ __SC_COMP(__NR_pselect6_time64, sys_pselect6, compat_sys_pselect6_time64) - #define __NR_ppoll_time64 414 - __SC_COMP(__NR_ppoll_time64, sys_ppoll, compat_sys_ppoll_time64) - #define __NR_io_pgetevents_time64 416 --__SYSCALL(__NR_io_pgetevents_time64, sys_io_pgetevents) -+__SC_COMP(__NR_io_pgetevents_time64, sys_io_pgetevents, compat_sys_io_pgetevents_time64) - #define __NR_recvmmsg_time64 417 - __SC_COMP(__NR_recvmmsg_time64, sys_recvmmsg, compat_sys_recvmmsg_time64) - #define __NR_mq_timedsend_time64 418 -@@ -776,12 +776,8 @@ __SYSCALL(__NR_fsmount, sys_fsmount) - __SYSCALL(__NR_fspick, sys_fspick) - #define __NR_pidfd_open 434 - __SYSCALL(__NR_pidfd_open, sys_pidfd_open) -- --#ifdef __ARCH_WANT_SYS_CLONE3 - #define __NR_clone3 435 - __SYSCALL(__NR_clone3, sys_clone3) --#endif -- - #define __NR_close_range 436 - __SYSCALL(__NR_close_range, sys_close_range) - #define __NR_openat2 437 -diff --git a/linux-headers/asm-loongarch/kvm.h b/linux-headers/asm-loongarch/kvm.h -index f9abef3823..70d89070bf 100644 ---- a/linux-headers/asm-loongarch/kvm.h -+++ b/linux-headers/asm-loongarch/kvm.h -@@ -64,6 +64,7 @@ struct kvm_fpu { - #define KVM_REG_LOONGARCH_KVM (KVM_REG_LOONGARCH | 0x20000ULL) - #define KVM_REG_LOONGARCH_FPSIMD (KVM_REG_LOONGARCH | 0x30000ULL) - #define KVM_REG_LOONGARCH_CPUCFG (KVM_REG_LOONGARCH | 0x40000ULL) -+#define KVM_REG_LOONGARCH_LBT (KVM_REG_LOONGARCH | 0x50000ULL) - #define KVM_REG_LOONGARCH_MASK (KVM_REG_LOONGARCH | 0x70000ULL) - #define KVM_CSR_IDX_MASK 0x7fff - #define KVM_CPUCFG_IDX_MASK 0x7fff -@@ -77,11 +78,34 @@ struct kvm_fpu { - /* Debugging: Special instruction for software breakpoint */ - #define KVM_REG_LOONGARCH_DEBUG_INST (KVM_REG_LOONGARCH_KVM | KVM_REG_SIZE_U64 | 3) - -+/* LBT registers */ -+#define KVM_REG_LOONGARCH_LBT_SCR0 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 1) -+#define KVM_REG_LOONGARCH_LBT_SCR1 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 2) -+#define KVM_REG_LOONGARCH_LBT_SCR2 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 3) -+#define KVM_REG_LOONGARCH_LBT_SCR3 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 4) -+#define KVM_REG_LOONGARCH_LBT_EFLAGS (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 5) -+#define KVM_REG_LOONGARCH_LBT_FTOP (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 6) -+ - #define LOONGARCH_REG_SHIFT 3 - #define LOONGARCH_REG_64(TYPE, REG) (TYPE | KVM_REG_SIZE_U64 | (REG << LOONGARCH_REG_SHIFT)) - #define KVM_IOC_CSRID(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CSR, REG) - #define KVM_IOC_CPUCFG(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CPUCFG, REG) -+ -+/* Device Control API on vm fd */ -+#define KVM_LOONGARCH_VM_FEAT_CTRL 0 -+#define KVM_LOONGARCH_VM_FEAT_LSX 0 -+#define KVM_LOONGARCH_VM_FEAT_LASX 1 -+#define KVM_LOONGARCH_VM_FEAT_X86BT 2 -+#define KVM_LOONGARCH_VM_FEAT_ARMBT 3 -+#define KVM_LOONGARCH_VM_FEAT_MIPSBT 4 -+#define KVM_LOONGARCH_VM_FEAT_PMU 5 -+#define KVM_LOONGARCH_VM_FEAT_PV_IPI 6 -+#define KVM_LOONGARCH_VM_FEAT_PV_STEALTIME 7 -+ -+/* Device Control API on vcpu fd */ - #define KVM_LOONGARCH_VCPU_CPUCFG 0 -+#define KVM_LOONGARCH_VCPU_PVTIME_CTRL 1 -+#define KVM_LOONGARCH_VCPU_PVTIME_GPA 0 - - struct kvm_debug_exit_arch { - }; -diff --git a/linux-headers/asm-loongarch/kvm_para.h b/linux-headers/asm-loongarch/kvm_para.h -new file mode 100644 -index 0000000000..4ba4ad8db1 ---- /dev/null -+++ b/linux-headers/asm-loongarch/kvm_para.h -@@ -0,0 +1,21 @@ -+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -+#ifndef _ASM_KVM_PARA_H -+#define _ASM_KVM_PARA_H -+ -+#include -+ -+/* -+ * CPUCFG index area: 0x40000000 -- 0x400000ff -+ * SW emulation for KVM hypervirsor -+ */ -+#define CPUCFG_KVM_BASE 0x40000000 -+#define CPUCFG_KVM_SIZE 0x100 -+#define CPUCFG_KVM_SIG (CPUCFG_KVM_BASE + 0) -+#define KVM_SIGNATURE "KVM\0" -+#define CPUCFG_KVM_FEATURE (CPUCFG_KVM_BASE + 4) -+#define KVM_FEATURE_IPI 1 -+#define KVM_FEATURE_STEAL_TIME 2 -+/* BIT 24 - 31 are features configurable by user space vmm */ -+#define KVM_FEATURE_VIRT_EXTIOI 24 -+ -+#endif /* _ASM_KVM_PARA_H */ -diff --git a/linux-headers/asm-loongarch/unistd.h b/linux-headers/asm-loongarch/unistd.h -index fcb668984f..1f01980f9c 100644 ---- a/linux-headers/asm-loongarch/unistd.h -+++ b/linux-headers/asm-loongarch/unistd.h -@@ -1,5 +1,3 @@ - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ --#define __ARCH_WANT_SYS_CLONE --#define __ARCH_WANT_SYS_CLONE3 - --#include -+#include -diff --git a/linux-headers/asm-loongarch/unistd_64.h b/linux-headers/asm-loongarch/unistd_64.h -new file mode 100644 -index 0000000000..887ea50cca ---- /dev/null -+++ b/linux-headers/asm-loongarch/unistd_64.h -@@ -0,0 +1,320 @@ -+#ifndef _ASM_UNISTD_64_H -+#define _ASM_UNISTD_64_H -+ -+#define __NR_io_setup 0 -+#define __NR_io_destroy 1 -+#define __NR_io_submit 2 -+#define __NR_io_cancel 3 -+#define __NR_io_getevents 4 -+#define __NR_setxattr 5 -+#define __NR_lsetxattr 6 -+#define __NR_fsetxattr 7 -+#define __NR_getxattr 8 -+#define __NR_lgetxattr 9 -+#define __NR_fgetxattr 10 -+#define __NR_listxattr 11 -+#define __NR_llistxattr 12 -+#define __NR_flistxattr 13 -+#define __NR_removexattr 14 -+#define __NR_lremovexattr 15 -+#define __NR_fremovexattr 16 -+#define __NR_getcwd 17 -+#define __NR_lookup_dcookie 18 -+#define __NR_eventfd2 19 -+#define __NR_epoll_create1 20 -+#define __NR_epoll_ctl 21 -+#define __NR_epoll_pwait 22 -+#define __NR_dup 23 -+#define __NR_dup3 24 -+#define __NR_fcntl 25 -+#define __NR_inotify_init1 26 -+#define __NR_inotify_add_watch 27 -+#define __NR_inotify_rm_watch 28 -+#define __NR_ioctl 29 -+#define __NR_ioprio_set 30 -+#define __NR_ioprio_get 31 -+#define __NR_flock 32 -+#define __NR_mknodat 33 -+#define __NR_mkdirat 34 -+#define __NR_unlinkat 35 -+#define __NR_symlinkat 36 -+#define __NR_linkat 37 -+#define __NR_umount2 39 -+#define __NR_mount 40 -+#define __NR_pivot_root 41 -+#define __NR_nfsservctl 42 -+#define __NR_statfs 43 -+#define __NR_fstatfs 44 -+#define __NR_truncate 45 -+#define __NR_ftruncate 46 -+#define __NR_fallocate 47 -+#define __NR_faccessat 48 -+#define __NR_chdir 49 -+#define __NR_fchdir 50 -+#define __NR_chroot 51 -+#define __NR_fchmod 52 -+#define __NR_fchmodat 53 -+#define __NR_fchownat 54 -+#define __NR_fchown 55 -+#define __NR_openat 56 -+#define __NR_close 57 -+#define __NR_vhangup 58 -+#define __NR_pipe2 59 -+#define __NR_quotactl 60 -+#define __NR_getdents64 61 -+#define __NR_lseek 62 -+#define __NR_read 63 -+#define __NR_write 64 -+#define __NR_readv 65 -+#define __NR_writev 66 -+#define __NR_pread64 67 -+#define __NR_pwrite64 68 -+#define __NR_preadv 69 -+#define __NR_pwritev 70 -+#define __NR_sendfile 71 -+#define __NR_pselect6 72 -+#define __NR_ppoll 73 -+#define __NR_signalfd4 74 -+#define __NR_vmsplice 75 -+#define __NR_splice 76 -+#define __NR_tee 77 -+#define __NR_readlinkat 78 -+#define __NR_newfstatat 79 -+#define __NR_fstat 80 -+#define __NR_sync 81 -+#define __NR_fsync 82 -+#define __NR_fdatasync 83 -+#define __NR_sync_file_range 84 -+#define __NR_timerfd_create 85 -+#define __NR_timerfd_settime 86 -+#define __NR_timerfd_gettime 87 -+#define __NR_utimensat 88 -+#define __NR_acct 89 -+#define __NR_capget 90 -+#define __NR_capset 91 -+#define __NR_personality 92 -+#define __NR_exit 93 -+#define __NR_exit_group 94 -+#define __NR_waitid 95 -+#define __NR_set_tid_address 96 -+#define __NR_unshare 97 -+#define __NR_futex 98 -+#define __NR_set_robust_list 99 -+#define __NR_get_robust_list 100 -+#define __NR_nanosleep 101 -+#define __NR_getitimer 102 -+#define __NR_setitimer 103 -+#define __NR_kexec_load 104 -+#define __NR_init_module 105 -+#define __NR_delete_module 106 -+#define __NR_timer_create 107 -+#define __NR_timer_gettime 108 -+#define __NR_timer_getoverrun 109 -+#define __NR_timer_settime 110 -+#define __NR_timer_delete 111 -+#define __NR_clock_settime 112 -+#define __NR_clock_gettime 113 -+#define __NR_clock_getres 114 -+#define __NR_clock_nanosleep 115 -+#define __NR_syslog 116 -+#define __NR_ptrace 117 -+#define __NR_sched_setparam 118 -+#define __NR_sched_setscheduler 119 -+#define __NR_sched_getscheduler 120 -+#define __NR_sched_getparam 121 -+#define __NR_sched_setaffinity 122 -+#define __NR_sched_getaffinity 123 -+#define __NR_sched_yield 124 -+#define __NR_sched_get_priority_max 125 -+#define __NR_sched_get_priority_min 126 -+#define __NR_sched_rr_get_interval 127 -+#define __NR_restart_syscall 128 -+#define __NR_kill 129 -+#define __NR_tkill 130 -+#define __NR_tgkill 131 -+#define __NR_sigaltstack 132 -+#define __NR_rt_sigsuspend 133 -+#define __NR_rt_sigaction 134 -+#define __NR_rt_sigprocmask 135 -+#define __NR_rt_sigpending 136 -+#define __NR_rt_sigtimedwait 137 -+#define __NR_rt_sigqueueinfo 138 -+#define __NR_rt_sigreturn 139 -+#define __NR_setpriority 140 -+#define __NR_getpriority 141 -+#define __NR_reboot 142 -+#define __NR_setregid 143 -+#define __NR_setgid 144 -+#define __NR_setreuid 145 -+#define __NR_setuid 146 -+#define __NR_setresuid 147 -+#define __NR_getresuid 148 -+#define __NR_setresgid 149 -+#define __NR_getresgid 150 -+#define __NR_setfsuid 151 -+#define __NR_setfsgid 152 -+#define __NR_times 153 -+#define __NR_setpgid 154 -+#define __NR_getpgid 155 -+#define __NR_getsid 156 -+#define __NR_setsid 157 -+#define __NR_getgroups 158 -+#define __NR_setgroups 159 -+#define __NR_uname 160 -+#define __NR_sethostname 161 -+#define __NR_setdomainname 162 -+#define __NR_getrusage 165 -+#define __NR_umask 166 -+#define __NR_prctl 167 -+#define __NR_getcpu 168 -+#define __NR_gettimeofday 169 -+#define __NR_settimeofday 170 -+#define __NR_adjtimex 171 -+#define __NR_getpid 172 -+#define __NR_getppid 173 -+#define __NR_getuid 174 -+#define __NR_geteuid 175 -+#define __NR_getgid 176 -+#define __NR_getegid 177 -+#define __NR_gettid 178 -+#define __NR_sysinfo 179 -+#define __NR_mq_open 180 -+#define __NR_mq_unlink 181 -+#define __NR_mq_timedsend 182 -+#define __NR_mq_timedreceive 183 -+#define __NR_mq_notify 184 -+#define __NR_mq_getsetattr 185 -+#define __NR_msgget 186 -+#define __NR_msgctl 187 -+#define __NR_msgrcv 188 -+#define __NR_msgsnd 189 -+#define __NR_semget 190 -+#define __NR_semctl 191 -+#define __NR_semtimedop 192 -+#define __NR_semop 193 -+#define __NR_shmget 194 -+#define __NR_shmctl 195 -+#define __NR_shmat 196 -+#define __NR_shmdt 197 -+#define __NR_socket 198 -+#define __NR_socketpair 199 -+#define __NR_bind 200 -+#define __NR_listen 201 -+#define __NR_accept 202 -+#define __NR_connect 203 -+#define __NR_getsockname 204 -+#define __NR_getpeername 205 -+#define __NR_sendto 206 -+#define __NR_recvfrom 207 -+#define __NR_setsockopt 208 -+#define __NR_getsockopt 209 -+#define __NR_shutdown 210 -+#define __NR_sendmsg 211 -+#define __NR_recvmsg 212 -+#define __NR_readahead 213 -+#define __NR_brk 214 -+#define __NR_munmap 215 -+#define __NR_mremap 216 -+#define __NR_add_key 217 -+#define __NR_request_key 218 -+#define __NR_keyctl 219 -+#define __NR_clone 220 -+#define __NR_execve 221 -+#define __NR_mmap 222 -+#define __NR_fadvise64 223 -+#define __NR_swapon 224 -+#define __NR_swapoff 225 -+#define __NR_mprotect 226 -+#define __NR_msync 227 -+#define __NR_mlock 228 -+#define __NR_munlock 229 -+#define __NR_mlockall 230 -+#define __NR_munlockall 231 -+#define __NR_mincore 232 -+#define __NR_madvise 233 -+#define __NR_remap_file_pages 234 -+#define __NR_mbind 235 -+#define __NR_get_mempolicy 236 -+#define __NR_set_mempolicy 237 -+#define __NR_migrate_pages 238 -+#define __NR_move_pages 239 -+#define __NR_rt_tgsigqueueinfo 240 -+#define __NR_perf_event_open 241 -+#define __NR_accept4 242 -+#define __NR_recvmmsg 243 -+#define __NR_wait4 260 -+#define __NR_prlimit64 261 -+#define __NR_fanotify_init 262 -+#define __NR_fanotify_mark 263 -+#define __NR_name_to_handle_at 264 -+#define __NR_open_by_handle_at 265 -+#define __NR_clock_adjtime 266 -+#define __NR_syncfs 267 -+#define __NR_setns 268 -+#define __NR_sendmmsg 269 -+#define __NR_process_vm_readv 270 -+#define __NR_process_vm_writev 271 -+#define __NR_kcmp 272 -+#define __NR_finit_module 273 -+#define __NR_sched_setattr 274 -+#define __NR_sched_getattr 275 -+#define __NR_renameat2 276 -+#define __NR_seccomp 277 -+#define __NR_getrandom 278 -+#define __NR_memfd_create 279 -+#define __NR_bpf 280 -+#define __NR_execveat 281 -+#define __NR_userfaultfd 282 -+#define __NR_membarrier 283 -+#define __NR_mlock2 284 -+#define __NR_copy_file_range 285 -+#define __NR_preadv2 286 -+#define __NR_pwritev2 287 -+#define __NR_pkey_mprotect 288 -+#define __NR_pkey_alloc 289 -+#define __NR_pkey_free 290 -+#define __NR_statx 291 -+#define __NR_io_pgetevents 292 -+#define __NR_rseq 293 -+#define __NR_kexec_file_load 294 -+#define __NR_pidfd_send_signal 424 -+#define __NR_io_uring_setup 425 -+#define __NR_io_uring_enter 426 -+#define __NR_io_uring_register 427 -+#define __NR_open_tree 428 -+#define __NR_move_mount 429 -+#define __NR_fsopen 430 -+#define __NR_fsconfig 431 -+#define __NR_fsmount 432 -+#define __NR_fspick 433 -+#define __NR_pidfd_open 434 -+#define __NR_clone3 435 -+#define __NR_close_range 436 -+#define __NR_openat2 437 -+#define __NR_pidfd_getfd 438 -+#define __NR_faccessat2 439 -+#define __NR_process_madvise 440 -+#define __NR_epoll_pwait2 441 -+#define __NR_mount_setattr 442 -+#define __NR_quotactl_fd 443 -+#define __NR_landlock_create_ruleset 444 -+#define __NR_landlock_add_rule 445 -+#define __NR_landlock_restrict_self 446 -+#define __NR_process_mrelease 448 -+#define __NR_futex_waitv 449 -+#define __NR_set_mempolicy_home_node 450 -+#define __NR_cachestat 451 -+#define __NR_fchmodat2 452 -+#define __NR_map_shadow_stack 453 -+#define __NR_futex_wake 454 -+#define __NR_futex_wait 455 -+#define __NR_futex_requeue 456 -+#define __NR_statmount 457 -+#define __NR_listmount 458 -+#define __NR_lsm_get_self_attr 459 -+#define __NR_lsm_set_self_attr 460 -+#define __NR_lsm_list_modules 461 -+#define __NR_mseal 462 -+ -+ -+#endif /* _ASM_UNISTD_64_H */ -diff --git a/linux-headers/asm-riscv/kvm.h b/linux-headers/asm-riscv/kvm.h -index e878e7cc39..e97db32964 100644 ---- a/linux-headers/asm-riscv/kvm.h -+++ b/linux-headers/asm-riscv/kvm.h -@@ -168,6 +168,13 @@ enum KVM_RISCV_ISA_EXT_ID { - KVM_RISCV_ISA_EXT_ZTSO, - KVM_RISCV_ISA_EXT_ZACAS, - KVM_RISCV_ISA_EXT_SSCOFPMF, -+ KVM_RISCV_ISA_EXT_ZIMOP, -+ KVM_RISCV_ISA_EXT_ZCA, -+ KVM_RISCV_ISA_EXT_ZCB, -+ KVM_RISCV_ISA_EXT_ZCD, -+ KVM_RISCV_ISA_EXT_ZCF, -+ KVM_RISCV_ISA_EXT_ZCMOP, -+ KVM_RISCV_ISA_EXT_ZAWRS, - KVM_RISCV_ISA_EXT_MAX, - }; - -diff --git a/linux-headers/asm-riscv/unistd.h b/linux-headers/asm-riscv/unistd.h -index 950ab3fd44..81896bbbf7 100644 ---- a/linux-headers/asm-riscv/unistd.h -+++ b/linux-headers/asm-riscv/unistd.h -@@ -14,41 +14,10 @@ - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -+#include - --#if defined(__LP64__) && !defined(__SYSCALL_COMPAT) --#define __ARCH_WANT_NEW_STAT --#define __ARCH_WANT_SET_GET_RLIMIT --#endif /* __LP64__ */ -- --#define __ARCH_WANT_SYS_CLONE3 --#define __ARCH_WANT_MEMFD_SECRET -- --#include -- --/* -- * Allows the instruction cache to be flushed from userspace. Despite RISC-V -- * having a direct 'fence.i' instruction available to userspace (which we -- * can't trap!), that's not actually viable when running on Linux because the -- * kernel might schedule a process on another hart. There is no way for -- * userspace to handle this without invoking the kernel (as it doesn't know the -- * thread->hart mappings), so we've defined a RISC-V specific system call to -- * flush the instruction cache. -- * -- * __NR_riscv_flush_icache is defined to flush the instruction cache over an -- * address range, with the flush applying to either all threads or just the -- * caller. We don't currently do anything with the address range, that's just -- * in there for forwards compatibility. -- */ --#ifndef __NR_riscv_flush_icache --#define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15) --#endif --__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache) -- --/* -- * Allows userspace to query the kernel for CPU architecture and -- * microarchitecture details across a given set of CPUs. -- */ --#ifndef __NR_riscv_hwprobe --#define __NR_riscv_hwprobe (__NR_arch_specific_syscall + 14) -+#if __BITS_PER_LONG == 64 -+#include -+#else -+#include - #endif --__SYSCALL(__NR_riscv_hwprobe, sys_riscv_hwprobe) -diff --git a/linux-headers/asm-riscv/unistd_32.h b/linux-headers/asm-riscv/unistd_32.h -new file mode 100644 -index 0000000000..9625743dfd ---- /dev/null -+++ b/linux-headers/asm-riscv/unistd_32.h -@@ -0,0 +1,315 @@ -+#ifndef _ASM_UNISTD_32_H -+#define _ASM_UNISTD_32_H -+ -+#define __NR_io_setup 0 -+#define __NR_io_destroy 1 -+#define __NR_io_submit 2 -+#define __NR_io_cancel 3 -+#define __NR_setxattr 5 -+#define __NR_lsetxattr 6 -+#define __NR_fsetxattr 7 -+#define __NR_getxattr 8 -+#define __NR_lgetxattr 9 -+#define __NR_fgetxattr 10 -+#define __NR_listxattr 11 -+#define __NR_llistxattr 12 -+#define __NR_flistxattr 13 -+#define __NR_removexattr 14 -+#define __NR_lremovexattr 15 -+#define __NR_fremovexattr 16 -+#define __NR_getcwd 17 -+#define __NR_lookup_dcookie 18 -+#define __NR_eventfd2 19 -+#define __NR_epoll_create1 20 -+#define __NR_epoll_ctl 21 -+#define __NR_epoll_pwait 22 -+#define __NR_dup 23 -+#define __NR_dup3 24 -+#define __NR_fcntl64 25 -+#define __NR_inotify_init1 26 -+#define __NR_inotify_add_watch 27 -+#define __NR_inotify_rm_watch 28 -+#define __NR_ioctl 29 -+#define __NR_ioprio_set 30 -+#define __NR_ioprio_get 31 -+#define __NR_flock 32 -+#define __NR_mknodat 33 -+#define __NR_mkdirat 34 -+#define __NR_unlinkat 35 -+#define __NR_symlinkat 36 -+#define __NR_linkat 37 -+#define __NR_umount2 39 -+#define __NR_mount 40 -+#define __NR_pivot_root 41 -+#define __NR_nfsservctl 42 -+#define __NR_statfs64 43 -+#define __NR_fstatfs64 44 -+#define __NR_truncate64 45 -+#define __NR_ftruncate64 46 -+#define __NR_fallocate 47 -+#define __NR_faccessat 48 -+#define __NR_chdir 49 -+#define __NR_fchdir 50 -+#define __NR_chroot 51 -+#define __NR_fchmod 52 -+#define __NR_fchmodat 53 -+#define __NR_fchownat 54 -+#define __NR_fchown 55 -+#define __NR_openat 56 -+#define __NR_close 57 -+#define __NR_vhangup 58 -+#define __NR_pipe2 59 -+#define __NR_quotactl 60 -+#define __NR_getdents64 61 -+#define __NR_llseek 62 -+#define __NR_read 63 -+#define __NR_write 64 -+#define __NR_readv 65 -+#define __NR_writev 66 -+#define __NR_pread64 67 -+#define __NR_pwrite64 68 -+#define __NR_preadv 69 -+#define __NR_pwritev 70 -+#define __NR_sendfile64 71 -+#define __NR_signalfd4 74 -+#define __NR_vmsplice 75 -+#define __NR_splice 76 -+#define __NR_tee 77 -+#define __NR_readlinkat 78 -+#define __NR_sync 81 -+#define __NR_fsync 82 -+#define __NR_fdatasync 83 -+#define __NR_sync_file_range 84 -+#define __NR_timerfd_create 85 -+#define __NR_acct 89 -+#define __NR_capget 90 -+#define __NR_capset 91 -+#define __NR_personality 92 -+#define __NR_exit 93 -+#define __NR_exit_group 94 -+#define __NR_waitid 95 -+#define __NR_set_tid_address 96 -+#define __NR_unshare 97 -+#define __NR_set_robust_list 99 -+#define __NR_get_robust_list 100 -+#define __NR_getitimer 102 -+#define __NR_setitimer 103 -+#define __NR_kexec_load 104 -+#define __NR_init_module 105 -+#define __NR_delete_module 106 -+#define __NR_timer_create 107 -+#define __NR_timer_getoverrun 109 -+#define __NR_timer_delete 111 -+#define __NR_syslog 116 -+#define __NR_ptrace 117 -+#define __NR_sched_setparam 118 -+#define __NR_sched_setscheduler 119 -+#define __NR_sched_getscheduler 120 -+#define __NR_sched_getparam 121 -+#define __NR_sched_setaffinity 122 -+#define __NR_sched_getaffinity 123 -+#define __NR_sched_yield 124 -+#define __NR_sched_get_priority_max 125 -+#define __NR_sched_get_priority_min 126 -+#define __NR_restart_syscall 128 -+#define __NR_kill 129 -+#define __NR_tkill 130 -+#define __NR_tgkill 131 -+#define __NR_sigaltstack 132 -+#define __NR_rt_sigsuspend 133 -+#define __NR_rt_sigaction 134 -+#define __NR_rt_sigprocmask 135 -+#define __NR_rt_sigpending 136 -+#define __NR_rt_sigqueueinfo 138 -+#define __NR_rt_sigreturn 139 -+#define __NR_setpriority 140 -+#define __NR_getpriority 141 -+#define __NR_reboot 142 -+#define __NR_setregid 143 -+#define __NR_setgid 144 -+#define __NR_setreuid 145 -+#define __NR_setuid 146 -+#define __NR_setresuid 147 -+#define __NR_getresuid 148 -+#define __NR_setresgid 149 -+#define __NR_getresgid 150 -+#define __NR_setfsuid 151 -+#define __NR_setfsgid 152 -+#define __NR_times 153 -+#define __NR_setpgid 154 -+#define __NR_getpgid 155 -+#define __NR_getsid 156 -+#define __NR_setsid 157 -+#define __NR_getgroups 158 -+#define __NR_setgroups 159 -+#define __NR_uname 160 -+#define __NR_sethostname 161 -+#define __NR_setdomainname 162 -+#define __NR_getrusage 165 -+#define __NR_umask 166 -+#define __NR_prctl 167 -+#define __NR_getcpu 168 -+#define __NR_getpid 172 -+#define __NR_getppid 173 -+#define __NR_getuid 174 -+#define __NR_geteuid 175 -+#define __NR_getgid 176 -+#define __NR_getegid 177 -+#define __NR_gettid 178 -+#define __NR_sysinfo 179 -+#define __NR_mq_open 180 -+#define __NR_mq_unlink 181 -+#define __NR_mq_notify 184 -+#define __NR_mq_getsetattr 185 -+#define __NR_msgget 186 -+#define __NR_msgctl 187 -+#define __NR_msgrcv 188 -+#define __NR_msgsnd 189 -+#define __NR_semget 190 -+#define __NR_semctl 191 -+#define __NR_semop 193 -+#define __NR_shmget 194 -+#define __NR_shmctl 195 -+#define __NR_shmat 196 -+#define __NR_shmdt 197 -+#define __NR_socket 198 -+#define __NR_socketpair 199 -+#define __NR_bind 200 -+#define __NR_listen 201 -+#define __NR_accept 202 -+#define __NR_connect 203 -+#define __NR_getsockname 204 -+#define __NR_getpeername 205 -+#define __NR_sendto 206 -+#define __NR_recvfrom 207 -+#define __NR_setsockopt 208 -+#define __NR_getsockopt 209 -+#define __NR_shutdown 210 -+#define __NR_sendmsg 211 -+#define __NR_recvmsg 212 -+#define __NR_readahead 213 -+#define __NR_brk 214 -+#define __NR_munmap 215 -+#define __NR_mremap 216 -+#define __NR_add_key 217 -+#define __NR_request_key 218 -+#define __NR_keyctl 219 -+#define __NR_clone 220 -+#define __NR_execve 221 -+#define __NR_mmap2 222 -+#define __NR_fadvise64_64 223 -+#define __NR_swapon 224 -+#define __NR_swapoff 225 -+#define __NR_mprotect 226 -+#define __NR_msync 227 -+#define __NR_mlock 228 -+#define __NR_munlock 229 -+#define __NR_mlockall 230 -+#define __NR_munlockall 231 -+#define __NR_mincore 232 -+#define __NR_madvise 233 -+#define __NR_remap_file_pages 234 -+#define __NR_mbind 235 -+#define __NR_get_mempolicy 236 -+#define __NR_set_mempolicy 237 -+#define __NR_migrate_pages 238 -+#define __NR_move_pages 239 -+#define __NR_rt_tgsigqueueinfo 240 -+#define __NR_perf_event_open 241 -+#define __NR_accept4 242 -+#define __NR_riscv_hwprobe 258 -+#define __NR_riscv_flush_icache 259 -+#define __NR_prlimit64 261 -+#define __NR_fanotify_init 262 -+#define __NR_fanotify_mark 263 -+#define __NR_name_to_handle_at 264 -+#define __NR_open_by_handle_at 265 -+#define __NR_syncfs 267 -+#define __NR_setns 268 -+#define __NR_sendmmsg 269 -+#define __NR_process_vm_readv 270 -+#define __NR_process_vm_writev 271 -+#define __NR_kcmp 272 -+#define __NR_finit_module 273 -+#define __NR_sched_setattr 274 -+#define __NR_sched_getattr 275 -+#define __NR_renameat2 276 -+#define __NR_seccomp 277 -+#define __NR_getrandom 278 -+#define __NR_memfd_create 279 -+#define __NR_bpf 280 -+#define __NR_execveat 281 -+#define __NR_userfaultfd 282 -+#define __NR_membarrier 283 -+#define __NR_mlock2 284 -+#define __NR_copy_file_range 285 -+#define __NR_preadv2 286 -+#define __NR_pwritev2 287 -+#define __NR_pkey_mprotect 288 -+#define __NR_pkey_alloc 289 -+#define __NR_pkey_free 290 -+#define __NR_statx 291 -+#define __NR_rseq 293 -+#define __NR_kexec_file_load 294 -+#define __NR_clock_gettime64 403 -+#define __NR_clock_settime64 404 -+#define __NR_clock_adjtime64 405 -+#define __NR_clock_getres_time64 406 -+#define __NR_clock_nanosleep_time64 407 -+#define __NR_timer_gettime64 408 -+#define __NR_timer_settime64 409 -+#define __NR_timerfd_gettime64 410 -+#define __NR_timerfd_settime64 411 -+#define __NR_utimensat_time64 412 -+#define __NR_pselect6_time64 413 -+#define __NR_ppoll_time64 414 -+#define __NR_io_pgetevents_time64 416 -+#define __NR_recvmmsg_time64 417 -+#define __NR_mq_timedsend_time64 418 -+#define __NR_mq_timedreceive_time64 419 -+#define __NR_semtimedop_time64 420 -+#define __NR_rt_sigtimedwait_time64 421 -+#define __NR_futex_time64 422 -+#define __NR_sched_rr_get_interval_time64 423 -+#define __NR_pidfd_send_signal 424 -+#define __NR_io_uring_setup 425 -+#define __NR_io_uring_enter 426 -+#define __NR_io_uring_register 427 -+#define __NR_open_tree 428 -+#define __NR_move_mount 429 -+#define __NR_fsopen 430 -+#define __NR_fsconfig 431 -+#define __NR_fsmount 432 -+#define __NR_fspick 433 -+#define __NR_pidfd_open 434 -+#define __NR_clone3 435 -+#define __NR_close_range 436 -+#define __NR_openat2 437 -+#define __NR_pidfd_getfd 438 -+#define __NR_faccessat2 439 -+#define __NR_process_madvise 440 -+#define __NR_epoll_pwait2 441 -+#define __NR_mount_setattr 442 -+#define __NR_quotactl_fd 443 -+#define __NR_landlock_create_ruleset 444 -+#define __NR_landlock_add_rule 445 -+#define __NR_landlock_restrict_self 446 -+#define __NR_memfd_secret 447 -+#define __NR_process_mrelease 448 -+#define __NR_futex_waitv 449 -+#define __NR_set_mempolicy_home_node 450 -+#define __NR_cachestat 451 -+#define __NR_fchmodat2 452 -+#define __NR_map_shadow_stack 453 -+#define __NR_futex_wake 454 -+#define __NR_futex_wait 455 -+#define __NR_futex_requeue 456 -+#define __NR_statmount 457 -+#define __NR_listmount 458 -+#define __NR_lsm_get_self_attr 459 -+#define __NR_lsm_set_self_attr 460 -+#define __NR_lsm_list_modules 461 -+#define __NR_mseal 462 -+ -+ -+#endif /* _ASM_UNISTD_32_H */ -diff --git a/linux-headers/asm-riscv/unistd_64.h b/linux-headers/asm-riscv/unistd_64.h -new file mode 100644 -index 0000000000..95bca8ae81 ---- /dev/null -+++ b/linux-headers/asm-riscv/unistd_64.h -@@ -0,0 +1,325 @@ -+#ifndef _ASM_UNISTD_64_H -+#define _ASM_UNISTD_64_H -+ -+#define __NR_io_setup 0 -+#define __NR_io_destroy 1 -+#define __NR_io_submit 2 -+#define __NR_io_cancel 3 -+#define __NR_io_getevents 4 -+#define __NR_setxattr 5 -+#define __NR_lsetxattr 6 -+#define __NR_fsetxattr 7 -+#define __NR_getxattr 8 -+#define __NR_lgetxattr 9 -+#define __NR_fgetxattr 10 -+#define __NR_listxattr 11 -+#define __NR_llistxattr 12 -+#define __NR_flistxattr 13 -+#define __NR_removexattr 14 -+#define __NR_lremovexattr 15 -+#define __NR_fremovexattr 16 -+#define __NR_getcwd 17 -+#define __NR_lookup_dcookie 18 -+#define __NR_eventfd2 19 -+#define __NR_epoll_create1 20 -+#define __NR_epoll_ctl 21 -+#define __NR_epoll_pwait 22 -+#define __NR_dup 23 -+#define __NR_dup3 24 -+#define __NR_fcntl 25 -+#define __NR_inotify_init1 26 -+#define __NR_inotify_add_watch 27 -+#define __NR_inotify_rm_watch 28 -+#define __NR_ioctl 29 -+#define __NR_ioprio_set 30 -+#define __NR_ioprio_get 31 -+#define __NR_flock 32 -+#define __NR_mknodat 33 -+#define __NR_mkdirat 34 -+#define __NR_unlinkat 35 -+#define __NR_symlinkat 36 -+#define __NR_linkat 37 -+#define __NR_umount2 39 -+#define __NR_mount 40 -+#define __NR_pivot_root 41 -+#define __NR_nfsservctl 42 -+#define __NR_statfs 43 -+#define __NR_fstatfs 44 -+#define __NR_truncate 45 -+#define __NR_ftruncate 46 -+#define __NR_fallocate 47 -+#define __NR_faccessat 48 -+#define __NR_chdir 49 -+#define __NR_fchdir 50 -+#define __NR_chroot 51 -+#define __NR_fchmod 52 -+#define __NR_fchmodat 53 -+#define __NR_fchownat 54 -+#define __NR_fchown 55 -+#define __NR_openat 56 -+#define __NR_close 57 -+#define __NR_vhangup 58 -+#define __NR_pipe2 59 -+#define __NR_quotactl 60 -+#define __NR_getdents64 61 -+#define __NR_lseek 62 -+#define __NR_read 63 -+#define __NR_write 64 -+#define __NR_readv 65 -+#define __NR_writev 66 -+#define __NR_pread64 67 -+#define __NR_pwrite64 68 -+#define __NR_preadv 69 -+#define __NR_pwritev 70 -+#define __NR_sendfile 71 -+#define __NR_pselect6 72 -+#define __NR_ppoll 73 -+#define __NR_signalfd4 74 -+#define __NR_vmsplice 75 -+#define __NR_splice 76 -+#define __NR_tee 77 -+#define __NR_readlinkat 78 -+#define __NR_newfstatat 79 -+#define __NR_fstat 80 -+#define __NR_sync 81 -+#define __NR_fsync 82 -+#define __NR_fdatasync 83 -+#define __NR_sync_file_range 84 -+#define __NR_timerfd_create 85 -+#define __NR_timerfd_settime 86 -+#define __NR_timerfd_gettime 87 -+#define __NR_utimensat 88 -+#define __NR_acct 89 -+#define __NR_capget 90 -+#define __NR_capset 91 -+#define __NR_personality 92 -+#define __NR_exit 93 -+#define __NR_exit_group 94 -+#define __NR_waitid 95 -+#define __NR_set_tid_address 96 -+#define __NR_unshare 97 -+#define __NR_futex 98 -+#define __NR_set_robust_list 99 -+#define __NR_get_robust_list 100 -+#define __NR_nanosleep 101 -+#define __NR_getitimer 102 -+#define __NR_setitimer 103 -+#define __NR_kexec_load 104 -+#define __NR_init_module 105 -+#define __NR_delete_module 106 -+#define __NR_timer_create 107 -+#define __NR_timer_gettime 108 -+#define __NR_timer_getoverrun 109 -+#define __NR_timer_settime 110 -+#define __NR_timer_delete 111 -+#define __NR_clock_settime 112 -+#define __NR_clock_gettime 113 -+#define __NR_clock_getres 114 -+#define __NR_clock_nanosleep 115 -+#define __NR_syslog 116 -+#define __NR_ptrace 117 -+#define __NR_sched_setparam 118 -+#define __NR_sched_setscheduler 119 -+#define __NR_sched_getscheduler 120 -+#define __NR_sched_getparam 121 -+#define __NR_sched_setaffinity 122 -+#define __NR_sched_getaffinity 123 -+#define __NR_sched_yield 124 -+#define __NR_sched_get_priority_max 125 -+#define __NR_sched_get_priority_min 126 -+#define __NR_sched_rr_get_interval 127 -+#define __NR_restart_syscall 128 -+#define __NR_kill 129 -+#define __NR_tkill 130 -+#define __NR_tgkill 131 -+#define __NR_sigaltstack 132 -+#define __NR_rt_sigsuspend 133 -+#define __NR_rt_sigaction 134 -+#define __NR_rt_sigprocmask 135 -+#define __NR_rt_sigpending 136 -+#define __NR_rt_sigtimedwait 137 -+#define __NR_rt_sigqueueinfo 138 -+#define __NR_rt_sigreturn 139 -+#define __NR_setpriority 140 -+#define __NR_getpriority 141 -+#define __NR_reboot 142 -+#define __NR_setregid 143 -+#define __NR_setgid 144 -+#define __NR_setreuid 145 -+#define __NR_setuid 146 -+#define __NR_setresuid 147 -+#define __NR_getresuid 148 -+#define __NR_setresgid 149 -+#define __NR_getresgid 150 -+#define __NR_setfsuid 151 -+#define __NR_setfsgid 152 -+#define __NR_times 153 -+#define __NR_setpgid 154 -+#define __NR_getpgid 155 -+#define __NR_getsid 156 -+#define __NR_setsid 157 -+#define __NR_getgroups 158 -+#define __NR_setgroups 159 -+#define __NR_uname 160 -+#define __NR_sethostname 161 -+#define __NR_setdomainname 162 -+#define __NR_getrlimit 163 -+#define __NR_setrlimit 164 -+#define __NR_getrusage 165 -+#define __NR_umask 166 -+#define __NR_prctl 167 -+#define __NR_getcpu 168 -+#define __NR_gettimeofday 169 -+#define __NR_settimeofday 170 -+#define __NR_adjtimex 171 -+#define __NR_getpid 172 -+#define __NR_getppid 173 -+#define __NR_getuid 174 -+#define __NR_geteuid 175 -+#define __NR_getgid 176 -+#define __NR_getegid 177 -+#define __NR_gettid 178 -+#define __NR_sysinfo 179 -+#define __NR_mq_open 180 -+#define __NR_mq_unlink 181 -+#define __NR_mq_timedsend 182 -+#define __NR_mq_timedreceive 183 -+#define __NR_mq_notify 184 -+#define __NR_mq_getsetattr 185 -+#define __NR_msgget 186 -+#define __NR_msgctl 187 -+#define __NR_msgrcv 188 -+#define __NR_msgsnd 189 -+#define __NR_semget 190 -+#define __NR_semctl 191 -+#define __NR_semtimedop 192 -+#define __NR_semop 193 -+#define __NR_shmget 194 -+#define __NR_shmctl 195 -+#define __NR_shmat 196 -+#define __NR_shmdt 197 -+#define __NR_socket 198 -+#define __NR_socketpair 199 -+#define __NR_bind 200 -+#define __NR_listen 201 -+#define __NR_accept 202 -+#define __NR_connect 203 -+#define __NR_getsockname 204 -+#define __NR_getpeername 205 -+#define __NR_sendto 206 -+#define __NR_recvfrom 207 -+#define __NR_setsockopt 208 -+#define __NR_getsockopt 209 -+#define __NR_shutdown 210 -+#define __NR_sendmsg 211 -+#define __NR_recvmsg 212 -+#define __NR_readahead 213 -+#define __NR_brk 214 -+#define __NR_munmap 215 -+#define __NR_mremap 216 -+#define __NR_add_key 217 -+#define __NR_request_key 218 -+#define __NR_keyctl 219 -+#define __NR_clone 220 -+#define __NR_execve 221 -+#define __NR_mmap 222 -+#define __NR_fadvise64 223 -+#define __NR_swapon 224 -+#define __NR_swapoff 225 -+#define __NR_mprotect 226 -+#define __NR_msync 227 -+#define __NR_mlock 228 -+#define __NR_munlock 229 -+#define __NR_mlockall 230 -+#define __NR_munlockall 231 -+#define __NR_mincore 232 -+#define __NR_madvise 233 -+#define __NR_remap_file_pages 234 -+#define __NR_mbind 235 -+#define __NR_get_mempolicy 236 -+#define __NR_set_mempolicy 237 -+#define __NR_migrate_pages 238 -+#define __NR_move_pages 239 -+#define __NR_rt_tgsigqueueinfo 240 -+#define __NR_perf_event_open 241 -+#define __NR_accept4 242 -+#define __NR_recvmmsg 243 -+#define __NR_riscv_hwprobe 258 -+#define __NR_riscv_flush_icache 259 -+#define __NR_wait4 260 -+#define __NR_prlimit64 261 -+#define __NR_fanotify_init 262 -+#define __NR_fanotify_mark 263 -+#define __NR_name_to_handle_at 264 -+#define __NR_open_by_handle_at 265 -+#define __NR_clock_adjtime 266 -+#define __NR_syncfs 267 -+#define __NR_setns 268 -+#define __NR_sendmmsg 269 -+#define __NR_process_vm_readv 270 -+#define __NR_process_vm_writev 271 -+#define __NR_kcmp 272 -+#define __NR_finit_module 273 -+#define __NR_sched_setattr 274 -+#define __NR_sched_getattr 275 -+#define __NR_renameat2 276 -+#define __NR_seccomp 277 -+#define __NR_getrandom 278 -+#define __NR_memfd_create 279 -+#define __NR_bpf 280 -+#define __NR_execveat 281 -+#define __NR_userfaultfd 282 -+#define __NR_membarrier 283 -+#define __NR_mlock2 284 -+#define __NR_copy_file_range 285 -+#define __NR_preadv2 286 -+#define __NR_pwritev2 287 -+#define __NR_pkey_mprotect 288 -+#define __NR_pkey_alloc 289 -+#define __NR_pkey_free 290 -+#define __NR_statx 291 -+#define __NR_io_pgetevents 292 -+#define __NR_rseq 293 -+#define __NR_kexec_file_load 294 -+#define __NR_pidfd_send_signal 424 -+#define __NR_io_uring_setup 425 -+#define __NR_io_uring_enter 426 -+#define __NR_io_uring_register 427 -+#define __NR_open_tree 428 -+#define __NR_move_mount 429 -+#define __NR_fsopen 430 -+#define __NR_fsconfig 431 -+#define __NR_fsmount 432 -+#define __NR_fspick 433 -+#define __NR_pidfd_open 434 -+#define __NR_clone3 435 -+#define __NR_close_range 436 -+#define __NR_openat2 437 -+#define __NR_pidfd_getfd 438 -+#define __NR_faccessat2 439 -+#define __NR_process_madvise 440 -+#define __NR_epoll_pwait2 441 -+#define __NR_mount_setattr 442 -+#define __NR_quotactl_fd 443 -+#define __NR_landlock_create_ruleset 444 -+#define __NR_landlock_add_rule 445 -+#define __NR_landlock_restrict_self 446 -+#define __NR_memfd_secret 447 -+#define __NR_process_mrelease 448 -+#define __NR_futex_waitv 449 -+#define __NR_set_mempolicy_home_node 450 -+#define __NR_cachestat 451 -+#define __NR_fchmodat2 452 -+#define __NR_map_shadow_stack 453 -+#define __NR_futex_wake 454 -+#define __NR_futex_wait 455 -+#define __NR_futex_requeue 456 -+#define __NR_statmount 457 -+#define __NR_listmount 458 -+#define __NR_lsm_get_self_attr 459 -+#define __NR_lsm_set_self_attr 460 -+#define __NR_lsm_list_modules 461 -+#define __NR_mseal 462 -+ -+ -+#endif /* _ASM_UNISTD_64_H */ -diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h -index 1c8f918234..4711ef2c3d 100644 ---- a/linux-headers/asm-x86/kvm.h -+++ b/linux-headers/asm-x86/kvm.h -@@ -106,6 +106,7 @@ struct kvm_ioapic_state { - - #define KVM_RUN_X86_SMM (1 << 0) - #define KVM_RUN_X86_BUS_LOCK (1 << 1) -+#define KVM_RUN_X86_GUEST_MODE (1 << 2) - - /* for KVM_GET_REGS and KVM_SET_REGS */ - struct kvm_regs { -@@ -436,6 +437,7 @@ struct kvm_sync_regs { - #define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4) - #define KVM_X86_QUIRK_FIX_HYPERCALL_INSN (1 << 5) - #define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6) -+#define KVM_X86_QUIRK_SLOT_ZAP_ALL (1 << 7) - - #define KVM_STATE_NESTED_FORMAT_VMX 0 - #define KVM_STATE_NESTED_FORMAT_SVM 1 -diff --git a/linux-headers/asm-x86/unistd_64.h b/linux-headers/asm-x86/unistd_64.h -index da439afee1..24c979be54 100644 ---- a/linux-headers/asm-x86/unistd_64.h -+++ b/linux-headers/asm-x86/unistd_64.h -@@ -336,6 +336,7 @@ - #define __NR_statx 332 - #define __NR_io_pgetevents 333 - #define __NR_rseq 334 -+#define __NR_uretprobe 335 - #define __NR_pidfd_send_signal 424 - #define __NR_io_uring_setup 425 - #define __NR_io_uring_enter 426 -diff --git a/linux-headers/asm-x86/unistd_x32.h b/linux-headers/asm-x86/unistd_x32.h -index 4fcb607c72..c23dd21a2d 100644 ---- a/linux-headers/asm-x86/unistd_x32.h -+++ b/linux-headers/asm-x86/unistd_x32.h -@@ -289,6 +289,7 @@ - #define __NR_statx (__X32_SYSCALL_BIT + 332) - #define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333) - #define __NR_rseq (__X32_SYSCALL_BIT + 334) -+#define __NR_uretprobe (__X32_SYSCALL_BIT + 335) - #define __NR_pidfd_send_signal (__X32_SYSCALL_BIT + 424) - #define __NR_io_uring_setup (__X32_SYSCALL_BIT + 425) - #define __NR_io_uring_enter (__X32_SYSCALL_BIT + 426) -diff --git a/linux-headers/linux/bits.h b/linux-headers/linux/bits.h -index d9897771be..c0d00c0a98 100644 ---- a/linux-headers/linux/bits.h -+++ b/linux-headers/linux/bits.h -@@ -12,4 +12,7 @@ - (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \ - (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h)))) - -+#define __GENMASK_U128(h, l) \ -+ ((_BIT128((h)) << 1) - (_BIT128(l))) -+ - #endif /* _LINUX_BITS_H */ -diff --git a/linux-headers/linux/const.h b/linux-headers/linux/const.h -index 1eb84b5087..2122610de7 100644 ---- a/linux-headers/linux/const.h -+++ b/linux-headers/linux/const.h -@@ -28,6 +28,23 @@ - #define _BITUL(x) (_UL(1) << (x)) - #define _BITULL(x) (_ULL(1) << (x)) - -+#if !defined(__ASSEMBLY__) -+/* -+ * Missing __asm__ support -+ * -+ * __BIT128() would not work in the __asm__ code, as it shifts an -+ * 'unsigned __init128' data type as direct representation of -+ * 128 bit constants is not supported in the gcc compiler, as -+ * they get silently truncated. -+ * -+ * TODO: Please revisit this implementation when gcc compiler -+ * starts representing 128 bit constants directly like long -+ * and unsigned long etc. Subsequently drop the comment for -+ * GENMASK_U128() which would then start supporting __asm__ code. -+ */ -+#define _BIT128(x) ((unsigned __int128)(1) << (x)) -+#endif -+ - #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1) - #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) - -diff --git a/linux-headers/linux/iommufd.h b/linux-headers/linux/iommufd.h -index 72e8f4b9dd..782baf477f 100644 ---- a/linux-headers/linux/iommufd.h -+++ b/linux-headers/linux/iommufd.h -@@ -4,8 +4,8 @@ - #ifndef _IOMMUFD_H - #define _IOMMUFD_H - --#include - #include -+#include - - #define IOMMUFD_TYPE (';') - -@@ -37,19 +37,20 @@ - enum { - IOMMUFD_CMD_BASE = 0x80, - IOMMUFD_CMD_DESTROY = IOMMUFD_CMD_BASE, -- IOMMUFD_CMD_IOAS_ALLOC, -- IOMMUFD_CMD_IOAS_ALLOW_IOVAS, -- IOMMUFD_CMD_IOAS_COPY, -- IOMMUFD_CMD_IOAS_IOVA_RANGES, -- IOMMUFD_CMD_IOAS_MAP, -- IOMMUFD_CMD_IOAS_UNMAP, -- IOMMUFD_CMD_OPTION, -- IOMMUFD_CMD_VFIO_IOAS, -- IOMMUFD_CMD_HWPT_ALLOC, -- IOMMUFD_CMD_GET_HW_INFO, -- IOMMUFD_CMD_HWPT_SET_DIRTY_TRACKING, -- IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP, -- IOMMUFD_CMD_HWPT_INVALIDATE, -+ IOMMUFD_CMD_IOAS_ALLOC = 0x81, -+ IOMMUFD_CMD_IOAS_ALLOW_IOVAS = 0x82, -+ IOMMUFD_CMD_IOAS_COPY = 0x83, -+ IOMMUFD_CMD_IOAS_IOVA_RANGES = 0x84, -+ IOMMUFD_CMD_IOAS_MAP = 0x85, -+ IOMMUFD_CMD_IOAS_UNMAP = 0x86, -+ IOMMUFD_CMD_OPTION = 0x87, -+ IOMMUFD_CMD_VFIO_IOAS = 0x88, -+ IOMMUFD_CMD_HWPT_ALLOC = 0x89, -+ IOMMUFD_CMD_GET_HW_INFO = 0x8a, -+ IOMMUFD_CMD_HWPT_SET_DIRTY_TRACKING = 0x8b, -+ IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP = 0x8c, -+ IOMMUFD_CMD_HWPT_INVALIDATE = 0x8d, -+ IOMMUFD_CMD_FAULT_QUEUE_ALLOC = 0x8e, - }; - - /** -@@ -356,10 +357,13 @@ struct iommu_vfio_ioas { - * the parent HWPT in a nesting configuration. - * @IOMMU_HWPT_ALLOC_DIRTY_TRACKING: Dirty tracking support for device IOMMU is - * enforced on device attachment -+ * @IOMMU_HWPT_FAULT_ID_VALID: The fault_id field of hwpt allocation data is -+ * valid. - */ - enum iommufd_hwpt_alloc_flags { - IOMMU_HWPT_ALLOC_NEST_PARENT = 1 << 0, - IOMMU_HWPT_ALLOC_DIRTY_TRACKING = 1 << 1, -+ IOMMU_HWPT_FAULT_ID_VALID = 1 << 2, - }; - - /** -@@ -396,8 +400,8 @@ struct iommu_hwpt_vtd_s1 { - * @IOMMU_HWPT_DATA_VTD_S1: Intel VT-d stage-1 page table - */ - enum iommu_hwpt_data_type { -- IOMMU_HWPT_DATA_NONE, -- IOMMU_HWPT_DATA_VTD_S1, -+ IOMMU_HWPT_DATA_NONE = 0, -+ IOMMU_HWPT_DATA_VTD_S1 = 1, - }; - - /** -@@ -411,6 +415,9 @@ enum iommu_hwpt_data_type { - * @data_type: One of enum iommu_hwpt_data_type - * @data_len: Length of the type specific data - * @data_uptr: User pointer to the type specific data -+ * @fault_id: The ID of IOMMUFD_FAULT object. Valid only if flags field of -+ * IOMMU_HWPT_FAULT_ID_VALID is set. -+ * @__reserved2: Padding to 64-bit alignment. Must be 0. - * - * Explicitly allocate a hardware page table object. This is the same object - * type that is returned by iommufd_device_attach() and represents the -@@ -441,6 +448,8 @@ struct iommu_hwpt_alloc { - __u32 data_type; - __u32 data_len; - __aligned_u64 data_uptr; -+ __u32 fault_id; -+ __u32 __reserved2; - }; - #define IOMMU_HWPT_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_ALLOC) - -@@ -482,8 +491,8 @@ struct iommu_hw_info_vtd { - * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type - */ - enum iommu_hw_info_type { -- IOMMU_HW_INFO_TYPE_NONE, -- IOMMU_HW_INFO_TYPE_INTEL_VTD, -+ IOMMU_HW_INFO_TYPE_NONE = 0, -+ IOMMU_HW_INFO_TYPE_INTEL_VTD = 1, - }; - - /** -@@ -620,7 +629,7 @@ struct iommu_hwpt_get_dirty_bitmap { - * @IOMMU_HWPT_INVALIDATE_DATA_VTD_S1: Invalidation data for VTD_S1 - */ - enum iommu_hwpt_invalidate_data_type { -- IOMMU_HWPT_INVALIDATE_DATA_VTD_S1, -+ IOMMU_HWPT_INVALIDATE_DATA_VTD_S1 = 0, - }; - - /** -@@ -692,4 +701,100 @@ struct iommu_hwpt_invalidate { - __u32 __reserved; - }; - #define IOMMU_HWPT_INVALIDATE _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_INVALIDATE) -+ -+/** -+ * enum iommu_hwpt_pgfault_flags - flags for struct iommu_hwpt_pgfault -+ * @IOMMU_PGFAULT_FLAGS_PASID_VALID: The pasid field of the fault data is -+ * valid. -+ * @IOMMU_PGFAULT_FLAGS_LAST_PAGE: It's the last fault of a fault group. -+ */ -+enum iommu_hwpt_pgfault_flags { -+ IOMMU_PGFAULT_FLAGS_PASID_VALID = (1 << 0), -+ IOMMU_PGFAULT_FLAGS_LAST_PAGE = (1 << 1), -+}; -+ -+/** -+ * enum iommu_hwpt_pgfault_perm - perm bits for struct iommu_hwpt_pgfault -+ * @IOMMU_PGFAULT_PERM_READ: request for read permission -+ * @IOMMU_PGFAULT_PERM_WRITE: request for write permission -+ * @IOMMU_PGFAULT_PERM_EXEC: (PCIE 10.4.1) request with a PASID that has the -+ * Execute Requested bit set in PASID TLP Prefix. -+ * @IOMMU_PGFAULT_PERM_PRIV: (PCIE 10.4.1) request with a PASID that has the -+ * Privileged Mode Requested bit set in PASID TLP -+ * Prefix. -+ */ -+enum iommu_hwpt_pgfault_perm { -+ IOMMU_PGFAULT_PERM_READ = (1 << 0), -+ IOMMU_PGFAULT_PERM_WRITE = (1 << 1), -+ IOMMU_PGFAULT_PERM_EXEC = (1 << 2), -+ IOMMU_PGFAULT_PERM_PRIV = (1 << 3), -+}; -+ -+/** -+ * struct iommu_hwpt_pgfault - iommu page fault data -+ * @flags: Combination of enum iommu_hwpt_pgfault_flags -+ * @dev_id: id of the originated device -+ * @pasid: Process Address Space ID -+ * @grpid: Page Request Group Index -+ * @perm: Combination of enum iommu_hwpt_pgfault_perm -+ * @addr: Fault address -+ * @length: a hint of how much data the requestor is expecting to fetch. For -+ * example, if the PRI initiator knows it is going to do a 10MB -+ * transfer, it could fill in 10MB and the OS could pre-fault in -+ * 10MB of IOVA. It's default to 0 if there's no such hint. -+ * @cookie: kernel-managed cookie identifying a group of fault messages. The -+ * cookie number encoded in the last page fault of the group should -+ * be echoed back in the response message. -+ */ -+struct iommu_hwpt_pgfault { -+ __u32 flags; -+ __u32 dev_id; -+ __u32 pasid; -+ __u32 grpid; -+ __u32 perm; -+ __u64 addr; -+ __u32 length; -+ __u32 cookie; -+}; -+ -+/** -+ * enum iommufd_page_response_code - Return status of fault handlers -+ * @IOMMUFD_PAGE_RESP_SUCCESS: Fault has been handled and the page tables -+ * populated, retry the access. This is the -+ * "Success" defined in PCI 10.4.2.1. -+ * @IOMMUFD_PAGE_RESP_INVALID: Could not handle this fault, don't retry the -+ * access. This is the "Invalid Request" in PCI -+ * 10.4.2.1. -+ */ -+enum iommufd_page_response_code { -+ IOMMUFD_PAGE_RESP_SUCCESS = 0, -+ IOMMUFD_PAGE_RESP_INVALID = 1, -+}; -+ -+/** -+ * struct iommu_hwpt_page_response - IOMMU page fault response -+ * @cookie: The kernel-managed cookie reported in the fault message. -+ * @code: One of response code in enum iommufd_page_response_code. -+ */ -+struct iommu_hwpt_page_response { -+ __u32 cookie; -+ __u32 code; -+}; -+ -+/** -+ * struct iommu_fault_alloc - ioctl(IOMMU_FAULT_QUEUE_ALLOC) -+ * @size: sizeof(struct iommu_fault_alloc) -+ * @flags: Must be 0 -+ * @out_fault_id: The ID of the new FAULT -+ * @out_fault_fd: The fd of the new FAULT -+ * -+ * Explicitly allocate a fault handling object. -+ */ -+struct iommu_fault_alloc { -+ __u32 size; -+ __u32 flags; -+ __u32 out_fault_id; -+ __u32 out_fault_fd; -+}; -+#define IOMMU_FAULT_QUEUE_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_FAULT_QUEUE_ALLOC) - #endif -diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h -index c93876ca0b..49dd1b30ce 100644 ---- a/linux-headers/linux/kvm.h -+++ b/linux-headers/linux/kvm.h -@@ -192,11 +192,20 @@ struct kvm_xen_exit { - /* Flags that describe what fields in emulation_failure hold valid data. */ - #define KVM_INTERNAL_ERROR_EMULATION_FLAG_INSTRUCTION_BYTES (1ULL << 0) - -+/* -+ * struct kvm_run can be modified by userspace at any time, so KVM must be -+ * careful to avoid TOCTOU bugs. In order to protect KVM, HINT_UNSAFE_IN_KVM() -+ * renames fields in struct kvm_run from to __unsafe when -+ * compiled into the kernel, ensuring that any use within KVM is obvious and -+ * gets extra scrutiny. -+ */ -+#define HINT_UNSAFE_IN_KVM(_symbol) _symbol -+ - /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ - struct kvm_run { - /* in */ - __u8 request_interrupt_window; -- __u8 immediate_exit; -+ __u8 HINT_UNSAFE_IN_KVM(immediate_exit); - __u8 padding1[6]; - - /* out */ -@@ -913,6 +922,9 @@ struct kvm_enable_cap { - #define KVM_CAP_MEMORY_ATTRIBUTES 233 - #define KVM_CAP_GUEST_MEMFD 234 - #define KVM_CAP_VM_TYPES 235 -+#define KVM_CAP_PRE_FAULT_MEMORY 236 -+#define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237 -+#define KVM_CAP_X86_GUEST_MODE 238 - - struct kvm_irq_routing_irqchip { - __u32 irqchip; -@@ -1544,4 +1556,13 @@ struct kvm_create_guest_memfd { - __u64 reserved[6]; - }; - -+#define KVM_PRE_FAULT_MEMORY _IOWR(KVMIO, 0xd5, struct kvm_pre_fault_memory) -+ -+struct kvm_pre_fault_memory { -+ __u64 gpa; -+ __u64 size; -+ __u64 flags; -+ __u64 padding[5]; -+}; -+ - #endif /* __LINUX_KVM_H */ -diff --git a/linux-headers/linux/mman.h b/linux-headers/linux/mman.h -index 4e8cb60780..2b83059586 100644 ---- a/linux-headers/linux/mman.h -+++ b/linux-headers/linux/mman.h -@@ -17,6 +17,7 @@ - #define MAP_SHARED 0x01 /* Share changes */ - #define MAP_PRIVATE 0x02 /* Changes are private */ - #define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */ -+#define MAP_DROPPABLE 0x08 /* Zero memory under memory pressure. */ - - /* - * Huge page size encoding when MAP_HUGETLB is specified, and a huge page -diff --git a/linux-headers/linux/psp-sev.h b/linux-headers/linux/psp-sev.h -index c3046c6bff..17bf191573 100644 ---- a/linux-headers/linux/psp-sev.h -+++ b/linux-headers/linux/psp-sev.h -@@ -31,6 +31,7 @@ enum { - SNP_PLATFORM_STATUS, - SNP_COMMIT, - SNP_SET_CONFIG, -+ SNP_VLEK_LOAD, - - SEV_MAX, - }; -@@ -50,6 +51,7 @@ typedef enum { - SEV_RET_INVALID_PLATFORM_STATE, - SEV_RET_INVALID_GUEST_STATE, - SEV_RET_INAVLID_CONFIG, -+ SEV_RET_INVALID_CONFIG = SEV_RET_INAVLID_CONFIG, - SEV_RET_INVALID_LEN, - SEV_RET_ALREADY_OWNED, - SEV_RET_INVALID_CERTIFICATE, -@@ -214,6 +216,32 @@ struct sev_user_data_snp_config { - __u8 rsvd1[52]; - } __attribute__((packed)); - -+/** -+ * struct sev_data_snp_vlek_load - SNP_VLEK_LOAD structure -+ * -+ * @len: length of the command buffer read by the PSP -+ * @vlek_wrapped_version: version of wrapped VLEK hashstick (Must be 0h) -+ * @rsvd: reserved -+ * @vlek_wrapped_address: address of a wrapped VLEK hashstick -+ * (struct sev_user_data_snp_wrapped_vlek_hashstick) -+ */ -+struct sev_user_data_snp_vlek_load { -+ __u32 len; /* In */ -+ __u8 vlek_wrapped_version; /* In */ -+ __u8 rsvd[3]; /* In */ -+ __u64 vlek_wrapped_address; /* In */ -+} __attribute__((packed)); -+ -+/** -+ * struct sev_user_data_snp_vlek_wrapped_vlek_hashstick - Wrapped VLEK data -+ * -+ * @data: Opaque data provided by AMD KDS (as described in SEV-SNP Firmware ABI -+ * 1.54, SNP_VLEK_LOAD) -+ */ -+struct sev_user_data_snp_wrapped_vlek_hashstick { -+ __u8 data[432]; /* In */ -+} __attribute__((packed)); -+ - /** - * struct sev_issue_cmd - SEV ioctl parameters - * --- -2.39.3 - diff --git a/kvm-migration-Add-helper-to-get-target-runstate.patch b/kvm-migration-Add-helper-to-get-target-runstate.patch deleted file mode 100644 index fb34d70..0000000 --- a/kvm-migration-Add-helper-to-get-target-runstate.patch +++ /dev/null @@ -1,84 +0,0 @@ -From b6ed71f7b16e09a29ab479f437805d83ee0c85e0 Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Fri, 6 Dec 2024 18:08:33 -0500 -Subject: [PATCH 01/22] migration: Add helper to get target runstate - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [1/22] a64178a0575a1b921e8a868a8007d0a50eb7ae29 (kmwolf/centos-qemu-kvm) - -In 99% cases, after QEMU migrates to dest host, it tries to detect the -target VM runstate using global_state_get_runstate(). - -There's one outlier so far which is Xen that won't send global state. -That's the major reason why global_state_received() check was always there -together with global_state_get_runstate(). - -However it's utterly confusing why global_state_received() has anything to -do with "let's start VM or not". - -Provide a helper to explain it, then we have an unified entry for getting -the target dest QEMU runstate after migration. - -Suggested-by: Fabiano Rosas -Signed-off-by: Peter Xu -Message-Id: <20241206230838.1111496-2-peterx@redhat.com> -Signed-off-by: Fabiano Rosas -(cherry picked from commit 7815f69867da92335055d4b5248430b0f122ce4e) -Signed-off-by: Kevin Wolf ---- - migration/migration.c | 21 +++++++++++++++++---- - 1 file changed, 17 insertions(+), 4 deletions(-) - -diff --git a/migration/migration.c b/migration/migration.c -index 3dea06d577..c7a9e2e026 100644 ---- a/migration/migration.c -+++ b/migration/migration.c -@@ -135,6 +135,21 @@ static bool migration_needs_multiple_sockets(void) - return migrate_multifd() || migrate_postcopy_preempt(); - } - -+static RunState migration_get_target_runstate(void) -+{ -+ /* -+ * When the global state is not migrated, it means we don't know the -+ * runstate of the src QEMU. We don't have much choice but assuming -+ * the VM is running. NOTE: this is pretty rare case, so far only Xen -+ * uses it. -+ */ -+ if (!global_state_received()) { -+ return RUN_STATE_RUNNING; -+ } -+ -+ return global_state_get_runstate(); -+} -+ - static bool transport_supports_multi_channels(MigrationAddress *addr) - { - if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { -@@ -727,8 +742,7 @@ static void process_incoming_migration_bh(void *opaque) - * unless we really are starting the VM. - */ - if (!migrate_late_block_activate() || -- (autostart && (!global_state_received() || -- runstate_is_live(global_state_get_runstate())))) { -+ (autostart && runstate_is_live(migration_get_target_runstate()))) { - /* Make sure all file formats throw away their mutable metadata. - * If we get an error here, just don't restart the VM yet. */ - bdrv_activate_all(&local_err); -@@ -751,8 +765,7 @@ static void process_incoming_migration_bh(void *opaque) - - dirty_bitmap_mig_before_vm_start(); - -- if (!global_state_received() || -- runstate_is_live(global_state_get_runstate())) { -+ if (runstate_is_live(migration_get_target_runstate())) { - if (autostart) { - vm_start(); - } else { --- -2.39.3 - diff --git a/kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch b/kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch deleted file mode 100644 index 145d080..0000000 --- a/kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 3f4762ae8fd1fb148b97cd713209d3b55e8ea489 Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Wed, 20 Nov 2024 11:01:32 -0500 -Subject: [PATCH] migration: Allow pipes to keep working for fd migrations -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Peter Xu -RH-MergeRequest: 302: migration: Allow pipes to keep working for fd migrations -RH-Jira: RHEL-69047 -RH-Acked-by: Juraj Marcin -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/1] f5c0af772cbd3ced12a7b260f86f98e74d8345d1 (peterx/qemu-kvm) - -Libvirt may still use pipes for old file migrations in fd: URI form, -especially when loading old images dumped from Libvirt's compression -algorithms. - -In that case, Libvirt needs to compress / uncompress the images on its own -over the migration binary stream, and pipes are passed over to QEMU for -outgoing / incoming migrations in "fd:" URIs. - -For future such use case, it should be suggested to use mapped-ram when -saving such VM image. However there can still be old images that was -compressed in such way, so libvirt needs to be able to load those images, -uncompress them and use the same pipe mechanism to pass that over to QEMU. - -It means, even if new file migrations can be gradually moved over to -mapped-ram (after Libvirt start supporting it), Libvirt still needs the -uncompressor for the old images to be able to load like before. - -Meanwhile since Libvirt currently exposes the compression capability to -guest images, it may needs its own lifecycle management to move that over -to mapped-ram, maybe can be done after mapped-ram saved the image, however -Dan and PeterK raised concern on temporary double disk space consumption. -I suppose for now the easiest is to enable pipes for both sides of "fd:" -migrations, until all things figured out from Libvirt side on how to move -on. - -And for "channels" QMP interface support on "migrate" / "migrate-incoming" -commands, we'll also need to move away from pipe. But let's leave that for -later too. - -So far, still allow pipes to happen like before on both save/load sides, -just like we would allow sockets to pass. - -Cc: qemu-stable -Cc: Fabiano Rosas -Cc: Peter Krempa -Cc: Daniel P. Berrangé -Fixes: c55deb860c ("migration: Deprecate fd: for file migration") -Reviewed-by: Fabiano Rosas -Link: https://lore.kernel.org/r/20241120160132.3659735-1-peterx@redhat.com -Signed-off-by: Peter Xu -(cherry picked from commit 87ae45e602e2943d58509e470e3a1d4ba084ab2f) -Signed-off-by: Peter Xu ---- - migration/fd.c | 27 +++++++++++++++++++++++++-- - 1 file changed, 25 insertions(+), 2 deletions(-) - -diff --git a/migration/fd.c b/migration/fd.c -index aab5189eac..9bf9be6acb 100644 ---- a/migration/fd.c -+++ b/migration/fd.c -@@ -25,6 +25,29 @@ - #include "io/channel-util.h" - #include "trace.h" - -+static bool fd_is_pipe(int fd) -+{ -+ struct stat statbuf; -+ -+ if (fstat(fd, &statbuf) == -1) { -+ return false; -+ } -+ -+ return S_ISFIFO(statbuf.st_mode); -+} -+ -+static bool migration_fd_valid(int fd) -+{ -+ if (fd_is_socket(fd)) { -+ return true; -+ } -+ -+ if (fd_is_pipe(fd)) { -+ return true; -+ } -+ -+ return false; -+} - - void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error **errp) - { -@@ -34,7 +57,7 @@ void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error ** - return; - } - -- if (!fd_is_socket(fd)) { -+ if (!migration_fd_valid(fd)) { - warn_report("fd: migration to a file is deprecated." - " Use file: instead."); - } -@@ -68,7 +91,7 @@ void fd_start_incoming_migration(const char *fdname, Error **errp) - return; - } - -- if (!fd_is_socket(fd)) { -+ if (!migration_fd_valid(fd)) { - warn_report("fd: migration to a file is deprecated." - " Use file: instead."); - } --- -2.39.3 - diff --git a/kvm-migration-Ensure-vmstate_save-sets-errp.patch b/kvm-migration-Ensure-vmstate_save-sets-errp.patch deleted file mode 100644 index 47a3c70..0000000 --- a/kvm-migration-Ensure-vmstate_save-sets-errp.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 6be2f51c147df1ab1dd7c68c6b554512dfc05e6f Mon Sep 17 00:00:00 2001 -From: Hanna Czenczek -Date: Tue, 15 Oct 2024 19:04:37 +0200 -Subject: [PATCH 1/9] migration: Ensure vmstate_save() sets errp - -RH-Author: Hanna Czenczek -RH-MergeRequest: 288: migration: Ensure vmstate_save() sets errp -RH-Jira: RHEL-63051 -RH-Acked-by: Stefano Garzarella -RH-Acked-by: German Maglione -RH-Commit: [1/1] 4d5a65c294ae83a29db885e42fb3f2ca913c36f0 (hreitz/qemu-kvm-c-9-s) - -migration/savevm.c contains some calls to vmstate_save() that are -followed by migrate_set_error() if the integer return value indicates an -error. migrate_set_error() requires that the `Error *` object passed to -it is set. Therefore, vmstate_save() is assumed to always set *errp on -error. - -Right now, that assumption is not met: vmstate_save_state_v() (called -internally by vmstate_save()) will not set *errp if -vmstate_subsection_save() or vmsd->post_save() fail. Fix that by adding -an *errp parameter to vmstate_subsection_save(), and by generating a -generic error in case post_save() fails (as is already done for -pre_save()). - -Without this patch, qemu will crash after vmstate_subsection_save() or -post_save() have failed inside of a vmstate_save() call (unless -migrate_set_error() then happen to discard the new error because -s->error is already set). This happens e.g. when receiving the state -from a virtio-fs back-end (virtiofsd) fails. - -Signed-off-by: Hanna Czenczek -Link: https://lore.kernel.org/r/20241015170437.310358-1-hreitz@redhat.com -Signed-off-by: Peter Xu -(cherry picked from commit 37dfcba1a04989830c706f9cbc00450e5d3a7447) -Signed-off-by: Hanna Czenczek ---- - migration/vmstate.c | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/migration/vmstate.c b/migration/vmstate.c -index ff5d589a6d..fa002b24e8 100644 ---- a/migration/vmstate.c -+++ b/migration/vmstate.c -@@ -22,7 +22,8 @@ - #include "trace.h" - - static int vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd, -- void *opaque, JSONWriter *vmdesc); -+ void *opaque, JSONWriter *vmdesc, -+ Error **errp); - static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd, - void *opaque); - -@@ -441,12 +442,13 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd, - json_writer_end_array(vmdesc); - } - -- ret = vmstate_subsection_save(f, vmsd, opaque, vmdesc); -+ ret = vmstate_subsection_save(f, vmsd, opaque, vmdesc, errp); - - if (vmsd->post_save) { - int ps_ret = vmsd->post_save(opaque); -- if (!ret) { -+ if (!ret && ps_ret) { - ret = ps_ret; -+ error_setg(errp, "post-save failed: %s", vmsd->name); - } - } - return ret; -@@ -518,7 +520,8 @@ static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd, - } - - static int vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd, -- void *opaque, JSONWriter *vmdesc) -+ void *opaque, JSONWriter *vmdesc, -+ Error **errp) - { - const VMStateDescription * const *sub = vmsd->subsections; - bool vmdesc_has_subsections = false; -@@ -546,7 +549,7 @@ static int vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd, - qemu_put_byte(f, len); - qemu_put_buffer(f, (uint8_t *)vmsdsub->name, len); - qemu_put_be32(f, vmsdsub->version_id); -- ret = vmstate_save_state(f, vmsdsub, opaque, vmdesc); -+ ret = vmstate_save_state_with_err(f, vmsdsub, opaque, vmdesc, errp); - if (ret) { - return ret; - } --- -2.39.3 - diff --git a/kvm-migration-Fix-UAF-for-incoming-migration-on-Migratio.patch b/kvm-migration-Fix-UAF-for-incoming-migration-on-Migratio.patch deleted file mode 100644 index fa55a5a..0000000 --- a/kvm-migration-Fix-UAF-for-incoming-migration-on-Migratio.patch +++ /dev/null @@ -1,180 +0,0 @@ -From f479e7cd7cc4e48f7383c4ee78609bb7605b70c6 Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Thu, 20 Feb 2025 08:24:59 -0500 -Subject: [PATCH 1/3] migration: Fix UAF for incoming migration on - MigrationState - -RH-Author: Peter Xu -RH-MergeRequest: 342: migration: Fix UAF for incoming migration on MigrationState -RH-Jira: RHEL-69776 -RH-Acked-by: Juraj Marcin -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/1] 65c90964461cf884167db18bedf62db7dc242573 (peterx/qemu-kvm) - -On the incoming migration side, QEMU uses a coroutine to load all the VM -states. Inside, it may reference MigrationState on global states like -migration capabilities, parameters, error state, shared mutexes and more. - -However there's nothing yet to make sure MigrationState won't get -destroyed (e.g. after migration_shutdown()). Meanwhile there's also no API -available to remove the incoming coroutine in migration_shutdown(), -avoiding it to access the freed elements. - -There's a bug report showing this can happen and crash dest QEMU when -migration is cancelled on source. - -When it happens, the dest main thread is trying to cleanup everything: - - #0 qemu_aio_coroutine_enter - #1 aio_dispatch_handler - #2 aio_poll - #3 monitor_cleanup - #4 qemu_cleanup - #5 qemu_default_main - -Then it found the migration incoming coroutine, schedule it (even after -migration_shutdown()), causing crash: - - #0 __pthread_kill_implementation - #1 __pthread_kill_internal - #2 __GI_raise - #3 __GI_abort - #4 __assert_fail_base - #5 __assert_fail - #6 qemu_mutex_lock_impl - #7 qemu_lockable_mutex_lock - #8 qemu_lockable_lock - #9 qemu_lockable_auto_lock - #10 migrate_set_error - #11 process_incoming_migration_co - #12 coroutine_trampoline - -To fix it, take a refcount after an incoming setup is properly done when -qmp_migrate_incoming() succeeded the 1st time. As it's during a QMP -handler which needs BQL, it means the main loop is still alive (without -going into cleanups, which also needs BQL). - -Releasing the refcount now only until the incoming migration coroutine -finished or failed. Hence the refcount is valid for both (1) setup phase -of incoming ports, mostly IO watches (e.g. qio_channel_add_watch_full()), -and (2) the incoming coroutine itself (process_incoming_migration_co()). - -Note that we can't unref in migration_incoming_state_destroy(), because -both qmp_xen_load_devices_state() and load_snapshot() will use it without -an incoming migration. Those hold BQL so they're not prone to this issue. - -PS: I suspect nobody uses Xen's command at all, as it didn't register yank, -hence AFAIU the command should crash on master when trying to unregister -yank in migration_incoming_state_destroy().. but that's another story. - -Also note that in some incoming failure cases we may not always unref the -MigrationState refcount, which is a trade-off to keep things simple. We -could make it accurate, but it can be an overkill. Some examples: - - - Unlike most of the rest protocols, socket_start_incoming_migration() - may create net listener after incoming port setup sucessfully. - It means we can't unref in migration_channel_process_incoming() as a - generic path because socket protocol might keep using MigrationState. - - - For either socket or file, multiple IO watches might be created, it - means logically each IO watch needs to take one refcount for - MigrationState so as to be 100% accurate on ownership of refcount taken. - -In general, we at least need per-protocol handling to make it accurate, -which can be an overkill if we know incoming failed after all. Add a short -comment to explain that when taking the refcount in qmp_migrate_incoming(). - -Bugzilla: https://issues.redhat.com/browse/RHEL-69775 -Tested-by: Yan Fu -Signed-off-by: Peter Xu -Reviewed-by: Fabiano Rosas -Message-ID: <20250220132459.512610-1-peterx@redhat.com> -Signed-off-by: Fabiano Rosas -(cherry picked from commit d657a14de5d597bbfe7b54e4c4f0646f440e98ad) -Signed-off-by: Peter Xu ---- - migration/migration.c | 40 ++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 38 insertions(+), 2 deletions(-) - -diff --git a/migration/migration.c b/migration/migration.c -index 999d4cac54..aabdc45c16 100644 ---- a/migration/migration.c -+++ b/migration/migration.c -@@ -115,6 +115,27 @@ static void migration_downtime_start(MigrationState *s) - s->downtime_start = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); - } - -+/* -+ * This is unfortunate: incoming migration actually needs the outgoing -+ * migration state (MigrationState) to be there too, e.g. to query -+ * capabilities, parameters, using locks, setup errors, etc. -+ * -+ * NOTE: when calling this, making sure current_migration exists and not -+ * been freed yet! Otherwise trying to access the refcount is already -+ * an use-after-free itself.. -+ * -+ * TODO: Move shared part of incoming / outgoing out into separate object. -+ * Then this is not needed. -+ */ -+static void migrate_incoming_ref_outgoing_state(void) -+{ -+ object_ref(migrate_get_current()); -+} -+static void migrate_incoming_unref_outgoing_state(void) -+{ -+ object_unref(migrate_get_current()); -+} -+ - static void migration_downtime_end(MigrationState *s) - { - int64_t now = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); -@@ -821,7 +842,7 @@ process_incoming_migration_co(void *opaque) - * postcopy thread. - */ - trace_process_incoming_migration_co_postcopy_end_main(); -- return; -+ goto out; - } - /* Else if something went wrong then just fall out of the normal exit */ - } -@@ -837,7 +858,8 @@ process_incoming_migration_co(void *opaque) - } - - migration_bh_schedule(process_incoming_migration_bh, mis); -- return; -+ goto out; -+ - fail: - migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE, - MIGRATION_STATUS_FAILED); -@@ -854,6 +876,9 @@ fail: - - exit(EXIT_FAILURE); - } -+out: -+ /* Pairs with the refcount taken in qmp_migrate_incoming() */ -+ migrate_incoming_unref_outgoing_state(); - } - - /** -@@ -1875,6 +1900,17 @@ void qmp_migrate_incoming(const char *uri, bool has_channels, - return; - } - -+ /* -+ * Making sure MigrationState is available until incoming migration -+ * completes. -+ * -+ * NOTE: QEMU _might_ leak this refcount in some failure paths, but -+ * that's OK. This is the minimum change we need to at least making -+ * sure success case is clean on the refcount. We can try harder to -+ * make it accurate for any kind of failures, but it might be an -+ * overkill and doesn't bring us much benefit. -+ */ -+ migrate_incoming_ref_outgoing_state(); - once = false; - } - --- -2.39.3 - diff --git a/kvm-migration-block-Apply-late-block-active-behavior-to-.patch b/kvm-migration-block-Apply-late-block-active-behavior-to-.patch deleted file mode 100644 index 93dc4d5..0000000 --- a/kvm-migration-block-Apply-late-block-active-behavior-to-.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 48773d81978e4c355445cb767c6c8b5346555092 Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Fri, 6 Dec 2024 18:08:36 -0500 -Subject: [PATCH 04/22] migration/block: Apply late-block-active behavior to - postcopy - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [4/22] 917b74fe13976f066f7c31dbd0eee85f424bbab5 (kmwolf/centos-qemu-kvm) - -Postcopy never cared about late-block-active. However there's no mention -in the capability that it doesn't apply to postcopy. - -Considering that we _assumed_ late activation is always good, do that too -for postcopy unconditionally, just like precopy. After this patch, we -should have unified the behavior across all. - -Signed-off-by: Peter Xu -Reviewed-by: Fabiano Rosas -Message-Id: <20241206230838.1111496-5-peterx@redhat.com> -Signed-off-by: Fabiano Rosas -(cherry picked from commit 61f2b489987c51159c53101a072c6aa901b50506) -Signed-off-by: Kevin Wolf ---- - migration/savevm.c | 25 ++++++++++++------------- - 1 file changed, 12 insertions(+), 13 deletions(-) - -diff --git a/migration/savevm.c b/migration/savevm.c -index 6bb404b9c8..a0c4befdc1 100644 ---- a/migration/savevm.c -+++ b/migration/savevm.c -@@ -2156,22 +2156,21 @@ static void loadvm_postcopy_handle_run_bh(void *opaque) - - trace_vmstate_downtime_checkpoint("dst-postcopy-bh-announced"); - -- /* Make sure all file formats throw away their mutable metadata. -- * If we get an error here, just don't restart the VM yet. */ -- bdrv_activate_all(&local_err); -- if (local_err) { -- error_report_err(local_err); -- local_err = NULL; -- autostart = false; -- } -- -- trace_vmstate_downtime_checkpoint("dst-postcopy-bh-cache-invalidated"); -- - dirty_bitmap_mig_before_vm_start(); - - if (autostart) { -- /* Hold onto your hats, starting the CPU */ -- vm_start(); -+ /* -+ * Make sure all file formats throw away their mutable metadata. -+ * If we get an error here, just don't restart the VM yet. -+ */ -+ bdrv_activate_all(&local_err); -+ trace_vmstate_downtime_checkpoint("dst-postcopy-bh-cache-invalidated"); -+ if (local_err) { -+ error_report_err(local_err); -+ local_err = NULL; -+ } else { -+ vm_start(); -+ } - } else { - /* leave it paused and let management decide when to start the CPU */ - runstate_set(RUN_STATE_PAUSED); --- -2.39.3 - diff --git a/kvm-migration-block-Fix-possible-race-with-block_inactiv.patch b/kvm-migration-block-Fix-possible-race-with-block_inactiv.patch deleted file mode 100644 index b8f6591..0000000 --- a/kvm-migration-block-Fix-possible-race-with-block_inactiv.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 3c6e09fe92972513d38c15c03db29a6843e44d3d Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Fri, 6 Dec 2024 18:08:37 -0500 -Subject: [PATCH 05/22] migration/block: Fix possible race with block_inactive - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [5/22] a88a20817cb28674367cc57dfe16e6c60c7122b1 (kmwolf/centos-qemu-kvm) - -Src QEMU sets block_inactive=true very early before the invalidation takes -place. It means if something wrong happened during setting the flag but -before reaching qemu_savevm_state_complete_precopy_non_iterable() where it -did the invalidation work, it'll make block_inactive flag inconsistent. - -For example, think about when qemu_savevm_state_complete_precopy_iterable() -can fail: it will have block_inactive set to true even if all block drives -are active. - -Fix that by only update the flag after the invalidation is done. - -No Fixes for any commit, because it's not an issue if bdrv_activate_all() -is re-entrant upon all-active disks - false positive block_inactive can -bring nothing more than "trying to active the blocks but they're already -active". However let's still do it right to avoid the inconsistent flag -v.s. reality. - -Signed-off-by: Peter Xu -Reviewed-by: Fabiano Rosas -Message-Id: <20241206230838.1111496-6-peterx@redhat.com> -Signed-off-by: Fabiano Rosas -(cherry picked from commit 8c97c5a476d146b35b2873ef73df601216a494d9) -Signed-off-by: Kevin Wolf ---- - migration/migration.c | 9 +++------ - migration/savevm.c | 2 ++ - 2 files changed, 5 insertions(+), 6 deletions(-) - -diff --git a/migration/migration.c b/migration/migration.c -index 8a262e01ff..784b7e9b90 100644 ---- a/migration/migration.c -+++ b/migration/migration.c -@@ -2779,14 +2779,11 @@ static int migration_completion_precopy(MigrationState *s, - goto out_unlock; - } - -- /* -- * Inactivate disks except in COLO, and track that we have done so in order -- * to remember to reactivate them if migration fails or is cancelled. -- */ -- s->block_inactive = !migrate_colo(); - migration_rate_set(RATE_LIMIT_DISABLED); -+ -+ /* Inactivate disks except in COLO */ - ret = qemu_savevm_state_complete_precopy(s->to_dst_file, false, -- s->block_inactive); -+ !migrate_colo()); - out_unlock: - bql_unlock(); - return ret; -diff --git a/migration/savevm.c b/migration/savevm.c -index a0c4befdc1..b88dadd904 100644 ---- a/migration/savevm.c -+++ b/migration/savevm.c -@@ -1577,6 +1577,8 @@ int qemu_savevm_state_complete_precopy_non_iterable(QEMUFile *f, - qemu_file_set_error(f, ret); - return ret; - } -+ /* Remember that we did this */ -+ s->block_inactive = true; - } - if (!in_postcopy) { - /* Postcopy stream will still be going */ --- -2.39.3 - diff --git a/kvm-migration-block-Make-late-block-active-the-default.patch b/kvm-migration-block-Make-late-block-active-the-default.patch deleted file mode 100644 index 6381fff..0000000 --- a/kvm-migration-block-Make-late-block-active-the-default.patch +++ /dev/null @@ -1,94 +0,0 @@ -From e97150d6dad119d3dd234c25f9b0373a2c323299 Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Fri, 6 Dec 2024 18:08:35 -0500 -Subject: [PATCH 03/22] migration/block: Make late-block-active the default - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [3/22] 9e197765811f282cd133013bd949be9bc49ca249 (kmwolf/centos-qemu-kvm) - -Migration capability 'late-block-active' controls when the block drives -will be activated. If enabled, block drives will only be activated until -VM starts, either src runstate was "live" (RUNNING, or SUSPENDED), or it'll -be postponed until qmp_cont(). - -Let's do this unconditionally. There's no harm to delay activation of -block drives. Meanwhile there's no ABI breakage if dest does it, because -src QEMU has nothing to do with it, so it's no concern on ABI breakage. - -IIUC we could avoid introducing this cap when introducing it before, but -now it's still not too late to just always do it. Cap now prone to -removal, but it'll be for later patches. - -Signed-off-by: Peter Xu -Reviewed-by: Fabiano Rosas -Message-Id: <20241206230838.1111496-4-peterx@redhat.com> -Signed-off-by: Fabiano Rosas -(cherry picked from commit fca9aef1c8d8fc4482cc541638dbfac76dc125d6) -Signed-off-by: Kevin Wolf ---- - migration/migration.c | 38 +++++++++++++++++++------------------- - 1 file changed, 19 insertions(+), 19 deletions(-) - -diff --git a/migration/migration.c b/migration/migration.c -index c7a9e2e026..8a262e01ff 100644 ---- a/migration/migration.c -+++ b/migration/migration.c -@@ -735,24 +735,6 @@ static void process_incoming_migration_bh(void *opaque) - - trace_vmstate_downtime_checkpoint("dst-precopy-bh-enter"); - -- /* If capability late_block_activate is set: -- * Only fire up the block code now if we're going to restart the -- * VM, else 'cont' will do it. -- * This causes file locking to happen; so we don't want it to happen -- * unless we really are starting the VM. -- */ -- if (!migrate_late_block_activate() || -- (autostart && runstate_is_live(migration_get_target_runstate()))) { -- /* Make sure all file formats throw away their mutable metadata. -- * If we get an error here, just don't restart the VM yet. */ -- bdrv_activate_all(&local_err); -- if (local_err) { -- error_report_err(local_err); -- local_err = NULL; -- autostart = false; -- } -- } -- - /* - * This must happen after all error conditions are dealt with and - * we're sure the VM is going to be running on this host. -@@ -767,7 +749,25 @@ static void process_incoming_migration_bh(void *opaque) - - if (runstate_is_live(migration_get_target_runstate())) { - if (autostart) { -- vm_start(); -+ /* -+ * Block activation is always delayed until VM starts, either -+ * here (which means we need to start the dest VM right now..), -+ * or until qmp_cont() later. -+ * -+ * We used to have cap 'late-block-activate' but now we do this -+ * unconditionally, as it has no harm but only benefit. E.g., -+ * it's not part of migration ABI on the time of disk activation. -+ * -+ * Make sure all file formats throw away their mutable -+ * metadata. If error, don't restart the VM yet. -+ */ -+ bdrv_activate_all(&local_err); -+ if (local_err) { -+ error_report_err(local_err); -+ local_err = NULL; -+ } else { -+ vm_start(); -+ } - } else { - runstate_set(RUN_STATE_PAUSED); - } --- -2.39.3 - diff --git a/kvm-migration-block-Rewrite-disk-activation.patch b/kvm-migration-block-Rewrite-disk-activation.patch deleted file mode 100644 index d449df0..0000000 --- a/kvm-migration-block-Rewrite-disk-activation.patch +++ /dev/null @@ -1,565 +0,0 @@ -From d97a28baf4a05c67bf644ac543a3f48a0f2875c0 Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Fri, 6 Dec 2024 18:08:38 -0500 -Subject: [PATCH 06/22] migration/block: Rewrite disk activation - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [6/22] c029cea2613097e1f26c563e6c220a00caa18501 (kmwolf/centos-qemu-kvm) - -This patch proposes a flag to maintain disk activation status globally. It -mostly rewrites disk activation mgmt for QEMU, including COLO and QMP -command xen_save_devices_state. - -Backgrounds -=========== - -We have two problems on disk activations, one resolved, one not. - -Problem 1: disk activation recover (for switchover interruptions) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -When migration is either cancelled or failed during switchover, especially -when after the disks are inactivated, QEMU needs to remember re-activate -the disks again before vm starts. - -It used to be done separately in two paths: one in qmp_migrate_cancel(), -the other one in the failure path of migration_completion(). - -It used to be fixed in different commits, all over the places in QEMU. So -these are the relevant changes I saw, I'm not sure if it's complete list: - - - In 2016, commit fe904ea824 ("migration: regain control of images when - migration fails to complete") - - - In 2017, commit 1d2acc3162 ("migration: re-active images while migration - been canceled after inactive them") - - - In 2023, commit 6dab4c93ec ("migration: Attempt disk reactivation in - more failure scenarios") - -Now since we have a slightly better picture maybe we can unify the -reactivation in a single path. - -One side benefit of doing so is, we can move the disk operation outside QMP -command "migrate_cancel". It's possible that in the future we may want to -make "migrate_cancel" be OOB-compatible, while that requires the command -doesn't need BQL in the first place. This will already do that and make -migrate_cancel command lightweight. - -Problem 2: disk invalidation on top of invalidated disks -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This is an unresolved bug for current QEMU. Link in "Resolves:" at the -end. It turns out besides the src switchover phase (problem 1 above), QEMU -also needs to remember block activation on destination. - -Consider two continuous migration in a row, where the VM was always paused. -In that scenario, the disks are not activated even until migration -completed in the 1st round. When the 2nd round starts, if QEMU doesn't -know the status of the disks, it needs to try inactivate the disk again. - -Here the issue is the block layer API bdrv_inactivate_all() will crash a -QEMU if invoked on already inactive disks for the 2nd migration. For -detail, see the bug link at the end. - -Implementation -============== - -This patch proposes to maintain disk activation with a global flag, so we -know: - - - If we used to inactivate disks for migration, but migration got - cancelled, or failed, QEMU will know it should reactivate the disks. - - - On incoming side, if the disks are never activated but then another - migration is triggered, QEMU should be able to tell that inactivate is - not needed for the 2nd migration. - -We used to have disk_inactive, but it only solves the 1st issue, not the -2nd. Also, it's done in completely separate paths so it's extremely hard -to follow either how the flag changes, or the duration that the flag is -valid, and when we will reactivate the disks. - -Convert the existing disk_inactive flag into that global flag (also invert -its naming), and maintain the disk activation status for the whole -lifecycle of qemu. That includes the incoming QEMU. - -Put both of the error cases of source migration (failure, cancelled) -together into migration_iteration_finish(), which will be invoked for -either of the scenario. So from that part QEMU should behave the same as -before. However with such global maintenance on disk activation status, we -not only cleanup quite a few temporary paths that we try to maintain the -disk activation status (e.g. in postcopy code), meanwhile it fixes the -crash for problem 2 in one shot. - -For freshly started QEMU, the flag is initialized to TRUE showing that the -QEMU owns the disks by default. - -For incoming migrated QEMU, the flag will be initialized to FALSE once and -for all showing that the dest QEMU doesn't own the disks until switchover. -That is guaranteed by the "once" variable. - -Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2395 -Signed-off-by: Peter Xu -Reviewed-by: Fabiano Rosas -Message-Id: <20241206230838.1111496-7-peterx@redhat.com> -Signed-off-by: Fabiano Rosas -(cherry picked from commit 8597af76153a87068b675d8099063c3ad8695773) -Signed-off-by: Kevin Wolf ---- - include/migration/misc.h | 4 ++ - migration/block-active.c | 94 ++++++++++++++++++++++++++++++++++++++++ - migration/colo.c | 2 +- - migration/meson.build | 1 + - migration/migration.c | 80 ++++++++-------------------------- - migration/migration.h | 5 +-- - migration/savevm.c | 33 ++++++-------- - migration/trace-events | 3 ++ - monitor/qmp-cmds.c | 8 +--- - 9 files changed, 139 insertions(+), 91 deletions(-) - create mode 100644 migration/block-active.c - -diff --git a/include/migration/misc.h b/include/migration/misc.h -index bfadc5613b..35ca8e1194 100644 ---- a/include/migration/misc.h -+++ b/include/migration/misc.h -@@ -111,4 +111,8 @@ bool migration_in_bg_snapshot(void); - /* migration/block-dirty-bitmap.c */ - void dirty_bitmap_mig_init(void); - -+/* Wrapper for block active/inactive operations */ -+bool migration_block_activate(Error **errp); -+bool migration_block_inactivate(void); -+ - #endif -diff --git a/migration/block-active.c b/migration/block-active.c -new file mode 100644 -index 0000000000..d477cf8182 ---- /dev/null -+++ b/migration/block-active.c -@@ -0,0 +1,94 @@ -+/* -+ * Block activation tracking for migration purpose -+ * -+ * SPDX-License-Identifier: GPL-2.0-or-later -+ * -+ * Copyright (C) 2024 Red Hat, Inc. -+ */ -+#include "qemu/osdep.h" -+#include "block/block.h" -+#include "qapi/error.h" -+#include "migration/migration.h" -+#include "qemu/error-report.h" -+#include "trace.h" -+ -+/* -+ * Migration-only cache to remember the block layer activation status. -+ * Protected by BQL. -+ * -+ * We need this because.. -+ * -+ * - Migration can fail after block devices are invalidated (during -+ * switchover phase). When that happens, we need to be able to recover -+ * the block drive status by re-activating them. -+ * -+ * - Currently bdrv_inactivate_all() is not safe to be invoked on top of -+ * invalidated drives (even if bdrv_activate_all() is actually safe to be -+ * called any time!). It means remembering this could help migration to -+ * make sure it won't invalidate twice in a row, crashing QEMU. It can -+ * happen when we migrate a PAUSED VM from host1 to host2, then migrate -+ * again to host3 without starting it. TODO: a cleaner solution is to -+ * allow safe invoke of bdrv_inactivate_all() at anytime, like -+ * bdrv_activate_all(). -+ * -+ * For freshly started QEMU, the flag is initialized to TRUE reflecting the -+ * scenario where QEMU owns block device ownerships. -+ * -+ * For incoming QEMU taking a migration stream, the flag is initialized to -+ * FALSE reflecting that the incoming side doesn't own the block devices, -+ * not until switchover happens. -+ */ -+static bool migration_block_active; -+ -+/* Setup the disk activation status */ -+void migration_block_active_setup(bool active) -+{ -+ migration_block_active = active; -+} -+ -+bool migration_block_activate(Error **errp) -+{ -+ ERRP_GUARD(); -+ -+ assert(bql_locked()); -+ -+ if (migration_block_active) { -+ trace_migration_block_activation("active-skipped"); -+ return true; -+ } -+ -+ trace_migration_block_activation("active"); -+ -+ bdrv_activate_all(errp); -+ if (*errp) { -+ error_report_err(error_copy(*errp)); -+ return false; -+ } -+ -+ migration_block_active = true; -+ return true; -+} -+ -+bool migration_block_inactivate(void) -+{ -+ int ret; -+ -+ assert(bql_locked()); -+ -+ if (!migration_block_active) { -+ trace_migration_block_activation("inactive-skipped"); -+ return true; -+ } -+ -+ trace_migration_block_activation("inactive"); -+ -+ ret = bdrv_inactivate_all(); -+ if (ret) { -+ error_report("%s: bdrv_inactivate_all() failed: %d", -+ __func__, ret); -+ return false; -+ } -+ -+ migration_block_active = false; -+ return true; -+} -diff --git a/migration/colo.c b/migration/colo.c -index 6449490221..ab903f34cb 100644 ---- a/migration/colo.c -+++ b/migration/colo.c -@@ -836,7 +836,7 @@ static void *colo_process_incoming_thread(void *opaque) - - /* Make sure all file formats throw away their mutable metadata */ - bql_lock(); -- bdrv_activate_all(&local_err); -+ migration_block_activate(&local_err); - bql_unlock(); - if (local_err) { - error_report_err(local_err); -diff --git a/migration/meson.build b/migration/meson.build -index 5ce2acb41e..6b79861d3c 100644 ---- a/migration/meson.build -+++ b/migration/meson.build -@@ -11,6 +11,7 @@ migration_files = files( - - system_ss.add(files( - 'block-dirty-bitmap.c', -+ 'block-active.c', - 'channel.c', - 'channel-block.c', - 'dirtyrate.c', -diff --git a/migration/migration.c b/migration/migration.c -index 784b7e9b90..38631d1206 100644 ---- a/migration/migration.c -+++ b/migration/migration.c -@@ -730,7 +730,6 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels, - - static void process_incoming_migration_bh(void *opaque) - { -- Error *local_err = NULL; - MigrationIncomingState *mis = opaque; - - trace_vmstate_downtime_checkpoint("dst-precopy-bh-enter"); -@@ -761,11 +760,7 @@ static void process_incoming_migration_bh(void *opaque) - * Make sure all file formats throw away their mutable - * metadata. If error, don't restart the VM yet. - */ -- bdrv_activate_all(&local_err); -- if (local_err) { -- error_report_err(local_err); -- local_err = NULL; -- } else { -+ if (migration_block_activate(NULL)) { - vm_start(); - } - } else { -@@ -1562,16 +1557,6 @@ static void migrate_fd_cancel(MigrationState *s) - } - } - } -- if (s->state == MIGRATION_STATUS_CANCELLING && s->block_inactive) { -- Error *local_err = NULL; -- -- bdrv_activate_all(&local_err); -- if (local_err) { -- error_report_err(local_err); -- } else { -- s->block_inactive = false; -- } -- } - } - - void migration_add_notifier_mode(NotifierWithReturn *notify, -@@ -1890,6 +1875,12 @@ void qmp_migrate_incoming(const char *uri, bool has_channels, - return; - } - -+ /* -+ * Newly setup incoming QEMU. Mark the block active state to reflect -+ * that the src currently owns the disks. -+ */ -+ migration_block_active_setup(false); -+ - once = false; - } - -@@ -2542,7 +2533,6 @@ static int postcopy_start(MigrationState *ms, Error **errp) - QIOChannelBuffer *bioc; - QEMUFile *fb; - uint64_t bandwidth = migrate_max_postcopy_bandwidth(); -- bool restart_block = false; - int cur_state = MIGRATION_STATUS_ACTIVE; - - if (migrate_postcopy_preempt()) { -@@ -2578,13 +2568,10 @@ static int postcopy_start(MigrationState *ms, Error **errp) - goto fail; - } - -- ret = bdrv_inactivate_all(); -- if (ret < 0) { -- error_setg_errno(errp, -ret, "%s: Failed in bdrv_inactivate_all()", -- __func__); -+ if (!migration_block_inactivate()) { -+ error_setg(errp, "%s: Failed in bdrv_inactivate_all()", __func__); - goto fail; - } -- restart_block = true; - - /* - * Cause any non-postcopiable, but iterative devices to -@@ -2654,8 +2641,6 @@ static int postcopy_start(MigrationState *ms, Error **errp) - goto fail_closefb; - } - -- restart_block = false; -- - /* Now send that blob */ - if (qemu_savevm_send_packaged(ms->to_dst_file, bioc->data, bioc->usage)) { - error_setg(errp, "%s: Failed to send packaged data", __func__); -@@ -2700,17 +2685,7 @@ fail_closefb: - fail: - migrate_set_state(&ms->state, MIGRATION_STATUS_POSTCOPY_ACTIVE, - MIGRATION_STATUS_FAILED); -- if (restart_block) { -- /* A failure happened early enough that we know the destination hasn't -- * accessed block devices, so we're safe to recover. -- */ -- Error *local_err = NULL; -- -- bdrv_activate_all(&local_err); -- if (local_err) { -- error_report_err(local_err); -- } -- } -+ migration_block_activate(NULL); - migration_call_notifiers(ms, MIG_EVENT_PRECOPY_FAILED, NULL); - bql_unlock(); - return -1; -@@ -2808,31 +2783,6 @@ static void migration_completion_postcopy(MigrationState *s) - trace_migration_completion_postcopy_end_after_complete(); - } - --static void migration_completion_failed(MigrationState *s, -- int current_active_state) --{ -- if (s->block_inactive && (s->state == MIGRATION_STATUS_ACTIVE || -- s->state == MIGRATION_STATUS_DEVICE)) { -- /* -- * If not doing postcopy, vm_start() will be called: let's -- * regain control on images. -- */ -- Error *local_err = NULL; -- -- bql_lock(); -- bdrv_activate_all(&local_err); -- if (local_err) { -- error_report_err(local_err); -- } else { -- s->block_inactive = false; -- } -- bql_unlock(); -- } -- -- migrate_set_state(&s->state, current_active_state, -- MIGRATION_STATUS_FAILED); --} -- - /** - * migration_completion: Used by migration_thread when there's not much left. - * The caller 'breaks' the loop when this returns. -@@ -2886,7 +2836,8 @@ fail: - error_free(local_err); - } - -- migration_completion_failed(s, current_active_state); -+ migrate_set_state(&s->state, current_active_state, -+ MIGRATION_STATUS_FAILED); - } - - /** -@@ -3309,6 +3260,11 @@ static void migration_iteration_finish(MigrationState *s) - case MIGRATION_STATUS_FAILED: - case MIGRATION_STATUS_CANCELLED: - case MIGRATION_STATUS_CANCELLING: -+ /* -+ * Re-activate the block drives if they're inactivated. Note, COLO -+ * shouldn't use block_active at all, so it should be no-op there. -+ */ -+ migration_block_activate(NULL); - if (runstate_is_live(s->vm_old_state)) { - if (!runstate_check(RUN_STATE_SHUTDOWN)) { - vm_start(); -@@ -3869,6 +3825,8 @@ static void migration_instance_init(Object *obj) - ms->state = MIGRATION_STATUS_NONE; - ms->mbps = -1; - ms->pages_per_second = -1; -+ /* Freshly started QEMU owns all the block devices */ -+ migration_block_active_setup(true); - qemu_sem_init(&ms->pause_sem, 0); - qemu_mutex_init(&ms->error_mutex); - -diff --git a/migration/migration.h b/migration/migration.h -index 38aa1402d5..5b17c1344d 100644 ---- a/migration/migration.h -+++ b/migration/migration.h -@@ -356,9 +356,6 @@ struct MigrationState { - /* Flag set once the migration thread is running (and needs joining) */ - bool migration_thread_running; - -- /* Flag set once the migration thread called bdrv_inactivate_all */ -- bool block_inactive; -- - /* Migration is waiting for guest to unplug device */ - QemuSemaphore wait_unplug_sem; - -@@ -537,4 +534,6 @@ int migration_rp_wait(MigrationState *s); - */ - void migration_rp_kick(MigrationState *s); - -+/* migration/block-active.c */ -+void migration_block_active_setup(bool active); - #endif -diff --git a/migration/savevm.c b/migration/savevm.c -index b88dadd904..7f8d177462 100644 ---- a/migration/savevm.c -+++ b/migration/savevm.c -@@ -1566,19 +1566,18 @@ int qemu_savevm_state_complete_precopy_non_iterable(QEMUFile *f, - } - - if (inactivate_disks) { -- /* Inactivate before sending QEMU_VM_EOF so that the -- * bdrv_activate_all() on the other end won't fail. */ -- ret = bdrv_inactivate_all(); -- if (ret) { -- error_setg(&local_err, "%s: bdrv_inactivate_all() failed (%d)", -- __func__, ret); -+ /* -+ * Inactivate before sending QEMU_VM_EOF so that the -+ * bdrv_activate_all() on the other end won't fail. -+ */ -+ if (!migration_block_inactivate()) { -+ error_setg(&local_err, "%s: bdrv_inactivate_all() failed", -+ __func__); - migrate_set_error(ms, local_err); - error_report_err(local_err); -- qemu_file_set_error(f, ret); -+ qemu_file_set_error(f, -EFAULT); - return ret; - } -- /* Remember that we did this */ -- s->block_inactive = true; - } - if (!in_postcopy) { - /* Postcopy stream will still be going */ -@@ -2142,7 +2141,6 @@ static int loadvm_postcopy_handle_listen(MigrationIncomingState *mis) - - static void loadvm_postcopy_handle_run_bh(void *opaque) - { -- Error *local_err = NULL; - MigrationIncomingState *mis = opaque; - - trace_vmstate_downtime_checkpoint("dst-postcopy-bh-enter"); -@@ -2165,12 +2163,11 @@ static void loadvm_postcopy_handle_run_bh(void *opaque) - * Make sure all file formats throw away their mutable metadata. - * If we get an error here, just don't restart the VM yet. - */ -- bdrv_activate_all(&local_err); -+ bool success = migration_block_activate(NULL); -+ - trace_vmstate_downtime_checkpoint("dst-postcopy-bh-cache-invalidated"); -- if (local_err) { -- error_report_err(local_err); -- local_err = NULL; -- } else { -+ -+ if (success) { - vm_start(); - } - } else { -@@ -3214,11 +3211,7 @@ void qmp_xen_save_devices_state(const char *filename, bool has_live, bool live, - * side of the migration take control of the images. - */ - if (live && !saved_vm_running) { -- ret = bdrv_inactivate_all(); -- if (ret) { -- error_setg(errp, "%s: bdrv_inactivate_all() failed (%d)", -- __func__, ret); -- } -+ migration_block_inactivate(); - } - } - -diff --git a/migration/trace-events b/migration/trace-events -index 0b7c3324fb..62141dc2ff 100644 ---- a/migration/trace-events -+++ b/migration/trace-events -@@ -377,3 +377,6 @@ migration_block_progression(unsigned percent) "Completed %u%%" - # page_cache.c - migration_pagecache_init(int64_t max_num_items) "Setting cache buckets to %" PRId64 - migration_pagecache_insert(void) "Error allocating page" -+ -+# block-active.c -+migration_block_activation(const char *name) "%s" -diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c -index 76f21e8af3..6f76d9beaf 100644 ---- a/monitor/qmp-cmds.c -+++ b/monitor/qmp-cmds.c -@@ -31,6 +31,7 @@ - #include "qapi/type-helpers.h" - #include "hw/mem/memory-device.h" - #include "hw/intc/intc.h" -+#include "migration/misc.h" - - NameInfo *qmp_query_name(Error **errp) - { -@@ -103,13 +104,8 @@ void qmp_cont(Error **errp) - * Continuing after completed migration. Images have been - * inactivated to allow the destination to take control. Need to - * get control back now. -- * -- * If there are no inactive block nodes (e.g. because the VM was -- * just paused rather than completing a migration), -- * bdrv_inactivate_all() simply doesn't do anything. - */ -- bdrv_activate_all(&local_err); -- if (local_err) { -+ if (!migration_block_activate(&local_err)) { - error_propagate(errp, local_err); - return; - } --- -2.39.3 - diff --git a/kvm-migration-block-active-Remove-global-active-flag.patch b/kvm-migration-block-active-Remove-global-active-flag.patch deleted file mode 100644 index 936aaa1..0000000 --- a/kvm-migration-block-active-Remove-global-active-flag.patch +++ /dev/null @@ -1,158 +0,0 @@ -From 927a37838380b5405596795f0f8968ac8b94bda2 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:13:55 +0100 -Subject: [PATCH 10/22] migration/block-active: Remove global active flag - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [10/22] caa43249916319b11a18994510e68176fae61d50 (kmwolf/centos-qemu-kvm) - -Block devices have an individual active state, a single global flag -can't cover this correctly. This becomes more important as we allow -users to manually manage which nodes are active or inactive. - -Now that it's allowed to call bdrv_inactivate_all() even when some -nodes are already inactive, we can remove the flag and just -unconditionally call bdrv_inactivate_all() and, more importantly, -bdrv_activate_all() before we make use of the nodes. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Reviewed-by: Eric Blake -Reviewed-by: Stefan Hajnoczi -Message-ID: <20250204211407.381505-5-kwolf@redhat.com> -Signed-off-by: Kevin Wolf -(cherry picked from commit c2a189976e211c9ff782538d5a5ed5e5cffeccd6) -Signed-off-by: Kevin Wolf ---- - migration/block-active.c | 46 ---------------------------------------- - migration/migration.c | 8 ------- - migration/migration.h | 2 -- - 3 files changed, 56 deletions(-) - -diff --git a/migration/block-active.c b/migration/block-active.c -index d477cf8182..40e986aade 100644 ---- a/migration/block-active.c -+++ b/migration/block-active.c -@@ -12,51 +12,12 @@ - #include "qemu/error-report.h" - #include "trace.h" - --/* -- * Migration-only cache to remember the block layer activation status. -- * Protected by BQL. -- * -- * We need this because.. -- * -- * - Migration can fail after block devices are invalidated (during -- * switchover phase). When that happens, we need to be able to recover -- * the block drive status by re-activating them. -- * -- * - Currently bdrv_inactivate_all() is not safe to be invoked on top of -- * invalidated drives (even if bdrv_activate_all() is actually safe to be -- * called any time!). It means remembering this could help migration to -- * make sure it won't invalidate twice in a row, crashing QEMU. It can -- * happen when we migrate a PAUSED VM from host1 to host2, then migrate -- * again to host3 without starting it. TODO: a cleaner solution is to -- * allow safe invoke of bdrv_inactivate_all() at anytime, like -- * bdrv_activate_all(). -- * -- * For freshly started QEMU, the flag is initialized to TRUE reflecting the -- * scenario where QEMU owns block device ownerships. -- * -- * For incoming QEMU taking a migration stream, the flag is initialized to -- * FALSE reflecting that the incoming side doesn't own the block devices, -- * not until switchover happens. -- */ --static bool migration_block_active; -- --/* Setup the disk activation status */ --void migration_block_active_setup(bool active) --{ -- migration_block_active = active; --} -- - bool migration_block_activate(Error **errp) - { - ERRP_GUARD(); - - assert(bql_locked()); - -- if (migration_block_active) { -- trace_migration_block_activation("active-skipped"); -- return true; -- } -- - trace_migration_block_activation("active"); - - bdrv_activate_all(errp); -@@ -65,7 +26,6 @@ bool migration_block_activate(Error **errp) - return false; - } - -- migration_block_active = true; - return true; - } - -@@ -75,11 +35,6 @@ bool migration_block_inactivate(void) - - assert(bql_locked()); - -- if (!migration_block_active) { -- trace_migration_block_activation("inactive-skipped"); -- return true; -- } -- - trace_migration_block_activation("inactive"); - - ret = bdrv_inactivate_all(); -@@ -89,6 +44,5 @@ bool migration_block_inactivate(void) - return false; - } - -- migration_block_active = false; - return true; - } -diff --git a/migration/migration.c b/migration/migration.c -index 38631d1206..999d4cac54 100644 ---- a/migration/migration.c -+++ b/migration/migration.c -@@ -1875,12 +1875,6 @@ void qmp_migrate_incoming(const char *uri, bool has_channels, - return; - } - -- /* -- * Newly setup incoming QEMU. Mark the block active state to reflect -- * that the src currently owns the disks. -- */ -- migration_block_active_setup(false); -- - once = false; - } - -@@ -3825,8 +3819,6 @@ static void migration_instance_init(Object *obj) - ms->state = MIGRATION_STATUS_NONE; - ms->mbps = -1; - ms->pages_per_second = -1; -- /* Freshly started QEMU owns all the block devices */ -- migration_block_active_setup(true); - qemu_sem_init(&ms->pause_sem, 0); - qemu_mutex_init(&ms->error_mutex); - -diff --git a/migration/migration.h b/migration/migration.h -index 5b17c1344d..c38d2a37e4 100644 ---- a/migration/migration.h -+++ b/migration/migration.h -@@ -534,6 +534,4 @@ int migration_rp_wait(MigrationState *s); - */ - void migration_rp_kick(MigrationState *s); - --/* migration/block-active.c */ --void migration_block_active_setup(bool active); - #endif --- -2.39.3 - diff --git a/kvm-nbd-server-Silence-server-warnings-on-port-probes.patch b/kvm-nbd-server-Silence-server-warnings-on-port-probes.patch deleted file mode 100644 index a09d883..0000000 --- a/kvm-nbd-server-Silence-server-warnings-on-port-probes.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 4364ac20ae74ae2fa4cc2dfa4e982411d9902b59 Mon Sep 17 00:00:00 2001 -From: Eric Blake -Date: Fri, 15 Nov 2024 13:55:53 -0600 -Subject: [PATCH] nbd-server: Silence server warnings on port probes - -RH-Author: Eric Blake -RH-MergeRequest: 334: nbd-server: Silence server warnings on port probes -RH-Jira: RHEL-76908 -RH-Acked-by: Stefan Hajnoczi -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/1] a66ea3900e0a8515871b6342dfbc0d2c108b4911 (ebblake/centos-qemu-kvm) - -While testing the use of qemu-nbd in a Pod of a Kubernetes cluster, I -got LOTS of log messages of the forms: - -qemu-nbd: option negotiation failed: Failed to read flags: Unexpected end-of-file before all data were read -qemu-nbd: option negotiation failed: Failed to read flags: Unable to read from socket: Connection reset by peer - -While it is nice to warn about clients that aren't following protocol -(in case it helps diagnosing bugs in those clients), a mere port probe -(where the client never write()s any bytes, and where we might even -hit EPIPE in trying to send our greeting to the client) is NOT -abnormal, but merely serves to pollute the log. And Kubernetes -_really_ likes to do port probes to determine whether a given Pod is -up and running. - -Easy ways to demonstrate the above port probes: -$ qemu-nbd -r -f raw path/to/file & -$ nc localhost 10809 -Message-ID: <20241115195638.1132007-2-eblake@redhat.com> -Reviewed-by: Vladimir Sementsov-Ogievskiy -(cherry picked from commit efd3dda312129b91986f85976afbda58d40f757f) -Signed-off-by: Eric Blake ---- - nbd/server.c | 26 +++++++++++++++++--------- - 1 file changed, 17 insertions(+), 9 deletions(-) - -diff --git a/nbd/server.c b/nbd/server.c -index c30e687fc8..f64e47270c 100644 ---- a/nbd/server.c -+++ b/nbd/server.c -@@ -1150,8 +1150,8 @@ nbd_negotiate_meta_queries(NBDClient *client, Error **errp) - * Return: - * -errno on error, errp is set - * 0 on successful negotiation, errp is not set -- * 1 if client sent NBD_OPT_ABORT, i.e. on valid disconnect, -- * errp is not set -+ * 1 if client sent NBD_OPT_ABORT (i.e. on valid disconnect) or never -+ * wrote anything (i.e. port probe); errp is not set - */ - static coroutine_fn int - nbd_negotiate_options(NBDClient *client, Error **errp) -@@ -1175,8 +1175,13 @@ nbd_negotiate_options(NBDClient *client, Error **errp) - ... Rest of request - */ - -- if (nbd_read32(client->ioc, &flags, "flags", errp) < 0) { -- return -EIO; -+ /* -+ * Intentionally ignore errors on this first read - we do not want -+ * to be noisy about a mere port probe, but only for clients that -+ * start talking the protocol and then quit abruptly. -+ */ -+ if (nbd_read32(client->ioc, &flags, "flags", NULL) < 0) { -+ return 1; - } - client->mode = NBD_MODE_EXPORT_NAME; - trace_nbd_negotiate_options_flags(flags); -@@ -1383,8 +1388,8 @@ nbd_negotiate_options(NBDClient *client, Error **errp) - * Return: - * -errno on error, errp is set - * 0 on successful negotiation, errp is not set -- * 1 if client sent NBD_OPT_ABORT, i.e. on valid disconnect, -- * errp is not set -+ * 1 if client sent NBD_OPT_ABORT (i.e. on valid disconnect) or never -+ * wrote anything (i.e. port probe); errp is not set - */ - static coroutine_fn int nbd_negotiate(NBDClient *client, Error **errp) - { -@@ -1415,9 +1420,12 @@ static coroutine_fn int nbd_negotiate(NBDClient *client, Error **errp) - stq_be_p(buf + 8, NBD_OPTS_MAGIC); - stw_be_p(buf + 16, NBD_FLAG_FIXED_NEWSTYLE | NBD_FLAG_NO_ZEROES); - -- if (nbd_write(client->ioc, buf, 18, errp) < 0) { -- error_prepend(errp, "write failed: "); -- return -EINVAL; -+ /* -+ * Be silent about failure to write our greeting: there is nothing -+ * wrong with a client testing if our port is alive. -+ */ -+ if (nbd_write(client->ioc, buf, 18, NULL) < 0) { -+ return 1; - } - ret = nbd_negotiate_options(client, errp); - if (ret != 0) { --- -2.39.3 - diff --git a/kvm-nbd-server-Support-inactive-nodes.patch b/kvm-nbd-server-Support-inactive-nodes.patch deleted file mode 100644 index 03c4fb3..0000000 --- a/kvm-nbd-server-Support-inactive-nodes.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 8c6301c578000fff63c5ee0406020ecc4d3ca170 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 4 Feb 2025 22:14:04 +0100 -Subject: [PATCH 19/22] nbd/server: Support inactive nodes - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [19/22] 140f88e93d88437c8c9c63299f714230ebfd9228 (kmwolf/centos-qemu-kvm) - -In order to support running an NBD export on inactive nodes, we must -make sure to return errors for any operations that aren't allowed on -inactive nodes. Reads are the only operation we know we need for -inactive images, so to err on the side of caution, return errors for -everything else, even if some operations could possibly be okay. - -Signed-off-by: Kevin Wolf -Acked-by: Fabiano Rosas -Message-ID: <20250204211407.381505-14-kwolf@redhat.com> -Reviewed-by: Stefan Hajnoczi -Reviewed-by: Eric Blake -Signed-off-by: Kevin Wolf -(cherry picked from commit 2e73a17c68f4d80023dc616e596e8c1f3ea8dd75) -Signed-off-by: Kevin Wolf ---- - nbd/server.c | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/nbd/server.c b/nbd/server.c -index f64e47270c..2076fb2666 100644 ---- a/nbd/server.c -+++ b/nbd/server.c -@@ -2026,6 +2026,7 @@ static void nbd_export_delete(BlockExport *blk_exp) - const BlockExportDriver blk_exp_nbd = { - .type = BLOCK_EXPORT_TYPE_NBD, - .instance_size = sizeof(NBDExport), -+ .supports_inactive = true, - .create = nbd_export_create, - .delete = nbd_export_delete, - .request_shutdown = nbd_export_request_shutdown, -@@ -2920,6 +2921,22 @@ static coroutine_fn int nbd_handle_request(NBDClient *client, - NBDExport *exp = client->exp; - char *msg; - size_t i; -+ bool inactive; -+ -+ WITH_GRAPH_RDLOCK_GUARD() { -+ inactive = bdrv_is_inactive(blk_bs(exp->common.blk)); -+ if (inactive) { -+ switch (request->type) { -+ case NBD_CMD_READ: -+ /* These commands are allowed on inactive nodes */ -+ break; -+ default: -+ /* Return an error for the rest */ -+ return nbd_send_generic_reply(client, request, -EPERM, -+ "export is inactive", errp); -+ } -+ } -+ } - - switch (request->type) { - case NBD_CMD_CACHE: --- -2.39.3 - diff --git a/kvm-net-Fix-announce_self.patch b/kvm-net-Fix-announce_self.patch deleted file mode 100644 index b288d44..0000000 --- a/kvm-net-Fix-announce_self.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 6b03a9c09340ee9d9f4dfda204832858057892ae Mon Sep 17 00:00:00 2001 -From: Laurent Vivier -Date: Fri, 17 Jan 2025 12:17:08 +0100 -Subject: [PATCH 1/3] net: Fix announce_self -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Laurent Vivier -RH-MergeRequest: 335: net: Fix announce_self -RH-Jira: RHEL-73894 -RH-Acked-by: Eugenio Pérez -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/1] f50da0292fdbfbdf20782b5a75cac2c362b8e472 (lvivier/qemu-kvm-centos) - -JIRA: https://issues.redhat.com/browse/RHEL-73894 - -b9ad513e1876 ("net: Remove receive_raw()") adds an iovec entry -in qemu_deliver_packet_iov() to add the virtio-net header -in the data when QEMU_NET_PACKET_FLAG_RAW is set but forgets -to increase the number of iovec entries in the array, so -receive_iov() will only send the first entry (the virtio-net -entry, full of 0) and no data. The packet will be discarded. - -The only user of QEMU_NET_PACKET_FLAG_RAW is announce_self. - -We can see the problem with tcpdump: - -- QEMU parameters: - - .. -monitor stdio \ - -netdev bridge,id=netdev0,br=virbr0 \ - -device virtio-net,mac=9a:2b:2c:2d:2e:2f,netdev=netdev0 \ - -- HMP command: - - (qemu) announce_self - -- TCP dump: - - $ sudo tcpdump -nxi virbr0 - - without the fix: - - - - with the fix: - - ARP, Reverse Request who-is 9a:2b:2c:2d:2e:2f tell 9a:2b:2c:2d:2e:2f, length 46 - 0x0000: 0001 0800 0604 0003 9a2b 2c2d 2e2f 0000 - 0x0010: 0000 9a2b 2c2d 2e2f 0000 0000 0000 0000 - 0x0020: 0000 0000 0000 0000 0000 0000 0000 - -Reported-by: Xiaohui Li -Bug: https://issues.redhat.com/browse/RHEL-73891 -Fixes: b9ad513e1876 ("net: Remove receive_raw()") -Cc: akihiko.odaki@daynix.com -Signed-off-by: Laurent Vivier -Reviewed-by: Akihiko Odaki -Reviewed-by: Michael Tokarev -Signed-off-by: Michael Tokarev -(cherry picked from commit 84dfdcbff33fff185528501be408c25c44499f32) -Signed-off-by: Laurent Vivier ---- - net/net.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/net/net.c b/net/net.c -index fc1125111c..94f51b6e5f 100644 ---- a/net/net.c -+++ b/net/net.c -@@ -828,6 +828,7 @@ static ssize_t qemu_deliver_packet_iov(NetClientState *sender, - iov_copy[0].iov_len = nc->vnet_hdr_len; - memcpy(&iov_copy[1], iov, iovcnt * sizeof(*iov)); - iov = iov_copy; -+ iovcnt++; - } - - if (nc->info->receive_iov) { --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Abort-IPL-on-invalid-loadparm.patch b/kvm-pc-bios-s390-ccw-Abort-IPL-on-invalid-loadparm.patch deleted file mode 100644 index ea0410d..0000000 --- a/kvm-pc-bios-s390-ccw-Abort-IPL-on-invalid-loadparm.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 3add991f9da7abac1ddc293a17f90a8b3ab5bb67 Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Fri, 17 Jan 2025 16:22:35 -0500 -Subject: [PATCH 2/6] pc-bios/s390-ccw: Abort IPL on invalid loadparm -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 331: Fix boot problems when falling back from network to another boot device on s390x [RHEL10] -RH-Jira: RHEL-72717 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/4] fdde5c57ff03fa0d2e69d711bbf485dcefc8f55b (thuth/qemu-kvm-cs) - -Because the loadparm specifies an exact kernel the user wants to boot, if the -loadparm is invalid it must represent a misconfiguration of the guest. Thus we -should abort the IPL immediately, without attempting to use other devices, to -avoid booting into an unintended guest image. - -Signed-off-by: Jared Rossi -Message-ID: <20250117212235.1324063-2-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 64fa0de46ee3cc972af5d3ce8c5dc0db8198cd2b) ---- - pc-bios/s390-ccw/bootmap.c | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c -index 56f2f75640..0f8baa0198 100644 ---- a/pc-bios/s390-ccw/bootmap.c -+++ b/pc-bios/s390-ccw/bootmap.c -@@ -336,8 +336,7 @@ static int run_eckd_boot_script(block_number_t bmt_block_nr, - - debug_print_int("loadparm", loadparm); - if (loadparm >= MAX_BOOT_ENTRIES) { -- puts("loadparm value greater than max number of boot entries allowed"); -- return -EINVAL; -+ panic("loadparm value greater than max number of boot entries allowed"); - } - - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -@@ -348,8 +347,8 @@ static int run_eckd_boot_script(block_number_t bmt_block_nr, - - block_nr = gen_eckd_block_num(&bmt->entry[loadparm].xeckd, ldipl); - if (block_nr == NULL_BLOCK_NR) { -- puts("Cannot find Boot Map Table Entry"); -- return -EIO; -+ printf("The requested boot entry (%d) is invalid\n", loadparm); -+ panic("Invalid loadparm"); - } - - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -@@ -792,8 +791,12 @@ static int ipl_scsi(void) - - debug_print_int("loadparm", loadparm); - if (loadparm >= MAX_BOOT_ENTRIES) { -- puts("loadparm value greater than max number of boot entries allowed"); -- return -EINVAL; -+ panic("loadparm value greater than max number of boot entries allowed"); -+ } -+ -+ if (!valid_entries[loadparm]) { -+ printf("The requested boot entry (%d) is invalid\n", loadparm); -+ panic("Invalid loadparm"); - } - - return zipl_run(&prog_table->entry[loadparm].scsi); --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Clarify-alignment-is-in-bytes.patch b/kvm-pc-bios-s390-ccw-Clarify-alignment-is-in-bytes.patch deleted file mode 100644 index 357bfe7..0000000 --- a/kvm-pc-bios-s390-ccw-Clarify-alignment-is-in-bytes.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 57746476c81359507743671addee330e303c1e02 Mon Sep 17 00:00:00 2001 -From: Jens Remus -Date: Tue, 1 Oct 2024 17:36:16 +0200 -Subject: [PATCH 22/38] pc-bios/s390-ccw: Clarify alignment is in bytes -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [21/23] 17e89c1a3ca01b9de4683aebdbd06c5350422d27 (thuth/qemu-kvm-cs9) - -The assembler directive .align [1] has architecture-dependent behavior, -which may be ambiguous for the reader. Some architectures perform the -alignment in bytes, others in power of two. s390 does in bytes. - -Use the directive .balign [2] instead, to clarify that the alignment -request is in bytes. No functional change. - -[1] https://sourceware.org/binutils/docs/as/Align.html -[2] https://sourceware.org/binutils/docs/as/Balign.html - -Signed-off-by: Jens Remus -Reviewed-by: Marc Hartmayer -Message-ID: <20241001153618.17791-2-mhartmay@linux.ibm.com> -Reviewed-by: Thomas Huth -Signed-off-by: Thomas Huth -(cherry picked from commit c58df213af7ec8924d219025a593b8f3ac475f16) ---- - pc-bios/s390-ccw/start.S | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S -index 061b06591c..576fc12c06 100644 ---- a/pc-bios/s390-ccw/start.S -+++ b/pc-bios/s390-ccw/start.S -@@ -112,7 +112,7 @@ io_new_code: - lctlg %c6,%c6,0(%r15) - br %r14 - -- .align 8 -+ .balign 8 - bss_start_literal: - .quad __bss_start - disabled_wait_psw: -@@ -125,7 +125,7 @@ io_new_mask: - .quad 0x0000000180000000 - - .bss -- .align 8 -+ .balign 8 - stack: - .space STACK_SIZE - .size stack,STACK_SIZE --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Don-t-generate-TEXTRELs.patch b/kvm-pc-bios-s390-ccw-Don-t-generate-TEXTRELs.patch deleted file mode 100644 index a113e2f..0000000 --- a/kvm-pc-bios-s390-ccw-Don-t-generate-TEXTRELs.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 62433cc6df65f10e99dab8b2ec9918b69c3c73ae Mon Sep 17 00:00:00 2001 -From: Jens Remus -Date: Tue, 1 Oct 2024 17:36:17 +0200 -Subject: [PATCH 23/38] pc-bios/s390-ccw: Don't generate TEXTRELs -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [22/23] 57de00e48321faf13f673c6d52fd9d59d9be5c83 (thuth/qemu-kvm-cs9) - -Commit 7cd50cbe4ca3 ("pc-bios/s390-ccw: Don't use __bss_start with the -"larl" instruction") introduced the address constant bss_start_literal -for __bss_start in the .text section, which introduced a relocation in -code (i.e. TEXTREL). The dedicated constant is required, as __bss_start -may not necessarily be aligned on a 2-byte boundary (see subject commit -for details). - -Move the constant to the .data section to get rid of the relocation in -the .text section. Add the linker option -z text to prevent TEXTRELs to -get introduced in the future. - -Note that the R_390_RELATIVE relocations are taken care of by function -glue() in include/hw/elf_ops.h.inc introduced by commit 5dce07e1cb67 -("elf-loader: Provide the possibility to relocate s390 ELF files"). - -Reported-by: Marc Hartmayer -Signed-off-by: Jens Remus -Reviewed-by: Marc Hartmayer -Message-ID: <20241001153618.17791-3-mhartmay@linux.ibm.com> -Reviewed-by: Thomas Huth -Signed-off-by: Thomas Huth -(cherry picked from commit 3259b4424a85d9cdfd1a33ed6030a6c51c1b9b8b) ---- - pc-bios/s390-ccw/Makefile | 2 +- - pc-bios/s390-ccw/start.S | 7 +++++-- - 2 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile -index db9e8f0892..38254e22df 100644 ---- a/pc-bios/s390-ccw/Makefile -+++ b/pc-bios/s390-ccw/Makefile -@@ -46,7 +46,7 @@ EXTRA_CFLAGS += -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-tables - EXTRA_CFLAGS += -msoft-float - EXTRA_CFLAGS += -std=gnu99 - EXTRA_CFLAGS += $(LIBC_INC) $(LIBNET_INC) --LDFLAGS += -Wl,-pie -nostdlib -z noexecstack -+LDFLAGS += -Wl,-pie -nostdlib -z noexecstack -z text - - cc-test = $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>/dev/null - cc-option = if $(call cc-test, $1); then \ -diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S -index 576fc12c06..b70213e412 100644 ---- a/pc-bios/s390-ccw/start.S -+++ b/pc-bios/s390-ccw/start.S -@@ -113,8 +113,6 @@ io_new_code: - br %r14 - - .balign 8 --bss_start_literal: -- .quad __bss_start - disabled_wait_psw: - .quad 0x0002000180000000,0x0000000000000000 - enabled_wait_psw: -@@ -124,6 +122,11 @@ external_new_mask: - io_new_mask: - .quad 0x0000000180000000 - -+.data -+ .balign 8 -+bss_start_literal: -+ .quad __bss_start -+ - .bss - .balign 8 - stack: --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Enable-failed-IPL-to-return-after-e.patch b/kvm-pc-bios-s390-ccw-Enable-failed-IPL-to-return-after-e.patch deleted file mode 100644 index d4d3246..0000000 --- a/kvm-pc-bios-s390-ccw-Enable-failed-IPL-to-return-after-e.patch +++ /dev/null @@ -1,426 +0,0 @@ -From cfc51bd73616b36a98f7f65f0df3b637d3711811 Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:46 -0400 -Subject: [PATCH 14/38] pc-bios/s390-ccw: Enable failed IPL to return after - error -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [13/23] a78913dc1a9de94de76d484475b967997c457d57 (thuth/qemu-kvm-cs9) - -Remove panic-on-error from IPL functions such that a return code is propagated -back to the main IPL calling function (rather than terminating immediately), -which facilitates possible error recovery in the future. - -A select few panics remain, which indicate fatal non-devices errors that must -result in termination. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-13-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 0181e23713114fd4c33326c3372aaf48dcfb412a) ---- - pc-bios/s390-ccw/bootmap.c | 53 ++++++++++++++++++-------- - pc-bios/s390-ccw/cio.c | 3 +- - pc-bios/s390-ccw/jump2ipl.c | 5 ++- - pc-bios/s390-ccw/main.c | 32 +++++++++------- - pc-bios/s390-ccw/s390-ccw.h | 2 +- - pc-bios/s390-ccw/virtio-blkdev.c | 2 +- - pc-bios/s390-ccw/virtio.c | 65 +++++++++++++++++++++----------- - pc-bios/s390-ccw/virtio.h | 2 +- - 8 files changed, 108 insertions(+), 56 deletions(-) - -diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c -index 95ef9104d0..56f2f75640 100644 ---- a/pc-bios/s390-ccw/bootmap.c -+++ b/pc-bios/s390-ccw/bootmap.c -@@ -62,15 +62,34 @@ static void *s2_prev_blk = _s2; - static void *s2_cur_blk = _s2 + MAX_SECTOR_SIZE; - static void *s2_next_blk = _s2 + MAX_SECTOR_SIZE * 2; - --static inline void verify_boot_info(BootInfo *bip) -+static inline int verify_boot_info(BootInfo *bip) - { -- IPL_assert(magic_match(bip->magic, ZIPL_MAGIC), "No zIPL sig in BootInfo"); -- IPL_assert(bip->version == BOOT_INFO_VERSION, "Wrong zIPL version"); -- IPL_assert(bip->bp_type == BOOT_INFO_BP_TYPE_IPL, "DASD is not for IPL"); -- IPL_assert(bip->dev_type == BOOT_INFO_DEV_TYPE_ECKD, "DASD is not ECKD"); -- IPL_assert(bip->flags == BOOT_INFO_FLAGS_ARCH, "Not for this arch"); -- IPL_assert(block_size_ok(bip->bp.ipl.bm_ptr.eckd.bptr.size), -- "Bad block size in zIPL section of the 1st record."); -+ if (!magic_match(bip->magic, ZIPL_MAGIC)) { -+ puts("No zIPL sig in BootInfo"); -+ return -EINVAL; -+ } -+ if (bip->version != BOOT_INFO_VERSION) { -+ puts("Wrong zIPL version"); -+ return -EINVAL; -+ } -+ if (bip->bp_type != BOOT_INFO_BP_TYPE_IPL) { -+ puts("DASD is not for IPL"); -+ return -ENODEV; -+ } -+ if (bip->dev_type != BOOT_INFO_DEV_TYPE_ECKD) { -+ puts("DASD is not ECKD"); -+ return -ENODEV; -+ } -+ if (bip->flags != BOOT_INFO_FLAGS_ARCH) { -+ puts("Not for this arch"); -+ return -EINVAL; -+ } -+ if (!block_size_ok(bip->bp.ipl.bm_ptr.eckd.bptr.size)) { -+ puts("Bad block size in zIPL section of 1st record"); -+ return -EINVAL; -+ } -+ -+ return 0; - } - - static void eckd_format_chs(ExtEckdBlockPtr *ptr, bool ldipl, -@@ -367,8 +386,8 @@ static int run_eckd_boot_script(block_number_t bmt_block_nr, - puts("Unknown script entry type"); - return -EINVAL; - } -- write_reset_psw(bms->entry[i].address.load_address); /* no return */ -- jump_to_IPL_code(0); /* no return */ -+ write_reset_psw(bms->entry[i].address.load_address); -+ jump_to_IPL_code(0); - return -1; - } - -@@ -1067,16 +1086,19 @@ void zipl_load(void) - - if (vdev->is_cdrom) { - ipl_iso_el_torito(); -- panic("\n! Cannot IPL this ISO image !\n"); -+ puts("Failed to IPL this ISO image!"); -+ return; - } - - if (virtio_get_device_type() == VIRTIO_ID_NET) { - netmain(); -- panic("\n! Cannot IPL from this network !\n"); -+ puts("Failed to IPL from this network!"); -+ return; - } - - if (ipl_scsi()) { -- panic("\n! Cannot IPL this SCSI device !\n"); -+ puts("Failed to IPL from this SCSI device!"); -+ return; - } - - switch (virtio_get_device_type()) { -@@ -1087,8 +1109,9 @@ void zipl_load(void) - zipl_load_vscsi(); - break; - default: -- panic("\n! Unknown IPL device type !\n"); -+ puts("Unknown IPL device type!"); -+ return; - } - -- puts("zIPL load failed."); -+ puts("zIPL load failed!"); - } -diff --git a/pc-bios/s390-ccw/cio.c b/pc-bios/s390-ccw/cio.c -index 7b09a38c96..5d543da73f 100644 ---- a/pc-bios/s390-ccw/cio.c -+++ b/pc-bios/s390-ccw/cio.c -@@ -59,7 +59,8 @@ uint16_t cu_type(SubChannelId schid) - }; - - if (do_cio(schid, CU_TYPE_UNKNOWN, ptr2u32(&sense_id_ccw), CCW_FMT1)) { -- panic("Failed to run SenseID CCw\n"); -+ puts("Failed to run SenseID CCW"); -+ return CU_TYPE_UNKNOWN; - } - - return sense_data.cu_type; -diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c -index 80b7f6a1f3..8db1764ff3 100644 ---- a/pc-bios/s390-ccw/jump2ipl.c -+++ b/pc-bios/s390-ccw/jump2ipl.c -@@ -33,7 +33,7 @@ static void jump_to_IPL_addr(void) - /* should not return */ - } - --void jump_to_IPL_code(uint64_t address) -+int jump_to_IPL_code(uint64_t address) - { - /* store the subsystem information _after_ the bootmap was loaded */ - write_subsystem_identification(); -@@ -68,7 +68,8 @@ void jump_to_IPL_code(uint64_t address) - asm volatile("lghi %%r1,1\n\t" - "diag %%r1,%%r1,0x308\n\t" - : : : "1", "memory"); -- panic("\n! IPL returns !\n"); -+ puts("IPL code jump failed"); -+ return -1; - } - - void jump_to_low_kernel(void) -diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c -index fc44da3161..34ef27d7a6 100644 ---- a/pc-bios/s390-ccw/main.c -+++ b/pc-bios/s390-ccw/main.c -@@ -77,6 +77,9 @@ static int is_dev_possibly_bootable(int dev_no, int sch_no) - - enable_subchannel(blk_schid); - cutype = cu_type(blk_schid); -+ if (cutype == CU_TYPE_UNKNOWN) { -+ return -EIO; -+ } - - /* - * Note: we always have to run virtio_is_supported() here to make -@@ -194,10 +197,10 @@ static void boot_setup(void) - have_iplb = store_iplb(&iplb); - } - --static void find_boot_device(void) -+static bool find_boot_device(void) - { - VDev *vdev = virtio_get_device(); -- bool found; -+ bool found = false; - - switch (iplb.pbt) { - case S390_IPL_TYPE_CCW: -@@ -215,10 +218,10 @@ static void find_boot_device(void) - found = find_subch(iplb.scsi.devno); - break; - default: -- panic("List-directed IPL not supported yet!\n"); -+ puts("Unsupported IPLB"); - } - -- IPL_assert(found, "Boot device not found\n"); -+ return found; - } - - static int virtio_setup(void) -@@ -244,11 +247,13 @@ static int virtio_setup(void) - ret = virtio_scsi_setup_device(blk_schid); - break; - default: -- panic("\n! No IPL device available !\n"); -+ puts("\n! No IPL device available !\n"); -+ return -1; - } - -- if (!ret) { -- IPL_assert(virtio_ipl_disk_is_valid(), "No valid IPL device detected"); -+ if (!ret && !virtio_ipl_disk_is_valid()) { -+ puts("No valid IPL device detected"); -+ return -ENODEV; - } - - return ret; -@@ -259,16 +264,16 @@ static void ipl_boot_device(void) - switch (cutype) { - case CU_TYPE_DASD_3990: - case CU_TYPE_DASD_2107: -- dasd_ipl(blk_schid, cutype); /* no return */ -+ dasd_ipl(blk_schid, cutype); - break; - case CU_TYPE_VIRTIO: -- if (virtio_setup() == 0) { -- zipl_load(); /* Only returns in case of errors */ -+ if (virtio_setup()) { -+ return; /* Only returns in case of errors */ - } -+ zipl_load(); - break; - default: - printf("Attempting to boot from unexpected device type 0x%X\n", cutype); -- panic("\nBoot failed.\n"); - } - } - -@@ -301,12 +306,11 @@ void main(void) - sclp_setup(); - css_setup(); - boot_setup(); -- if (have_iplb) { -- find_boot_device(); -+ if (have_iplb && find_boot_device()) { - ipl_boot_device(); - } else { - probe_boot_device(); - } - -- panic("Failed to load OS from hard disk\n"); -+ panic("Failed to IPL. Halting..."); - } -diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h -index 344ad15655..6cdce3e5e5 100644 ---- a/pc-bios/s390-ccw/s390-ccw.h -+++ b/pc-bios/s390-ccw/s390-ccw.h -@@ -78,7 +78,7 @@ void zipl_load(void); - - /* jump2ipl.c */ - void write_reset_psw(uint64_t psw); --void jump_to_IPL_code(uint64_t address); -+int jump_to_IPL_code(uint64_t address); - void jump_to_low_kernel(void); - - /* menu.c */ -diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blkdev.c -index 1c585f034b..7b2d1e20f4 100644 ---- a/pc-bios/s390-ccw/virtio-blkdev.c -+++ b/pc-bios/s390-ccw/virtio-blkdev.c -@@ -59,7 +59,7 @@ int virtio_read_many(unsigned long sector, void *load_addr, int sec_num) - case VIRTIO_ID_SCSI: - return virtio_scsi_read_many(vdev, sector, load_addr, sec_num); - } -- panic("\n! No readable IPL device !\n"); -+ - return -1; - } - -diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c -index 8c6b0a8a92..8b5a370bb3 100644 ---- a/pc-bios/s390-ccw/virtio.c -+++ b/pc-bios/s390-ccw/virtio.c -@@ -217,16 +217,19 @@ int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd) - return 0; - } - --void virtio_setup_ccw(VDev *vdev) -+int virtio_setup_ccw(VDev *vdev) - { -- int i, rc, cfg_size = 0; -+ int i, cfg_size = 0; - uint8_t status; - struct VirtioFeatureDesc { - uint32_t features; - uint8_t index; - } __attribute__((packed)) feats; - -- IPL_assert(virtio_is_supported(vdev->schid), "PE"); -+ if (!virtio_is_supported(vdev->schid)) { -+ puts("Virtio unsupported for this device ID"); -+ return -ENODEV; -+ } - /* device ID has been established now */ - - vdev->config.blk.blk_size = 0; /* mark "illegal" - setup started... */ -@@ -235,8 +238,10 @@ void virtio_setup_ccw(VDev *vdev) - run_ccw(vdev, CCW_CMD_VDEV_RESET, NULL, 0, false); - - status = VIRTIO_CONFIG_S_ACKNOWLEDGE; -- rc = run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false); -- IPL_assert(rc == 0, "Could not write ACKNOWLEDGE status to host"); -+ if (run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false)) { -+ puts("Could not write ACKNOWLEDGE status to host"); -+ return -EIO; -+ } - - switch (vdev->senseid.cu_model) { - case VIRTIO_ID_NET: -@@ -255,27 +260,37 @@ void virtio_setup_ccw(VDev *vdev) - cfg_size = sizeof(vdev->config.scsi); - break; - default: -- panic("Unsupported virtio device\n"); -+ puts("Unsupported virtio device"); -+ return -ENODEV; - } - - status |= VIRTIO_CONFIG_S_DRIVER; -- rc = run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false); -- IPL_assert(rc == 0, "Could not write DRIVER status to host"); -+ if (run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false)) { -+ puts("Could not write DRIVER status to host"); -+ return -EIO; -+ } - - /* Feature negotiation */ - for (i = 0; i < ARRAY_SIZE(vdev->guest_features); i++) { - feats.features = 0; - feats.index = i; -- rc = run_ccw(vdev, CCW_CMD_READ_FEAT, &feats, sizeof(feats), false); -- IPL_assert(rc == 0, "Could not get features bits"); -+ if (run_ccw(vdev, CCW_CMD_READ_FEAT, &feats, sizeof(feats), false)) { -+ puts("Could not get features bits"); -+ return -EIO; -+ } -+ - vdev->guest_features[i] &= bswap32(feats.features); - feats.features = bswap32(vdev->guest_features[i]); -- rc = run_ccw(vdev, CCW_CMD_WRITE_FEAT, &feats, sizeof(feats), false); -- IPL_assert(rc == 0, "Could not set features bits"); -+ if (run_ccw(vdev, CCW_CMD_WRITE_FEAT, &feats, sizeof(feats), false)) { -+ puts("Could not set features bits"); -+ return -EIO; -+ } - } - -- rc = run_ccw(vdev, CCW_CMD_READ_CONF, &vdev->config, cfg_size, false); -- IPL_assert(rc == 0, "Could not get virtio device configuration"); -+ if (run_ccw(vdev, CCW_CMD_READ_CONF, &vdev->config, cfg_size, false)) { -+ puts("Could not get virtio device configuration"); -+ return -EIO; -+ } - - for (i = 0; i < vdev->nr_vqs; i++) { - VqInfo info = { -@@ -289,19 +304,27 @@ void virtio_setup_ccw(VDev *vdev) - .num = 0, - }; - -- rc = run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), false); -- IPL_assert(rc == 0, "Could not get virtio device VQ configuration"); -+ if (run_ccw(vdev, CCW_CMD_READ_VQ_CONF, &config, sizeof(config), -+ false)) { -+ puts("Could not get virtio device VQ config"); -+ return -EIO; -+ } - info.num = config.num; - vring_init(&vdev->vrings[i], &info); - vdev->vrings[i].schid = vdev->schid; -- IPL_assert( -- run_ccw(vdev, CCW_CMD_SET_VQ, &info, sizeof(info), false) == 0, -- "Cannot set VQ info"); -+ if (run_ccw(vdev, CCW_CMD_SET_VQ, &info, sizeof(info), false)) { -+ puts("Cannot set VQ info"); -+ return -EIO; -+ } - } - - status |= VIRTIO_CONFIG_S_DRIVER_OK; -- rc = run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false); -- IPL_assert(rc == 0, "Could not write DRIVER_OK status to host"); -+ if (run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false)) { -+ puts("Could not write DRIVER_OK status to host"); -+ return -EIO; -+ } -+ -+ return 0; - } - - bool virtio_is_supported(SubChannelId schid) -diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h -index 6f9a558ff5..9faf3986b1 100644 ---- a/pc-bios/s390-ccw/virtio.h -+++ b/pc-bios/s390-ccw/virtio.h -@@ -274,7 +274,7 @@ void vring_send_buf(VRing *vr, void *p, int len, int flags); - int vr_poll(VRing *vr); - int vring_wait_reply(void); - int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd); --void virtio_setup_ccw(VDev *vdev); -+int virtio_setup_ccw(VDev *vdev); - - int virtio_net_init(void *mac_addr); - --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Fix-boot-problem-with-virtio-net-de.patch b/kvm-pc-bios-s390-ccw-Fix-boot-problem-with-virtio-net-de.patch deleted file mode 100644 index d29be6d..0000000 --- a/kvm-pc-bios-s390-ccw-Fix-boot-problem-with-virtio-net-de.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 548a415cff7d590d86033902fb29d5e15f57d17f Mon Sep 17 00:00:00 2001 -From: Thomas Huth -Date: Thu, 16 Jan 2025 12:58:25 +0100 -Subject: [PATCH 4/6] pc-bios/s390-ccw: Fix boot problem with virtio-net - devices -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 331: Fix boot problems when falling back from network to another boot device on s390x [RHEL10] -RH-Jira: RHEL-72717 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [3/4] f7ef8c63507c7f1ee8d05083f9540bee1697071c (thuth/qemu-kvm-cs) - -When we are trying to boot from virtio-net devices, the -s390-ccw bios currently leaves the virtio-net device enabled -after using it. That means that the receiving virt queues will -continue to happily write incoming network packets into memory. -This can corrupt data of the following boot process. For example, -if you set up a second guest on a virtual network and create a -lot of broadcast traffic there, e.g. with: - - ping -i 0.02 -s 1400 -b 192.168.1.255 - -and then you try to boot a guest with two boot devices, a network -device first (which should not be bootable) and e.g. a bootable SCSI -CD second, then this guest will fail to load the kernel from the CD -image: - - $ qemu-system-s390x -m 2G -nographic -device virtio-scsi-ccw \ - -netdev tap,id=net0 -device virtio-net-ccw,netdev=net0,bootindex=1 \ - -drive if=none,file=test.iso,format=raw,id=cd1 \ - -device scsi-cd,drive=cd1,bootindex=2 - LOADPARM=[ ] - - Network boot device detected - Network boot starting... - Using MAC address: 52:54:00:12:34:56 - Requesting information via DHCP: done - Using IPv4 address: 192.168.1.76 - Using TFTP server: 192.168.1.1 - Trying pxelinux.cfg files... - TFTP error: ICMP ERROR "port unreachable" - Receiving data: 0 KBytes - Repeating TFTP read request... - TFTP error: ICMP ERROR "port unreachable" - Failed to load OS from network. - Failed to IPL from this network! - LOADPARM=[ ] - - Using virtio-scsi. - - ! virtio-scsi:setup:inquiry: response VS RESP=ff ! - ERROR: No suitable device for IPL. Halting... - -We really have to shut up the virtio-net devices after we're not -using it anymore. The easiest way to do this is to simply reset -the device, so let's do that now. - -Reviewed-by: Jared Rossi -Reviewed-by: Eric Farman -Tested-by: Jared Rossi -Message-ID: <20250116115826.192047-3-thuth@redhat.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 68c95ed1db070f7545e487e742715f01a545aab0) ---- - pc-bios/s390-ccw/netmain.c | 33 +++++++++++++++++++++++---------- - pc-bios/s390-ccw/virtio-net.c | 5 +++++ - pc-bios/s390-ccw/virtio.h | 1 + - 3 files changed, 29 insertions(+), 10 deletions(-) - -diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c -index e46e470db4..335ea9b63e 100644 ---- a/pc-bios/s390-ccw/netmain.c -+++ b/pc-bios/s390-ccw/netmain.c -@@ -153,19 +153,10 @@ static int tftp_load(filename_ip_t *fnip, void *buffer, int len) - return rc; - } - --static int net_init(filename_ip_t *fn_ip) -+static int net_init_ip(filename_ip_t *fn_ip) - { - int rc; - -- memset(fn_ip, 0, sizeof(filename_ip_t)); -- -- rc = virtio_net_init(mac); -- if (rc < 0) { -- puts("Could not initialize network device"); -- return -101; -- } -- fn_ip->fd = rc; -- - printf(" Using MAC address: %02x:%02x:%02x:%02x:%02x:%02x\n", - mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - -@@ -221,11 +212,33 @@ static int net_init(filename_ip_t *fn_ip) - return rc; - } - -+static int net_init(filename_ip_t *fn_ip) -+{ -+ int rc; -+ -+ memset(fn_ip, 0, sizeof(filename_ip_t)); -+ -+ rc = virtio_net_init(mac); -+ if (rc < 0) { -+ puts("Could not initialize network device"); -+ return -101; -+ } -+ fn_ip->fd = rc; -+ -+ rc = net_init_ip(fn_ip); -+ if (rc < 0) { -+ virtio_net_deinit(); -+ } -+ -+ return rc; -+} -+ - static void net_release(filename_ip_t *fn_ip) - { - if (fn_ip->ip_version == 4) { - dhcp_send_release(fn_ip->fd); - } -+ virtio_net_deinit(); - } - - /** -diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c -index 578c89d0c5..301445bf97 100644 ---- a/pc-bios/s390-ccw/virtio-net.c -+++ b/pc-bios/s390-ccw/virtio-net.c -@@ -140,3 +140,8 @@ int recv(int fd, void *buf, int maxlen, int flags) - - return len; - } -+ -+void virtio_net_deinit(void) -+{ -+ virtio_reset(virtio_get_device()); -+} -diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h -index f13fa6f5fe..5c5e808a50 100644 ---- a/pc-bios/s390-ccw/virtio.h -+++ b/pc-bios/s390-ccw/virtio.h -@@ -278,5 +278,6 @@ int virtio_reset(VDev *vdev); - int virtio_setup_ccw(VDev *vdev); - - int virtio_net_init(void *mac_addr); -+void virtio_net_deinit(void); - - #endif /* VIRTIO_H */ --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Introduce-EXTRA_LDFLAGS.patch b/kvm-pc-bios-s390-ccw-Introduce-EXTRA_LDFLAGS.patch deleted file mode 100644 index b37a033..0000000 --- a/kvm-pc-bios-s390-ccw-Introduce-EXTRA_LDFLAGS.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 06818b9971babd2895158f9fb913d6262eea4cb7 Mon Sep 17 00:00:00 2001 -From: Marc Hartmayer -Date: Tue, 1 Oct 2024 17:36:18 +0200 -Subject: [PATCH 24/38] pc-bios/s390-ccw: Introduce `EXTRA_LDFLAGS` -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [23/23] 148b9e68cb80b5535c6bb732e5b5ce324ba3848e (thuth/qemu-kvm-cs9) - -Some packaging tools want to override `LDFLAGS` when building QEMU, this will -result in a build error as most likely no `-nostdlib` flag is passed. Introduce -`EXTRA_LDFLAGS` so that the packager can override `LDFLAGS` without breaking the -build. - -Signed-off-by: Marc Hartmayer -Message-ID: <20241001153618.17791-4-mhartmay@linux.ibm.com> -Reviewed-by: Thomas Huth -[thuth: Drop the hunk to netbook.mak which is not necessary anymore] -Signed-off-by: Thomas Huth -(cherry picked from commit 694d79ffce996c0993cebccc07c2ab6fc281e7d0) ---- - pc-bios/s390-ccw/Makefile | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile -index 38254e22df..dc69dd484f 100644 ---- a/pc-bios/s390-ccw/Makefile -+++ b/pc-bios/s390-ccw/Makefile -@@ -4,6 +4,7 @@ all: build-all - - include config-host.mak - CFLAGS = -O2 -g -I $(SRC_PATH)/../../include/hw/s390x/ipl -+LDFLAGS ?= - MAKEFLAGS += -rR - - GIT_SUBMODULES = roms/SLOF -@@ -46,7 +47,7 @@ EXTRA_CFLAGS += -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-tables - EXTRA_CFLAGS += -msoft-float - EXTRA_CFLAGS += -std=gnu99 - EXTRA_CFLAGS += $(LIBC_INC) $(LIBNET_INC) --LDFLAGS += -Wl,-pie -nostdlib -z noexecstack -z text -+EXTRA_LDFLAGS += -Wl,-pie -nostdlib -z noexecstack -z text - - cc-test = $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>/dev/null - cc-option = if $(call cc-test, $1); then \ -@@ -111,7 +112,7 @@ libnet.a: $(LIBNETOBJS) - build-all: s390-ccw.img - - s390-ccw.elf: $(OBJECTS) libnet.a libc.a -- $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^,Linking) -+ $(call quiet-command,$(CC) $(EXTRA_LDFLAGS) $(LDFLAGS) -o $@ $^,Linking) - - s390-ccw.img: s390-ccw.elf - $(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,Stripping $< into) --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Link-the-netboot-code-into-the-main.patch b/kvm-pc-bios-s390-ccw-Link-the-netboot-code-into-the-main.patch deleted file mode 100644 index 835a818..0000000 --- a/kvm-pc-bios-s390-ccw-Link-the-netboot-code-into-the-main.patch +++ /dev/null @@ -1,263 +0,0 @@ -From 7686f2129e50540b6e9865fad8b4ab9c0343c432 Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:37 -0400 -Subject: [PATCH 04/38] pc-bios/s390-ccw: Link the netboot code into the main - s390-ccw.img binary -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [3/23] 5c7283de7f4e2388e157ea408a44176fdaf5127a (thuth/qemu-kvm-cs9) - -We originally built a separate binary for the netboot code since it -was considered as experimental and we could not be sure that the -necessary SLOF module had been checked out. Time passed, the code -proved its usefulness, and the build system nowadays makes sure that -the SLOF module is checked out if you have a s390x compiler available -for building the s390-ccw bios. So there is no real compelling reason -anymore to keep the netboot code in a separate binary. Linking the -code together with the main s390-ccw.img will make future enhancements -much easier, like supporting more than one boot device. - -Co-authored by: Thomas Huth -Signed-off-by: Jared Rossi -Message-ID: <20241020012953.1380075-4-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 8e5739ce4b0b04d7121cb2b29521acde2a8f3a24) ---- - pc-bios/s390-ccw/Makefile | 13 +++++++------ - pc-bios/s390-ccw/bootmap.c | 2 +- - pc-bios/s390-ccw/cio.h | 2 ++ - pc-bios/s390-ccw/iplb.h | 4 ++-- - pc-bios/s390-ccw/main.c | 10 +++++++--- - pc-bios/s390-ccw/netboot.mak | 14 -------------- - pc-bios/s390-ccw/netmain.c | 15 ++------------- - pc-bios/s390-ccw/s390-ccw.h | 3 +++ - pc-bios/s390-ccw/virtio.h | 1 - - 9 files changed, 24 insertions(+), 40 deletions(-) - -diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile -index 3f4232636e..cf6859823a 100644 ---- a/pc-bios/s390-ccw/Makefile -+++ b/pc-bios/s390-ccw/Makefile -@@ -32,19 +32,20 @@ QEMU_DGFLAGS = -MMD -MP -MT $@ -MF $(@D)/$(*F).d - - .PHONY : all clean build-all distclean - --OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ -- virtio.o virtio-scsi.o virtio-blkdev.o cio.o dasd-ipl.o -+OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o netmain.o \ -+ virtio.o virtio-net.o virtio-scsi.o virtio-blkdev.o cio.o dasd-ipl.o - - SLOF_DIR := $(SRC_PATH)/../../roms/SLOF - - LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include -+LIBNET_INC := -I$(SLOF_DIR)/lib/libnet - - EXTRA_CFLAGS += -Wall - EXTRA_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -fno-common -fPIE - EXTRA_CFLAGS += -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-tables - EXTRA_CFLAGS += -msoft-float - EXTRA_CFLAGS += -std=gnu99 --EXTRA_CFLAGS += $(LIBC_INC) -+EXTRA_CFLAGS += $(LIBC_INC) $(LIBNET_INC) - LDFLAGS += -Wl,-pie -nostdlib -z noexecstack - - cc-test = $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>/dev/null -@@ -62,9 +63,9 @@ config-cc.mak: Makefile - - include $(SRC_PATH)/netboot.mak - --build-all: s390-ccw.img s390-netboot.img -+build-all: s390-ccw.img - --s390-ccw.elf: $(OBJECTS) libc.a -+s390-ccw.elf: $(OBJECTS) libnet.a libc.a - $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^,Linking) - - s390-ccw.img: s390-ccw.elf -@@ -72,7 +73,7 @@ s390-ccw.img: s390-ccw.elf - - $(OBJECTS): Makefile - --ALL_OBJS = $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS)) -+ALL_OBJS = $(sort $(OBJECTS) $(LIBCOBJS) $(LIBNETOBJS)) - -include $(ALL_OBJS:%.o=%.d) - - clean: -diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c -index 3cc79706be..414c3f1b47 100644 ---- a/pc-bios/s390-ccw/bootmap.c -+++ b/pc-bios/s390-ccw/bootmap.c -@@ -929,7 +929,7 @@ void zipl_load(void) - } - - if (virtio_get_device_type() == VIRTIO_ID_NET) { -- jump_to_IPL_code(vdev->netboot_start_addr); -+ netmain(); - } - - ipl_scsi(); -diff --git a/pc-bios/s390-ccw/cio.h b/pc-bios/s390-ccw/cio.h -index 8b18153deb..6a5e86ba01 100644 ---- a/pc-bios/s390-ccw/cio.h -+++ b/pc-bios/s390-ccw/cio.h -@@ -361,6 +361,8 @@ typedef struct CcwSearchIdData { - uint8_t record; - } __attribute__((packed)) CcwSearchIdData; - -+extern SubChannelId net_schid; -+ - int enable_mss_facility(void); - void enable_subchannel(SubChannelId schid); - uint16_t cu_type(SubChannelId schid); -diff --git a/pc-bios/s390-ccw/iplb.h b/pc-bios/s390-ccw/iplb.h -index cb6ac8a880..3758698468 100644 ---- a/pc-bios/s390-ccw/iplb.h -+++ b/pc-bios/s390-ccw/iplb.h -@@ -87,9 +87,9 @@ extern IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); - struct QemuIplParameters { - uint8_t qipl_flags; - uint8_t reserved1[3]; -- uint64_t netboot_start_addr; -+ uint64_t reserved2; - uint32_t boot_menu_timeout; -- uint8_t reserved2[12]; -+ uint8_t reserved3[12]; - } __attribute__ ((packed)); - typedef struct QemuIplParameters QemuIplParameters; - -diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c -index 203df20965..fc44da3161 100644 ---- a/pc-bios/s390-ccw/main.c -+++ b/pc-bios/s390-ccw/main.c -@@ -38,8 +38,13 @@ LowCore *lowcore; /* Yes, this *is* a pointer to address 0 */ - */ - void write_subsystem_identification(void) - { -- lowcore->subchannel_id = blk_schid.sch_id; -- lowcore->subchannel_nr = blk_schid.sch_no; -+ if (cutype == CU_TYPE_VIRTIO && virtio_get_device_type() == VIRTIO_ID_NET) { -+ lowcore->subchannel_id = net_schid.sch_id; -+ lowcore->subchannel_nr = net_schid.sch_no; -+ } else { -+ lowcore->subchannel_id = blk_schid.sch_id; -+ lowcore->subchannel_nr = blk_schid.sch_no; -+ } - lowcore->io_int_parm = 0; - } - -@@ -231,7 +236,6 @@ static int virtio_setup(void) - switch (vdev->senseid.cu_model) { - case VIRTIO_ID_NET: - puts("Network boot device detected"); -- vdev->netboot_start_addr = qipl.netboot_start_addr; - return 0; - case VIRTIO_ID_BLOCK: - ret = virtio_blk_setup_device(blk_schid); -diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak -index d2b3d8ee74..0a24257ff4 100644 ---- a/pc-bios/s390-ccw/netboot.mak -+++ b/pc-bios/s390-ccw/netboot.mak -@@ -1,18 +1,4 @@ - --NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o -- --LIBNET_INC := -I$(SLOF_DIR)/lib/libnet -- --NETLDFLAGS := $(LDFLAGS) -Wl,-Ttext=0x7800000 -- --$(NETOBJS): EXTRA_CFLAGS += $(LIBC_INC) $(LIBNET_INC) -- --s390-netboot.elf: $(NETOBJS) libnet.a libc.a -- $(call quiet-command,$(CC) $(NETLDFLAGS) -o $@ $^,Linking) -- --s390-netboot.img: s390-netboot.elf -- $(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,Stripping $< into) -- - # libc files: - - LIBC_CFLAGS = $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ -diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c -index 509119be15..bc6ad8695f 100644 ---- a/pc-bios/s390-ccw/netmain.c -+++ b/pc-bios/s390-ccw/netmain.c -@@ -41,7 +41,6 @@ - #define DEFAULT_TFTP_RETRIES 20 - - extern char _start[]; --void write_iplb_location(void) {} - - #define KERNEL_ADDR ((void *)0L) - #define KERNEL_MAX_SIZE ((long)_start) -@@ -50,10 +49,9 @@ void write_iplb_location(void) {} - /* STSI 3.2.2 offset of first vmdb + offset of uuid inside vmdb */ - #define STSI322_VMDB_UUID_OFFSET ((8 + 12) * 4) - --IplParameterBlock iplb __attribute__((aligned(PAGE_SIZE))); - static char cfgbuf[2048]; - --static SubChannelId net_schid = { .one = 1 }; -+SubChannelId net_schid = { .one = 1 }; - static uint8_t mac[6]; - static uint64_t dest_timer; - -@@ -438,15 +436,6 @@ static int net_try_direct_tftp_load(filename_ip_t *fn_ip) - return rc; - } - --void write_subsystem_identification(void) --{ -- SubChannelId *schid = (SubChannelId *) 184; -- uint32_t *zeroes = (uint32_t *) 188; -- -- *schid = net_schid; -- *zeroes = 0; --} -- - static bool find_net_dev(Schib *schib, int dev_no) - { - int i, r; -@@ -509,7 +498,7 @@ static void virtio_setup(void) - IPL_assert(found, "No virtio net device found"); - } - --void main(void) -+void netmain(void) - { - filename_ip_t fn_ip; - int rc, fnlen; -diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h -index 6f6d95d170..6abb34e563 100644 ---- a/pc-bios/s390-ccw/s390-ccw.h -+++ b/pc-bios/s390-ccw/s390-ccw.h -@@ -55,6 +55,9 @@ void write_iplb_location(void); - unsigned int get_loadparm_index(void); - void main(void); - -+/* netmain.c */ -+void netmain(void); -+ - /* sclp.c */ - void sclp_print(const char *string); - void sclp_set_write_mask(uint32_t receive_mask, uint32_t send_mask); -diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h -index 85bd9d1695..6f9a558ff5 100644 ---- a/pc-bios/s390-ccw/virtio.h -+++ b/pc-bios/s390-ccw/virtio.h -@@ -253,7 +253,6 @@ struct VDev { - uint8_t scsi_dev_heads; - bool scsi_device_selected; - ScsiDevice selected_scsi_device; -- uint64_t netboot_start_addr; - uint32_t max_transfer; - uint32_t guest_features[2]; - }; --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Merge-netboot.mak-into-the-main-Mak.patch b/kvm-pc-bios-s390-ccw-Merge-netboot.mak-into-the-main-Mak.patch deleted file mode 100644 index c587fec..0000000 --- a/kvm-pc-bios-s390-ccw-Merge-netboot.mak-into-the-main-Mak.patch +++ /dev/null @@ -1,141 +0,0 @@ -From 56030483f01524ee7021218e07c8d0ce1b588c62 Mon Sep 17 00:00:00 2001 -From: Thomas Huth -Date: Fri, 21 Jun 2024 09:40:11 +0200 -Subject: [PATCH 07/38] pc-bios/s390-ccw: Merge netboot.mak into the main - Makefile -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [6/23] 9ce64794a5c328673cdee6fa058088c3426efad8 (thuth/qemu-kvm-cs9) - -Now that the netboot code has been merged into the main s390-ccw.img, -it also does not make sense to keep the build rules in a separate -file. Thus let's merge netboot.mak into the main Makefile. - -Message-Id: <20240621082422.136217-7-thuth@redhat.com> -Signed-off-by: Thomas Huth -(cherry picked from commit f1fdadda36f73c9a4a96f92deb3062528cd12acc) ---- - pc-bios/s390-ccw/Makefile | 47 +++++++++++++++++++++++++++++++++++- - pc-bios/s390-ccw/netboot.mak | 45 ---------------------------------- - 2 files changed, 46 insertions(+), 46 deletions(-) - delete mode 100644 pc-bios/s390-ccw/netboot.mak - -diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile -index cf6859823a..27cbb354af 100644 ---- a/pc-bios/s390-ccw/Makefile -+++ b/pc-bios/s390-ccw/Makefile -@@ -61,7 +61,52 @@ config-cc.mak: Makefile - $(call cc-option,-march=z900,-march=z10)) 3> config-cc.mak - -include config-cc.mak - --include $(SRC_PATH)/netboot.mak -+# libc files: -+ -+LIBC_CFLAGS = $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ -+ -MMD -MP -MT $@ -MF $(@:%.o=%.d) -+ -+CTYPE_OBJS = isdigit.o isxdigit.o toupper.o -+%.o : $(SLOF_DIR)/lib/libc/ctype/%.c -+ $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) -+ -+STRING_OBJS = strcat.o strchr.o strrchr.o strcpy.o strlen.o strncpy.o \ -+ strcmp.o strncmp.o strcasecmp.o strncasecmp.o strstr.o \ -+ memset.o memcpy.o memmove.o memcmp.o -+%.o : $(SLOF_DIR)/lib/libc/string/%.c -+ $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) -+ -+STDLIB_OBJS = atoi.o atol.o strtoul.o strtol.o rand.o malloc.o free.o -+%.o : $(SLOF_DIR)/lib/libc/stdlib/%.c -+ $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) -+ -+STDIO_OBJS = sprintf.o snprintf.o vfprintf.o vsnprintf.o vsprintf.o fprintf.o \ -+ printf.o putc.o puts.o putchar.o stdchnls.o fileno.o -+%.o : $(SLOF_DIR)/lib/libc/stdio/%.c -+ $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) -+ -+sbrk.o: $(SLOF_DIR)/slof/sbrk.c -+ $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) -+ -+LIBCOBJS := $(STRING_OBJS) $(CTYPE_OBJS) $(STDLIB_OBJS) $(STDIO_OBJS) sbrk.o -+ -+libc.a: $(LIBCOBJS) -+ $(call quiet-command,$(AR) -rc $@ $^,Creating static library) -+ -+# libnet files: -+ -+LIBNETOBJS := args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \ -+ dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o -+LIBNETCFLAGS = $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ -+ -DDHCPARCH=0x1F -MMD -MP -MT $@ -MF $(@:%.o=%.d) -+ -+%.o : $(SLOF_DIR)/lib/libnet/%.c -+ $(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,Compiling) -+ -+libnet.a: $(LIBNETOBJS) -+ $(call quiet-command,$(AR) -rc $@ $^,Creating static library) -+ -+# Main targets: - - build-all: s390-ccw.img - -diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak -deleted file mode 100644 -index 0a24257ff4..0000000000 ---- a/pc-bios/s390-ccw/netboot.mak -+++ /dev/null -@@ -1,45 +0,0 @@ -- --# libc files: -- --LIBC_CFLAGS = $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ -- -MMD -MP -MT $@ -MF $(@:%.o=%.d) -- --CTYPE_OBJS = isdigit.o isxdigit.o toupper.o --%.o : $(SLOF_DIR)/lib/libc/ctype/%.c -- $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) -- --STRING_OBJS = strcat.o strchr.o strrchr.o strcpy.o strlen.o strncpy.o \ -- strcmp.o strncmp.o strcasecmp.o strncasecmp.o strstr.o \ -- memset.o memcpy.o memmove.o memcmp.o --%.o : $(SLOF_DIR)/lib/libc/string/%.c -- $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) -- --STDLIB_OBJS = atoi.o atol.o strtoul.o strtol.o rand.o malloc.o free.o --%.o : $(SLOF_DIR)/lib/libc/stdlib/%.c -- $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) -- --STDIO_OBJS = sprintf.o snprintf.o vfprintf.o vsnprintf.o vsprintf.o fprintf.o \ -- printf.o putc.o puts.o putchar.o stdchnls.o fileno.o --%.o : $(SLOF_DIR)/lib/libc/stdio/%.c -- $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) -- --sbrk.o: $(SLOF_DIR)/slof/sbrk.c -- $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) -- --LIBCOBJS := $(STRING_OBJS) $(CTYPE_OBJS) $(STDLIB_OBJS) $(STDIO_OBJS) sbrk.o -- --libc.a: $(LIBCOBJS) -- $(call quiet-command,$(AR) -rc $@ $^,Creating static library) -- --# libnet files: -- --LIBNETOBJS := args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \ -- dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o --LIBNETCFLAGS = $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ -- -DDHCPARCH=0x1F -MMD -MP -MT $@ -MF $(@:%.o=%.d) -- --%.o : $(SLOF_DIR)/lib/libnet/%.c -- $(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,Compiling) -- --libnet.a: $(LIBNETOBJS) -- $(call quiet-command,$(AR) -rc $@ $^,Creating static library) --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Re-initialize-receive-queue-index-b.patch b/kvm-pc-bios-s390-ccw-Re-initialize-receive-queue-index-b.patch deleted file mode 100644 index bd90563..0000000 --- a/kvm-pc-bios-s390-ccw-Re-initialize-receive-queue-index-b.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b2add99e201168c36eed56a3982ab02f63e5717a Mon Sep 17 00:00:00 2001 -From: Thomas Huth -Date: Mon, 11 Nov 2024 14:11:20 +0100 -Subject: [PATCH 9/9] pc-bios/s390-ccw: Re-initialize receive queue index - before each boot attempt - -RH-Author: Thomas Huth -RH-MergeRequest: 297: [c10s] Fixes for the new s390x "boot order" feature -RH-Jira: RHEL-68444 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [8/8] 8d40508aaf993f2e1b94d471f0e50d0f375e22d2 (thuth/qemu-kvm-cs9) - -Now that we can boot from multiple boot devices, we have to make sure -to reinitialize static variables like rx_last_idx to avoid that they -contain garbage data during the second boot attempt (which can lead to -crashes when the code tries to access the wrong ring data). - -Message-ID: <20241111131120.317796-1-thuth@redhat.com> -Reviewed-by: Jared Rossi -Signed-off-by: Thomas Huth -(cherry picked from commit 6ba1f714c00f8839a8df9f643e0058f00da3fd25) ---- - pc-bios/s390-ccw/virtio-net.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c -index f9854a22c3..578c89d0c5 100644 ---- a/pc-bios/s390-ccw/virtio-net.c -+++ b/pc-bios/s390-ccw/virtio-net.c -@@ -51,6 +51,8 @@ int virtio_net_init(void *mac_addr) - void *buf; - int i; - -+ rx_last_idx = 0; -+ - vdev->guest_features[0] = VIRTIO_NET_F_MAC_BIT; - virtio_setup_ccw(vdev); - --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Remove-panics-from-DASD-IPL-path.patch b/kvm-pc-bios-s390-ccw-Remove-panics-from-DASD-IPL-path.patch deleted file mode 100644 index 774fb08..0000000 --- a/kvm-pc-bios-s390-ccw-Remove-panics-from-DASD-IPL-path.patch +++ /dev/null @@ -1,177 +0,0 @@ -From 8279e0d5e38b31b9fcd36ff38f0175163ac4ba28 Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:44 -0400 -Subject: [PATCH 12/38] pc-bios/s390-ccw: Remove panics from DASD IPL path -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [11/23] 10de76e1707b351835081f37ddf8ef1c2c00fe61 (thuth/qemu-kvm-cs9) - -Remove panic-on-error from DASD IPL specific functions so that error recovery -may be possible in the future. - -Functions that would previously panic now provide a return code. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-11-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 1d5c7f078e938e6844f404429dd70bc52b39dac6) ---- - pc-bios/s390-ccw/dasd-ipl.c | 66 ++++++++++++++++++++----------------- - pc-bios/s390-ccw/dasd-ipl.h | 2 +- - 2 files changed, 37 insertions(+), 31 deletions(-) - -diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c -index ae751adec1..babece95ea 100644 ---- a/pc-bios/s390-ccw/dasd-ipl.c -+++ b/pc-bios/s390-ccw/dasd-ipl.c -@@ -111,38 +111,29 @@ static void make_readipl(void) - ccwIplRead->count = 0x18; /* Read 0x18 bytes of data */ - } - --static void run_readipl(SubChannelId schid, uint16_t cutype) -+static int run_readipl(SubChannelId schid, uint16_t cutype) - { -- if (do_cio(schid, cutype, 0x00, CCW_FMT0)) { -- panic("dasd-ipl: Failed to run Read IPL channel program\n"); -- } -+ return do_cio(schid, cutype, 0x00, CCW_FMT0); - } - - /* - * The architecture states that IPL1 data should consist of a psw followed by - * format-0 READ and TIC CCWs. Let's sanity check. - */ --static void check_ipl1(void) -+static bool check_ipl1(void) - { - Ccw0 *ccwread = (Ccw0 *)0x08; - Ccw0 *ccwtic = (Ccw0 *)0x10; - -- if (ccwread->cmd_code != CCW_CMD_DASD_READ || -- ccwtic->cmd_code != CCW_CMD_TIC) { -- panic("dasd-ipl: IPL1 data invalid. Is this disk really bootable?\n"); -- } -+ return (ccwread->cmd_code == CCW_CMD_DASD_READ && -+ ccwtic->cmd_code == CCW_CMD_TIC); - } - --static void check_ipl2(uint32_t ipl2_addr) -+static bool check_ipl2(uint32_t ipl2_addr) - { - Ccw0 *ccw = u32toptr(ipl2_addr); - -- if (ipl2_addr == 0x00) { -- panic("IPL2 address invalid. Is this disk really bootable?\n"); -- } -- if (ccw->cmd_code == 0x00) { -- panic("IPL2 ccw data invalid. Is this disk really bootable?\n"); -- } -+ return (ipl2_addr != 0x00 && ccw->cmd_code != 0x00); - } - - static uint32_t read_ipl2_addr(void) -@@ -188,52 +179,67 @@ static void ipl1_fixup(void) - ccwSearchTic->cda = ptr2u32(ccwSearchID); - } - --static void run_ipl1(SubChannelId schid, uint16_t cutype) -+static int run_ipl1(SubChannelId schid, uint16_t cutype) - { - uint32_t startAddr = 0x08; - -- if (do_cio(schid, cutype, startAddr, CCW_FMT0)) { -- panic("dasd-ipl: Failed to run IPL1 channel program\n"); -- } -+ return do_cio(schid, cutype, startAddr, CCW_FMT0); - } - --static void run_ipl2(SubChannelId schid, uint16_t cutype, uint32_t addr) -+static int run_ipl2(SubChannelId schid, uint16_t cutype, uint32_t addr) - { -- if (run_dynamic_ccw_program(schid, cutype, addr)) { -- panic("dasd-ipl: Failed to run IPL2 channel program\n"); -- } -+ return run_dynamic_ccw_program(schid, cutype, addr); - } - - /* - * Limitations in vfio-ccw support complicate the IPL process. Details can - * be found in docs/devel/s390-dasd-ipl.rst - */ --void dasd_ipl(SubChannelId schid, uint16_t cutype) -+int dasd_ipl(SubChannelId schid, uint16_t cutype) - { - PSWLegacy *pswl = (PSWLegacy *) 0x00; - uint32_t ipl2_addr; - - /* Construct Read IPL CCW and run it to read IPL1 from boot disk */ - make_readipl(); -- run_readipl(schid, cutype); -+ if (run_readipl(schid, cutype)) { -+ puts("Failed to run Read IPL channel program"); -+ return -EIO; -+ } -+ - ipl2_addr = read_ipl2_addr(); -- check_ipl1(); -+ -+ if (!check_ipl1()) { -+ puts("IPL1 invalid for DASD-IPL"); -+ return -EINVAL; -+ } - - /* - * Fixup IPL1 channel program to account for vfio-ccw limitations, then run - * it to read IPL2 channel program from boot disk. - */ - ipl1_fixup(); -- run_ipl1(schid, cutype); -- check_ipl2(ipl2_addr); -+ if (run_ipl1(schid, cutype)) { -+ puts("Failed to run IPL1 channel program"); -+ return -EIO; -+ } -+ -+ if (!check_ipl2(ipl2_addr)) { -+ puts("IPL2 invalid for DASD-IPL"); -+ return -EINVAL; -+ } - - /* - * Run IPL2 channel program to read operating system code from boot disk - */ -- run_ipl2(schid, cutype, ipl2_addr); -+ if (run_ipl2(schid, cutype, ipl2_addr)) { -+ puts("Failed to run IPL2 channel program"); -+ return -EIO; -+ } - - /* Transfer control to the guest operating system */ - pswl->mask |= PSW_MASK_EAMODE; /* Force z-mode */ - pswl->addr |= PSW_MASK_BAMODE; /* ... */ - jump_to_low_kernel(); -+ return -1; - } -diff --git a/pc-bios/s390-ccw/dasd-ipl.h b/pc-bios/s390-ccw/dasd-ipl.h -index c394828906..eb1898c84a 100644 ---- a/pc-bios/s390-ccw/dasd-ipl.h -+++ b/pc-bios/s390-ccw/dasd-ipl.h -@@ -11,6 +11,6 @@ - #ifndef DASD_IPL_H - #define DASD_IPL_H - --void dasd_ipl(SubChannelId schid, uint16_t cutype); -+int dasd_ipl(SubChannelId schid, uint16_t cutype); - - #endif /* DASD_IPL_H */ --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Remove-panics-from-ECKD-IPL-path.patch b/kvm-pc-bios-s390-ccw-Remove-panics-from-ECKD-IPL-path.patch deleted file mode 100644 index 4d55909..0000000 --- a/kvm-pc-bios-s390-ccw-Remove-panics-from-ECKD-IPL-path.patch +++ /dev/null @@ -1,475 +0,0 @@ -From 0a8e0f11dd82d5988b1090e8e4b8326be0dcb30c Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:42 -0400 -Subject: [PATCH 10/38] pc-bios/s390-ccw: Remove panics from ECKD IPL path -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [9/23] 628c2800ed02da8920e7e7c21d9f57e38a9a933d (thuth/qemu-kvm-cs9) - -Remove panic-on-error from ECKD block device IPL specific functions so that -error recovery may be possible in the future. - -Functions that would previously panic now provide a return code. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-9-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 806315279d5c629e1cc3a945bcfba3fe5482d84b) ---- - pc-bios/s390-ccw/bootmap.c | 187 +++++++++++++++++++++++++------------ - pc-bios/s390-ccw/bootmap.h | 1 + - 2 files changed, 130 insertions(+), 58 deletions(-) - -diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c -index af73254acb..b9596e28c7 100644 ---- a/pc-bios/s390-ccw/bootmap.c -+++ b/pc-bios/s390-ccw/bootmap.c -@@ -145,14 +145,17 @@ static block_number_t load_eckd_segments(block_number_t blk, bool ldipl, - bool more_data; - - memset(_bprs, FREE_SPACE_FILLER, sizeof(_bprs)); -- read_block(blk, bprs, "BPRS read failed"); -+ if (virtio_read(blk, bprs)) { -+ puts("BPRS read failed"); -+ return ERROR_BLOCK_NR; -+ } - - do { - more_data = false; - for (j = 0;; j++) { - block_nr = gen_eckd_block_num(&bprs[j].xeckd, ldipl); - if (is_null_block_number(block_nr)) { /* end of chunk */ -- break; -+ return NULL_BLOCK_NR; - } - - /* we need the updated blockno for the next indirect entry -@@ -163,15 +166,20 @@ static block_number_t load_eckd_segments(block_number_t blk, bool ldipl, - } - - /* List directed pointer does not store block size */ -- IPL_assert(ldipl || block_size_ok(bprs[j].xeckd.bptr.size), -- "bad chunk block size"); -+ if (!ldipl && !block_size_ok(bprs[j].xeckd.bptr.size)) { -+ puts("Bad chunk block size"); -+ return ERROR_BLOCK_NR; -+ } - - if (!eckd_valid_address(&bprs[j].xeckd, ldipl)) { - /* - * If an invalid address is found during LD-IPL then break and -- * retry as CCW -+ * retry as CCW-IPL, otherwise abort on error - */ -- IPL_assert(ldipl, "bad chunk ECKD addr"); -+ if (!ldipl) { -+ puts("Bad chunk ECKD address"); -+ return ERROR_BLOCK_NR; -+ } - break; - } - -@@ -189,7 +197,10 @@ static block_number_t load_eckd_segments(block_number_t blk, bool ldipl, - * I.e. the next ptr must point to the unused memory area - */ - memset(_bprs, FREE_SPACE_FILLER, sizeof(_bprs)); -- read_block(block_nr, bprs, "BPRS continuation read failed"); -+ if (virtio_read(block_nr, bprs)) { -+ puts("BPRS continuation read failed"); -+ return ERROR_BLOCK_NR; -+ } - more_data = true; - break; - } -@@ -198,7 +209,10 @@ static block_number_t load_eckd_segments(block_number_t blk, bool ldipl, - * to memory (address). - */ - rc = virtio_read_many(block_nr, (void *)(*address), count + 1); -- IPL_assert(rc == 0, "code chunk read failed"); -+ if (rc != 0) { -+ puts("Code chunk read failed"); -+ return ERROR_BLOCK_NR; -+ } - - *address += (count + 1) * virtio_get_block_size(); - } -@@ -232,7 +246,10 @@ static int eckd_get_boot_menu_index(block_number_t s1b_block_nr) - - /* Get Stage1b data */ - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -- read_block(s1b_block_nr, s1b, "Cannot read stage1b boot loader"); -+ if (virtio_read(s1b_block_nr, s1b)) { -+ puts("Cannot read stage1b boot loader"); -+ return -EIO; -+ } - - memset(_s2, FREE_SPACE_FILLER, sizeof(_s2)); - -@@ -244,7 +261,10 @@ static int eckd_get_boot_menu_index(block_number_t s1b_block_nr) - break; - } - -- read_block(cur_block_nr, s2_cur_blk, "Cannot read stage2 boot loader"); -+ if (virtio_read(cur_block_nr, s2_cur_blk)) { -+ puts("Cannot read stage2 boot loader"); -+ return -EIO; -+ } - - if (find_zipl_boot_menu_banner(&banner_offset)) { - /* -@@ -252,8 +272,10 @@ static int eckd_get_boot_menu_index(block_number_t s1b_block_nr) - * possibility of menu data spanning multiple blocks. - */ - if (prev_block_nr) { -- read_block(prev_block_nr, s2_prev_blk, -- "Cannot read stage2 boot loader"); -+ if (virtio_read(prev_block_nr, s2_prev_blk)) { -+ puts("Cannot read stage2 boot loader"); -+ return -EIO; -+ } - } - - if (i + 1 < STAGE2_BLK_CNT_MAX) { -@@ -261,8 +283,10 @@ static int eckd_get_boot_menu_index(block_number_t s1b_block_nr) - } - - if (next_block_nr && !is_null_block_number(next_block_nr)) { -- read_block(next_block_nr, s2_next_blk, -- "Cannot read stage2 boot loader"); -+ if (virtio_read(next_block_nr, s2_next_blk)) { -+ puts("Cannot read stage2 boot loader"); -+ return -EIO; -+ } - } - - return menu_get_zipl_boot_index(s2_cur_blk + banner_offset); -@@ -275,7 +299,7 @@ static int eckd_get_boot_menu_index(block_number_t s1b_block_nr) - return 0; - } - --static void run_eckd_boot_script(block_number_t bmt_block_nr, -+static int run_eckd_boot_script(block_number_t bmt_block_nr, - block_number_t s1b_block_nr) - { - int i; -@@ -292,17 +316,28 @@ static void run_eckd_boot_script(block_number_t bmt_block_nr, - } - - debug_print_int("loadparm", loadparm); -- IPL_assert(loadparm < MAX_BOOT_ENTRIES, "loadparm value greater than" -- " maximum number of boot entries allowed"); -+ if (loadparm >= MAX_BOOT_ENTRIES) { -+ puts("loadparm value greater than max number of boot entries allowed"); -+ return -EINVAL; -+ } - - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -- read_block(bmt_block_nr, sec, "Cannot read Boot Map Table"); -+ if (virtio_read(bmt_block_nr, sec)) { -+ puts("Cannot read Boot Map Table"); -+ return -EIO; -+ } - - block_nr = gen_eckd_block_num(&bmt->entry[loadparm].xeckd, ldipl); -- IPL_assert(block_nr != -1, "Cannot find Boot Map Table Entry"); -+ if (block_nr == NULL_BLOCK_NR) { -+ puts("Cannot find Boot Map Table Entry"); -+ return -EIO; -+ } - - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -- read_block(block_nr, sec, "Cannot read Boot Map Script"); -+ if (virtio_read(block_nr, sec)) { -+ puts("Cannot read Boot Map Script"); -+ return -EIO; -+ } - - for (i = 0; bms->entry[i].type == BOOT_SCRIPT_LOAD || - bms->entry[i].type == BOOT_SCRIPT_SIGNATURE; i++) { -@@ -317,21 +352,27 @@ static void run_eckd_boot_script(block_number_t bmt_block_nr, - - do { - block_nr = load_eckd_segments(block_nr, ldipl, &address); -- } while (block_nr != -1); -+ if (block_nr == ERROR_BLOCK_NR) { -+ return ldipl ? 0 : -EIO; -+ } -+ } while (block_nr != NULL_BLOCK_NR); - } - - if (ldipl && bms->entry[i].type != BOOT_SCRIPT_EXEC) { - /* Abort LD-IPL and retry as CCW-IPL */ -- return; -+ return 0; - } - -- IPL_assert(bms->entry[i].type == BOOT_SCRIPT_EXEC, -- "Unknown script entry type"); -+ if (bms->entry[i].type != BOOT_SCRIPT_EXEC) { -+ puts("Unknown script entry type"); -+ return -EINVAL; -+ } - write_reset_psw(bms->entry[i].address.load_address); /* no return */ - jump_to_IPL_code(0); /* no return */ -+ return -1; - } - --static void ipl_eckd_cdl(void) -+static int ipl_eckd_cdl(void) - { - XEckdMbr *mbr; - EckdCdlIpl2 *ipl2 = (void *)sec; -@@ -342,20 +383,23 @@ static void ipl_eckd_cdl(void) - puts("CDL"); - - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -- read_block(1, ipl2, "Cannot read IPL2 record at block 1"); -+ if (virtio_read(1, ipl2)) { -+ puts("Cannot read IPL2 record at block 1"); -+ return -EIO; -+ } - - mbr = &ipl2->mbr; - if (!magic_match(mbr, ZIPL_MAGIC)) { - puts("No zIPL section in IPL2 record."); -- return; -+ return 0; - } - if (!block_size_ok(mbr->blockptr.xeckd.bptr.size)) { - puts("Bad block size in zIPL section of IPL2 record."); -- return; -+ return 0; - } - if (mbr->dev_type != DEV_TYPE_ECKD) { - puts("Non-ECKD device type in zIPL section of IPL2 record."); -- return; -+ return 0; - } - - /* save pointer to Boot Map Table */ -@@ -365,19 +409,21 @@ static void ipl_eckd_cdl(void) - s1b_block_nr = eckd_block_num(&ipl2->stage1.seek[0].chs); - - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -- read_block(2, vlbl, "Cannot read Volume Label at block 2"); -+ if (virtio_read(2, vlbl)) { -+ puts("Cannot read Volume Label at block 2"); -+ return -EIO; -+ } - if (!magic_match(vlbl->key, VOL1_MAGIC)) { - puts("Invalid magic of volume label block."); -- return; -+ return 0; - } - if (!magic_match(vlbl->f.key, VOL1_MAGIC)) { - puts("Invalid magic of volser block."); -- return; -+ return 0; - } - print_volser(vlbl->f.volser); - -- run_eckd_boot_script(bmt_block_nr, s1b_block_nr); -- /* no return */ -+ return run_eckd_boot_script(bmt_block_nr, s1b_block_nr); - } - - static void print_eckd_ldl_msg(ECKD_IPL_mode_t mode) -@@ -403,7 +449,7 @@ static void print_eckd_ldl_msg(ECKD_IPL_mode_t mode) - print_volser(vlbl->volser); - } - --static void ipl_eckd_ldl(ECKD_IPL_mode_t mode) -+static int ipl_eckd_ldl(ECKD_IPL_mode_t mode) - { - block_number_t bmt_block_nr, s1b_block_nr; - EckdLdlIpl1 *ipl1 = (void *)sec; -@@ -415,10 +461,13 @@ static void ipl_eckd_ldl(ECKD_IPL_mode_t mode) - /* DO NOT read BootMap pointer (only one, xECKD) at block #2 */ - - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -- read_block(0, sec, "Cannot read block 0 to grab boot info."); -+ if (virtio_read(0, sec)) { -+ puts("Cannot read block 0 to grab boot info."); -+ return -EIO; -+ } - if (mode == ECKD_LDL_UNLABELED) { - if (!magic_match(ipl1->bip.magic, ZIPL_MAGIC)) { -- return; /* not applicable layout */ -+ return 0; /* not applicable layout */ - } - puts("unlabeled LDL."); - } -@@ -430,8 +479,7 @@ static void ipl_eckd_ldl(ECKD_IPL_mode_t mode) - /* save pointer to Stage1b Data */ - s1b_block_nr = eckd_block_num(&ipl1->stage1.seek[0].chs); - -- run_eckd_boot_script(bmt_block_nr, s1b_block_nr); -- /* no return */ -+ return run_eckd_boot_script(bmt_block_nr, s1b_block_nr); - } - - static block_number_t eckd_find_bmt(ExtEckdBlockPtr *ptr) -@@ -441,7 +489,10 @@ static block_number_t eckd_find_bmt(ExtEckdBlockPtr *ptr) - BootRecord *br; - - blockno = gen_eckd_block_num(ptr, 0); -- read_block(blockno, tmp_sec, "Cannot read boot record"); -+ if (virtio_read(blockno, tmp_sec)) { -+ puts("Cannot read boot record"); -+ return ERROR_BLOCK_NR; -+ } - br = (BootRecord *)tmp_sec; - if (!magic_match(br->magic, ZIPL_MAGIC)) { - /* If the boot record is invalid, return and try CCW-IPL instead */ -@@ -470,7 +521,7 @@ static void print_eckd_msg(void) - printf("%s", msg); - } - --static void ipl_eckd(void) -+static int ipl_eckd(void) - { - IplVolumeLabel *vlbl = (void *)sec; - LDL_VTOC *vtoc = (void *)sec; -@@ -480,7 +531,10 @@ static void ipl_eckd(void) - - /* Block 2 can contain either the CDL VOL1 label or the LDL VTOC */ - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -- read_block(2, vlbl, "Cannot read block 2"); -+ if (virtio_read(2, vlbl)) { -+ puts("Cannot read block 2"); -+ return -EIO; -+ } - - /* - * First check for a list-directed-format pointer which would -@@ -488,36 +542,53 @@ static void ipl_eckd(void) - */ - if (eckd_valid_address((ExtEckdBlockPtr *)&vlbl->f.br, 0)) { - ldipl_bmt = eckd_find_bmt((ExtEckdBlockPtr *)&vlbl->f.br); -- if (ldipl_bmt) { -+ switch (ldipl_bmt) { -+ case ERROR_BLOCK_NR: -+ return -EIO; -+ case NULL_BLOCK_NR: -+ break; /* Invalid BMT but the device may still boot with CCW-IPL */ -+ default: - puts("List-Directed"); -- /* LD-IPL does not use the S1B bock, just make it NULL */ -- run_eckd_boot_script(ldipl_bmt, NULL_BLOCK_NR); -- /* Only return in error, retry as CCW-IPL */ -+ /* -+ * LD-IPL does not use the S1B bock, just make it NULL_BLOCK_NR. -+ * In some failure cases retry IPL before aborting. -+ */ -+ if (run_eckd_boot_script(ldipl_bmt, NULL_BLOCK_NR)) { -+ return -EIO; -+ } -+ /* Non-fatal error, retry as CCW-IPL */ - printf("Retrying IPL "); - print_eckd_msg(); - } - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -- read_block(2, vtoc, "Cannot read block 2"); -+ if (virtio_read(2, vtoc)) { -+ puts("Cannot read block 2"); -+ return -EIO; -+ } - } - - /* Not list-directed */ - if (magic_match(vtoc->magic, VOL1_MAGIC)) { -- ipl_eckd_cdl(); /* may return in error */ -+ if (ipl_eckd_cdl()) { -+ return -1; -+ } - } - - if (magic_match(vtoc->magic, CMS1_MAGIC)) { -- ipl_eckd_ldl(ECKD_CMS); /* no return */ -+ return ipl_eckd_ldl(ECKD_CMS); - } - if (magic_match(vtoc->magic, LNX1_MAGIC)) { -- ipl_eckd_ldl(ECKD_LDL); /* no return */ -+ return ipl_eckd_ldl(ECKD_LDL); - } - -- ipl_eckd_ldl(ECKD_LDL_UNLABELED); /* it still may return */ -+ if (ipl_eckd_ldl(ECKD_LDL_UNLABELED)) { -+ return -1; -+ } - /* - * Ok, it is not a LDL by any means. - * It still might be a CDL with zero record keys for IPL1 and IPL2 - */ -- ipl_eckd_cdl(); -+ return ipl_eckd_cdl(); - } - - /*********************************************************************** -@@ -910,7 +981,7 @@ static bool has_iso_signature(void) - * Bus specific IPL sequences - */ - --static void zipl_load_vblk(void) -+static int zipl_load_vblk(void) - { - int blksize = virtio_get_block_size(); - -@@ -919,7 +990,7 @@ static void zipl_load_vblk(void) - virtio_assume_iso9660(); - } - if (ipl_iso_el_torito()) { -- return; -+ return 0; - } - } - -@@ -927,21 +998,21 @@ static void zipl_load_vblk(void) - puts("Using guessed DASD geometry."); - virtio_assume_eckd(); - } -- ipl_eckd(); -+ return ipl_eckd(); - } - --static void zipl_load_vscsi(void) -+static int zipl_load_vscsi(void) - { - if (virtio_get_block_size() == VIRTIO_ISO_BLOCK_SIZE) { - /* Is it an ISO image in non-CD drive? */ - if (ipl_iso_el_torito()) { -- return; -+ return 0; - } - } - - puts("Using guessed DASD geometry."); - virtio_assume_eckd(); -- ipl_eckd(); -+ return ipl_eckd(); - } - - /*********************************************************************** -diff --git a/pc-bios/s390-ccw/bootmap.h b/pc-bios/s390-ccw/bootmap.h -index 3cb573b86b..95943441d3 100644 ---- a/pc-bios/s390-ccw/bootmap.h -+++ b/pc-bios/s390-ccw/bootmap.h -@@ -16,6 +16,7 @@ - - typedef uint64_t block_number_t; - #define NULL_BLOCK_NR 0xffffffffffffffffULL -+#define ERROR_BLOCK_NR 0xfffffffffffffffeULL - - #define FREE_SPACE_FILLER '\xAA' - --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Remove-panics-from-ISO-IPL-path.patch b/kvm-pc-bios-s390-ccw-Remove-panics-from-ISO-IPL-path.patch deleted file mode 100644 index 7004386..0000000 --- a/kvm-pc-bios-s390-ccw-Remove-panics-from-ISO-IPL-path.patch +++ /dev/null @@ -1,269 +0,0 @@ -From 6238d2aa6b1a1f421ac04b0d35281dd5e4c65b5c Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:41 -0400 -Subject: [PATCH 09/38] pc-bios/s390-ccw: Remove panics from ISO IPL path -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [8/23] de54d00bb7f300a38e7babdf8c9b587c0ed81883 (thuth/qemu-kvm-cs9) - -Remove panic-on-error from IPL ISO El Torito specific functions so that error -recovery may be possible in the future. - -Functions that would previously panic now provide a return code. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-8-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit bef2b8dd1a36fc79cabcda48e667f2cba476924c) ---- - pc-bios/s390-ccw/bootmap.c | 87 ++++++++++++++++++++++++------------- - pc-bios/s390-ccw/bootmap.h | 15 +++---- - pc-bios/s390-ccw/s390-ccw.h | 1 + - 3 files changed, 65 insertions(+), 38 deletions(-) - -diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c -index 414c3f1b47..af73254acb 100644 ---- a/pc-bios/s390-ccw/bootmap.c -+++ b/pc-bios/s390-ccw/bootmap.c -@@ -678,8 +678,10 @@ static bool is_iso_bc_entry_compatible(IsoBcSection *s) - if (s->unused || !s->sector_count) { - return false; - } -- read_iso_sector(bswap32(s->load_rba), magic_sec, -- "Failed to read image sector 0"); -+ if (virtio_read(bswap32(s->load_rba), magic_sec)) { -+ puts("Failed to read image sector 0"); -+ return false; -+ } - - /* Checking bytes 8 - 32 for S390 Linux magic */ - return !memcmp(magic_sec + 8, linux_s390_magic, 24); -@@ -692,28 +694,35 @@ static uint32_t sec_offset[ISO9660_MAX_DIR_DEPTH]; - /* Remained directory space in bytes */ - static uint32_t dir_rem[ISO9660_MAX_DIR_DEPTH]; - --static inline uint32_t iso_get_file_size(uint32_t load_rba) -+static inline long iso_get_file_size(uint32_t load_rba) - { - IsoVolDesc *vd = (IsoVolDesc *)sec; - IsoDirHdr *cur_record = &vd->vd.primary.rootdir; - uint8_t *temp = sec + ISO_SECTOR_SIZE; - int level = 0; - -- read_iso_sector(ISO_PRIMARY_VD_SECTOR, sec, -- "Failed to read ISO primary descriptor"); -+ if (virtio_read(ISO_PRIMARY_VD_SECTOR, sec)) { -+ puts("Failed to read ISO primary descriptor"); -+ return -EIO; -+ } -+ - sec_loc[0] = iso_733_to_u32(cur_record->ext_loc); - dir_rem[0] = 0; - sec_offset[0] = 0; - - while (level >= 0) { -- IPL_assert(sec_offset[level] <= ISO_SECTOR_SIZE, -- "Directory tree structure violation"); -+ if (sec_offset[level] > ISO_SECTOR_SIZE) { -+ puts("Directory tree structure violation"); -+ return -EIO; -+ } - - cur_record = (IsoDirHdr *)(temp + sec_offset[level]); - - if (sec_offset[level] == 0) { -- read_iso_sector(sec_loc[level], temp, -- "Failed to read ISO directory"); -+ if (virtio_read(sec_loc[level], temp)) { -+ puts("Failed to read ISO directory"); -+ return -EIO; -+ } - if (dir_rem[level] == 0) { - /* Skip self and parent records */ - dir_rem[level] = iso_733_to_u32(cur_record->data_len) - -@@ -758,8 +767,10 @@ static inline uint32_t iso_get_file_size(uint32_t load_rba) - if (dir_rem[level] == 0) { - /* Nothing remaining */ - level--; -- read_iso_sector(sec_loc[level], temp, -- "Failed to read ISO directory"); -+ if (virtio_read(sec_loc[level], temp)) { -+ puts("Failed to read ISO directory"); -+ return -EIO; -+ } - } - } - -@@ -774,19 +785,24 @@ static void load_iso_bc_entry(IsoBcSection *load) - * is padded and ISO_SECTOR_SIZE bytes aligned - */ - uint32_t blks_to_load = bswap16(s.sector_count) >> ET_SECTOR_SHIFT; -- uint32_t real_size = iso_get_file_size(bswap32(s.load_rba)); -+ long real_size = iso_get_file_size(bswap32(s.load_rba)); - -- if (real_size) { -+ if (real_size > 0) { - /* Round up blocks to load */ - blks_to_load = (real_size + ISO_SECTOR_SIZE - 1) / ISO_SECTOR_SIZE; - puts("ISO boot image size verified"); - } else { - puts("ISO boot image size could not be verified"); -+ if (real_size < 0) { -+ return; -+ } - } - -- read_iso_boot_image(bswap32(s.load_rba), -+ if (read_iso_boot_image(bswap32(s.load_rba), - (void *)((uint64_t)bswap16(s.load_segment)), -- blks_to_load); -+ blks_to_load)) { -+ return; -+ } - - jump_to_low_kernel(); - } -@@ -809,17 +825,18 @@ static uint32_t find_iso_bc(void) - return bswap32(et->bc_offset); - } - } -- read_iso_sector(block_num++, sec, -- "Failed to read ISO volume descriptor"); -+ if (virtio_read(block_num++, sec)) { -+ puts("Failed to read ISO volume descriptor"); -+ return 0; -+ } - } - - return 0; - } - --static IsoBcSection *find_iso_bc_entry(void) -+static IsoBcSection *find_iso_bc_entry(uint32_t offset) - { - IsoBcEntry *e = (IsoBcEntry *)sec; -- uint32_t offset = find_iso_bc(); - int i; - unsigned int loadparm = get_loadparm_index(); - -@@ -827,11 +844,13 @@ static IsoBcSection *find_iso_bc_entry(void) - return NULL; - } - -- read_iso_sector(offset, sec, "Failed to read El Torito boot catalog"); -+ if (virtio_read(offset, sec)) { -+ puts("Failed to read El Torito boot catalog"); -+ return NULL; -+ } - - if (!is_iso_bc_valid(e)) { - /* The validation entry is mandatory */ -- panic("No valid boot catalog found!\n"); - return NULL; - } - -@@ -851,19 +870,25 @@ static IsoBcSection *find_iso_bc_entry(void) - } - } - -- panic("No suitable boot entry found on ISO-9660 media!\n"); -- - return NULL; - } - --static void ipl_iso_el_torito(void) -+static int ipl_iso_el_torito(void) - { -- IsoBcSection *s = find_iso_bc_entry(); -+ uint32_t offset = find_iso_bc(); -+ if (!offset) { -+ return 0; -+ } -+ -+ IsoBcSection *s = find_iso_bc_entry(offset); - - if (s) { -- load_iso_bc_entry(s); -- /* no return */ -+ load_iso_bc_entry(s); /* only return in error */ -+ return -1; - } -+ -+ puts("No suitable boot entry found on ISO-9660 media!"); -+ return -EIO; - } - - /** -@@ -893,7 +918,9 @@ static void zipl_load_vblk(void) - if (blksize != VIRTIO_ISO_BLOCK_SIZE) { - virtio_assume_iso9660(); - } -- ipl_iso_el_torito(); -+ if (ipl_iso_el_torito()) { -+ return; -+ } - } - - if (blksize != VIRTIO_DASD_DEFAULT_BLOCK_SIZE) { -@@ -907,7 +934,9 @@ static void zipl_load_vscsi(void) - { - if (virtio_get_block_size() == VIRTIO_ISO_BLOCK_SIZE) { - /* Is it an ISO image in non-CD drive? */ -- ipl_iso_el_torito(); -+ if (ipl_iso_el_torito()) { -+ return; -+ } - } - - puts("Using guessed DASD geometry."); -diff --git a/pc-bios/s390-ccw/bootmap.h b/pc-bios/s390-ccw/bootmap.h -index 4a7d8a91f1..3cb573b86b 100644 ---- a/pc-bios/s390-ccw/bootmap.h -+++ b/pc-bios/s390-ccw/bootmap.h -@@ -385,17 +385,14 @@ static inline uint32_t iso_733_to_u32(uint64_t x) - - #define ISO_PRIMARY_VD_SECTOR 16 - --static inline void read_iso_sector(uint32_t block_offset, void *buf, -- const char *errmsg) --{ -- IPL_assert(virtio_read_many(block_offset, buf, 1) == 0, errmsg); --} -- --static inline void read_iso_boot_image(uint32_t block_offset, void *load_addr, -+static inline int read_iso_boot_image(uint32_t block_offset, void *load_addr, - uint32_t blks_to_load) - { -- IPL_assert(virtio_read_many(block_offset, load_addr, blks_to_load) == 0, -- "Failed to read boot image!"); -+ if (virtio_read_many(block_offset, load_addr, blks_to_load)) { -+ puts("Failed to read boot image!"); -+ return -1; -+ } -+ return 0; - } - - #define ISO9660_MAX_DIR_DEPTH 8 -diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h -index 6abb34e563..3e844abd71 100644 ---- a/pc-bios/s390-ccw/s390-ccw.h -+++ b/pc-bios/s390-ccw/s390-ccw.h -@@ -30,6 +30,7 @@ typedef unsigned long long u64; - #define EIO 1 - #define EBUSY 2 - #define ENODEV 3 -+#define EINVAL 4 - - #ifndef MIN - #define MIN(a, b) (((a) < (b)) ? (a) : (b)) --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Remove-panics-from-Netboot-IPL-path.patch b/kvm-pc-bios-s390-ccw-Remove-panics-from-Netboot-IPL-path.patch deleted file mode 100644 index d66f32c..0000000 --- a/kvm-pc-bios-s390-ccw-Remove-panics-from-Netboot-IPL-path.patch +++ /dev/null @@ -1,130 +0,0 @@ -From d5e0f77bd63bc767856e1922b24556ef1b123b55 Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:45 -0400 -Subject: [PATCH 13/38] pc-bios/s390-ccw: Remove panics from Netboot IPL path -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [12/23] 26920462eca8a2e6d443c811efa69023fbe4f31f (thuth/qemu-kvm-cs9) - -Remove panic-on-error from Netboot specific functions so that error recovery -may be possible in the future. - -Functions that would previously panic now provide a return code. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-12-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit f1a2a6e41ef76e02ddc5ede3dd042ef96b4fb8d2) ---- - pc-bios/s390-ccw/bootmap.c | 1 + - pc-bios/s390-ccw/netmain.c | 17 +++++++++++------ - pc-bios/s390-ccw/s390-ccw.h | 2 +- - pc-bios/s390-ccw/virtio-net.c | 7 +++++-- - 4 files changed, 18 insertions(+), 9 deletions(-) - -diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c -index 652807a16a..95ef9104d0 100644 ---- a/pc-bios/s390-ccw/bootmap.c -+++ b/pc-bios/s390-ccw/bootmap.c -@@ -1072,6 +1072,7 @@ void zipl_load(void) - - if (virtio_get_device_type() == VIRTIO_ID_NET) { - netmain(); -+ panic("\n! Cannot IPL from this network !\n"); - } - - if (ipl_scsi()) { -diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c -index bc6ad8695f..d1a6c9a91c 100644 ---- a/pc-bios/s390-ccw/netmain.c -+++ b/pc-bios/s390-ccw/netmain.c -@@ -464,7 +464,7 @@ static bool find_net_dev(Schib *schib, int dev_no) - return false; - } - --static void virtio_setup(void) -+static bool virtio_setup(void) - { - Schib schib; - int ssid; -@@ -495,10 +495,10 @@ static void virtio_setup(void) - } - } - -- IPL_assert(found, "No virtio net device found"); -+ return found; - } - --void netmain(void) -+int netmain(void) - { - filename_ip_t fn_ip; - int rc, fnlen; -@@ -506,11 +506,15 @@ void netmain(void) - sclp_setup(); - puts("Network boot starting..."); - -- virtio_setup(); -+ if (!virtio_setup()) { -+ puts("No virtio net device found."); -+ return -1; -+ } - - rc = net_init(&fn_ip); - if (rc) { -- panic("Network initialization failed. Halting."); -+ puts("Network initialization failed."); -+ return -1; - } - - fnlen = strlen(fn_ip.filename); -@@ -528,5 +532,6 @@ void netmain(void) - jump_to_low_kernel(); - } - -- panic("Failed to load OS from network."); -+ puts("Failed to load OS from network."); -+ return -1; - } -diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h -index 3e844abd71..344ad15655 100644 ---- a/pc-bios/s390-ccw/s390-ccw.h -+++ b/pc-bios/s390-ccw/s390-ccw.h -@@ -57,7 +57,7 @@ unsigned int get_loadparm_index(void); - void main(void); - - /* netmain.c */ --void netmain(void); -+int netmain(void); - - /* sclp.c */ - void sclp_print(const char *string); -diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c -index 2fcb0a58c5..f9854a22c3 100644 ---- a/pc-bios/s390-ccw/virtio-net.c -+++ b/pc-bios/s390-ccw/virtio-net.c -@@ -54,8 +54,11 @@ int virtio_net_init(void *mac_addr) - vdev->guest_features[0] = VIRTIO_NET_F_MAC_BIT; - virtio_setup_ccw(vdev); - -- IPL_assert(vdev->guest_features[0] & VIRTIO_NET_F_MAC_BIT, -- "virtio-net device does not support the MAC address feature"); -+ if (!(vdev->guest_features[0] & VIRTIO_NET_F_MAC_BIT)) { -+ puts("virtio-net device does not support the MAC address feature"); -+ return -1; -+ } -+ - memcpy(mac_addr, vdev->config.net.mac, ETH_ALEN); - - for (i = 0; i < 64; i++) { --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Remove-panics-from-SCSI-IPL-path.patch b/kvm-pc-bios-s390-ccw-Remove-panics-from-SCSI-IPL-path.patch deleted file mode 100644 index e02a98d..0000000 --- a/kvm-pc-bios-s390-ccw-Remove-panics-from-SCSI-IPL-path.patch +++ /dev/null @@ -1,554 +0,0 @@ -From 6212bfb4f7a45b06b38bf5d11774de1d3df982aa Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:43 -0400 -Subject: [PATCH 11/38] pc-bios/s390-ccw: Remove panics from SCSI IPL path -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [10/23] 3d67ba81c0296f59f5ec2fab3361512e83b6d78d (thuth/qemu-kvm-cs9) - -Remove panic-on-error from virtio-scsi IPL specific functions so that error -recovery may be possible in the future. - -Functions that would previously panic now provide a return code. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-10-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit facd91ac1af75b657fc80189fe9cb026bb1abdbc) ---- - pc-bios/s390-ccw/bootmap.c | 88 ++++++++++++++----- - pc-bios/s390-ccw/virtio-blkdev.c | 4 +- - pc-bios/s390-ccw/virtio-scsi.c | 143 +++++++++++++++++++++---------- - 3 files changed, 164 insertions(+), 71 deletions(-) - -diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c -index b9596e28c7..652807a16a 100644 ---- a/pc-bios/s390-ccw/bootmap.c -+++ b/pc-bios/s390-ccw/bootmap.c -@@ -595,7 +595,7 @@ static int ipl_eckd(void) - * IPL a SCSI disk - */ - --static void zipl_load_segment(ComponentEntry *entry) -+static int zipl_load_segment(ComponentEntry *entry) - { - const int max_entries = (MAX_SECTOR_SIZE / sizeof(ScsiBlockPtr)); - ScsiBlockPtr *bprs = (void *)sec; -@@ -615,7 +615,10 @@ static void zipl_load_segment(ComponentEntry *entry) - do { - memset(bprs, FREE_SPACE_FILLER, bprs_size); - fill_hex_val(blk_no, &blockno, sizeof(blockno)); -- read_block(blockno, bprs, err_msg); -+ if (virtio_read(blockno, bprs)) { -+ puts(err_msg); -+ return -EIO; -+ } - - for (i = 0;; i++) { - uint64_t *cur_desc = (void *)&bprs[i]; -@@ -643,23 +646,37 @@ static void zipl_load_segment(ComponentEntry *entry) - } - address = virtio_load_direct(cur_desc[0], cur_desc[1], 0, - (void *)address); -- IPL_assert(address != -1, "zIPL load segment failed"); -+ if (!address) { -+ puts("zIPL load segment failed"); -+ return -EIO; -+ } - } - } while (blockno); -+ -+ return 0; - } - - /* Run a zipl program */ --static void zipl_run(ScsiBlockPtr *pte) -+static int zipl_run(ScsiBlockPtr *pte) - { - ComponentHeader *header; - ComponentEntry *entry; - uint8_t tmp_sec[MAX_SECTOR_SIZE]; - -- read_block(pte->blockno, tmp_sec, "Cannot read header"); -+ if (virtio_read(pte->blockno, tmp_sec)) { -+ puts("Cannot read header"); -+ return -EIO; -+ } - header = (ComponentHeader *)tmp_sec; - -- IPL_assert(magic_match(tmp_sec, ZIPL_MAGIC), "No zIPL magic in header"); -- IPL_assert(header->type == ZIPL_COMP_HEADER_IPL, "Bad header type"); -+ if (!magic_match(tmp_sec, ZIPL_MAGIC)) { -+ puts("No zIPL magic in header"); -+ return -EINVAL; -+ } -+ if (header->type != ZIPL_COMP_HEADER_IPL) { -+ puts("Bad header type"); -+ return -EINVAL; -+ } - - dputs("start loading images\n"); - -@@ -674,22 +691,30 @@ static void zipl_run(ScsiBlockPtr *pte) - continue; - } - -- zipl_load_segment(entry); -+ if (zipl_load_segment(entry)) { -+ return -1; -+ } - - entry++; - -- IPL_assert((uint8_t *)(&entry[1]) <= (tmp_sec + MAX_SECTOR_SIZE), -- "Wrong entry value"); -+ if ((uint8_t *)(&entry[1]) > (tmp_sec + MAX_SECTOR_SIZE)) { -+ puts("Wrong entry value"); -+ return -EINVAL; -+ } - } - -- IPL_assert(entry->component_type == ZIPL_COMP_ENTRY_EXEC, "No EXEC entry"); -+ if (entry->component_type != ZIPL_COMP_ENTRY_EXEC) { -+ puts("No EXEC entry"); -+ return -EINVAL; -+ } - - /* should not return */ - write_reset_psw(entry->compdat.load_psw); - jump_to_IPL_code(0); -+ return -1; - } - --static void ipl_scsi(void) -+static int ipl_scsi(void) - { - ScsiMbr *mbr = (void *)sec; - int program_table_entries = 0; -@@ -700,10 +725,13 @@ static void ipl_scsi(void) - - /* Grab the MBR */ - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -- read_block(0, mbr, "Cannot read block 0"); -+ if (virtio_read(0, mbr)) { -+ puts("Cannot read block 0"); -+ return -EIO; -+ } - - if (!magic_match(mbr->magic, ZIPL_MAGIC)) { -- return; -+ return 0; - } - - puts("Using SCSI scheme."); -@@ -711,11 +739,20 @@ static void ipl_scsi(void) - IPL_check(mbr->version_id == 1, - "Unknown MBR layout version, assuming version 1"); - debug_print_int("program table", mbr->pt.blockno); -- IPL_assert(mbr->pt.blockno, "No Program Table"); -+ if (!mbr->pt.blockno) { -+ puts("No Program Table"); -+ return -EINVAL; -+ } - - /* Parse the program table */ -- read_block(mbr->pt.blockno, sec, "Error reading Program Table"); -- IPL_assert(magic_match(sec, ZIPL_MAGIC), "No zIPL magic in PT"); -+ if (virtio_read(mbr->pt.blockno, sec)) { -+ puts("Error reading Program Table"); -+ return -EIO; -+ } -+ if (!magic_match(sec, ZIPL_MAGIC)) { -+ puts("No zIPL magic in Program Table"); -+ return -EINVAL; -+ } - - for (i = 0; i < MAX_BOOT_ENTRIES; i++) { - if (prog_table->entry[i].scsi.blockno) { -@@ -725,17 +762,22 @@ static void ipl_scsi(void) - } - - debug_print_int("program table entries", program_table_entries); -- IPL_assert(program_table_entries != 0, "Empty Program Table"); -+ if (program_table_entries == 0) { -+ puts("Empty Program Table"); -+ return -EINVAL; -+ } - - if (menu_is_enabled_enum()) { - loadparm = menu_get_enum_boot_index(valid_entries); - } - - debug_print_int("loadparm", loadparm); -- IPL_assert(loadparm < MAX_BOOT_ENTRIES, "loadparm value greater than" -- " maximum number of boot entries allowed"); -+ if (loadparm >= MAX_BOOT_ENTRIES) { -+ puts("loadparm value greater than max number of boot entries allowed"); -+ return -EINVAL; -+ } - -- zipl_run(&prog_table->entry[loadparm].scsi); /* no return */ -+ return zipl_run(&prog_table->entry[loadparm].scsi); - } - - /*********************************************************************** -@@ -1032,7 +1074,9 @@ void zipl_load(void) - netmain(); - } - -- ipl_scsi(); -+ if (ipl_scsi()) { -+ panic("\n! Cannot IPL this SCSI device !\n"); -+ } - - switch (virtio_get_device_type()) { - case VIRTIO_ID_BLOCK: -diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blkdev.c -index 2666326801..1c585f034b 100644 ---- a/pc-bios/s390-ccw/virtio-blkdev.c -+++ b/pc-bios/s390-ccw/virtio-blkdev.c -@@ -73,13 +73,13 @@ unsigned long virtio_load_direct(unsigned long rec_list1, unsigned long rec_list - unsigned long addr = (unsigned long)load_addr; - - if (sec_len != virtio_get_block_size()) { -- return -1; -+ return 0; - } - - printf("."); - status = virtio_read_many(sec, (void *)addr, sec_num); - if (status) { -- panic("I/O Error"); -+ return 0; - } - addr += sec_num * virtio_get_block_size(); - -diff --git a/pc-bios/s390-ccw/virtio-scsi.c b/pc-bios/s390-ccw/virtio-scsi.c -index 6b4a1caf8a..71db75ce7b 100644 ---- a/pc-bios/s390-ccw/virtio-scsi.c -+++ b/pc-bios/s390-ccw/virtio-scsi.c -@@ -26,7 +26,7 @@ static uint8_t scsi_inquiry_std_response[256]; - static ScsiInquiryEvpdPages scsi_inquiry_evpd_pages_response; - static ScsiInquiryEvpdBl scsi_inquiry_evpd_bl_response; - --static inline void vs_assert(bool term, const char **msgs) -+static inline bool vs_assert(bool term, const char **msgs) - { - if (!term) { - int i = 0; -@@ -35,11 +35,13 @@ static inline void vs_assert(bool term, const char **msgs) - while (msgs[i]) { - printf("%s", msgs[i++]); - } -- panic(" !\n"); -+ puts(" !"); - } -+ -+ return term; - } - --static void virtio_scsi_verify_response(VirtioScsiCmdResp *resp, -+static bool virtio_scsi_verify_response(VirtioScsiCmdResp *resp, - const char *title) - { - const char *mr[] = { -@@ -56,8 +58,8 @@ static void virtio_scsi_verify_response(VirtioScsiCmdResp *resp, - 0 - }; - -- vs_assert(resp->response == VIRTIO_SCSI_S_OK, mr); -- vs_assert(resp->status == CDB_STATUS_GOOD, ms); -+ return vs_assert(resp->response == VIRTIO_SCSI_S_OK, mr) && -+ vs_assert(resp->status == CDB_STATUS_GOOD, ms); - } - - static void prepare_request(VDev *vdev, const void *cdb, int cdb_size, -@@ -78,24 +80,31 @@ static void prepare_request(VDev *vdev, const void *cdb, int cdb_size, - } - } - --static inline void vs_io_assert(bool term, const char *msg) -+static inline bool vs_io_assert(bool term, const char *msg) - { -- if (!term) { -- virtio_scsi_verify_response(&resp, msg); -+ if (!term && !virtio_scsi_verify_response(&resp, msg)) { -+ return false; - } -+ -+ return true; - } - --static void vs_run(const char *title, VirtioCmd *cmd, VDev *vdev, -+static int vs_run(const char *title, VirtioCmd *cmd, VDev *vdev, - const void *cdb, int cdb_size, - void *data, uint32_t data_size) - { - prepare_request(vdev, cdb, cdb_size, data, data_size); -- vs_io_assert(virtio_run(vdev, VR_REQUEST, cmd) == 0, title); -+ if (!vs_io_assert(virtio_run(vdev, VR_REQUEST, cmd) == 0, title)) { -+ puts(title); -+ return -EIO; -+ } -+ -+ return 0; - } - - /* SCSI protocol implementation routines */ - --static bool scsi_inquiry(VDev *vdev, uint8_t evpd, uint8_t page, -+static int scsi_inquiry(VDev *vdev, uint8_t evpd, uint8_t page, - void *data, uint32_t data_size) - { - ScsiCdbInquiry cdb = { -@@ -110,12 +119,13 @@ static bool scsi_inquiry(VDev *vdev, uint8_t evpd, uint8_t page, - { data, data_size, VRING_DESC_F_WRITE }, - }; - -- vs_run("inquiry", inquiry, vdev, &cdb, sizeof(cdb), data, data_size); -+ int ret = vs_run("inquiry", inquiry, -+ vdev, &cdb, sizeof(cdb), data, data_size); - -- return virtio_scsi_response_ok(&resp); -+ return ret ? ret : virtio_scsi_response_ok(&resp); - } - --static bool scsi_test_unit_ready(VDev *vdev) -+static int scsi_test_unit_ready(VDev *vdev) - { - ScsiCdbTestUnitReady cdb = { - .command = 0x00, -@@ -131,7 +141,7 @@ static bool scsi_test_unit_ready(VDev *vdev) - return virtio_scsi_response_ok(&resp); - } - --static bool scsi_report_luns(VDev *vdev, void *data, uint32_t data_size) -+static int scsi_report_luns(VDev *vdev, void *data, uint32_t data_size) - { - ScsiCdbReportLuns cdb = { - .command = 0xa0, -@@ -144,13 +154,13 @@ static bool scsi_report_luns(VDev *vdev, void *data, uint32_t data_size) - { data, data_size, VRING_DESC_F_WRITE }, - }; - -- vs_run("report luns", report_luns, -+ int ret = vs_run("report luns", report_luns, - vdev, &cdb, sizeof(cdb), data, data_size); - -- return virtio_scsi_response_ok(&resp); -+ return ret ? ret : virtio_scsi_response_ok(&resp); - } - --static bool scsi_read_10(VDev *vdev, -+static int scsi_read_10(VDev *vdev, - unsigned long sector, int sectors, void *data, - unsigned int data_size) - { -@@ -168,12 +178,13 @@ static bool scsi_read_10(VDev *vdev, - debug_print_int("read_10 sector", sector); - debug_print_int("read_10 sectors", sectors); - -- vs_run("read(10)", read_10, vdev, &cdb, sizeof(cdb), data, data_size); -+ int ret = vs_run("read(10)", read_10, -+ vdev, &cdb, sizeof(cdb), data, data_size); - -- return virtio_scsi_response_ok(&resp); -+ return ret ? ret : virtio_scsi_response_ok(&resp); - } - --static bool scsi_read_capacity(VDev *vdev, -+static int scsi_read_capacity(VDev *vdev, - void *data, uint32_t data_size) - { - ScsiCdbReadCapacity16 cdb = { -@@ -187,10 +198,10 @@ static bool scsi_read_capacity(VDev *vdev, - { data, data_size, VRING_DESC_F_WRITE }, - }; - -- vs_run("read capacity", read_capacity_16, -+ int ret = vs_run("read capacity", read_capacity_16, - vdev, &cdb, sizeof(cdb), data, data_size); - -- return virtio_scsi_response_ok(&resp); -+ return ret ? ret : virtio_scsi_response_ok(&resp); - } - - /* virtio-scsi routines */ -@@ -207,7 +218,7 @@ static int virtio_scsi_locate_device(VDev *vdev) - static uint8_t data[16 + 8 * 63]; - ScsiLunReport *r = (void *) data; - ScsiDevice *sdev = vdev->scsi_device; -- int i, luns; -+ int i, ret, luns; - - /* QEMU has hardcoded channel #0 in many places. - * If this hardcoded value is ever changed, we'll need to add code for -@@ -233,13 +244,21 @@ static int virtio_scsi_locate_device(VDev *vdev) - sdev->channel = channel; - sdev->target = target; - sdev->lun = 0; /* LUN has to be 0 for REPORT LUNS */ -- if (!scsi_report_luns(vdev, data, sizeof(data))) { -+ ret = scsi_report_luns(vdev, data, sizeof(data)); -+ if (ret < 0) { -+ return ret; -+ } -+ -+ else if (ret == 0) { - if (resp.response == VIRTIO_SCSI_S_BAD_TARGET) { - continue; - } - printf("target 0x%X\n", target); -- virtio_scsi_verify_response(&resp, "SCSI cannot report LUNs"); -+ if (!virtio_scsi_verify_response(&resp, "SCSI cannot report LUNs")) { -+ return -EIO; -+ } - } -+ - if (r->lun_list_len == 0) { - printf("no LUNs for target 0x%X\n", target); - continue; -@@ -283,7 +302,9 @@ int virtio_scsi_read_many(VDev *vdev, - data_size = sector_count * virtio_get_block_size() * f; - if (!scsi_read_10(vdev, sector * f, sector_count * f, load_addr, - data_size)) { -- virtio_scsi_verify_response(&resp, "virtio-scsi:read_many"); -+ if (!virtio_scsi_verify_response(&resp, "virtio-scsi:read_many")) { -+ return -1; -+ } - } - load_addr += data_size; - sector += sector_count; -@@ -352,11 +373,16 @@ static int virtio_scsi_setup(VDev *vdev) - uint8_t code = resp.sense[0] & SCSI_SENSE_CODE_MASK; - uint8_t sense_key = resp.sense[2] & SCSI_SENSE_KEY_MASK; - -- IPL_assert(resp.sense_len != 0, "virtio-scsi:setup: no SENSE data"); -+ if (resp.sense_len == 0) { -+ puts("virtio-scsi: setup: no SENSE data"); -+ return -EINVAL; -+ } - -- IPL_assert(retry_test_unit_ready && code == 0x70 && -- sense_key == SCSI_SENSE_KEY_UNIT_ATTENTION, -- "virtio-scsi:setup: cannot retry"); -+ if (!retry_test_unit_ready || code != 0x70 || -+ sense_key != SCSI_SENSE_KEY_UNIT_ATTENTION) { -+ puts("virtio-scsi:setup: cannot retry"); -+ return -EIO; -+ } - - /* retry on CHECK_CONDITION/UNIT_ATTENTION as it - * may not designate a real error, but it may be -@@ -367,16 +393,22 @@ static int virtio_scsi_setup(VDev *vdev) - continue; - } - -- virtio_scsi_verify_response(&resp, "virtio-scsi:setup"); -+ if (!virtio_scsi_verify_response(&resp, "virtio-scsi:setup")) { -+ return -1; -+ } - } - - /* read and cache SCSI INQUIRY response */ -- if (!scsi_inquiry(vdev, -+ ret = scsi_inquiry(vdev, - SCSI_INQUIRY_STANDARD, - SCSI_INQUIRY_STANDARD_NONE, - scsi_inquiry_std_response, -- sizeof(scsi_inquiry_std_response))) { -- virtio_scsi_verify_response(&resp, "virtio-scsi:setup:inquiry"); -+ sizeof(scsi_inquiry_std_response)); -+ if (ret < 1) { -+ if (ret != 0 || !virtio_scsi_verify_response(&resp, -+ "virtio-scsi:setup:inquiry")) { -+ return -1; -+ } - } - - if (virtio_scsi_inquiry_response_is_cdrom(scsi_inquiry_std_response)) { -@@ -385,12 +417,16 @@ static int virtio_scsi_setup(VDev *vdev) - vdev->scsi_block_size = VIRTIO_ISO_BLOCK_SIZE; - } - -- if (!scsi_inquiry(vdev, -+ ret = scsi_inquiry(vdev, - SCSI_INQUIRY_EVPD, - SCSI_INQUIRY_EVPD_SUPPORTED_PAGES, - evpd, -- sizeof(*evpd))) { -- virtio_scsi_verify_response(&resp, "virtio-scsi:setup:supported_pages"); -+ sizeof(*evpd)); -+ if (ret < 1) { -+ if (ret != 0 || !virtio_scsi_verify_response(&resp, -+ "virtio-scsi:setup:supported_pages")) { -+ return -1; -+ } - } - - debug_print_int("EVPD length", evpd->page_length); -@@ -402,12 +438,16 @@ static int virtio_scsi_setup(VDev *vdev) - continue; - } - -- if (!scsi_inquiry(vdev, -+ ret = scsi_inquiry(vdev, - SCSI_INQUIRY_EVPD, - SCSI_INQUIRY_EVPD_BLOCK_LIMITS, - evpd_bl, -- sizeof(*evpd_bl))) { -- virtio_scsi_verify_response(&resp, "virtio-scsi:setup:blocklimits"); -+ sizeof(*evpd_bl)); -+ if (ret < 1) { -+ if (ret != 0 || !virtio_scsi_verify_response(&resp, -+ "virtio-scsi:setup:blocklimits")) { -+ return -1; -+ } - } - - debug_print_int("max transfer", evpd_bl->max_transfer); -@@ -423,8 +463,12 @@ static int virtio_scsi_setup(VDev *vdev) - vdev->max_transfer = MIN_NON_ZERO(VIRTIO_SCSI_MAX_SECTORS, - vdev->max_transfer); - -- if (!scsi_read_capacity(vdev, data, data_size)) { -- virtio_scsi_verify_response(&resp, "virtio-scsi:setup:read_capacity"); -+ ret = scsi_read_capacity(vdev, data, data_size); -+ if (ret < 1) { -+ if (ret != 0 || !virtio_scsi_verify_response(&resp, -+ "virtio-scsi:setup:read_capacity")) { -+ return -1; -+ } - } - scsi_parse_capacity_report(data, &vdev->scsi_last_block, - (uint32_t *) &vdev->scsi_block_size); -@@ -439,10 +483,15 @@ int virtio_scsi_setup_device(SubChannelId schid) - vdev->schid = schid; - virtio_setup_ccw(vdev); - -- IPL_assert(vdev->config.scsi.sense_size == VIRTIO_SCSI_SENSE_SIZE, -- "Config: sense size mismatch"); -- IPL_assert(vdev->config.scsi.cdb_size == VIRTIO_SCSI_CDB_SIZE, -- "Config: CDB size mismatch"); -+ if (vdev->config.scsi.sense_size != VIRTIO_SCSI_SENSE_SIZE) { -+ puts("Config: sense size mismatch"); -+ return -EINVAL; -+ } -+ -+ if (vdev->config.scsi.cdb_size != VIRTIO_SCSI_CDB_SIZE) { -+ puts("Config: CDB size mismatch"); -+ return -EINVAL; -+ } - - puts("Using virtio-scsi."); - --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-Use-the-libc-from-SLOF-and-remove-s.patch b/kvm-pc-bios-s390-ccw-Use-the-libc-from-SLOF-and-remove-s.patch deleted file mode 100644 index 9d14f0c..0000000 --- a/kvm-pc-bios-s390-ccw-Use-the-libc-from-SLOF-and-remove-s.patch +++ /dev/null @@ -1,1208 +0,0 @@ -From 736819e0c108bdd8bcb75e28c24ff97c2411d85c Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:36 -0400 -Subject: [PATCH 03/38] pc-bios/s390-ccw: Use the libc from SLOF and remove - sclp prints -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [2/23] cfb15217ddbad8b3ae9606763ff1e1085807d381 (thuth/qemu-kvm-cs9) - -We are already using the libc from SLOF for the s390-netboot.img, and -this libc implementation is way more complete and accurate than the -simple implementation that we currently use for the s390-ccw.img binary. -Since we are now always assuming that the SLOF submodule is available -when building the s390-ccw bios (see commit bf6903f6944f), we can drop -the simple implementation and use the SLOF libc for the s390-ccw.img -binary, too. - -Additionally replace sclp_print calls with puts/printf now that it is -available. - -Co-authored by: Thomas Huth -Signed-off-by: Jared Rossi -Message-ID: <20241020012953.1380075-3-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 9f4278837dc770266c8a026696dd91a525dd2682) ---- - pc-bios/s390-ccw/Makefile | 15 +++-- - pc-bios/s390-ccw/bootmap.c | 47 ++++++------- - pc-bios/s390-ccw/bootmap.h | 4 +- - pc-bios/s390-ccw/cio.c | 78 ++++++++++------------ - pc-bios/s390-ccw/dasd-ipl.c | 5 +- - pc-bios/s390-ccw/jump2ipl.c | 5 +- - pc-bios/s390-ccw/libc.c | 88 ------------------------ - pc-bios/s390-ccw/libc.h | 89 ------------------------- - pc-bios/s390-ccw/main.c | 14 ++-- - pc-bios/s390-ccw/menu.c | 51 +++++++------- - pc-bios/s390-ccw/netboot.mak | 3 - - pc-bios/s390-ccw/netmain.c | 10 +-- - pc-bios/s390-ccw/s390-ccw.h | 30 +++------ - pc-bios/s390-ccw/sclp.c | 7 +- - pc-bios/s390-ccw/virtio-blkdev.c | 6 +- - pc-bios/s390-ccw/virtio-scsi.c | 17 ++--- - pc-bios/s390-ccw/virtio.c | 2 +- - tests/tcg/s390x/Makefile.softmmu-target | 2 +- - tests/tcg/s390x/console.c | 3 + - 19 files changed, 140 insertions(+), 336 deletions(-) - delete mode 100644 pc-bios/s390-ccw/libc.c - delete mode 100644 pc-bios/s390-ccw/libc.h - -diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile -index 6207911b53..3f4232636e 100644 ---- a/pc-bios/s390-ccw/Makefile -+++ b/pc-bios/s390-ccw/Makefile -@@ -33,13 +33,18 @@ QEMU_DGFLAGS = -MMD -MP -MT $@ -MF $(@D)/$(*F).d - .PHONY : all clean build-all distclean - - OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ -- virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o -+ virtio.o virtio-scsi.o virtio-blkdev.o cio.o dasd-ipl.o -+ -+SLOF_DIR := $(SRC_PATH)/../../roms/SLOF -+ -+LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include - - EXTRA_CFLAGS += -Wall - EXTRA_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -fno-common -fPIE - EXTRA_CFLAGS += -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-tables - EXTRA_CFLAGS += -msoft-float - EXTRA_CFLAGS += -std=gnu99 -+EXTRA_CFLAGS += $(LIBC_INC) - LDFLAGS += -Wl,-pie -nostdlib -z noexecstack - - cc-test = $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>/dev/null -@@ -55,18 +60,18 @@ config-cc.mak: Makefile - $(call cc-option,-march=z900,-march=z10)) 3> config-cc.mak - -include config-cc.mak - -+include $(SRC_PATH)/netboot.mak -+ - build-all: s390-ccw.img s390-netboot.img - --s390-ccw.elf: $(OBJECTS) -- $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(OBJECTS),Linking) -+s390-ccw.elf: $(OBJECTS) libc.a -+ $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^,Linking) - - s390-ccw.img: s390-ccw.elf - $(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,Stripping $< into) - - $(OBJECTS): Makefile - --include $(SRC_PATH)/netboot.mak -- - ALL_OBJS = $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS)) - -include $(ALL_OBJS:%.o=%.d) - -diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c -index a2137449dc..3cc79706be 100644 ---- a/pc-bios/s390-ccw/bootmap.c -+++ b/pc-bios/s390-ccw/bootmap.c -@@ -8,7 +8,8 @@ - * directory. - */ - --#include "libc.h" -+#include -+#include - #include "s390-ccw.h" - #include "s390-arch.h" - #include "bootmap.h" -@@ -21,7 +22,7 @@ - - #ifdef DEBUG_FALLBACK - #define dputs(txt) \ -- do { sclp_print("zipl: " txt); } while (0) -+ do { printf("zipl: " txt); } while (0) - #else - #define dputs(fmt, ...) \ - do { } while (0) -@@ -270,7 +271,7 @@ static int eckd_get_boot_menu_index(block_number_t s1b_block_nr) - prev_block_nr = cur_block_nr; - } - -- sclp_print("No zipl boot menu data found. Booting default entry."); -+ printf("No zipl boot menu data found. Booting default entry."); - return 0; - } - -@@ -338,22 +339,22 @@ static void ipl_eckd_cdl(void) - block_number_t bmt_block_nr, s1b_block_nr; - - /* we have just read the block #0 and recognized it as "IPL1" */ -- sclp_print("CDL\n"); -+ puts("CDL"); - - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); - read_block(1, ipl2, "Cannot read IPL2 record at block 1"); - - mbr = &ipl2->mbr; - if (!magic_match(mbr, ZIPL_MAGIC)) { -- sclp_print("No zIPL section in IPL2 record.\n"); -+ puts("No zIPL section in IPL2 record."); - return; - } - if (!block_size_ok(mbr->blockptr.xeckd.bptr.size)) { -- sclp_print("Bad block size in zIPL section of IPL2 record.\n"); -+ puts("Bad block size in zIPL section of IPL2 record."); - return; - } - if (mbr->dev_type != DEV_TYPE_ECKD) { -- sclp_print("Non-ECKD device type in zIPL section of IPL2 record.\n"); -+ puts("Non-ECKD device type in zIPL section of IPL2 record."); - return; - } - -@@ -366,11 +367,11 @@ static void ipl_eckd_cdl(void) - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); - read_block(2, vlbl, "Cannot read Volume Label at block 2"); - if (!magic_match(vlbl->key, VOL1_MAGIC)) { -- sclp_print("Invalid magic of volume label block.\n"); -+ puts("Invalid magic of volume label block."); - return; - } - if (!magic_match(vlbl->f.key, VOL1_MAGIC)) { -- sclp_print("Invalid magic of volser block.\n"); -+ puts("Invalid magic of volser block."); - return; - } - print_volser(vlbl->f.volser); -@@ -384,8 +385,8 @@ static void print_eckd_ldl_msg(ECKD_IPL_mode_t mode) - LDL_VTOC *vlbl = (void *)sec; /* already read, 3rd block */ - char msg[4] = { '?', '.', '\n', '\0' }; - -- sclp_print((mode == ECKD_CMS) ? "CMS" : "LDL"); -- sclp_print(" version "); -+ printf((mode == ECKD_CMS) ? "CMS" : "LDL"); -+ printf(" version "); - switch (vlbl->LDL_version) { - case LDL1_VERSION: - msg[0] = '1'; -@@ -398,7 +399,7 @@ static void print_eckd_ldl_msg(ECKD_IPL_mode_t mode) - msg[1] = '?'; - break; - } -- sclp_print(msg); -+ printf("%s", msg); - print_volser(vlbl->volser); - } - -@@ -419,7 +420,7 @@ static void ipl_eckd_ldl(ECKD_IPL_mode_t mode) - if (!magic_match(ipl1->bip.magic, ZIPL_MAGIC)) { - return; /* not applicable layout */ - } -- sclp_print("unlabeled LDL.\n"); -+ puts("unlabeled LDL."); - } - verify_boot_info(&ipl1->bip); - -@@ -466,7 +467,7 @@ static void print_eckd_msg(void) - *p-- = ' '; - } - } -- sclp_print(msg); -+ printf("%s", msg); - } - - static void ipl_eckd(void) -@@ -488,11 +489,11 @@ static void ipl_eckd(void) - if (eckd_valid_address((ExtEckdBlockPtr *)&vlbl->f.br, 0)) { - ldipl_bmt = eckd_find_bmt((ExtEckdBlockPtr *)&vlbl->f.br); - if (ldipl_bmt) { -- sclp_print("List-Directed\n"); -+ puts("List-Directed"); - /* LD-IPL does not use the S1B bock, just make it NULL */ - run_eckd_boot_script(ldipl_bmt, NULL_BLOCK_NR); - /* Only return in error, retry as CCW-IPL */ -- sclp_print("Retrying IPL "); -+ printf("Retrying IPL "); - print_eckd_msg(); - } - memset(sec, FREE_SPACE_FILLER, sizeof(sec)); -@@ -634,7 +635,7 @@ static void ipl_scsi(void) - return; - } - -- sclp_print("Using SCSI scheme.\n"); -+ puts("Using SCSI scheme."); - debug_print_int("MBR Version", mbr->version_id); - IPL_check(mbr->version_id == 1, - "Unknown MBR layout version, assuming version 1"); -@@ -743,7 +744,7 @@ static inline uint32_t iso_get_file_size(uint32_t load_rba) - if (cur_record->file_flags & 0x2) { - /* Subdirectory */ - if (level == ISO9660_MAX_DIR_DEPTH - 1) { -- sclp_print("ISO-9660 directory depth limit exceeded\n"); -+ puts("ISO-9660 directory depth limit exceeded"); - } else { - level++; - sec_loc[level] = iso_733_to_u32(cur_record->ext_loc); -@@ -778,9 +779,9 @@ static void load_iso_bc_entry(IsoBcSection *load) - if (real_size) { - /* Round up blocks to load */ - blks_to_load = (real_size + ISO_SECTOR_SIZE - 1) / ISO_SECTOR_SIZE; -- sclp_print("ISO boot image size verified\n"); -+ puts("ISO boot image size verified"); - } else { -- sclp_print("ISO boot image size could not be verified\n"); -+ puts("ISO boot image size could not be verified"); - } - - read_iso_boot_image(bswap32(s.load_rba), -@@ -896,7 +897,7 @@ static void zipl_load_vblk(void) - } - - if (blksize != VIRTIO_DASD_DEFAULT_BLOCK_SIZE) { -- sclp_print("Using guessed DASD geometry.\n"); -+ puts("Using guessed DASD geometry."); - virtio_assume_eckd(); - } - ipl_eckd(); -@@ -909,7 +910,7 @@ static void zipl_load_vscsi(void) - ipl_iso_el_torito(); - } - -- sclp_print("Using guessed DASD geometry.\n"); -+ puts("Using guessed DASD geometry."); - virtio_assume_eckd(); - ipl_eckd(); - } -@@ -944,5 +945,5 @@ void zipl_load(void) - panic("\n! Unknown IPL device type !\n"); - } - -- sclp_print("zIPL load failed.\n"); -+ puts("zIPL load failed."); - } -diff --git a/pc-bios/s390-ccw/bootmap.h b/pc-bios/s390-ccw/bootmap.h -index d4690a88c2..4a7d8a91f1 100644 ---- a/pc-bios/s390-ccw/bootmap.h -+++ b/pc-bios/s390-ccw/bootmap.h -@@ -336,9 +336,7 @@ static inline void print_volser(const void *volser) - - ebcdic_to_ascii((char *)volser, ascii, 6); - ascii[6] = '\0'; -- sclp_print("VOLSER=["); -- sclp_print(ascii); -- sclp_print("]\n"); -+ printf("VOLSER=[%s]\n", ascii); - } - - static inline bool unused_space(const void *p, size_t size) -diff --git a/pc-bios/s390-ccw/cio.c b/pc-bios/s390-ccw/cio.c -index 83ca27ab41..7b09a38c96 100644 ---- a/pc-bios/s390-ccw/cio.c -+++ b/pc-bios/s390-ccw/cio.c -@@ -11,7 +11,8 @@ - * directory. - */ - --#include "libc.h" -+#include -+#include - #include "s390-ccw.h" - #include "s390-arch.h" - #include "helper.h" -@@ -90,9 +91,9 @@ static void print_eckd_dasd_sense_data(SenseDataEckdDasd *sd) - char msgline[512]; - - if (sd->config_info & 0x8000) { -- sclp_print("Eckd Dasd Sense Data (fmt 24-bytes):\n"); -+ puts("Eckd Dasd Sense Data (fmt 24-bytes):"); - } else { -- sclp_print("Eckd Dasd Sense Data (fmt 32-bytes):\n"); -+ puts("Eckd Dasd Sense Data (fmt 32-bytes):"); - } - - strcat(msgline, " Sense Condition Flags :"); -@@ -158,22 +159,21 @@ static void print_eckd_dasd_sense_data(SenseDataEckdDasd *sd) - if (sd->status[1] & SNS_STAT2_IMPRECISE_END) { - strcat(msgline, " [Imprecise-End]"); - } -- strcat(msgline, "\n"); -- sclp_print(msgline); -- -- print_int(" Residual Count =", sd->res_count); -- print_int(" Phys Drive ID =", sd->phys_drive_id); -- print_int(" low cyl address =", sd->low_cyl_addr); -- print_int(" head addr & hi cyl =", sd->head_high_cyl_addr); -- print_int(" format/message =", sd->fmt_msg); -- print_int(" fmt-dependent[0-7] =", sd->fmt_dependent_info[0]); -- print_int(" fmt-dependent[8-15]=", sd->fmt_dependent_info[1]); -- print_int(" prog action code =", sd->program_action_code); -- print_int(" Configuration info =", sd->config_info); -- print_int(" mcode / hi-cyl =", sd->mcode_hicyl); -- print_int(" cyl & head addr [0]=", sd->cyl_head_addr[0]); -- print_int(" cyl & head addr [1]=", sd->cyl_head_addr[1]); -- print_int(" cyl & head addr [2]=", sd->cyl_head_addr[2]); -+ puts(msgline); -+ -+ printf(" Residual Count = 0x%X\n", sd->res_count); -+ printf(" Phys Drive ID = 0x%X\n", sd->phys_drive_id); -+ printf(" low cyl address = 0x%X\n", sd->low_cyl_addr); -+ printf(" head addr & hi cyl = 0x%X\n", sd->head_high_cyl_addr); -+ printf(" format/message = 0x%X\n", sd->fmt_msg); -+ printf(" fmt-dependent[0-7] = 0x%llX\n", sd->fmt_dependent_info[0]); -+ printf(" fmt-dependent[8-15]= 0x%llX\n", sd->fmt_dependent_info[1]); -+ printf(" prog action code = 0x%X\n", sd->program_action_code); -+ printf(" Configuration info = 0x%X\n", sd->config_info); -+ printf(" mcode / hi-cyl = 0x%X\n", sd->mcode_hicyl); -+ printf(" cyl & head addr [0]= 0x%X\n", sd->cyl_head_addr[0]); -+ printf(" cyl & head addr [1]= 0x%X\n", sd->cyl_head_addr[1]); -+ printf(" cyl & head addr [2]= 0x%X\n", sd->cyl_head_addr[2]); - } - - static void print_irb_err(Irb *irb) -@@ -182,7 +182,7 @@ static void print_irb_err(Irb *irb) - uint64_t prev_ccw = *(uint64_t *)u32toptr(irb->scsw.cpa - 8); - char msgline[256]; - -- sclp_print("Interrupt Response Block Data:\n"); -+ puts("Interrupt Response Block Data:"); - - strcat(msgline, " Function Ctrl :"); - if (irb->scsw.ctrl & SCSW_FCTL_START_FUNC) { -@@ -194,8 +194,7 @@ static void print_irb_err(Irb *irb) - if (irb->scsw.ctrl & SCSW_FCTL_CLEAR_FUNC) { - strcat(msgline, " [Clear]"); - } -- strcat(msgline, "\n"); -- sclp_print(msgline); -+ puts(msgline); - - msgline[0] = '\0'; - strcat(msgline, " Activity Ctrl :"); -@@ -220,8 +219,7 @@ static void print_irb_err(Irb *irb) - if (irb->scsw.ctrl & SCSW_ACTL_SUSPENDED) { - strcat(msgline, " [Suspended]"); - } -- strcat(msgline, "\n"); -- sclp_print(msgline); -+ puts(msgline); - - msgline[0] = '\0'; - strcat(msgline, " Status Ctrl :"); -@@ -240,9 +238,7 @@ static void print_irb_err(Irb *irb) - if (irb->scsw.ctrl & SCSW_SCTL_STATUS_PEND) { - strcat(msgline, " [Status-Pending]"); - } -- -- strcat(msgline, "\n"); -- sclp_print(msgline); -+ puts(msgline); - - msgline[0] = '\0'; - strcat(msgline, " Device Status :"); -@@ -270,8 +266,7 @@ static void print_irb_err(Irb *irb) - if (irb->scsw.dstat & SCSW_DSTAT_UEXCP) { - strcat(msgline, " [Unit-Exception]"); - } -- strcat(msgline, "\n"); -- sclp_print(msgline); -+ puts(msgline); - - msgline[0] = '\0'; - strcat(msgline, " Channel Status :"); -@@ -299,12 +294,11 @@ static void print_irb_err(Irb *irb) - if (irb->scsw.cstat & SCSW_CSTAT_CHAINCHK) { - strcat(msgline, " [Chaining-Check]"); - } -- strcat(msgline, "\n"); -- sclp_print(msgline); -+ puts(msgline); - -- print_int(" cpa=", irb->scsw.cpa); -- print_int(" prev_ccw=", prev_ccw); -- print_int(" this_ccw=", this_ccw); -+ printf(" cpa= 0x%X\n", irb->scsw.cpa); -+ printf(" prev_ccw= 0x%llX\n", prev_ccw); -+ printf(" this_ccw= 0x%llX\n", this_ccw); - } - - /* -@@ -341,7 +335,7 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt, Irb *irb) - return -1; - } - if (rc) { -- print_int("ssch failed with cc=", rc); -+ printf("ssch failed with cc= 0x%x\n", rc); - return rc; - } - -@@ -350,7 +344,7 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt, Irb *irb) - /* collect status */ - rc = tsch(schid, irb); - if (rc) { -- print_int("tsch failed with cc=", rc); -+ printf("tsch failed with cc= 0x%X\n", rc); - } - - return rc; -@@ -406,12 +400,12 @@ int do_cio(SubChannelId schid, uint16_t cutype, uint32_t ccw_addr, int fmt) - continue; - } - -- sclp_print("cio device error\n"); -- print_int(" ssid ", schid.ssid); -- print_int(" cssid ", schid.cssid); -- print_int(" sch_no", schid.sch_no); -- print_int(" ctrl-unit type", cutype); -- sclp_print("\n"); -+ printf("cio device error\n"); -+ printf(" ssid 0x%X\n", schid.ssid); -+ printf(" cssid 0x%X\n", schid.cssid); -+ printf(" sch_no 0x%X\n", schid.sch_no); -+ printf(" ctrl-unit type 0x%X\n", cutype); -+ printf("\n"); - print_irb_err(&irb); - if (cutype == CU_TYPE_DASD_3990 || cutype == CU_TYPE_DASD_2107 || - cutype == CU_TYPE_UNKNOWN) { -diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c -index 254bb1a15e..ae751adec1 100644 ---- a/pc-bios/s390-ccw/dasd-ipl.c -+++ b/pc-bios/s390-ccw/dasd-ipl.c -@@ -8,7 +8,8 @@ - * directory. - */ - --#include "libc.h" -+#include -+#include - #include "s390-ccw.h" - #include "s390-arch.h" - #include "dasd-ipl.h" -@@ -82,7 +83,7 @@ static int run_dynamic_ccw_program(SubChannelId schid, uint16_t cutype, - do { - has_next = dynamic_cp_fixup(cpa, &next_cpa); - -- print_int("executing ccw chain at ", cpa); -+ printf("executing ccw chain at 0x%X\n", cpa); - enable_prefixing(); - rc = do_cio(schid, cutype, cpa, CCW_FMT0); - disable_prefixing(); -diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c -index 78f5f46533..80b7f6a1f3 100644 ---- a/pc-bios/s390-ccw/jump2ipl.c -+++ b/pc-bios/s390-ccw/jump2ipl.c -@@ -6,7 +6,8 @@ - * directory. - */ - --#include "libc.h" -+#include -+#include - #include "s390-ccw.h" - #include "s390-arch.h" - -@@ -57,7 +58,7 @@ void jump_to_IPL_code(uint64_t address) - debug_print_int("set IPL addr to", address ?: *reset_psw & PSW_MASK_SHORT_ADDR); - - /* Ensure the guest output starts fresh */ -- sclp_print("\n"); -+ printf("\n"); - - /* - * HACK ALERT. -diff --git a/pc-bios/s390-ccw/libc.c b/pc-bios/s390-ccw/libc.c -deleted file mode 100644 -index 3187923950..0000000000 ---- a/pc-bios/s390-ccw/libc.c -+++ /dev/null -@@ -1,88 +0,0 @@ --/* -- * libc-style definitions and functions -- * -- * Copyright 2018 IBM Corp. -- * Author(s): Collin L. Walling -- * -- * This code is free software; you can redistribute it and/or modify it -- * under the terms of the GNU General Public License as published by the -- * Free Software Foundation; either version 2 of the License, or (at your -- * option) any later version. -- */ -- --#include "libc.h" --#include "s390-ccw.h" -- --/** -- * atoui: -- * @str: the string to be converted. -- * -- * Given a string @str, convert it to an integer. Leading spaces are -- * ignored. Any other non-numerical value will terminate the conversion -- * and return 0. This function only handles numbers between 0 and -- * UINT64_MAX inclusive. -- * -- * Returns: an integer converted from the string @str, or the number 0 -- * if an error occurred. -- */ --uint64_t atoui(const char *str) --{ -- int val = 0; -- -- if (!str || !str[0]) { -- return 0; -- } -- -- while (*str == ' ') { -- str++; -- } -- -- while (*str) { -- if (!isdigit(*(unsigned char *)str)) { -- break; -- } -- val = val * 10 + *str - '0'; -- str++; -- } -- -- return val; --} -- --/** -- * uitoa: -- * @num: an integer (base 10) to be converted. -- * @str: a pointer to a string to store the conversion. -- * @len: the length of the passed string. -- * -- * Given an integer @num, convert it to a string. The string @str must be -- * allocated beforehand. The resulting string will be null terminated and -- * returned. This function only handles numbers between 0 and UINT64_MAX -- * inclusive. -- * -- * Returns: the string @str of the converted integer @num -- */ --char *uitoa(uint64_t num, char *str, size_t len) --{ -- long num_idx = 1; /* account for NUL */ -- uint64_t tmp = num; -- -- IPL_assert(str != NULL, "uitoa: no space allocated to store string"); -- -- /* Count indices of num */ -- while ((tmp /= 10) != 0) { -- num_idx++; -- } -- -- /* Check if we have enough space for num and NUL */ -- IPL_assert(len > num_idx, "uitoa: array too small for conversion"); -- -- str[num_idx--] = '\0'; -- -- /* Convert int to string */ -- while (num_idx >= 0) { -- str[num_idx--] = num % 10 + '0'; -- num /= 10; -- } -- -- return str; --} -diff --git a/pc-bios/s390-ccw/libc.h b/pc-bios/s390-ccw/libc.h -deleted file mode 100644 -index bcdc45732d..0000000000 ---- a/pc-bios/s390-ccw/libc.h -+++ /dev/null -@@ -1,89 +0,0 @@ --/* -- * libc-style definitions and functions -- * -- * Copyright (c) 2013 Alexander Graf -- * -- * This code is free software; you can redistribute it and/or modify it -- * under the terms of the GNU General Public License as published by the -- * Free Software Foundation; either version 2 of the License, or (at your -- * option) any later version. -- */ -- --#ifndef S390_CCW_LIBC_H --#define S390_CCW_LIBC_H -- --typedef unsigned long size_t; --typedef int bool; --typedef unsigned char uint8_t; --typedef unsigned short uint16_t; --typedef unsigned int uint32_t; --typedef unsigned long long uint64_t; -- --static inline void *memset(void *s, int c, size_t n) --{ -- size_t i; -- unsigned char *p = s; -- -- for (i = 0; i < n; i++) { -- p[i] = c; -- } -- -- return s; --} -- --static inline void *memcpy(void *s1, const void *s2, size_t n) --{ -- uint8_t *dest = s1; -- const uint8_t *src = s2; -- size_t i; -- -- for (i = 0; i < n; i++) { -- dest[i] = src[i]; -- } -- -- return s1; --} -- --static inline int memcmp(const void *s1, const void *s2, size_t n) --{ -- size_t i; -- const uint8_t *p1 = s1, *p2 = s2; -- -- for (i = 0; i < n; i++) { -- if (p1[i] != p2[i]) { -- return p1[i] > p2[i] ? 1 : -1; -- } -- } -- -- return 0; --} -- --static inline size_t strlen(const char *str) --{ -- size_t i; -- for (i = 0; *str; i++) { -- str++; -- } -- return i; --} -- --static inline char *strcat(char *dest, const char *src) --{ -- int i; -- char *dest_end = dest + strlen(dest); -- -- for (i = 0; i <= strlen(src); i++) { -- dest_end[i] = src[i]; -- } -- return dest; --} -- --static inline int isdigit(int c) --{ -- return (c >= '0') && (c <= '9'); --} -- --uint64_t atoui(const char *str); --char *uitoa(uint64_t num, char *str, size_t len); -- --#endif -diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c -index 5506798098..203df20965 100644 ---- a/pc-bios/s390-ccw/main.c -+++ b/pc-bios/s390-ccw/main.c -@@ -8,7 +8,9 @@ - * directory. - */ - --#include "libc.h" -+#include -+#include -+#include - #include "helper.h" - #include "s390-arch.h" - #include "s390-ccw.h" -@@ -50,7 +52,7 @@ void write_iplb_location(void) - - unsigned int get_loadparm_index(void) - { -- return atoui(loadparm_str); -+ return atoi(loadparm_str); - } - - static int is_dev_possibly_bootable(int dev_no, int sch_no) -@@ -176,7 +178,7 @@ static void boot_setup(void) - - sclp_get_loadparm_ascii(loadparm_str); - memcpy(lpmsg + 10, loadparm_str, 8); -- sclp_print(lpmsg); -+ puts(lpmsg); - - /* - * Clear out any potential S390EP magic (see jump_to_low_kernel()), -@@ -228,7 +230,7 @@ static int virtio_setup(void) - - switch (vdev->senseid.cu_model) { - case VIRTIO_ID_NET: -- sclp_print("Network boot device detected\n"); -+ puts("Network boot device detected"); - vdev->netboot_start_addr = qipl.netboot_start_addr; - return 0; - case VIRTIO_ID_BLOCK: -@@ -261,7 +263,7 @@ static void ipl_boot_device(void) - } - break; - default: -- print_int("Attempting to boot from unexpected device type", cutype); -+ printf("Attempting to boot from unexpected device type 0x%X\n", cutype); - panic("\nBoot failed.\n"); - } - } -@@ -287,7 +289,7 @@ static void probe_boot_device(void) - } - } - -- sclp_print("Could not find a suitable boot device (none specified)\n"); -+ puts("Could not find a suitable boot device (none specified)"); - } - - void main(void) -diff --git a/pc-bios/s390-ccw/menu.c b/pc-bios/s390-ccw/menu.c -index d601952d3e..84062e94af 100644 ---- a/pc-bios/s390-ccw/menu.c -+++ b/pc-bios/s390-ccw/menu.c -@@ -9,7 +9,10 @@ - * directory. - */ - --#include "libc.h" -+#include -+#include -+#include -+#include - #include "s390-ccw.h" - #include "sclp.h" - #include "s390-time.h" -@@ -93,7 +96,7 @@ static int read_prompt(char *buf, size_t len) - case KEYCODE_BACKSP: - if (idx > 0) { - buf[--idx] = 0; -- sclp_print("\b \b"); -+ printf("\b \b"); - } - continue; - case KEYCODE_ENTER: -@@ -103,7 +106,7 @@ static int read_prompt(char *buf, size_t len) - /* Echo input and add to buffer */ - if (idx < len) { - buf[idx++] = inp[0]; -- sclp_print(inp); -+ printf("%s", inp); - } - } - } -@@ -140,22 +143,19 @@ static int get_index(void) - } - } - -- return atoui(buf); -+ return atoi(buf); - } - - static void boot_menu_prompt(bool retry) - { -- char tmp[11]; -- - if (retry) { -- sclp_print("\nError: undefined configuration" -+ printf("\nError: undefined configuration" - "\nPlease choose:\n"); - } else if (timeout > 0) { -- sclp_print("Please choose (default will boot in "); -- sclp_print(uitoa(timeout / 1000, tmp, sizeof(tmp))); -- sclp_print(" seconds):\n"); -+ printf("Please choose (default will boot in %d seconds):\n", -+ (int)(timeout / 1000)); - } else { -- sclp_print("Please choose:\n"); -+ puts("Please choose:"); - } - } - -@@ -163,7 +163,6 @@ static int get_boot_index(bool *valid_entries) - { - int boot_index; - bool retry = false; -- char tmp[5]; - - do { - boot_menu_prompt(retry); -@@ -172,8 +171,7 @@ static int get_boot_index(bool *valid_entries) - } while (boot_index < 0 || boot_index >= MAX_BOOT_ENTRIES || - !valid_entries[boot_index]); - -- sclp_print("\nBooting entry #"); -- sclp_print(uitoa(boot_index, tmp, sizeof(tmp))); -+ printf("\nBooting entry #%d", boot_index); - - return boot_index; - } -@@ -187,9 +185,9 @@ static int zipl_print_entry(const char *data, size_t len) - buf[len] = '\n'; - buf[len + 1] = '\0'; - -- sclp_print(buf); -+ printf("%s", buf); - -- return buf[0] == ' ' ? atoui(buf + 1) : atoui(buf); -+ return buf[0] == ' ' ? atoi(buf + 1) : atoi(buf); - } - - int menu_get_zipl_boot_index(const char *menu_data) -@@ -209,7 +207,7 @@ int menu_get_zipl_boot_index(const char *menu_data) - } - - /* Print banner */ -- sclp_print("s390-ccw zIPL Boot Menu\n\n"); -+ puts("s390-ccw zIPL Boot Menu\n"); - menu_data += strlen(menu_data) + 1; - - /* Print entries */ -@@ -221,37 +219,34 @@ int menu_get_zipl_boot_index(const char *menu_data) - valid_entries[entry] = true; - - if (entry == 0) { -- sclp_print("\n"); -+ printf("\n"); - } - } - -- sclp_print("\n"); -+ printf("\n"); - return get_boot_index(valid_entries); - } - - int menu_get_enum_boot_index(bool *valid_entries) - { -- char tmp[3]; - int i; - -- sclp_print("s390-ccw Enumerated Boot Menu.\n\n"); -+ puts("s390-ccw Enumerated Boot Menu.\n"); - - for (i = 0; i < MAX_BOOT_ENTRIES; i++) { - if (valid_entries[i]) { - if (i < 10) { -- sclp_print(" "); -+ printf(" "); - } -- sclp_print("["); -- sclp_print(uitoa(i, tmp, sizeof(tmp))); -- sclp_print("]"); -+ printf("[%d]", i); - if (i == 0) { -- sclp_print(" default\n"); -+ printf(" default\n"); - } -- sclp_print("\n"); -+ printf("\n"); - } - } - -- sclp_print("\n"); -+ printf("\n"); - return get_boot_index(valid_entries); - } - -diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak -index 046aa35587..d2b3d8ee74 100644 ---- a/pc-bios/s390-ccw/netboot.mak -+++ b/pc-bios/s390-ccw/netboot.mak -@@ -1,9 +1,6 @@ - --SLOF_DIR := $(SRC_PATH)/../../roms/SLOF -- - NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o - --LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include - LIBNET_INC := -I$(SLOF_DIR)/lib/libnet - - NETLDFLAGS := $(LDFLAGS) -Wl,-Ttext=0x7800000 -diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c -index 5cd619b2d6..509119be15 100644 ---- a/pc-bios/s390-ccw/netmain.c -+++ b/pc-bios/s390-ccw/netmain.c -@@ -293,7 +293,7 @@ static int load_kernel_with_initrd(filename_ip_t *fn_ip, - printf("Loading pxelinux.cfg entry '%s'\n", entry->label); - - if (!entry->kernel) { -- printf("Kernel entry is missing!\n"); -+ puts("Kernel entry is missing!\n"); - return -1; - } - -@@ -515,13 +515,13 @@ void main(void) - int rc, fnlen; - - sclp_setup(); -- sclp_print("Network boot starting...\n"); -+ puts("Network boot starting..."); - - virtio_setup(); - - rc = net_init(&fn_ip); - if (rc) { -- panic("Network initialization failed. Halting.\n"); -+ panic("Network initialization failed. Halting."); - } - - fnlen = strlen(fn_ip.filename); -@@ -535,9 +535,9 @@ void main(void) - net_release(&fn_ip); - - if (rc > 0) { -- sclp_print("Network loading done, starting kernel...\n"); -+ puts("Network loading done, starting kernel..."); - jump_to_low_kernel(); - } - -- panic("Failed to load OS from network\n"); -+ panic("Failed to load OS from network."); - } -diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h -index c977a52b50..6f6d95d170 100644 ---- a/pc-bios/s390-ccw/s390-ccw.h -+++ b/pc-bios/s390-ccw/s390-ccw.h -@@ -13,6 +13,11 @@ - - /* #define DEBUG */ - -+#include -+#include -+#include -+#include -+ - typedef unsigned char u8; - typedef unsigned short u16; - typedef unsigned int u32; -@@ -26,9 +31,6 @@ typedef unsigned long long u64; - #define EBUSY 2 - #define ENODEV 3 - --#ifndef NULL --#define NULL 0 --#endif - #ifndef MIN - #define MIN(a, b) (((a) < (b)) ? (a) : (b)) - #endif -@@ -87,7 +89,7 @@ bool menu_is_enabled_enum(void); - __attribute__ ((__noreturn__)) - static inline void panic(const char *string) - { -- sclp_print(string); -+ printf("ERROR: %s\n ", string); - disabled_wait(); - } - -@@ -109,20 +111,10 @@ static inline void fill_hex_val(char *out, void *ptr, unsigned size) - } - } - --static inline void print_int(const char *desc, u64 addr) --{ -- char out[] = ": 0xffffffffffffffff\n"; -- -- fill_hex_val(&out[4], &addr, sizeof(addr)); -- -- sclp_print(desc); -- sclp_print(out); --} -- - static inline void debug_print_int(const char *desc, u64 addr) - { - #ifdef DEBUG -- print_int(desc, addr); -+ printf("%s 0x%X\n", desc, addr); - #endif - } - -@@ -147,18 +139,14 @@ static inline void debug_print_addr(const char *desc, void *p) - static inline void IPL_assert(bool term, const char *message) - { - if (!term) { -- sclp_print("\n! "); -- sclp_print(message); -- panic(" !\n"); /* no return */ -+ panic(message); /* no return */ - } - } - - static inline void IPL_check(bool term, const char *message) - { - if (!term) { -- sclp_print("\n! WARNING: "); -- sclp_print(message); -- sclp_print(" !\n"); -+ printf("WARNING: %s\n", message); - } - } - -diff --git a/pc-bios/s390-ccw/sclp.c b/pc-bios/s390-ccw/sclp.c -index 7251f9af4d..4a07de018d 100644 ---- a/pc-bios/s390-ccw/sclp.c -+++ b/pc-bios/s390-ccw/sclp.c -@@ -8,7 +8,7 @@ - * directory. - */ - --#include "libc.h" -+#include - #include "s390-ccw.h" - #include "sclp.h" - -@@ -101,11 +101,6 @@ long write(int fd, const void *str, size_t len) - return len; - } - --void sclp_print(const char *str) --{ -- write(1, str, strlen(str)); --} -- - void sclp_get_loadparm_ascii(char *loadparm) - { - -diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blkdev.c -index a81207b52e..2666326801 100644 ---- a/pc-bios/s390-ccw/virtio-blkdev.c -+++ b/pc-bios/s390-ccw/virtio-blkdev.c -@@ -8,7 +8,7 @@ - * directory. - */ - --#include "libc.h" -+#include - #include "s390-ccw.h" - #include "virtio.h" - #include "virtio-scsi.h" -@@ -76,7 +76,7 @@ unsigned long virtio_load_direct(unsigned long rec_list1, unsigned long rec_list - return -1; - } - -- sclp_print("."); -+ printf("."); - status = virtio_read_many(sec, (void *)addr, sec_num); - if (status) { - panic("I/O Error"); -@@ -230,7 +230,7 @@ int virtio_blk_setup_device(SubChannelId schid) - vdev->schid = schid; - virtio_setup_ccw(vdev); - -- sclp_print("Using virtio-blk.\n"); -+ puts("Using virtio-blk."); - - return 0; - } -diff --git a/pc-bios/s390-ccw/virtio-scsi.c b/pc-bios/s390-ccw/virtio-scsi.c -index d1a84b937c..6b4a1caf8a 100644 ---- a/pc-bios/s390-ccw/virtio-scsi.c -+++ b/pc-bios/s390-ccw/virtio-scsi.c -@@ -9,7 +9,8 @@ - * directory. - */ - --#include "libc.h" -+#include -+#include - #include "s390-ccw.h" - #include "virtio.h" - #include "scsi.h" -@@ -30,9 +31,9 @@ static inline void vs_assert(bool term, const char **msgs) - if (!term) { - int i = 0; - -- sclp_print("\n! "); -+ printf("\n! "); - while (msgs[i]) { -- sclp_print(msgs[i++]); -+ printf("%s", msgs[i++]); - } - panic(" !\n"); - } -@@ -236,11 +237,11 @@ static int virtio_scsi_locate_device(VDev *vdev) - if (resp.response == VIRTIO_SCSI_S_BAD_TARGET) { - continue; - } -- print_int("target", target); -+ printf("target 0x%X\n", target); - virtio_scsi_verify_response(&resp, "SCSI cannot report LUNs"); - } - if (r->lun_list_len == 0) { -- print_int("no LUNs for target", target); -+ printf("no LUNs for target 0x%X\n", target); - continue; - } - luns = r->lun_list_len / 8; -@@ -264,7 +265,7 @@ static int virtio_scsi_locate_device(VDev *vdev) - } - } - -- sclp_print("Warning: Could not locate a usable virtio-scsi device\n"); -+ puts("Warning: Could not locate a usable virtio-scsi device"); - return -ENODEV; - } - -@@ -379,7 +380,7 @@ static int virtio_scsi_setup(VDev *vdev) - } - - if (virtio_scsi_inquiry_response_is_cdrom(scsi_inquiry_std_response)) { -- sclp_print("SCSI CD-ROM detected.\n"); -+ puts("SCSI CD-ROM detected."); - vdev->is_cdrom = true; - vdev->scsi_block_size = VIRTIO_ISO_BLOCK_SIZE; - } -@@ -443,7 +444,7 @@ int virtio_scsi_setup_device(SubChannelId schid) - IPL_assert(vdev->config.scsi.cdb_size == VIRTIO_SCSI_CDB_SIZE, - "Config: CDB size mismatch"); - -- sclp_print("Using virtio-scsi.\n"); -+ puts("Using virtio-scsi."); - - return virtio_scsi_setup(vdev); - } -diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c -index 5edd058d88..8c6b0a8a92 100644 ---- a/pc-bios/s390-ccw/virtio.c -+++ b/pc-bios/s390-ccw/virtio.c -@@ -8,7 +8,7 @@ - * directory. - */ - --#include "libc.h" -+#include - #include "s390-ccw.h" - #include "cio.h" - #include "virtio.h" -diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Makefile.softmmu-target -index f60f94b090..90964a2ccb 100644 ---- a/tests/tcg/s390x/Makefile.softmmu-target -+++ b/tests/tcg/s390x/Makefile.softmmu-target -@@ -2,7 +2,7 @@ S390X_SRC=$(SRC_PATH)/tests/tcg/s390x - VPATH+=$(S390X_SRC) - QEMU_OPTS+=-action panic=exit-failure -nographic $(EXTFLAGS) -kernel - LINK_SCRIPT=$(S390X_SRC)/softmmu.ld --CFLAGS+=-ggdb -O0 -+CFLAGS+=-ggdb -O0 -I$(SRC_PATH)/include/hw/s390x/ipl/ - LDFLAGS=-nostdlib -static - - %.o: %.S -diff --git a/tests/tcg/s390x/console.c b/tests/tcg/s390x/console.c -index d43ce3f44b..6c26f04949 100644 ---- a/tests/tcg/s390x/console.c -+++ b/tests/tcg/s390x/console.c -@@ -4,7 +4,10 @@ - * - * SPDX-License-Identifier: GPL-2.0-or-later - */ -+ - #include "../../../pc-bios/s390-ccw/sclp.c" -+#include "../../../roms/SLOF/lib/libc/string/memset.c" -+#include "../../../roms/SLOF/lib/libc/string/memcpy.c" - - void __sys_outc(char c) - { --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-netmain-Fix-error-messages-with-reg.patch b/kvm-pc-bios-s390-ccw-netmain-Fix-error-messages-with-reg.patch deleted file mode 100644 index 9213f65..0000000 --- a/kvm-pc-bios-s390-ccw-netmain-Fix-error-messages-with-reg.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 3f7951b9a46772a1c942aed1fe87fc7461acb197 Mon Sep 17 00:00:00 2001 -From: Thomas Huth -Date: Thu, 16 Jan 2025 12:58:26 +0100 -Subject: [PATCH 5/6] pc-bios/s390-ccw/netmain: Fix error messages with regards - to the TFTP server -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 331: Fix boot problems when falling back from network to another boot device on s390x [RHEL10] -RH-Jira: RHEL-72717 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [4/4] 5b87d859a69ff0f399ba516a87c847a0f3942666 (thuth/qemu-kvm-cs) - -The code in net_init_ip() currently bails out early if "rc" is less -than 0, so the if-statements that check for negative "rc" codes to -print out some specific error messages with regards to the TFTP server -are never reached. Move them earlier to bring that dead code back to -life. - -Reviewed-by: Jared Rossi -Reviewed-by: Eric Farman -Tested-by: Jared Rossi -Message-ID: <20250116115826.192047-4-thuth@redhat.com> -Signed-off-by: Thomas Huth -(cherry picked from commit bbfa7f8558d5346b6884108ad50df3517fe17358) ---- - pc-bios/s390-ccw/netmain.c | 19 ++++++++----------- - 1 file changed, 8 insertions(+), 11 deletions(-) - -diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c -index 335ea9b63e..719a547ada 100644 ---- a/pc-bios/s390-ccw/netmain.c -+++ b/pc-bios/s390-ccw/netmain.c -@@ -168,6 +168,14 @@ static int net_init_ip(filename_ip_t *fn_ip) - if (fn_ip->ip_version == 4) { - set_ipv4_address(fn_ip->own_ip); - } -+ } else if (rc == -2) { -+ printf("ARP request to TFTP server (%d.%d.%d.%d) failed\n", -+ (fn_ip->server_ip >> 24) & 0xFF, (fn_ip->server_ip >> 16) & 0xFF, -+ (fn_ip->server_ip >> 8) & 0xFF, fn_ip->server_ip & 0xFF); -+ return -102; -+ } else if (rc == -4 || rc == -3) { -+ puts("Can't obtain TFTP server IP address"); -+ return -107; - } else { - puts("Could not get IP address"); - return -101; -@@ -183,17 +191,6 @@ static int net_init_ip(filename_ip_t *fn_ip) - printf(" Using IPv6 address: %s\n", ip6_str); - } - -- if (rc == -2) { -- printf("ARP request to TFTP server (%d.%d.%d.%d) failed\n", -- (fn_ip->server_ip >> 24) & 0xFF, (fn_ip->server_ip >> 16) & 0xFF, -- (fn_ip->server_ip >> 8) & 0xFF, fn_ip->server_ip & 0xFF); -- return -102; -- } -- if (rc == -4 || rc == -3) { -- puts("Can't obtain TFTP server IP address"); -- return -107; -- } -- - printf(" Using TFTP server: "); - if (fn_ip->ip_version == 4) { - printf("%d.%d.%d.%d\n", --- -2.39.3 - diff --git a/kvm-pc-bios-s390-ccw-virtio-Add-a-function-to-reset-a-vi.patch b/kvm-pc-bios-s390-ccw-virtio-Add-a-function-to-reset-a-vi.patch deleted file mode 100644 index 020e9d3..0000000 --- a/kvm-pc-bios-s390-ccw-virtio-Add-a-function-to-reset-a-vi.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 75a9cc1fb986e96ad5ee9df22daf93afb4624bd3 Mon Sep 17 00:00:00 2001 -From: Thomas Huth -Date: Thu, 16 Jan 2025 12:58:24 +0100 -Subject: [PATCH 3/6] pc-bios/s390-ccw/virtio: Add a function to reset a virtio - device -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 331: Fix boot problems when falling back from network to another boot device on s390x [RHEL10] -RH-Jira: RHEL-72717 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [2/4] 96435852a2dc8955f9deef6d82c7fac90ce90e96 (thuth/qemu-kvm-cs) - -To be able to properly silence a virtio device after using it, -we need a global function to reset the device. - -Reviewed-by: Jared Rossi -Reviewed-by: Eric Farman -Tested-by: Jared Rossi -Message-ID: <20250116115826.192047-2-thuth@redhat.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 3936d0556383829b8db9518aed8badfed6513953) ---- - pc-bios/s390-ccw/virtio.c | 7 ++++++- - pc-bios/s390-ccw/virtio.h | 1 + - 2 files changed, 7 insertions(+), 1 deletion(-) - -diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c -index 8b5a370bb3..cd6c99c7e3 100644 ---- a/pc-bios/s390-ccw/virtio.c -+++ b/pc-bios/s390-ccw/virtio.c -@@ -217,6 +217,11 @@ int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd) - return 0; - } - -+int virtio_reset(VDev *vdev) -+{ -+ return run_ccw(vdev, CCW_CMD_VDEV_RESET, NULL, 0, false); -+} -+ - int virtio_setup_ccw(VDev *vdev) - { - int i, cfg_size = 0; -@@ -235,7 +240,7 @@ int virtio_setup_ccw(VDev *vdev) - vdev->config.blk.blk_size = 0; /* mark "illegal" - setup started... */ - vdev->guessed_disk_nature = VIRTIO_GDN_NONE; - -- run_ccw(vdev, CCW_CMD_VDEV_RESET, NULL, 0, false); -+ virtio_reset(vdev); - - status = VIRTIO_CONFIG_S_ACKNOWLEDGE; - if (run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false)) { -diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h -index 9faf3986b1..f13fa6f5fe 100644 ---- a/pc-bios/s390-ccw/virtio.h -+++ b/pc-bios/s390-ccw/virtio.h -@@ -274,6 +274,7 @@ void vring_send_buf(VRing *vr, void *p, int len, int flags); - int vr_poll(VRing *vr); - int vring_wait_reply(void); - int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd); -+int virtio_reset(VDev *vdev); - int virtio_setup_ccw(VDev *vdev); - - int virtio_net_init(void *mac_addr); --- -2.39.3 - diff --git a/kvm-pc-bios-s390x-Enable-multi-device-boot-loop.patch b/kvm-pc-bios-s390x-Enable-multi-device-boot-loop.patch deleted file mode 100644 index edf9dd9..0000000 --- a/kvm-pc-bios-s390x-Enable-multi-device-boot-loop.patch +++ /dev/null @@ -1,227 +0,0 @@ -From 9facd91b090c8b63cb06da93c2b2ea51f26a3310 Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:51 -0400 -Subject: [PATCH 19/38] pc-bios/s390x: Enable multi-device boot loop -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [18/23] 809cf0c60e4323a1260194e482f6b077f54af90a (thuth/qemu-kvm-cs9) - -Allow attempts to boot from multiple IPL devices. If the first device fails to -IPL, select the pre-built IPLB for the next device in the boot order and attempt -to IPL from it. Continue this process until IPL is successful or there are no -devices left to try. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-18-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit f697bed22f58eff9b2893ac2fe3d511847398400) ---- - pc-bios/s390-ccw/iplb.h | 24 ++++++++++++++++++++ - pc-bios/s390-ccw/jump2ipl.c | 7 +++--- - pc-bios/s390-ccw/main.c | 45 +++++++++++++++++++++++-------------- - pc-bios/s390-ccw/netmain.c | 2 +- - 4 files changed, 57 insertions(+), 21 deletions(-) - -diff --git a/pc-bios/s390-ccw/iplb.h b/pc-bios/s390-ccw/iplb.h -index 16643f5879..08f259ff31 100644 ---- a/pc-bios/s390-ccw/iplb.h -+++ b/pc-bios/s390-ccw/iplb.h -@@ -17,9 +17,11 @@ - #endif - - #include -+#include - - extern QemuIplParameters qipl; - extern IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); -+extern bool have_iplb; - - #define S390_IPL_TYPE_FCP 0x00 - #define S390_IPL_TYPE_CCW 0x02 -@@ -49,4 +51,26 @@ static inline bool set_iplb(IplParameterBlock *iplb) - return manage_iplb(iplb, false); - } - -+/* -+ * The IPL started on the device, but failed in some way. If the IPLB chain -+ * still has more devices left to try, use the next device in order. -+ */ -+static inline bool load_next_iplb(void) -+{ -+ IplParameterBlock *next_iplb; -+ -+ if (qipl.chain_len < 1) { -+ return false; -+ } -+ -+ qipl.index++; -+ next_iplb = (IplParameterBlock *) qipl.next_iplb; -+ memcpy(&iplb, next_iplb, sizeof(IplParameterBlock)); -+ -+ qipl.chain_len--; -+ qipl.next_iplb = qipl.next_iplb + sizeof(IplParameterBlock); -+ -+ return true; -+} -+ - #endif /* IPLB_H */ -diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c -index 99d18947d1..86321d0f46 100644 ---- a/pc-bios/s390-ccw/jump2ipl.c -+++ b/pc-bios/s390-ccw/jump2ipl.c -@@ -45,9 +45,10 @@ int jump_to_IPL_code(uint64_t address) - */ - if (iplb.pbt == S390_IPL_TYPE_QEMU_SCSI) { - iplb.devno = qipl.index; -- if (!set_iplb(&iplb)) { -- panic("Failed to set IPLB"); -- } -+ } -+ -+ if (have_iplb && !set_iplb(&iplb)) { -+ panic("Failed to set IPLB"); - } - - /* -diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c -index ab4709e16e..a4d1c05aac 100644 ---- a/pc-bios/s390-ccw/main.c -+++ b/pc-bios/s390-ccw/main.c -@@ -23,7 +23,7 @@ static SubChannelId blk_schid = { .one = 1 }; - static char loadparm_str[LOADPARM_LEN + 1]; - QemuIplParameters qipl; - IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); --static bool have_iplb; -+bool have_iplb; - static uint16_t cutype; - LowCore *lowcore; /* Yes, this *is* a pointer to address 0 */ - -@@ -55,6 +55,12 @@ void write_iplb_location(void) - } - } - -+static void copy_qipl(void) -+{ -+ QemuIplParameters *early_qipl = (QemuIplParameters *)QIPL_ADDRESS; -+ memcpy(&qipl, early_qipl, sizeof(QemuIplParameters)); -+} -+ - unsigned int get_loadparm_index(void) - { - return atoi(loadparm_str); -@@ -152,6 +158,7 @@ static void menu_setup(void) - - /* If loadparm was set to any other value, then do not enable menu */ - if (memcmp(loadparm_str, LOADPARM_EMPTY, LOADPARM_LEN) != 0) { -+ menu_set_parms(qipl.qipl_flags & ~BOOT_MENU_FLAG_MASK, 0); - return; - } - -@@ -183,7 +190,6 @@ static void css_setup(void) - static void boot_setup(void) - { - char lpmsg[] = "LOADPARM=[________]\n"; -- have_iplb = store_iplb(&iplb); - - if (memcmp(iplb.loadparm, NO_LOADPARM, LOADPARM_LEN) != 0) { - ebcdic_to_ascii((char *) iplb.loadparm, loadparm_str, LOADPARM_LEN); -@@ -191,6 +197,10 @@ static void boot_setup(void) - sclp_get_loadparm_ascii(loadparm_str); - } - -+ if (have_iplb) { -+ menu_setup(); -+ } -+ - memcpy(lpmsg + 10, loadparm_str, 8); - puts(lpmsg); - -@@ -208,6 +218,7 @@ static bool find_boot_device(void) - - switch (iplb.pbt) { - case S390_IPL_TYPE_CCW: -+ vdev->scsi_device_selected = false; - debug_print_int("device no. ", iplb.ccw.devno); - blk_schid.ssid = iplb.ccw.ssid & 0x3; - debug_print_int("ssid ", blk_schid.ssid); -@@ -231,15 +242,8 @@ static bool find_boot_device(void) - static int virtio_setup(void) - { - VDev *vdev = virtio_get_device(); -- QemuIplParameters *early_qipl = (QemuIplParameters *)QIPL_ADDRESS; - int ret; - -- memcpy(&qipl, early_qipl, sizeof(QemuIplParameters)); -- -- if (have_iplb) { -- menu_setup(); -- } -- - switch (vdev->senseid.cu_model) { - case VIRTIO_ID_NET: - puts("Network boot device detected"); -@@ -271,10 +275,9 @@ static void ipl_boot_device(void) - dasd_ipl(blk_schid, cutype); - break; - case CU_TYPE_VIRTIO: -- if (virtio_setup()) { -- return; /* Only returns in case of errors */ -+ if (virtio_setup() == 0) { -+ zipl_load(); - } -- zipl_load(); - break; - default: - printf("Attempting to boot from unexpected device type 0x%X\n", cutype); -@@ -307,14 +310,22 @@ static void probe_boot_device(void) - - void main(void) - { -+ copy_qipl(); - sclp_setup(); - css_setup(); -- boot_setup(); -- if (have_iplb && find_boot_device()) { -- ipl_boot_device(); -- } else { -+ have_iplb = store_iplb(&iplb); -+ if (!have_iplb) { - probe_boot_device(); - } - -- panic("Failed to IPL. Halting..."); -+ while (have_iplb) { -+ boot_setup(); -+ if (have_iplb && find_boot_device()) { -+ ipl_boot_device(); -+ } -+ have_iplb = load_next_iplb(); -+ } -+ -+ panic("No suitable device for IPL. Halting..."); -+ - } -diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c -index d1a6c9a91c..e46e470db4 100644 ---- a/pc-bios/s390-ccw/netmain.c -+++ b/pc-bios/s390-ccw/netmain.c -@@ -478,7 +478,7 @@ static bool virtio_setup(void) - */ - enable_mss_facility(); - -- if (store_iplb(&iplb)) { -+ if (have_iplb || store_iplb(&iplb)) { - IPL_assert(iplb.pbt == S390_IPL_TYPE_CCW, "IPL_TYPE_CCW expected"); - dev_no = iplb.ccw.devno; - debug_print_int("device no. ", dev_no); --- -2.39.3 - diff --git a/kvm-pc-bios-s390x-Initialize-cdrom-type-to-false-for-eac.patch b/kvm-pc-bios-s390x-Initialize-cdrom-type-to-false-for-eac.patch deleted file mode 100644 index 24c9794..0000000 --- a/kvm-pc-bios-s390x-Initialize-cdrom-type-to-false-for-eac.patch +++ /dev/null @@ -1,39 +0,0 @@ -From f0e7e2ae018cabdee3a87fa562ad7a4482d235b4 Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Fri, 8 Nov 2024 14:41:36 -0500 -Subject: [PATCH 7/9] pc-bios/s390x: Initialize cdrom type to false for each - IPL device - -RH-Author: Thomas Huth -RH-MergeRequest: 297: [c10s] Fixes for the new s390x "boot order" feature -RH-Jira: RHEL-68444 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [6/8] efbe12669e2a20d1c8412edfc5e2350475b84dda (thuth/qemu-kvm-cs9) - -Clear information about cdrom type so that current IPL device isn't tainted -by stale data from previous devices. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241108194136.2833932-1-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 8c797468116d19940fb758efa749eae414616e3a) ---- - pc-bios/s390-ccw/main.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c -index a4d1c05aac..7509755e36 100644 ---- a/pc-bios/s390-ccw/main.c -+++ b/pc-bios/s390-ccw/main.c -@@ -242,6 +242,7 @@ static bool find_boot_device(void) - static int virtio_setup(void) - { - VDev *vdev = virtio_get_device(); -+ vdev->is_cdrom = false; - int ret; - - switch (vdev->senseid.cu_model) { --- -2.39.3 - diff --git a/kvm-pc-bios-s390x-Initialize-machine-loadparm-before-pro.patch b/kvm-pc-bios-s390x-Initialize-machine-loadparm-before-pro.patch deleted file mode 100644 index c9fa0a7..0000000 --- a/kvm-pc-bios-s390x-Initialize-machine-loadparm-before-pro.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 2d9158563e5d34f9147e660f943f631bad80b6dd Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Thu, 14 Nov 2024 11:19:52 -0500 -Subject: [PATCH 8/9] pc-bios/s390x: Initialize machine loadparm before probing - IPL devices - -RH-Author: Thomas Huth -RH-MergeRequest: 297: [c10s] Fixes for the new s390x "boot order" feature -RH-Jira: RHEL-68444 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [7/8] 7513fec6ef170ab0c2068a7641a79b77537f1608 (thuth/qemu-kvm-cs9) - -Commit bb185de423 ("s390x: Add individual loadparm assignment to -CCW device") allowed boot devices to be assigned a loadparm value independent -of the machine value, however, when no boot devices are defined, the machine -loadparm becomes ignored. Therefore, let's check the machine loadparm -prior to probing the devices. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241114161952.3508554-1-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 1056ca1e70dc6e0458238141bcebfb7810cede6d) ---- - pc-bios/s390-ccw/main.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c -index 7509755e36..76bf743900 100644 ---- a/pc-bios/s390-ccw/main.c -+++ b/pc-bios/s390-ccw/main.c -@@ -191,7 +191,7 @@ static void boot_setup(void) - { - char lpmsg[] = "LOADPARM=[________]\n"; - -- if (memcmp(iplb.loadparm, NO_LOADPARM, LOADPARM_LEN) != 0) { -+ if (have_iplb && memcmp(iplb.loadparm, NO_LOADPARM, LOADPARM_LEN) != 0) { - ebcdic_to_ascii((char *) iplb.loadparm, loadparm_str, LOADPARM_LEN); - } else { - sclp_get_loadparm_ascii(loadparm_str); -@@ -316,6 +316,7 @@ void main(void) - css_setup(); - have_iplb = store_iplb(&iplb); - if (!have_iplb) { -+ boot_setup(); - probe_boot_device(); - } - --- -2.39.3 - diff --git a/kvm-pc-q35-Bump-max_cpus-to-4096-vcpus.patch b/kvm-pc-q35-Bump-max_cpus-to-4096-vcpus.patch deleted file mode 100644 index 2764ab4..0000000 --- a/kvm-pc-q35-Bump-max_cpus-to-4096-vcpus.patch +++ /dev/null @@ -1,72 +0,0 @@ -From b270420c34cd990b1bcbe506c3fb0ef6f76d21a8 Mon Sep 17 00:00:00 2001 -From: Ani Sinha -Date: Wed, 8 Jan 2025 15:10:22 +0530 -Subject: [PATCH 5/7] pc: q35: Bump max_cpus to 4096 vcpus - -RH-Author: Ani Sinha -RH-MergeRequest: 317: pc: q35: Bump max_cpus to 4096 vcpus -RH-Jira: RHEL-57668 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/1] 35242a1fa8fc21f7d73422d23074cd8da5f74781 (anisinha/centos-qemu-kvm) - -This is the downstream change equivalent of the upstream QEMU commit -e4e98c7e ("pc: q35: Bump max_cpus to 4096 vcpus") - -Since upstream Linux kernel commit -f10a570b093e6 ("KVM: x86: Add CONFIG_KVM_MAX_NR_VCPUS to allow up to 4096 vCPUs") -Linux kernel can support upto a maximum number of 4096 vcpus when MAXSMP is -enabled in the kernel. This upstream change has been backported to c9s kernel -already. Please see JIRA https://issues.redhat.com/browse/RHEL-11579 and the -following commit authored by Vitaly Kuznetsov: -a85f846be686b0a ("KVM: x86: Add CONFIG_KVM_MAX_NR_VCPUS to allow up to 4096 vCPUs") - -At present, QEMU has been tested to correctly boot a linux guest with 4096 -vcpus using edk2 that has the fixes corresponding to the following two upstream -edk2 PRs: - -https://github.com/tianocore/edk2/pull/5410 -https://github.com/tianocore/edk2/pull/5418 - -The changes corresponding to the above two upstream edk2 PRs has been included -in the downstream c9s edk2 with the following MR: -https://gitlab.com/redhat/centos-stream/src/edk2/-/merge_requests/59 - -So bump up the value max_cpus to 4096 for RHEL q35 machines versions 9.6 and -newer. Q35 RHEL machines versions 9.4 and older continue to support 710 maximum -vcpus as before for compatibility reasons. - -See also -https://gitlab.com/redhat/centos-stream/src/qemu-kvm/-/merge_requests/236 -https://gitlab.com/redhat/centos-stream/src/qemu-kvm/-/merge_requests/273 - -Signed-off-by: Ani Sinha ---- - hw/i386/pc_q35.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c -index 37f54062c8..506f9dc0c0 100644 ---- a/hw/i386/pc_q35.c -+++ b/hw/i386/pc_q35.c -@@ -344,7 +344,7 @@ static void pc_q35_machine_options(MachineClass *m) - m->default_display = "std"; - m->default_nic = "e1000e"; - m->no_floppy = 1; -- m->max_cpus = 710; -+ m->max_cpus = 4096; - 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); -@@ -698,6 +698,9 @@ 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); -+ -+ /* older RHEL machines continue to support 710 vcpus */ -+ m->max_cpus = 710; - m->desc = "RHEL-9.4.0 PC (Q35 + ICH9, 2009)"; - pcmc->smbios_stream_product = "RHEL"; - pcmc->smbios_stream_version = "9.4.0"; --- -2.39.3 - diff --git a/kvm-pci-ensure-valid-link-status-bits-for-downstream-por.patch b/kvm-pci-ensure-valid-link-status-bits-for-downstream-por.patch deleted file mode 100644 index 6618d59..0000000 --- a/kvm-pci-ensure-valid-link-status-bits-for-downstream-por.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 765eed6ea5144c19658897e852efcd24fbebaf87 Mon Sep 17 00:00:00 2001 -From: Sebastian Ott -Date: Tue, 3 Dec 2024 13:19:28 +0100 -Subject: [PATCH 1/6] pci: ensure valid link status bits for downstream ports - -RH-Author: Sebastian Ott -RH-MergeRequest: 328: pci: ensure valid link status bits for downstream ports -RH-Jira: RHEL-65618 -RH-Acked-by: Eric Auger -RH-Acked-by: Gavin Shan -RH-Acked-by: Cornelia Huck -RH-Acked-by: Kashyap Chamarthy -RH-Commit: [1/1] fe92e0cd7ab04bfede6d1bf416b1080061cca172 (seott1/cos-qemu-kvm) - -PCI hotplug for downstream endpoints on arm fails because Linux' -PCIe hotplug driver doesn't like the QEMU provided LNKSTA: - - pcieport 0000:08:01.0: pciehp: Slot(2): Card present - pcieport 0000:08:01.0: pciehp: Slot(2): Link Up - pcieport 0000:08:01.0: pciehp: Slot(2): Cannot train link: status 0x2000 - -There's 2 cases where LNKSTA isn't setup properly: -* the downstream device has no express capability -* max link width of the bridge is 0 - -Move the sanity checks added via 88c869198aa63 -("pci: Sanity test minimum downstream LNKSTA") outside of the -branch to make sure downstream ports always have a valid LNKSTA. - -Signed-off-by: Sebastian Ott -Tested-by: Zhenyu Zhang -Message-Id: <20241203121928.14861-1-sebott@redhat.com> -Reviewed-by: Alex Williamson -Reviewed-by: Michael S. Tsirkin -Signed-off-by: Michael S. Tsirkin -(cherry picked from commit 694632fd44987cc4618612a38ad151047524a590) -JIRA: https://issues.redhat.com/browse/RHEL-65618 -Signed-off-by: Sebastian Ott ---- - hw/pci/pcie.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c -index 4b2f0805c6..9cb137c30f 100644 ---- a/hw/pci/pcie.c -+++ b/hw/pci/pcie.c -@@ -1080,18 +1080,22 @@ void pcie_sync_bridge_lnk(PCIDevice *bridge_dev) - if ((lnksta & PCI_EXP_LNKSTA_NLW) > (lnkcap & PCI_EXP_LNKCAP_MLW)) { - lnksta &= ~PCI_EXP_LNKSTA_NLW; - lnksta |= lnkcap & PCI_EXP_LNKCAP_MLW; -- } else if (!(lnksta & PCI_EXP_LNKSTA_NLW)) { -- lnksta |= QEMU_PCI_EXP_LNKSTA_NLW(QEMU_PCI_EXP_LNK_X1); - } - - if ((lnksta & PCI_EXP_LNKSTA_CLS) > (lnkcap & PCI_EXP_LNKCAP_SLS)) { - lnksta &= ~PCI_EXP_LNKSTA_CLS; - lnksta |= lnkcap & PCI_EXP_LNKCAP_SLS; -- } else if (!(lnksta & PCI_EXP_LNKSTA_CLS)) { -- lnksta |= QEMU_PCI_EXP_LNKSTA_CLS(QEMU_PCI_EXP_LNK_2_5GT); - } - } - -+ if (!(lnksta & PCI_EXP_LNKSTA_NLW)) { -+ lnksta |= QEMU_PCI_EXP_LNKSTA_NLW(QEMU_PCI_EXP_LNK_X1); -+ } -+ -+ if (!(lnksta & PCI_EXP_LNKSTA_CLS)) { -+ lnksta |= QEMU_PCI_EXP_LNKSTA_CLS(QEMU_PCI_EXP_LNK_2_5GT); -+ } -+ - pci_word_test_and_clear_mask(exp_cap + PCI_EXP_LNKSTA, - PCI_EXP_LNKSTA_CLS | PCI_EXP_LNKSTA_NLW); - pci_word_test_and_set_mask(exp_cap + PCI_EXP_LNKSTA, lnksta & --- -2.39.3 - diff --git a/kvm-qdev-Fix-set_pci_devfn-to-visit-option-only-once.patch b/kvm-qdev-Fix-set_pci_devfn-to-visit-option-only-once.patch deleted file mode 100644 index c58f4f5..0000000 --- a/kvm-qdev-Fix-set_pci_devfn-to-visit-option-only-once.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 33607f8bd2e0d56e854131c4e70c770b88fa5441 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Tue, 19 Nov 2024 13:03:53 +0100 -Subject: [PATCH 1/7] qdev: Fix set_pci_devfn() to visit option only once - -RH-Author: Stefan Hajnoczi -RH-MergeRequest: 312: qdev-monitor: avoid QemuOpts in QMP device_add -RH-Jira: RHEL-43412 -RH-Acked-by: Kevin Wolf -RH-Acked-by: Hanna Czenczek -RH-Commit: [1/4] 4d9ce49f16904d34d4f751f1dec3a53abfe8c8a8 (stefanha/centos-stream-qemu-kvm) - -pci_devfn properties accept either a string or an integer as input. To -implement this, set_pci_devfn() first tries to visit the option as a -string, and if that fails, it visits it as an integer instead. While the -QemuOpts visitor happens to accept this, it is invalid according to the -visitor interface. QObject input visitors run into an assertion failure -when this is done. - -QObject input visitors are used with the JSON syntax version of -device -on the command line: - -$ ./qemu-system-x86_64 -enable-kvm -M q35 -device pcie-pci-bridge,id=pci.1,bus=pcie.0 -blockdev null-co,node-name=disk -device '{ "driver": "virtio-blk-pci", "drive": "disk", "id": "virtio-disk0", "bus": "pci.1", "addr": 1 }' -qemu-system-x86_64: ../qapi/qobject-input-visitor.c:143: QObject *qobject_input_try_get_object(QObjectInputVisitor *, const char *, _Bool): Assertion `removed' failed. - -The proper way to accept both strings and integers is using the -alternate mechanism, which tells us the type of the input before it's -visited. With this information, we can directly visit it as the right -type. - -This fixes set_pci_devfn() by using the alternate mechanism. - -Cc: qemu-stable@nongnu.org -Reported-by: Peter Maydell -Signed-off-by: Kevin Wolf -Message-ID: <20241119120353.57812-1-kwolf@redhat.com> -Acked-by: Paolo Bonzini -Reviewed-by: Markus Armbruster -Signed-off-by: Kevin Wolf -(cherry picked from commit 5102f9df4a9a7adfbd902f9515c3f8f53dba288e) -Signed-off-by: Stefan Hajnoczi ---- - hw/core/qdev-properties-system.c | 54 +++++++++++++++++++++----------- - 1 file changed, 36 insertions(+), 18 deletions(-) - -diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c -index 5cd527cdba..b182dc293a 100644 ---- a/hw/core/qdev-properties-system.c -+++ b/hw/core/qdev-properties-system.c -@@ -820,39 +820,57 @@ static void set_pci_devfn(Object *obj, Visitor *v, const char *name, - void *opaque, Error **errp) - { - Property *prop = opaque; -+ g_autofree GenericAlternate *alt; - int32_t value, *ptr = object_field_prop_ptr(obj, prop); - unsigned int slot, fn, n; -- char *str; -+ g_autofree char *str = NULL; -+ -+ if (!visit_start_alternate(v, name, &alt, sizeof(*alt), errp)) { -+ return; -+ } -+ -+ switch (alt->type) { -+ case QTYPE_QSTRING: -+ if (!visit_type_str(v, name, &str, errp)) { -+ goto out; -+ } - -- if (!visit_type_str(v, name, &str, NULL)) { -+ if (sscanf(str, "%x.%x%n", &slot, &fn, &n) != 2) { -+ fn = 0; -+ if (sscanf(str, "%x%n", &slot, &n) != 1) { -+ goto invalid; -+ } -+ } -+ if (str[n] != '\0' || fn > 7 || slot > 31) { -+ goto invalid; -+ } -+ *ptr = slot << 3 | fn; -+ break; -+ -+ case QTYPE_QNUM: - if (!visit_type_int32(v, name, &value, errp)) { -- return; -+ goto out; - } - if (value < -1 || value > 255) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - name ? name : "null", "a value between -1 and 255"); -- return; -+ goto out; - } - *ptr = value; -- return; -- } -+ break; - -- if (sscanf(str, "%x.%x%n", &slot, &fn, &n) != 2) { -- fn = 0; -- if (sscanf(str, "%x%n", &slot, &n) != 1) { -- goto invalid; -- } -- } -- if (str[n] != '\0' || fn > 7 || slot > 31) { -- goto invalid; -+ default: -+ error_setg(errp, "Invalid parameter type for '%s', expected int or str", -+ name ? name : "null"); -+ goto out; - } -- *ptr = slot << 3 | fn; -- g_free(str); -- return; -+ -+ goto out; - - invalid: - error_set_from_qdev_prop_error(errp, EINVAL, obj, name, str); -- g_free(str); -+out: -+ visit_end_alternate(v, (void **) &alt); - } - - static int print_pci_devfn(Object *obj, Property *prop, char *dest, --- -2.39.3 - diff --git a/kvm-qdev-monitor-avoid-QemuOpts-in-QMP-device_add.patch b/kvm-qdev-monitor-avoid-QemuOpts-in-QMP-device_add.patch deleted file mode 100644 index 9de3875..0000000 --- a/kvm-qdev-monitor-avoid-QemuOpts-in-QMP-device_add.patch +++ /dev/null @@ -1,131 +0,0 @@ -From de4f7c3b6dbba3eb8450cd7714ae93787009cd17 Mon Sep 17 00:00:00 2001 -From: Stefan Hajnoczi -Date: Tue, 27 Aug 2024 15:27:50 -0400 -Subject: [PATCH 3/7] qdev-monitor: avoid QemuOpts in QMP device_add -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Stefan Hajnoczi -RH-MergeRequest: 312: qdev-monitor: avoid QemuOpts in QMP device_add -RH-Jira: RHEL-43412 -RH-Acked-by: Kevin Wolf -RH-Acked-by: Hanna Czenczek -RH-Commit: [3/4] 7c45f3791491cd66ec2476ef0aa515b5bffba456 (stefanha/centos-stream-qemu-kvm) - -The QMP device_add monitor command converts the QDict arguments to -QemuOpts and then back again to QDict. This process only supports scalar -types. Device properties like virtio-blk-pci's iothread-vq-mapping (an -array of objects) are silently dropped by qemu_opts_from_qdict() during -the QemuOpts conversion even though QAPI is capable of validating them. -As a result, hotplugging virtio-blk-pci devices with the -iothread-vq-mapping property does not work as expected (the property is -ignored). - -Get rid of the QemuOpts conversion in qmp_device_add() and call -qdev_device_add_from_qdict() with from_json=true. Using the QMP -command's QDict arguments directly allows non-scalar properties. - -The HMP is also adjusted since qmp_device_add()'s now expects properly -typed JSON arguments and cannot be used from HMP anymore. Move the code -that was previously in qmp_device_add() (with QemuOpts conversion and -from_json=false) into hmp_device_add() so that its behavior is -unchanged. - -This patch changes the behavior of QMP device_add but not HMP -device_add. QMP clients that sent incorrectly typed device_add QMP -commands no longer work. This is a breaking change but clients should be -using the correct types already. See the netdev_add QAPIfication in -commit db2a380c8457 for similar reasoning and object-add in commit -9151e59a8b6e. Unlike those commits, we continue to rely on 'gen': false -for the time being. - -Markus helped me figure this out and even provided a draft patch. The -code ended up very close to what he suggested. - -Suggested-by: Markus Armbruster -Cc: Daniel P. Berrangé -Signed-off-by: Stefan Hajnoczi -Message-ID: <20240827192751.948633-2-stefanha@redhat.com> -Reviewed-by: Daniel P. Berrangé -Reviewed-by: Kevin Wolf -Signed-off-by: Kevin Wolf -(cherry picked from commit be93fd53723cbdca675bd9ed112dae5cabbe1e91) -Signed-off-by: Stefan Hajnoczi ---- - system/qdev-monitor.c | 42 ++++++++++++++++++++++++++++-------------- - 1 file changed, 28 insertions(+), 14 deletions(-) - -diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c -index 6af6ef7d66..8b27cc42b0 100644 ---- a/system/qdev-monitor.c -+++ b/system/qdev-monitor.c -@@ -849,18 +849,9 @@ void hmp_info_qdm(Monitor *mon, const QDict *qdict) - - void qmp_device_add(QDict *qdict, QObject **ret_data, Error **errp) - { -- QemuOpts *opts; - DeviceState *dev; - -- opts = qemu_opts_from_qdict(qemu_find_opts("device"), qdict, errp); -- if (!opts) { -- return; -- } -- if (!monitor_cur_is_qmp() && qdev_device_help(opts)) { -- qemu_opts_del(opts); -- return; -- } -- dev = qdev_device_add(opts, errp); -+ dev = qdev_device_add_from_qdict(qdict, true, errp); - if (!dev) { - /* - * Drain all pending RCU callbacks. This is done because -@@ -872,9 +863,6 @@ void qmp_device_add(QDict *qdict, QObject **ret_data, Error **errp) - * to the user - */ - drain_call_rcu(); -- -- qemu_opts_del(opts); -- return; - } - object_unref(OBJECT(dev)); - } -@@ -967,8 +955,34 @@ void qmp_device_del(const char *id, Error **errp) - void hmp_device_add(Monitor *mon, const QDict *qdict) - { - Error *err = NULL; -+ QemuOpts *opts; -+ DeviceState *dev; - -- qmp_device_add((QDict *)qdict, NULL, &err); -+ opts = qemu_opts_from_qdict(qemu_find_opts("device"), qdict, &err); -+ if (!opts) { -+ goto out; -+ } -+ if (qdev_device_help(opts)) { -+ qemu_opts_del(opts); -+ return; -+ } -+ dev = qdev_device_add(opts, &err); -+ if (!dev) { -+ /* -+ * Drain all pending RCU callbacks. This is done because -+ * some bus related operations can delay a device removal -+ * (in this case this can happen if device is added and then -+ * removed due to a configuration error) -+ * to a RCU callback, but user might expect that this interface -+ * will finish its job completely once qmp command returns result -+ * to the user -+ */ -+ drain_call_rcu(); -+ -+ qemu_opts_del(opts); -+ } -+ object_unref(dev); -+out: - hmp_handle_error(mon, err); - } - --- -2.39.3 - diff --git a/kvm-qemu-ga-Optimize-freeze-hook-script-logic-of-logging.patch b/kvm-qemu-ga-Optimize-freeze-hook-script-logic-of-logging.patch deleted file mode 100644 index 51eda58..0000000 --- a/kvm-qemu-ga-Optimize-freeze-hook-script-logic-of-logging.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 14fc984df8059560815cc1f55f058569fe480832 Mon Sep 17 00:00:00 2001 -From: Dehan Meng -Date: Wed, 25 Dec 2024 16:37:44 +0800 -Subject: [PATCH 4/4] qemu-ga: Optimize freeze-hook script logic of logging - error - -RH-Author: 6-dehan -RH-MergeRequest: 326: qemu-ga: Optimize freeze-hook script logic of logging error -RH-Jira: RHEL-74461 -RH-Acked-by: Konstantin Kostiuk -RH-Acked-by: Yan Vugenfirer -RH-Commit: [1/1] f133428aa9b511a93e528823e8253a41d46e1de5 (6-dehan/centos-qemu-kvm) - -Make sure the error log of fsfreeze hooks -when freeze/thaw/snapshot could be logged -to system logs if the default logfile of -qga can't be written or other situations - -Reviewed-by: Konstantin Kostiuk -Reviewed-by: Yan Vugenfirer -Signed-off-by: Dehan Meng ---- - scripts/qemu-guest-agent/fsfreeze-hook | 36 +++++++++++++++++++++++--- - 1 file changed, 32 insertions(+), 4 deletions(-) - -diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook -index 70536ba3e3..d5d8d4daf8 100755 ---- a/scripts/qemu-guest-agent/fsfreeze-hook -+++ b/scripts/qemu-guest-agent/fsfreeze-hook -@@ -19,15 +19,43 @@ is_ignored_file() { - return 1 - } - -+USE_SYSLOG=0 -+# if log file is not writable, fallback to syslog -+[ ! -w "$LOGFILE" ] && USE_SYSLOG=1 -+# try to update log file and fallback to syslog if it fails -+touch "$LOGFILE" &>/dev/null || USE_SYSLOG=1 -+ -+# Ensure the log file is writable, fallback to syslog if not -+log_message() { -+ local message="$1" -+ if [ "$USE_SYSLOG" -eq 0 ]; then -+ printf "%s: %s\n" "$(date)" "$message" >>"$LOGFILE" -+ else -+ logger -t qemu-ga-freeze-hook "$message" -+ fi -+} -+ - # Iterate executables in directory "fsfreeze-hook.d" with the specified args - [ ! -d "$FSFREEZE_D" ] && exit 0 -+ - for file in "$FSFREEZE_D"/* ; do - is_ignored_file "$file" && continue - [ -x "$file" ] || continue -- printf "$(date): execute $file $@\n" >>$LOGFILE -- "$file" "$@" >>$LOGFILE 2>&1 -- STATUS=$? -- printf "$(date): $file finished with status=$STATUS\n" >>$LOGFILE -+ -+ log_message "Executing $file $@" -+ if [ "$USE_SYSLOG" -eq 0 ]; then -+ "$file" "$@" >>"$LOGFILE" 2>&1 -+ STATUS=$? -+ else -+ "$file" "$@" 2>&1 | logger -t qemu-ga-freeze-hook -+ STATUS=${PIPESTATUS[0]} -+ fi -+ -+ if [ $STATUS -ne 0 ]; then -+ log_message "Error: $file finished with status=$STATUS" -+ else -+ log_message "$file finished successfully" -+ fi - done - - exit 0 --- -2.39.3 - diff --git a/kvm-qemu-guest-agent-Update-the-logfile-path-of-qga-fsfr.patch b/kvm-qemu-guest-agent-Update-the-logfile-path-of-qga-fsfr.patch deleted file mode 100644 index 08328b0..0000000 --- a/kvm-qemu-guest-agent-Update-the-logfile-path-of-qga-fsfr.patch +++ /dev/null @@ -1,39 +0,0 @@ -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/kvm-qga-Add-log-to-guest-fsfreeze-thaw-command.patch b/kvm-qga-Add-log-to-guest-fsfreeze-thaw-command.patch deleted file mode 100644 index ae1d2c6..0000000 --- a/kvm-qga-Add-log-to-guest-fsfreeze-thaw-command.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 53cc229c86bd0c555cdf68adb75918bec6c525fb Mon Sep 17 00:00:00 2001 -From: Konstantin Kostiuk -Date: Mon, 16 Dec 2024 17:45:52 +0200 -Subject: [PATCH 3/4] qga: Add log to guest-fsfreeze-thaw command -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: 6-dehan -RH-MergeRequest: 325: qga: Add log to guest-fsfreeze-thaw command -RH-Jira: RHEL-74361 -RH-Acked-by: Konstantin Kostiuk -RH-Acked-by: Yan Vugenfirer -RH-Commit: [1/1] a6f5a87f592136857fb76b8261d1de98f1d28772 (6-dehan/centos-qemu-kvm) - -Signed-off-by: Konstantin Kostiuk -Reviewed-by: Daniel P. Berrangé ---- - qga/commands-posix.c | 2 ++ - qga/commands-win32.c | 3 +++ - 2 files changed, 5 insertions(+) - -diff --git a/qga/commands-posix.c b/qga/commands-posix.c -index c2bd0b4316..49e40f9127 100644 ---- a/qga/commands-posix.c -+++ b/qga/commands-posix.c -@@ -806,8 +806,10 @@ int64_t qmp_guest_fsfreeze_thaw(Error **errp) - int ret; - - ret = qmp_guest_fsfreeze_do_thaw(errp); -+ - if (ret >= 0) { - ga_unset_frozen(ga_state); -+ slog("guest-fsthaw called"); - execute_fsfreeze_hook(FSFREEZE_HOOK_THAW, errp); - } else { - ret = 0; -diff --git a/qga/commands-win32.c b/qga/commands-win32.c -index 61b36da469..1aea6cd167 100644 ---- a/qga/commands-win32.c -+++ b/qga/commands-win32.c -@@ -1273,6 +1273,9 @@ int64_t qmp_guest_fsfreeze_thaw(Error **errp) - qga_vss_fsfreeze(&i, false, NULL, errp); - - ga_unset_frozen(ga_state); -+ -+ slog("guest-fsthaw called"); -+ - return i; - } - --- -2.39.3 - diff --git a/kvm-qga-skip-bind-mounts-in-fs-list.patch b/kvm-qga-skip-bind-mounts-in-fs-list.patch deleted file mode 100644 index e7bddde..0000000 --- a/kvm-qga-skip-bind-mounts-in-fs-list.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 5aec8bc4d0458e6011f5e0242a8f18bdba835af8 Mon Sep 17 00:00:00 2001 -From: Jean-Louis Dupond -Date: Wed, 2 Oct 2024 12:06:35 +0200 -Subject: [PATCH 17/18] qga: skip bind mounts in fs list - -RH-Author: Konstantin Kostiuk -RH-MergeRequest: 307: qga: skip bind mounts in fs list -RH-Jira: RHEL-71939 -RH-Acked-by: yvugenfi -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/1] 787cdc9477275959892800418ea37b76fce28ac3 (kkostiuk/redhat-centos-stream-src-qemu-kvm) - -The filesystem list in build_fs_mount_list should skip bind mounts. -This because we end up in locking situations when doing fsFreeze. Like -mentioned in [1] and [2]. - -Next to that, the build_fs_mount_list call did a fallback via -build_fs_mount_list_from_mtab if mountinfo did not exist. -There it skipped bind mounts, but this is broken for newer OS. -This as mounts does not return the path of the bind mount but the -underlying dev/partition, so S_ISDIR will never return true in -dev_major_minor call. - -This patch simply checks the existing devmajor:devminor tuple in the -mounts, and if it already exists, this means we have the same devices -mounted again, a bind mount. So skip this. - -Same approach is used in open-vm-tools [3]. - -[1]: https://gitlab.com/qemu-project/qemu/-/issues/592 -[2]: https://gitlab.com/qemu-project/qemu/-/issues/520 -[3]: https://github.com/vmware/open-vm-tools/commit/d58847b497e212737007958c945af1df22a8ab58 - -Signed-off-by: Jean-Louis Dupond -Reviewed-by: Konstantin Kostiuk -Link: https://lore.kernel.org/r/20241002100634.162499-2-jean-louis@dupond.be -Signed-off-by: Konstantin Kostiuk ---- - qga/commands-linux.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - -diff --git a/qga/commands-linux.c b/qga/commands-linux.c -index 51d5e3d927..426b040ab8 100644 ---- a/qga/commands-linux.c -+++ b/qga/commands-linux.c -@@ -59,6 +59,22 @@ static int dev_major_minor(const char *devpath, - return -1; - } - -+/* -+ * Check if we already have the devmajor:devminor in the mounts -+ * If thats the case return true. -+ */ -+static bool dev_exists(FsMountList *mounts, unsigned int devmajor, unsigned int devminor) -+{ -+ FsMount *mount; -+ -+ QTAILQ_FOREACH(mount, mounts, next) { -+ if (mount->devmajor == devmajor && mount->devminor == devminor) { -+ return true; -+ } -+ } -+ return false; -+} -+ - static bool build_fs_mount_list_from_mtab(FsMountList *mounts, Error **errp) - { - struct mntent *ment; -@@ -89,6 +105,10 @@ static bool build_fs_mount_list_from_mtab(FsMountList *mounts, Error **errp) - /* Skip bind mounts */ - continue; - } -+ if (dev_exists(mounts, devmajor, devminor)) { -+ /* Skip already existing devices (bind mounts) */ -+ continue; -+ } - - mount = g_new0(FsMount, 1); - mount->dirname = g_strdup(ment->mnt_dir); -@@ -172,6 +192,11 @@ bool build_fs_mount_list(FsMountList *mounts, Error **errp) - } - } - -+ if (dev_exists(mounts, devmajor, devminor)) { -+ /* Skip already existing devices (bind mounts) */ -+ continue; -+ } -+ - mount = g_new0(FsMount, 1); - mount->dirname = g_strdup(line + dir_s); - mount->devtype = g_strdup(dash + type_s); --- -2.39.3 - diff --git a/kvm-qmp-cont-Only-activate-disks-if-migration-completed.patch b/kvm-qmp-cont-Only-activate-disks-if-migration-completed.patch deleted file mode 100644 index 5967f47..0000000 --- a/kvm-qmp-cont-Only-activate-disks-if-migration-completed.patch +++ /dev/null @@ -1,73 +0,0 @@ -From fd5603e42b6287c849bfed700d34c817b4b93891 Mon Sep 17 00:00:00 2001 -From: Peter Xu -Date: Fri, 6 Dec 2024 18:08:34 -0500 -Subject: [PATCH 02/22] qmp/cont: Only activate disks if migration completed - -RH-Author: Kevin Wolf -RH-MergeRequest: 340: QMP command for block device reactivation after migration -RH-Jira: RHEL-54670 -RH-Acked-by: Eric Blake -RH-Acked-by: Stefan Hajnoczi -RH-Commit: [2/22] 554508370a344aa69e0e8888c0567d353cbcfe94 (kmwolf/centos-qemu-kvm) - -As the comment says, the activation of disks is for the case where -migration has completed, rather than when QEMU is still during -migration (RUN_STATE_INMIGRATE). - -Move the code over to reflect what the comment is describing. - -Cc: Kevin Wolf -Cc: Markus Armbruster -Signed-off-by: Peter Xu -Reviewed-by: Fabiano Rosas -Message-Id: <20241206230838.1111496-3-peterx@redhat.com> -Signed-off-by: Fabiano Rosas -(cherry picked from commit e4e5e89bbd8e731e86735d9d25b7b5f49e8f08b6) -Signed-off-by: Kevin Wolf ---- - monitor/qmp-cmds.c | 26 ++++++++++++++------------ - 1 file changed, 14 insertions(+), 12 deletions(-) - -diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c -index f84a0dc523..76f21e8af3 100644 ---- a/monitor/qmp-cmds.c -+++ b/monitor/qmp-cmds.c -@@ -96,21 +96,23 @@ void qmp_cont(Error **errp) - } - } - -- /* Continuing after completed migration. Images have been inactivated to -- * allow the destination to take control. Need to get control back now. -- * -- * If there are no inactive block nodes (e.g. because the VM was just -- * paused rather than completing a migration), bdrv_inactivate_all() simply -- * doesn't do anything. */ -- bdrv_activate_all(&local_err); -- if (local_err) { -- error_propagate(errp, local_err); -- return; -- } -- - if (runstate_check(RUN_STATE_INMIGRATE)) { - autostart = 1; - } else { -+ /* -+ * Continuing after completed migration. Images have been -+ * inactivated to allow the destination to take control. Need to -+ * get control back now. -+ * -+ * If there are no inactive block nodes (e.g. because the VM was -+ * just paused rather than completing a migration), -+ * bdrv_inactivate_all() simply doesn't do anything. -+ */ -+ bdrv_activate_all(&local_err); -+ if (local_err) { -+ error_propagate(errp, local_err); -+ return; -+ } - vm_start(); - } - } --- -2.39.3 - diff --git a/kvm-remove-stale-compat-definitions.patch b/kvm-remove-stale-compat-definitions.patch deleted file mode 100644 index cc1180f..0000000 --- a/kvm-remove-stale-compat-definitions.patch +++ /dev/null @@ -1,425 +0,0 @@ -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/kvm-s390x-Add-individual-loadparm-assignment-to-CCW-devi.patch b/kvm-s390x-Add-individual-loadparm-assignment-to-CCW-devi.patch deleted file mode 100644 index b14ddcd..0000000 --- a/kvm-s390x-Add-individual-loadparm-assignment-to-CCW-devi.patch +++ /dev/null @@ -1,362 +0,0 @@ -From 2cbfea2082fdb4b6687b1ee7ad31826dcae6e5ca Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:48 -0400 -Subject: [PATCH 16/38] s390x: Add individual loadparm assignment to CCW device -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [15/23] fe8aa289e564c45e589c9ecb131af60d4d914919 (thuth/qemu-kvm-cs9) - -Add a loadparm property to the VirtioCcwDevice object so that different -loadparms can be defined on a per-device basis for CCW boot devices. - -The machine/global loadparm is still supported. If both a global and per-device -loadparm are defined, the per-device value will override the global value for -that device, but any other devices that do not specify a per-device loadparm -will still use the global loadparm. - -It is invalid to assign a loadparm to a non-boot device. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-15-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit bb185de42339025db9bbd5aa11f3f644c2a077f8) ---- - hw/s390x/ccw-device.c | 46 +++++++++++++++++++++++++ - hw/s390x/ccw-device.h | 2 ++ - hw/s390x/ipl.c | 68 ++++++++++++++++++++++--------------- - hw/s390x/ipl.h | 3 +- - hw/s390x/s390-virtio-ccw.c | 18 +--------- - hw/s390x/sclp.c | 9 ++--- - include/hw/s390x/ipl/qipl.h | 1 + - pc-bios/s390-ccw/main.c | 10 ++++-- - 8 files changed, 102 insertions(+), 55 deletions(-) - -diff --git a/hw/s390x/ccw-device.c b/hw/s390x/ccw-device.c -index a7d682e5af..4e54f34b1c 100644 ---- a/hw/s390x/ccw-device.c -+++ b/hw/s390x/ccw-device.c -@@ -13,6 +13,10 @@ - #include "ccw-device.h" - #include "hw/qdev-properties.h" - #include "qemu/module.h" -+#include "ipl.h" -+#include "qapi/visitor.h" -+#include "qemu/ctype.h" -+#include "qapi/error.h" - - static void ccw_device_refill_ids(CcwDevice *dev) - { -@@ -37,10 +41,52 @@ static bool ccw_device_realize(CcwDevice *dev, Error **errp) - return true; - } - -+static void ccw_device_get_loadparm(Object *obj, Visitor *v, -+ const char *name, void *opaque, -+ Error **errp) -+{ -+ CcwDevice *dev = CCW_DEVICE(obj); -+ char *str = g_strndup((char *) dev->loadparm, sizeof(dev->loadparm)); -+ -+ visit_type_str(v, name, &str, errp); -+ g_free(str); -+} -+ -+static void ccw_device_set_loadparm(Object *obj, Visitor *v, -+ const char *name, void *opaque, -+ Error **errp) -+{ -+ CcwDevice *dev = CCW_DEVICE(obj); -+ char *val; -+ int index; -+ -+ index = object_property_get_int(obj, "bootindex", NULL); -+ -+ if (index < 0) { -+ error_setg(errp, "LOADPARM is only valid for boot devices!"); -+ } -+ -+ if (!visit_type_str(v, name, &val, errp)) { -+ return; -+ } -+ -+ s390_ipl_fmt_loadparm(dev->loadparm, val, errp); -+} -+ -+static const PropertyInfo ccw_loadparm = { -+ .name = "ccw_loadparm", -+ .description = "Up to 8 chars in set of [A-Za-z0-9. ] to pass" -+ " to the guest loader/kernel", -+ .get = ccw_device_get_loadparm, -+ .set = ccw_device_set_loadparm, -+}; -+ - static Property ccw_device_properties[] = { - DEFINE_PROP_CSS_DEV_ID("devno", CcwDevice, devno), - DEFINE_PROP_CSS_DEV_ID_RO("dev_id", CcwDevice, dev_id), - DEFINE_PROP_CSS_DEV_ID_RO("subch_id", CcwDevice, subch_id), -+ DEFINE_PROP("loadparm", CcwDevice, loadparm, ccw_loadparm, -+ typeof(uint8_t[8])), - DEFINE_PROP_END_OF_LIST(), - }; - -diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h -index 5feeb0ee7a..1e1737c0f3 100644 ---- a/hw/s390x/ccw-device.h -+++ b/hw/s390x/ccw-device.h -@@ -26,6 +26,8 @@ struct CcwDevice { - CssDevId dev_id; - /* The actual busid of the virtual subchannel. */ - CssDevId subch_id; -+ /* If set, use this loadparm value when device is boot target */ -+ uint8_t loadparm[8]; - }; - typedef struct CcwDevice CcwDevice; - -diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c -index 8a0a3e6961..d83832d975 100644 ---- a/hw/s390x/ipl.c -+++ b/hw/s390x/ipl.c -@@ -34,6 +34,7 @@ - #include "qemu/config-file.h" - #include "qemu/cutils.h" - #include "qemu/option.h" -+#include "qemu/ctype.h" - #include "standard-headers/linux/virtio_ids.h" - - #define KERN_IMAGE_START 0x010000UL -@@ -397,12 +398,43 @@ static CcwDevice *s390_get_ccw_device(DeviceState *dev_st, int *devtype) - return ccw_dev; - } - -+void s390_ipl_fmt_loadparm(uint8_t *loadparm, char *str, Error **errp) -+{ -+ int i; -+ -+ /* Initialize the loadparm with spaces */ -+ memset(loadparm, ' ', LOADPARM_LEN); -+ for (i = 0; i < LOADPARM_LEN && str[i]; i++) { -+ uint8_t c = qemu_toupper(str[i]); /* mimic HMC */ -+ -+ if (qemu_isalnum(c) || c == '.' || c == ' ') { -+ loadparm[i] = c; -+ } else { -+ error_setg(errp, "LOADPARM: invalid character '%c' (ASCII 0x%02x)", -+ c, c); -+ return; -+ } -+ } -+} -+ -+void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t *ebcdic_lp) -+{ -+ int i; -+ -+ /* Initialize the loadparm with EBCDIC spaces (0x40) */ -+ memset(ebcdic_lp, '@', LOADPARM_LEN); -+ for (i = 0; i < LOADPARM_LEN && ascii_lp[i]; i++) { -+ ebcdic_lp[i] = ascii2ebcdic[(uint8_t) ascii_lp[i]]; -+ } -+} -+ - static bool s390_gen_initial_iplb(S390IPLState *ipl) - { - DeviceState *dev_st; - CcwDevice *ccw_dev = NULL; - SCSIDevice *sd; - int devtype; -+ uint8_t *lp; - - dev_st = get_boot_device(0); - if (dev_st) { -@@ -413,6 +445,8 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) - * Currently allow IPL only from CCW devices. - */ - if (ccw_dev) { -+ lp = ccw_dev->loadparm; -+ - switch (devtype) { - case CCW_DEVTYPE_SCSI: - sd = SCSI_DEVICE(dev_st); -@@ -445,40 +479,20 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl) - break; - } - -- if (!s390_ipl_set_loadparm(ipl->iplb.loadparm)) { -- ipl->iplb.flags |= DIAG308_FLAGS_LP_VALID; -+ /* If the device loadparm is empty use the global machine loadparm */ -+ if (memcmp(lp, NO_LOADPARM, 8) == 0) { -+ lp = S390_CCW_MACHINE(qdev_get_machine())->loadparm; - } - -+ s390_ipl_convert_loadparm((char *)lp, ipl->iplb.loadparm); -+ ipl->iplb.flags |= DIAG308_FLAGS_LP_VALID; -+ - return true; - } - - return false; - } - --int s390_ipl_set_loadparm(uint8_t *loadparm) --{ -- MachineState *machine = MACHINE(qdev_get_machine()); -- char *lp = object_property_get_str(OBJECT(machine), "loadparm", NULL); -- -- if (lp) { -- int i; -- -- /* lp is an uppercase string without leading/embedded spaces */ -- for (i = 0; i < 8 && lp[i]; i++) { -- loadparm[i] = ascii2ebcdic[(uint8_t) lp[i]]; -- } -- -- if (i < 8) { -- memset(loadparm + i, 0x40, 8 - i); /* fill with EBCDIC spaces */ -- } -- -- g_free(lp); -- return 0; -- } -- -- return -1; --} -- - static bool is_virtio_ccw_device_of_type(IplParameterBlock *iplb, - int virtio_id) - { -@@ -534,7 +548,7 @@ static void update_machine_ipl_properties(IplParameterBlock *iplb) - ascii_loadparm[i] = 0; - object_property_set_str(machine, "loadparm", ascii_loadparm, &err); - } else { -- object_property_set_str(machine, "loadparm", "", &err); -+ object_property_set_str(machine, "loadparm", " ", &err); - } - if (err) { - warn_report_err(err); -diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h -index fa394c339d..b670bad551 100644 ---- a/hw/s390x/ipl.h -+++ b/hw/s390x/ipl.h -@@ -21,7 +21,8 @@ - - #define DIAG308_FLAGS_LP_VALID 0x80 - --int s390_ipl_set_loadparm(uint8_t *loadparm); -+void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t *ebcdic_lp); -+void s390_ipl_fmt_loadparm(uint8_t *loadparm, char *str, Error **errp); - void s390_ipl_update_diag308(IplParameterBlock *iplb); - int s390_ipl_prepare_pv_header(Error **errp); - int s390_ipl_pv_unpack(void); -diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c -index 29a89a0c31..0347dc69ca 100644 ---- a/hw/s390x/s390-virtio-ccw.c -+++ b/hw/s390x/s390-virtio-ccw.c -@@ -724,28 +724,12 @@ static void machine_set_loadparm(Object *obj, Visitor *v, - { - S390CcwMachineState *ms = S390_CCW_MACHINE(obj); - char *val; -- int i; - - if (!visit_type_str(v, name, &val, errp)) { - return; - } - -- for (i = 0; i < sizeof(ms->loadparm) && val[i]; i++) { -- uint8_t c = qemu_toupper(val[i]); /* mimic HMC */ -- -- if (('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || (c == '.') || -- (c == ' ')) { -- ms->loadparm[i] = c; -- } else { -- error_setg(errp, "LOADPARM: invalid character '%c' (ASCII 0x%02x)", -- c, c); -- return; -- } -- } -- -- for (; i < sizeof(ms->loadparm); i++) { -- ms->loadparm[i] = ' '; /* pad right with spaces */ -- } -+ s390_ipl_fmt_loadparm(ms->loadparm, val, errp); - } - - static void ccw_machine_class_init(ObjectClass *oc, void *data) -diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c -index e725dcd5fd..8757626b5c 100644 ---- a/hw/s390x/sclp.c -+++ b/hw/s390x/sclp.c -@@ -110,7 +110,6 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) - MachineState *machine = MACHINE(qdev_get_machine()); - int cpu_count; - int rnsize, rnmax; -- IplParameterBlock *ipib = s390_ipl_get_iplb(); - int required_len = SCCB_REQ_LEN(ReadInfo, machine->possible_cpus->len); - int offset_cpu = s390_has_feat(S390_FEAT_EXTENDED_LENGTH_SCCB) ? - offsetof(ReadInfo, entries) : -@@ -171,12 +170,8 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) - read_info->rnmax2 = cpu_to_be64(rnmax); - } - -- if (ipib && ipib->flags & DIAG308_FLAGS_LP_VALID) { -- memcpy(&read_info->loadparm, &ipib->loadparm, -- sizeof(read_info->loadparm)); -- } else { -- s390_ipl_set_loadparm(read_info->loadparm); -- } -+ s390_ipl_convert_loadparm((char *)S390_CCW_MACHINE(machine)->loadparm, -+ read_info->loadparm); - - sccb->h.response_code = cpu_to_be16(SCLP_RC_NORMAL_READ_COMPLETION); - } -diff --git a/include/hw/s390x/ipl/qipl.h b/include/hw/s390x/ipl/qipl.h -index 0ef04af027..b67d2ae061 100644 ---- a/include/hw/s390x/ipl/qipl.h -+++ b/include/hw/s390x/ipl/qipl.h -@@ -18,6 +18,7 @@ - - #define QIPL_ADDRESS 0xcc - #define LOADPARM_LEN 8 -+#define NO_LOADPARM "\0\0\0\0\0\0\0\0" - - /* - * The QEMU IPL Parameters will be stored at absolute address -diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c -index 34ef27d7a6..ab4709e16e 100644 ---- a/pc-bios/s390-ccw/main.c -+++ b/pc-bios/s390-ccw/main.c -@@ -183,8 +183,14 @@ static void css_setup(void) - static void boot_setup(void) - { - char lpmsg[] = "LOADPARM=[________]\n"; -+ have_iplb = store_iplb(&iplb); -+ -+ if (memcmp(iplb.loadparm, NO_LOADPARM, LOADPARM_LEN) != 0) { -+ ebcdic_to_ascii((char *) iplb.loadparm, loadparm_str, LOADPARM_LEN); -+ } else { -+ sclp_get_loadparm_ascii(loadparm_str); -+ } - -- sclp_get_loadparm_ascii(loadparm_str); - memcpy(lpmsg + 10, loadparm_str, 8); - puts(lpmsg); - -@@ -193,8 +199,6 @@ static void boot_setup(void) - * so we don't taint our decision-making process during a reboot. - */ - memset((char *)S390EP, 0, 6); -- -- have_iplb = store_iplb(&iplb); - } - - static bool find_boot_device(void) --- -2.39.3 - diff --git a/kvm-s390x-Rebuild-IPLB-for-SCSI-device-directly-from-DIA.patch b/kvm-s390x-Rebuild-IPLB-for-SCSI-device-directly-from-DIA.patch deleted file mode 100644 index 11fa6c5..0000000 --- a/kvm-s390x-Rebuild-IPLB-for-SCSI-device-directly-from-DIA.patch +++ /dev/null @@ -1,264 +0,0 @@ -From ad587091d8716dbc118776b8edb61db12f6da122 Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:50 -0400 -Subject: [PATCH 18/38] s390x: Rebuild IPLB for SCSI device directly from - DIAG308 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [17/23] 8267b7ecd71f2af5409e2e41890b6e5bb56fabd2 (thuth/qemu-kvm-cs9) - -Because virtio-scsi type devices use a non-architected IPLB pbt code they cannot -be set and stored normally. Instead, the IPLB must be rebuilt during re-ipl. - -As s390x does not natively support multiple boot devices, the devno field is -used to store the position in the boot order for the device. - -Handling the rebuild as part of DIAG308 removes the need to check the devices -for invalid IPLBs later in the IPL. - -Signed-off-by: Jared Rossi -Acked-by: Thomas Huth -Message-ID: <20241020012953.1380075-17-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 455e3bc3f74ee76964efec2e0c646db15095d0d2) ---- - hw/s390x/ipl.c | 74 ++++++------------------------------- - hw/s390x/ipl.h | 11 ++++-- - include/hw/s390x/ipl/qipl.h | 3 +- - pc-bios/s390-ccw/jump2ipl.c | 11 ++++-- - target/s390x/diag.c | 9 ++++- - 5 files changed, 38 insertions(+), 70 deletions(-) - -diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c -index f4576f8822..5fbd43c346 100644 ---- a/hw/s390x/ipl.c -+++ b/hw/s390x/ipl.c -@@ -448,7 +448,6 @@ void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t *ebcdic_lp) - - static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) - { -- S390IPLState *ipl = get_ipl_device(); - CcwDevice *ccw_dev = NULL; - SCSIDevice *sd; - int devtype; -@@ -481,9 +480,6 @@ static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) - iplb->ccw.ssid = ccw_dev->sch->ssid & 3; - break; - case CCW_DEVTYPE_VIRTIO_NET: -- /* The S390IPLState netboot is true if ANY IPLB may use netboot */ -- ipl->netboot = true; -- /* Fall through to CCW_DEVTYPE_VIRTIO case */ - case CCW_DEVTYPE_VIRTIO: - iplb->len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN); - iplb->blk0_len = -@@ -508,6 +504,16 @@ static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) - return false; - } - -+void s390_rebuild_iplb(uint16_t dev_index, IplParameterBlock *iplb) -+{ -+ S390IPLState *ipl = get_ipl_device(); -+ uint16_t index; -+ index = ipl->rebuilt_iplb ? ipl->iplb_index : dev_index; -+ -+ ipl->rebuilt_iplb = s390_build_iplb(get_boot_device(index), iplb); -+ ipl->iplb_index = index; -+} -+ - static bool s390_init_all_iplbs(S390IPLState *ipl) - { - int iplb_num = 0; -@@ -564,44 +570,6 @@ static bool s390_init_all_iplbs(S390IPLState *ipl) - return iplb_num; - } - --static bool is_virtio_ccw_device_of_type(IplParameterBlock *iplb, -- int virtio_id) --{ -- uint8_t cssid; -- uint8_t ssid; -- uint16_t devno; -- uint16_t schid; -- SubchDev *sch = NULL; -- -- if (iplb->pbt != S390_IPL_TYPE_CCW) { -- return false; -- } -- -- devno = be16_to_cpu(iplb->ccw.devno); -- ssid = iplb->ccw.ssid & 3; -- -- for (schid = 0; schid < MAX_SCHID; schid++) { -- for (cssid = 0; cssid < MAX_CSSID; cssid++) { -- sch = css_find_subch(1, cssid, ssid, schid); -- -- if (sch && sch->devno == devno) { -- return sch->id.cu_model == virtio_id; -- } -- } -- } -- return false; --} -- --static bool is_virtio_net_device(IplParameterBlock *iplb) --{ -- return is_virtio_ccw_device_of_type(iplb, VIRTIO_ID_NET); --} -- --static bool is_virtio_scsi_device(IplParameterBlock *iplb) --{ -- return is_virtio_ccw_device_of_type(iplb, VIRTIO_ID_SCSI); --} -- - static void update_machine_ipl_properties(IplParameterBlock *iplb) - { - Object *machine = qdev_get_machine(); -@@ -641,7 +609,7 @@ void s390_ipl_update_diag308(IplParameterBlock *iplb) - ipl->iplb = *iplb; - ipl->iplb_valid = true; - } -- ipl->netboot = is_virtio_net_device(iplb); -+ - update_machine_ipl_properties(iplb); - } - -@@ -668,32 +636,14 @@ IplParameterBlock *s390_ipl_get_iplb(void) - void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type) - { - S390IPLState *ipl = get_ipl_device(); -- - if (reset_type == S390_RESET_EXTERNAL || reset_type == S390_RESET_REIPL) { - /* use CPU 0 for full resets */ - ipl->reset_cpu_index = 0; - } else { - ipl->reset_cpu_index = cs->cpu_index; - } -- ipl->reset_type = reset_type; - -- if (reset_type == S390_RESET_REIPL && -- ipl->iplb_valid && -- !ipl->netboot && -- ipl->iplb.pbt == S390_IPL_TYPE_CCW && -- is_virtio_scsi_device(&ipl->iplb)) { -- CcwDevice *ccw_dev = s390_get_ccw_device(get_boot_device(0), NULL); -- -- if (ccw_dev && -- cpu_to_be16(ccw_dev->sch->devno) == ipl->iplb.ccw.devno && -- (ccw_dev->sch->ssid & 3) == ipl->iplb.ccw.ssid) { -- /* -- * this is the original boot device's SCSI -- * so restore IPL parameter info from it -- */ -- ipl->iplb_valid = s390_build_iplb(get_boot_device(0), &ipl->iplb); -- } -- } -+ ipl->reset_type = reset_type; - if (reset_type == S390_RESET_MODIFIED_CLEAR || - reset_type == S390_RESET_LOAD_NORMAL || - reset_type == S390_RESET_PV) { -diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h -index 54eb48fd6e..d7d0b7bfd2 100644 ---- a/hw/s390x/ipl.h -+++ b/hw/s390x/ipl.h -@@ -24,6 +24,7 @@ - - void s390_ipl_convert_loadparm(char *ascii_lp, uint8_t *ebcdic_lp); - void s390_ipl_fmt_loadparm(uint8_t *loadparm, char *str, Error **errp); -+void s390_rebuild_iplb(uint16_t index, IplParameterBlock *iplb); - void s390_ipl_update_diag308(IplParameterBlock *iplb); - int s390_ipl_prepare_pv_header(Error **errp); - int s390_ipl_pv_unpack(void); -@@ -65,7 +66,8 @@ struct S390IPLState { - bool enforce_bios; - bool iplb_valid; - bool iplb_valid_pv; -- bool netboot; -+ bool rebuilt_iplb; -+ uint16_t iplb_index; - /* reset related properties don't have to be migrated or reset */ - enum s390_reset reset_type; - int reset_cpu_index; -@@ -172,11 +174,14 @@ static inline bool iplb_valid_pv(IplParameterBlock *iplb) - - static inline bool iplb_valid(IplParameterBlock *iplb) - { -+ uint32_t len = be32_to_cpu(iplb->len); -+ - switch (iplb->pbt) { - case S390_IPL_TYPE_FCP: -- return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_FCP_LEN; -+ return len >= S390_IPLB_MIN_FCP_LEN; - case S390_IPL_TYPE_CCW: -- return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_CCW_LEN; -+ return len >= S390_IPLB_MIN_CCW_LEN; -+ case S390_IPL_TYPE_QEMU_SCSI: - default: - return false; - } -diff --git a/include/hw/s390x/ipl/qipl.h b/include/hw/s390x/ipl/qipl.h -index 1da4f75aa8..6824391111 100644 ---- a/include/hw/s390x/ipl/qipl.h -+++ b/include/hw/s390x/ipl/qipl.h -@@ -29,7 +29,8 @@ - */ - struct QemuIplParameters { - uint8_t qipl_flags; -- uint8_t reserved1[3]; -+ uint8_t index; -+ uint8_t reserved1[2]; - uint64_t reserved2; - uint32_t boot_menu_timeout; - uint8_t reserved3[2]; -diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c -index 8db1764ff3..99d18947d1 100644 ---- a/pc-bios/s390-ccw/jump2ipl.c -+++ b/pc-bios/s390-ccw/jump2ipl.c -@@ -39,10 +39,15 @@ int jump_to_IPL_code(uint64_t address) - write_subsystem_identification(); - write_iplb_location(); - -- /* prevent unknown IPL types in the guest */ -+ /* -+ * The IPLB for QEMU SCSI type devices must be rebuilt during re-ipl. The -+ * iplb.devno is set to the boot position of the target SCSI device. -+ */ - if (iplb.pbt == S390_IPL_TYPE_QEMU_SCSI) { -- iplb.pbt = S390_IPL_TYPE_CCW; -- set_iplb(&iplb); -+ iplb.devno = qipl.index; -+ if (!set_iplb(&iplb)) { -+ panic("Failed to set IPLB"); -+ } - } - - /* -diff --git a/target/s390x/diag.c b/target/s390x/diag.c -index 27ffd48576..a1fd54ddac 100644 ---- a/target/s390x/diag.c -+++ b/target/s390x/diag.c -@@ -133,7 +133,14 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3, uintptr_t ra) - - valid = subcode == DIAG308_PV_SET ? iplb_valid_pv(iplb) : iplb_valid(iplb); - if (!valid) { -- env->regs[r1 + 1] = DIAG_308_RC_INVALID; -+ if (subcode == DIAG308_SET && iplb->pbt == S390_IPL_TYPE_QEMU_SCSI) { -+ s390_rebuild_iplb(iplb->devno, iplb); -+ s390_ipl_update_diag308(iplb); -+ env->regs[r1 + 1] = DIAG_308_RC_OK; -+ } else { -+ env->regs[r1 + 1] = DIAG_308_RC_INVALID; -+ } -+ - goto out; - } - --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-Add-PLO-extension-facility.patch b/kvm-s390x-cpumodel-Add-PLO-extension-facility.patch deleted file mode 100644 index 1134828..0000000 --- a/kvm-s390x-cpumodel-Add-PLO-extension-facility.patch +++ /dev/null @@ -1,221 +0,0 @@ -From e4bdbc368426bc9aeb6dbfeeb2de46de1256861d Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:50 +0100 -Subject: [PATCH 15/18] s390x/cpumodel: Add PLO-extension facility -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [15/16] 6e8bb7b1f0e8c84ba0c3cd7e7714d22642402513 (thuth/qemu-kvm-cs9) - -The PLO-extension facility introduces numerous locking related -subfunctions. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Janosch Frank -Message-ID: <20241206122751.189721-15-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 393c835e341e8921d1d6ae45da308e85176c4f00) ---- - target/s390x/cpu_features.c | 1 + - target/s390x/cpu_features_def.h.inc | 39 +++++++++++++++++++++++++ - target/s390x/cpu_models.c | 38 ++++++++++++++++++++++++ - target/s390x/gen-features.c | 45 +++++++++++++++++++++++++++++ - 4 files changed, 123 insertions(+) - -diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c -index 5f8b02f12c..4b5be6798e 100644 ---- a/target/s390x/cpu_features.c -+++ b/target/s390x/cpu_features.c -@@ -240,6 +240,7 @@ void s390_get_deprecated_features(S390FeatBitmap features) - /* indexed by feature group number for easy lookup */ - static S390FeatGroupDef s390_feature_groups[] = { - FEAT_GROUP_INIT("plo", PLO, "Perform-locked-operation facility"), -+ FEAT_GROUP_INIT("plo_ext", PLO_EXT, "PLO-extension facility"), - FEAT_GROUP_INIT("tods", TOD_CLOCK_STEERING, "Tod-clock-steering facility"), - FEAT_GROUP_INIT("gen13ptff", GEN13_PTFF, "PTFF enhancements introduced with z13"), - FEAT_GROUP_INIT("gen17ptff", GEN17_PTFF, "PTFF enhancements introduced with gen17"), -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index fe7e1bd19c..e23e603a79 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -93,6 +93,7 @@ DEF_FEAT(BPB, "bpb", STFL, 82, "Branch prediction blocking") - DEF_FEAT(MISC_INSTRUCTION_EXT4, "minste4", STFL, 84, "Miscellaneous-Instruction-Extensions Facility 4") - DEF_FEAT(SIF, "sif", STFL, 85, "Sequential-instruction-fetching facility") - DEF_FEAT(MSA_EXT_12, "msa12-base", STFL, 86, "Message-security-assist-extension-12 facility (excluding subfunctions)") -+DEF_FEAT(PLO_EXT, "plo-ext", STFL, 87, "PLO-extension facility") - DEF_FEAT(VECTOR, "vx", STFL, 129, "Vector facility") - DEF_FEAT(INSTRUCTION_EXEC_PROT, "iep", STFL, 130, "Instruction-execution-protection facility") - DEF_FEAT(SIDE_EFFECT_ACCESS_ESOP2, "sea_esop2", STFL, 131, "Side-effect-access facility and Enhanced-suppression-on-protection facility 2") -@@ -180,6 +181,44 @@ DEF_FEAT(PLO_CSTST, "plo-cstst", PLO, 20, "PLO Compare and swap and triple store - DEF_FEAT(PLO_CSTSTG, "plo-cststg", PLO, 21, "PLO Compare and swap and triple store (64 bit in parameter list)") - DEF_FEAT(PLO_CSTSTGR, "plo-cststgr", PLO, 22, "PLO Compare and swap and triple store (64 bit in general registers)") - DEF_FEAT(PLO_CSTSTX, "plo-cststx", PLO, 23, "PLO Compare and swap and triple store (128 bit in parameter list)") -+DEF_FEAT(PLO_CLO, "plo-clo", PLO, 24, "PLO Compare and load (256 bit in parameter list)") -+DEF_FEAT(PLO_CSO, "plo-cso", PLO, 25, "PLO Compare and swap (256 bit in parameter list)") -+DEF_FEAT(PLO_DCSO, "plo-dcso", PLO, 26, "PLO Double compare and swap (256 bit in parameter list)") -+DEF_FEAT(PLO_CSSTO, "plo-cssto", PLO, 27, "PLO Compare and swap and store (256 bit in parameter list)") -+DEF_FEAT(PLO_CSDSTO, "plo-csdsto", PLO, 28, "PLO Compare and swap and double store (256 bit in parameter list)") -+DEF_FEAT(PLO_CSTSTO, "plo-cststo", PLO, 29, "PLO Compare and swap and trible store (256 bit in parameter list)") -+DEF_FEAT(PLO_TCS, "plo-tcs", PLO, 30, "Triple compare and swap (32 bit in parameter list)") -+DEF_FEAT(PLO_TCSG, "plo-tcsg", PLO, 31, "Triple compare and swap (64 bit in parameter list)") -+DEF_FEAT(PLO_TCSX, "plo-tcsx", PLO, 32, "Triple compare and swap (128 bit in parameter list)") -+DEF_FEAT(PLO_TCSO, "plo-tcso", PLO, 33, "Triple compare and swap (256 bit in parameter list)") -+DEF_FEAT(PLO_QCS, "plo-qcs", PLO, 34, "Quadruple compare and swap (32 bit in parameter list)") -+DEF_FEAT(PLO_QCSG, "plo-qcsg", PLO, 35, "Quadruple compare and swap (64 bit in parameter list)") -+DEF_FEAT(PLO_QCSX, "plo-qcsx", PLO, 36, "Quadruple compare and swap (128 bit in parameter list)") -+DEF_FEAT(PLO_QCSO, "plo-qcso", PLO, 37, "Quadruple compare and swap (256 bit in parameter list)") -+DEF_FEAT(PLO_LO, "plo-lo", PLO, 38, "Load (256 bit in parameter list)") -+DEF_FEAT(PLO_DLX, "plo-dlx", PLO, 39, "Double load (128 bit in parameter list)") -+DEF_FEAT(PLO_DLO, "plo-dlo", PLO, 40, "Double load (256 bit in parameter list)") -+DEF_FEAT(PLO_TL, "plo-tl", PLO, 41, "Triple load (32 bit in parameter list)") -+DEF_FEAT(PLO_TLG, "plo-tlg", PLO, 42, "Triple load (64 bit in parameter list)") -+DEF_FEAT(PLO_TLX, "plo-tlx", PLO, 43, "Triple load (128 bit in parameter list)") -+DEF_FEAT(PLO_TLO, "plo-tlo", PLO, 44, "Triple load (256 bit in parameter list)") -+DEF_FEAT(PLO_QL, "plo-ql", PLO, 45, "Quadruple load (32 bit in parameter list)") -+DEF_FEAT(PLO_QLG, "plo-qlg", PLO, 46, "Quadruple load (64 bit in parameter list)") -+DEF_FEAT(PLO_QLX, "plo-qlx", PLO, 47, "Quadruple load (128 bit in parameter list)") -+DEF_FEAT(PLO_QLO, "plo-qlo", PLO, 48, "Quadruple load (256 bit in parameter list)") -+DEF_FEAT(PLO_STO, "plo-sto", PLO, 49, "Store (256 bit in parameter list)") -+DEF_FEAT(PLO_DST, "plo-dst", PLO, 50, "Double store (32 bit in parameter list)") -+DEF_FEAT(PLO_DSTG, "plo-dstg", PLO, 51, "Double store (64 bit in parameter list)") -+DEF_FEAT(PLO_DSTX, "plo-dstx", PLO, 52, "Double store (128 bit in parameter list)") -+DEF_FEAT(PLO_DSTO, "plo-dsto", PLO, 53, "Double store (256 bit in parameter list)") -+DEF_FEAT(PLO_TST, "plo-tst", PLO, 54, "Triple store (32 bit in parameter list)") -+DEF_FEAT(PLO_TSTG, "plo-tstg", PLO, 55, "Triple store (64 bit in parameter list)") -+DEF_FEAT(PLO_TSTX, "plo-tstx", PLO, 56, "Triple store (128 bit in parameter list)") -+DEF_FEAT(PLO_TSTO, "plo-tsto", PLO, 57, "Triple store (256 bit in parameter list)") -+DEF_FEAT(PLO_QST, "plo-qst", PLO, 58, "Quadruple store (32 bit in parameter list)") -+DEF_FEAT(PLO_QSTG, "plo-qstg", PLO, 59, "Quadruple store (64 bit in parameter list)") -+DEF_FEAT(PLO_QSTX, "plo-qstx", PLO, 60, "Quadruple store (128 bit in parameter list)") -+DEF_FEAT(PLO_QSTO, "plo-qsto", PLO, 61, "Quadruple store (256 bit in parameter list)") - - /* Features exposed via the PTFF instruction. */ - DEF_FEAT(PTFF_QTO, "ptff-qto", PTFF, 1, "PTFF Query TOD Offset") -diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c -index 9e9f6dae07..3fb5b0980e 100644 ---- a/target/s390x/cpu_models.c -+++ b/target/s390x/cpu_models.c -@@ -516,6 +516,44 @@ static void check_consistency(const S390CPUModel *model) - { S390_FEAT_PFCR_CSTST, S390_FEAT_CCF_BASE }, - { S390_FEAT_PFCR_CSTSTG, S390_FEAT_CCF_BASE }, - { S390_FEAT_INEFF_NC_TX, S390_FEAT_TRANSACTIONAL_EXE }, -+ { S390_FEAT_PLO_CLO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_CSO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_DCSO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_CSSTO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_CSDSTO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_CSTSTO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TCS, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TCSG, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TCSX, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TCSO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QCS, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QCSG, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QCSX, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QCSO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_LO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_DLX, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_DLO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TL, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TLG, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TLX, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TLO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QL, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QLG, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QLX, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QLO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_STO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_DST, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_DSTG, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_DSTX, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_DSTO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TST, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TSTG, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TSTX, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_TSTO, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QST, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QSTG, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QSTX, S390_FEAT_PLO_EXT }, -+ { S390_FEAT_PLO_QSTO, S390_FEAT_PLO_EXT }, - }; - int i; - -diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c -index 6d00ffcda7..680d45d303 100644 ---- a/target/s390x/gen-features.c -+++ b/target/s390x/gen-features.c -@@ -46,6 +46,47 @@ - S390_FEAT_PLO_CSTSTGR, \ - S390_FEAT_PLO_CSTSTX - -+#define S390_FEAT_GROUP_PLO_EXT \ -+ S390_FEAT_PLO_EXT, \ -+ S390_FEAT_PLO_CLO, \ -+ S390_FEAT_PLO_CSO, \ -+ S390_FEAT_PLO_DCSO, \ -+ S390_FEAT_PLO_CSSTO, \ -+ S390_FEAT_PLO_CSDSTO, \ -+ S390_FEAT_PLO_CSTSTO, \ -+ S390_FEAT_PLO_TCS, \ -+ S390_FEAT_PLO_TCSG, \ -+ S390_FEAT_PLO_TCSX, \ -+ S390_FEAT_PLO_TCSO, \ -+ S390_FEAT_PLO_QCS, \ -+ S390_FEAT_PLO_QCSG, \ -+ S390_FEAT_PLO_QCSX, \ -+ S390_FEAT_PLO_QCSO, \ -+ S390_FEAT_PLO_LO, \ -+ S390_FEAT_PLO_DLX, \ -+ S390_FEAT_PLO_DLO, \ -+ S390_FEAT_PLO_TL, \ -+ S390_FEAT_PLO_TLG, \ -+ S390_FEAT_PLO_TLX, \ -+ S390_FEAT_PLO_TLO, \ -+ S390_FEAT_PLO_QL, \ -+ S390_FEAT_PLO_QLG, \ -+ S390_FEAT_PLO_QLX, \ -+ S390_FEAT_PLO_QLO, \ -+ S390_FEAT_PLO_STO, \ -+ S390_FEAT_PLO_DST, \ -+ S390_FEAT_PLO_DSTG, \ -+ S390_FEAT_PLO_DSTX, \ -+ S390_FEAT_PLO_DSTO, \ -+ S390_FEAT_PLO_TST, \ -+ S390_FEAT_PLO_TSTG, \ -+ S390_FEAT_PLO_TSTX, \ -+ S390_FEAT_PLO_TSTO, \ -+ S390_FEAT_PLO_QST, \ -+ S390_FEAT_PLO_QSTG, \ -+ S390_FEAT_PLO_QSTX, \ -+ S390_FEAT_PLO_QSTO -+ - #define S390_FEAT_GROUP_TOD_CLOCK_STEERING \ - S390_FEAT_TOD_CLOCK_STEERING, \ - S390_FEAT_PTFF_QTO, \ -@@ -320,6 +361,9 @@ - static uint16_t group_PLO[] = { - S390_FEAT_GROUP_PLO, - }; -+static uint16_t group_PLO_EXT[] = { -+ S390_FEAT_GROUP_PLO_EXT, -+}; - static uint16_t group_TOD_CLOCK_STEERING[] = { - S390_FEAT_GROUP_TOD_CLOCK_STEERING, - }; -@@ -936,6 +980,7 @@ typedef struct { - *******************************/ - static FeatGroupDefSpec FeatGroupDef[] = { - FEAT_GROUP_INITIALIZER(PLO), -+ FEAT_GROUP_INITIALIZER(PLO_EXT), - FEAT_GROUP_INITIALIZER(TOD_CLOCK_STEERING), - FEAT_GROUP_INITIALIZER(GEN13_PTFF), - FEAT_GROUP_INITIALIZER(GEN17_PTFF), --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-Add-Sequential-Instruction-Fetching-f.patch b/kvm-s390x-cpumodel-Add-Sequential-Instruction-Fetching-f.patch deleted file mode 100644 index 05dece7..0000000 --- a/kvm-s390x-cpumodel-Add-Sequential-Instruction-Fetching-f.patch +++ /dev/null @@ -1,43 +0,0 @@ -From dcfaf859fa755f9c75b1e848f1b61b293b500d0d Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:48 +0100 -Subject: [PATCH 13/18] s390x/cpumodel: Add Sequential-Instruction-Fetching - facility -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [13/16] 5f8facceda9ecad3b417ed3da2d360fdd480f6d4 (thuth/qemu-kvm-cs9) - -The sequential instruction fetching facility provides few guarantees, -for example, to avoid stop machine calls on enabling/disabling kprobes. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Janosch Frank -Message-ID: <20241206122751.189721-13-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit a5fa8bee72847406bfc32e15c8e41c0a2a0812e1) ---- - target/s390x/cpu_features_def.h.inc | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index 2c1d1cd98a..09a80844a7 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -91,6 +91,7 @@ DEF_FEAT(DFP_PACKED_CONVERSION, "dfppc", STFL, 80, "Decimal-floating-point packe - DEF_FEAT(PPA15, "ppa15", STFL, 81, "PPA15 is installed") - DEF_FEAT(BPB, "bpb", STFL, 82, "Branch prediction blocking") - DEF_FEAT(MISC_INSTRUCTION_EXT4, "minste4", STFL, 84, "Miscellaneous-Instruction-Extensions Facility 4") -+DEF_FEAT(SIF, "sif", STFL, 85, "Sequential-instruction-fetching facility") - DEF_FEAT(MSA_EXT_12, "msa12-base", STFL, 86, "Message-security-assist-extension-12 facility (excluding subfunctions)") - DEF_FEAT(VECTOR, "vx", STFL, 129, "Vector facility") - DEF_FEAT(INSTRUCTION_EXEC_PROT, "iep", STFL, 130, "Instruction-execution-protection facility") --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-Add-ptff-Query-Time-Stamp-Event-QTSE-.patch b/kvm-s390x-cpumodel-Add-ptff-Query-Time-Stamp-Event-QTSE-.patch deleted file mode 100644 index 9a0c5de..0000000 --- a/kvm-s390x-cpumodel-Add-ptff-Query-Time-Stamp-Event-QTSE-.patch +++ /dev/null @@ -1,90 +0,0 @@ -From d1313d94cb0a2b69b18cf7e7531945cb131c23c2 Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:41 +0100 -Subject: [PATCH 06/18] s390x/cpumodel: Add ptff Query Time-Stamp Event (QTSE) - support -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [6/16] f5642cffc8deb0caf96d59da72e82db435e28205 (thuth/qemu-kvm-cs9) - -Introduce a new PTFF subfunction to query-stamp events. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Janosch Frank -Message-ID: <20241206122751.189721-6-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit eba6f49128fbcf75d19acb6aef250d0664d03e9e) ---- - target/s390x/cpu_features.c | 1 + - target/s390x/cpu_features_def.h.inc | 1 + - target/s390x/gen-features.c | 9 +++++++++ - 3 files changed, 11 insertions(+) - -diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c -index 9ba127e386..385a2ff860 100644 ---- a/target/s390x/cpu_features.c -+++ b/target/s390x/cpu_features.c -@@ -241,6 +241,7 @@ static S390FeatGroupDef s390_feature_groups[] = { - FEAT_GROUP_INIT("plo", PLO, "Perform-locked-operation facility"), - FEAT_GROUP_INIT("tods", TOD_CLOCK_STEERING, "Tod-clock-steering facility"), - FEAT_GROUP_INIT("gen13ptff", GEN13_PTFF, "PTFF enhancements introduced with z13"), -+ FEAT_GROUP_INIT("gen17ptff", GEN17_PTFF, "PTFF enhancements introduced with gen17"), - FEAT_GROUP_INIT("msa", MSA, "Message-security-assist facility"), - FEAT_GROUP_INIT("msa1", MSA_EXT_1, "Message-security-assist-extension 1 facility"), - FEAT_GROUP_INIT("msa2", MSA_EXT_2, "Message-security-assist-extension 2 facility"), -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index 2132837ffe..f96cb5a7d8 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -181,6 +181,7 @@ DEF_FEAT(PTFF_QSI, "ptff-qsi", PTFF, 2, "PTFF Query Steering Information") - DEF_FEAT(PTFF_QPT, "ptff-qpc", PTFF, 3, "PTFF Query Physical Clock") - DEF_FEAT(PTFF_QUI, "ptff-qui", PTFF, 4, "PTFF Query UTC Information") - DEF_FEAT(PTFF_QTOU, "ptff-qtou", PTFF, 5, "PTFF Query TOD Offset User") -+DEF_FEAT(PTFF_QTSE, "ptff-qtse", PTFF, 6, "PTFF Query Time-Stamp Event") - DEF_FEAT(PTFF_QSIE, "ptff-qsie", PTFF, 10, "PTFF Query Steering Information Extended") - DEF_FEAT(PTFF_QTOUE, "ptff-qtoue", PTFF, 13, "PTFF Query TOD Offset User Extended") - DEF_FEAT(PTFF_STO, "ptff-sto", PTFF, 65, "PTFF Set TOD Offset") -diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c -index 3326e7df43..302b653214 100644 ---- a/target/s390x/gen-features.c -+++ b/target/s390x/gen-features.c -@@ -64,6 +64,9 @@ - S390_FEAT_PTFF_STOE, \ - S390_FEAT_PTFF_STOUE - -+#define S390_FEAT_GROUP_GEN17_PTFF \ -+ S390_FEAT_PTFF_QTSE -+ - #define S390_FEAT_GROUP_MSA \ - S390_FEAT_MSA, \ - S390_FEAT_KMAC_DEA, \ -@@ -318,6 +321,11 @@ static uint16_t group_GEN13_PTFF[] = { - static uint16_t group_MULTIPLE_EPOCH_PTFF[] = { - S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF, - }; -+ -+static uint16_t group_GEN17_PTFF[] = { -+ S390_FEAT_GROUP_GEN17_PTFF, -+}; -+ - static uint16_t group_MSA[] = { - S390_FEAT_GROUP_MSA, - }; -@@ -918,6 +926,7 @@ static FeatGroupDefSpec FeatGroupDef[] = { - FEAT_GROUP_INITIALIZER(PLO), - FEAT_GROUP_INITIALIZER(TOD_CLOCK_STEERING), - FEAT_GROUP_INITIALIZER(GEN13_PTFF), -+ FEAT_GROUP_INITIALIZER(GEN17_PTFF), - FEAT_GROUP_INITIALIZER(MSA), - FEAT_GROUP_INITIALIZER(MSA_EXT_1), - FEAT_GROUP_INITIALIZER(MSA_EXT_2), --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-add-Concurrent-functions-facility-sup.patch b/kvm-s390x-cpumodel-add-Concurrent-functions-facility-sup.patch deleted file mode 100644 index bb5c4c5..0000000 --- a/kvm-s390x-cpumodel-add-Concurrent-functions-facility-sup.patch +++ /dev/null @@ -1,169 +0,0 @@ -From 66725d6be2ad779432d3b02a0ad20a415bd37f1f Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:43 +0100 -Subject: [PATCH 08/18] s390x/cpumodel: add Concurrent-functions facility - support -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [8/16] 891c3efec3d7dbce03e01f0fcb61cca9669570eb (thuth/qemu-kvm-cs9) - -The Concurrent-functions facility introduces the new instruction -Perform Functions with Concurrent Results (PFCR) with few subfunctions. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Janosch Frank -Message-ID: <20241206122751.189721-8-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit c9ea365dce32bc114dacd7cfca7c478a82459b47) ---- - target/s390x/cpu_features.c | 2 ++ - target/s390x/cpu_features.h | 1 + - target/s390x/cpu_features_def.h.inc | 8 ++++++++ - target/s390x/cpu_models.c | 5 +++++ - target/s390x/gen-features.c | 13 +++++++++++++ - target/s390x/kvm/kvm.c | 6 ++++++ - 6 files changed, 35 insertions(+) - -diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c -index 385a2ff860..5f8b02f12c 100644 ---- a/target/s390x/cpu_features.c -+++ b/target/s390x/cpu_features.c -@@ -93,6 +93,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type, - case S390_FEAT_TYPE_KDSA: - case S390_FEAT_TYPE_SORTL: - case S390_FEAT_TYPE_DFLTCC: -+ case S390_FEAT_TYPE_PFCR: - set_be_bit(0, data); /* query is always available */ - break; - default: -@@ -263,6 +264,7 @@ static S390FeatGroupDef s390_feature_groups[] = { - FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), - FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), - FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"), -+ FEAT_GROUP_INIT("ccf", CONCURRENT_FUNCTIONS, "Concurrent-functions facility"), - }; - - const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group) -diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h -index 661a8cd6db..5635839d03 100644 ---- a/target/s390x/cpu_features.h -+++ b/target/s390x/cpu_features.h -@@ -44,6 +44,7 @@ typedef enum { - S390_FEAT_TYPE_SORTL, - S390_FEAT_TYPE_DFLTCC, - S390_FEAT_TYPE_UV_FEAT_GUEST, -+ S390_FEAT_TYPE_PFCR, - } S390FeatType; - - /* Definition of a CPU feature */ -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index f96cb5a7d8..09872ab3d8 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -116,6 +116,7 @@ DEF_FEAT(BEAR_ENH, "beareh", STFL, 193, "BEAR-enhancement facility") - DEF_FEAT(RDP, "rdp", STFL, 194, "Reset-DAT-protection facility") - DEF_FEAT(PAI, "pai", STFL, 196, "Processor-Activity-Instrumentation facility") - DEF_FEAT(PAIE, "paie", STFL, 197, "Processor-Activity-Instrumentation extension-1") -+DEF_FEAT(CCF_BASE, "ccf-base", STFL, 201, "Concurrent-Functions facility") - - /* Features exposed via SCLP SCCB Byte 80 - 98 (bit numbers relative to byte-80) */ - DEF_FEAT(SIE_GSLS, "gsls", SCLP_CONF_CHAR, 40, "SIE: Guest-storage-limit-suppression facility") -@@ -413,3 +414,10 @@ DEF_FEAT(DEFLATE_F0, "dfltcc-f0", DFLTCC, 192, "DFLTCC format 0 parameter-block" - /* Features exposed via the UV-CALL instruction */ - DEF_FEAT(UV_FEAT_AP, "appv", UV_FEAT_GUEST, 4, "AP instructions installed for secure guests") - DEF_FEAT(UV_FEAT_AP_INTR, "appvi", UV_FEAT_GUEST, 5, "AP instructions interruption support for secure guests") -+ -+/* Features exposed via the PFCR instruction (concurrent-functions facility). */ -+DEF_FEAT(PFCR_QAF, "pfcr-qaf", PFCR, 0, "PFCR Query-Available-Functions") -+DEF_FEAT(PFCR_CSDST, "pfcr-csdst", PFCR, 1, "PFCR Compare-and-Swap-and-Double-Store (32)") -+DEF_FEAT(PFCR_CSDSTG, "pfcr-csdstg", PFCR, 2, "PFCR Compare-and-Swap-and-Double-Store (64)") -+DEF_FEAT(PFCR_CSTST, "pfcr-cstst", PFCR, 3, "PFCR Compare-and-Swap-and-Triple-Store (32)") -+DEF_FEAT(PFCR_CSTSTG, "pfcr-cststg", PFCR, 4, "PFCR Compare-and-Swap-and-Triple-Store (64)") -diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c -index da441b7b10..cb45911ac0 100644 ---- a/target/s390x/cpu_models.c -+++ b/target/s390x/cpu_models.c -@@ -507,6 +507,11 @@ static void check_consistency(const S390CPUModel *model) - { S390_FEAT_RDP, S390_FEAT_LOCAL_TLB_CLEARING }, - { S390_FEAT_UV_FEAT_AP, S390_FEAT_AP }, - { S390_FEAT_UV_FEAT_AP_INTR, S390_FEAT_UV_FEAT_AP }, -+ { S390_FEAT_PFCR_QAF, S390_FEAT_CCF_BASE }, -+ { S390_FEAT_PFCR_CSDST, S390_FEAT_CCF_BASE }, -+ { S390_FEAT_PFCR_CSDSTG, S390_FEAT_CCF_BASE }, -+ { S390_FEAT_PFCR_CSTST, S390_FEAT_CCF_BASE }, -+ { S390_FEAT_PFCR_CSTSTG, S390_FEAT_CCF_BASE }, - }; - int i; - -diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c -index 302b653214..6d00ffcda7 100644 ---- a/target/s390x/gen-features.c -+++ b/target/s390x/gen-features.c -@@ -308,6 +308,14 @@ - S390_FEAT_DEFLATE_XPND, \ - S390_FEAT_DEFLATE_F0 - -+#define S390_FEAT_GROUP_CONCURRENT_FUNCTIONS \ -+ S390_FEAT_CCF_BASE, \ -+ S390_FEAT_PFCR_QAF, \ -+ S390_FEAT_PFCR_CSDST, \ -+ S390_FEAT_PFCR_CSDSTG, \ -+ S390_FEAT_PFCR_CSTST, \ -+ S390_FEAT_PFCR_CSTSTG -+ - /* cpu feature groups */ - static uint16_t group_PLO[] = { - S390_FEAT_GROUP_PLO, -@@ -398,6 +406,10 @@ static uint16_t group_DEFLATE_CONVERSION[] = { - S390_FEAT_GROUP_DEFLATE_CONVERSION, - }; - -+static uint16_t group_CONCURRENT_FUNCTIONS[] = { -+ S390_FEAT_GROUP_CONCURRENT_FUNCTIONS, -+}; -+ - /* Base features (in order of release) - * Only non-hypervisor managed features belong here. - * Base feature sets are static meaning they do not change in future QEMU -@@ -948,6 +960,7 @@ static FeatGroupDefSpec FeatGroupDef[] = { - FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), - FEAT_GROUP_INITIALIZER(ENH_SORT), - FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION), -+ FEAT_GROUP_INITIALIZER(CONCURRENT_FUNCTIONS), - }; - - #define QEMU_FEAT_INITIALIZER(_name) \ -diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c -index 8ffe0159d8..dd0322c43a 100644 ---- a/target/s390x/kvm/kvm.c -+++ b/target/s390x/kvm/kvm.c -@@ -2195,6 +2195,9 @@ static int query_cpu_subfunc(S390FeatBitmap features) - if (test_bit(S390_FEAT_DEFLATE_BASE, features)) { - s390_add_from_feat_block(features, S390_FEAT_TYPE_DFLTCC, prop.dfltcc); - } -+ if (test_bit(S390_FEAT_CCF_BASE, features)) { -+ s390_add_from_feat_block(features, S390_FEAT_TYPE_PFCR, prop.pfcr); -+ } - return 0; - } - -@@ -2248,6 +2251,9 @@ static int configure_cpu_subfunc(const S390FeatBitmap features) - if (test_bit(S390_FEAT_DEFLATE_BASE, features)) { - s390_fill_feat_block(features, S390_FEAT_TYPE_DFLTCC, prop.dfltcc); - } -+ if (test_bit(S390_FEAT_CCF_BASE, features)) { -+ s390_fill_feat_block(features, S390_FEAT_TYPE_PFCR, prop.pfcr); -+ } - return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr); - } - --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-add-Ineffective-nonconstrained-transa.patch b/kvm-s390x-cpumodel-add-Ineffective-nonconstrained-transa.patch deleted file mode 100644 index 45cacc4..0000000 --- a/kvm-s390x-cpumodel-add-Ineffective-nonconstrained-transa.patch +++ /dev/null @@ -1,56 +0,0 @@ -From e54ca265e81453305c96adce3e521d543ac124a6 Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:47 +0100 -Subject: [PATCH 12/18] s390x/cpumodel: add - Ineffective-nonconstrained-transaction facility -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [12/16] 1a5530bb0a42f5771a46bb21934b77035d26aa54 (thuth/qemu-kvm-cs9) - -This facility indicates reduced support for noncontrained -transactional-execution. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Janosch Frank -Message-ID: <20241206122751.189721-12-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 12417b713c1fffc26c680e99e3429f055eb9af2e) ---- - target/s390x/cpu_features_def.h.inc | 1 + - target/s390x/cpu_models.c | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index df154d145f..2c1d1cd98a 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -112,6 +112,7 @@ DEF_FEAT(MSA_EXT_9, "msa9-base", STFL, 155, "Message-security-assist-extension-9 - DEF_FEAT(ETOKEN, "etoken", STFL, 156, "Etoken facility") - DEF_FEAT(UNPACK, "unpack", STFL, 161, "Unpack facility") - DEF_FEAT(NNPA, "nnpa", STFL, 165, "NNPA facility") -+DEF_FEAT(INEFF_NC_TX, "ineff_nc_tx", STFL, 170, "Ineffective-nonconstrained-transaction facility") - DEF_FEAT(VECTOR_PACKED_DECIMAL_ENH2, "vxpdeh2", STFL, 192, "Vector-Packed-Decimal-Enhancement facility 2") - DEF_FEAT(BEAR_ENH, "beareh", STFL, 193, "BEAR-enhancement facility") - DEF_FEAT(RDP, "rdp", STFL, 194, "Reset-DAT-protection facility") -diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c -index 94cc6a0f3e..9e9f6dae07 100644 ---- a/target/s390x/cpu_models.c -+++ b/target/s390x/cpu_models.c -@@ -515,6 +515,7 @@ static void check_consistency(const S390CPUModel *model) - { S390_FEAT_PFCR_CSDSTG, S390_FEAT_CCF_BASE }, - { S390_FEAT_PFCR_CSTST, S390_FEAT_CCF_BASE }, - { S390_FEAT_PFCR_CSTSTG, S390_FEAT_CCF_BASE }, -+ { S390_FEAT_INEFF_NC_TX, S390_FEAT_TRANSACTIONAL_EXE }, - }; - int i; - --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-add-Miscellaneous-Instruction-Extensi.patch b/kvm-s390x-cpumodel-add-Miscellaneous-Instruction-Extensi.patch deleted file mode 100644 index 645294c..0000000 --- a/kvm-s390x-cpumodel-add-Miscellaneous-Instruction-Extensi.patch +++ /dev/null @@ -1,42 +0,0 @@ -From f836a70baeebc6cfff87f3b8cf39bc82225cd88f Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:45 +0100 -Subject: [PATCH 10/18] s390x/cpumodel: add - Miscellaneous-Instruction-Extensions Facility 4 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [10/16] 375acf46d9a9950c939e0bf95c6512f6df3b3b3d (thuth/qemu-kvm-cs9) - -This facility introduces few new instructions. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Janosch Frank -Message-ID: <20241206122751.189721-10-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit e68e5ea6fe87c0177ea6421045c1d46f223a861e) ---- - target/s390x/cpu_features_def.h.inc | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index 0b7be0e6e9..8be2e0e46d 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -90,6 +90,7 @@ DEF_FEAT(EDAT_2, "edat2", STFL, 78, "Enhanced-DAT facility 2") - DEF_FEAT(DFP_PACKED_CONVERSION, "dfppc", STFL, 80, "Decimal-floating-point packed-conversion facility") - DEF_FEAT(PPA15, "ppa15", STFL, 81, "PPA15 is installed") - DEF_FEAT(BPB, "bpb", STFL, 82, "Branch prediction blocking") -+DEF_FEAT(MISC_INSTRUCTION_EXT4, "minste4", STFL, 84, "Miscellaneous-Instruction-Extensions Facility 4") - DEF_FEAT(MSA_EXT_12, "msa12-base", STFL, 86, "Message-security-assist-extension-12 facility (excluding subfunctions)") - DEF_FEAT(VECTOR, "vx", STFL, 129, "Vector facility") - DEF_FEAT(INSTRUCTION_EXEC_PROT, "iep", STFL, 130, "Instruction-execution-protection facility") --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-add-Vector-Enhancements-facility-3.patch b/kvm-s390x-cpumodel-add-Vector-Enhancements-facility-3.patch deleted file mode 100644 index fe6327e..0000000 --- a/kvm-s390x-cpumodel-add-Vector-Enhancements-facility-3.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 38d15311c53d6f973ad6bcffe5a851fed58d82cf Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:44 +0100 -Subject: [PATCH 09/18] s390x/cpumodel: add Vector Enhancements facility 3 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [9/16] 0e28c1a3a458b035a165e6d0f6e65290efce4cf0 (thuth/qemu-kvm-cs9) - -The Vector Enhancements facility 3 introduces new instructions and -extends support for doubleword/quadword elements. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Janosch Frank -Message-ID: <20241206122751.189721-9-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 0b2c66a3fa5ccecf26ea011d97d65a986b42b4d8) ---- - target/s390x/cpu_features_def.h.inc | 1 + - target/s390x/cpu_models.c | 2 ++ - 2 files changed, 3 insertions(+) - -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index 09872ab3d8..0b7be0e6e9 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -116,6 +116,7 @@ DEF_FEAT(BEAR_ENH, "beareh", STFL, 193, "BEAR-enhancement facility") - DEF_FEAT(RDP, "rdp", STFL, 194, "Reset-DAT-protection facility") - DEF_FEAT(PAI, "pai", STFL, 196, "Processor-Activity-Instrumentation facility") - DEF_FEAT(PAIE, "paie", STFL, 197, "Processor-Activity-Instrumentation extension-1") -+DEF_FEAT(VECTOR_ENH3, "vxeh3", STFL, 198, "Vector Enhancements facility 3") - DEF_FEAT(CCF_BASE, "ccf-base", STFL, 201, "Concurrent-Functions facility") - - /* Features exposed via SCLP SCCB Byte 80 - 98 (bit numbers relative to byte-80) */ -diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c -index cb45911ac0..5fb5c6f38e 100644 ---- a/target/s390x/cpu_models.c -+++ b/target/s390x/cpu_models.c -@@ -461,6 +461,8 @@ static void check_consistency(const S390CPUModel *model) - { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH, S390_FEAT_VECTOR_PACKED_DECIMAL }, - { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH2, S390_FEAT_VECTOR_PACKED_DECIMAL_ENH }, - { S390_FEAT_VECTOR_ENH, S390_FEAT_VECTOR }, -+ { S390_FEAT_VECTOR_ENH2, S390_FEAT_VECTOR_ENH }, -+ { S390_FEAT_VECTOR_ENH3, S390_FEAT_VECTOR_ENH2 }, - { S390_FEAT_INSTRUCTION_EXEC_PROT, S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2 }, - { S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2, S390_FEAT_ESOP }, - { S390_FEAT_CMM_NT, S390_FEAT_CMM }, --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-add-Vector-Packed-Decimal-Enhancement.patch b/kvm-s390x-cpumodel-add-Vector-Packed-Decimal-Enhancement.patch deleted file mode 100644 index 4dd3499..0000000 --- a/kvm-s390x-cpumodel-add-Vector-Packed-Decimal-Enhancement.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 846d00e369c2ff33201c4a7ae4a303f4feb82c8f Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:46 +0100 -Subject: [PATCH 11/18] s390x/cpumodel: add Vector-Packed-Decimal-Enhancement - facility 3 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [11/16] 4ab6618fe8fda8277fc92d0de6505df034f8c9fe (thuth/qemu-kvm-cs9) - -This facility introduces new capabilities for the signed-pack-decimal -format. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Janosch Frank -Message-ID: <20241206122751.189721-11-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit db4c208abde53a7ed16d566bf63a3520894bba8d) ---- - target/s390x/cpu_features_def.h.inc | 1 + - target/s390x/cpu_models.c | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index 8be2e0e46d..df154d145f 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -118,6 +118,7 @@ DEF_FEAT(RDP, "rdp", STFL, 194, "Reset-DAT-protection facility") - DEF_FEAT(PAI, "pai", STFL, 196, "Processor-Activity-Instrumentation facility") - DEF_FEAT(PAIE, "paie", STFL, 197, "Processor-Activity-Instrumentation extension-1") - DEF_FEAT(VECTOR_ENH3, "vxeh3", STFL, 198, "Vector Enhancements facility 3") -+DEF_FEAT(VECTOR_PACKED_DECIMAL_ENH3, "vxpdeh3", STFL, 199, "Vector-Packed-Decimal-Enhancement facility 3") - DEF_FEAT(CCF_BASE, "ccf-base", STFL, 201, "Concurrent-Functions facility") - - /* Features exposed via SCLP SCCB Byte 80 - 98 (bit numbers relative to byte-80) */ -diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c -index 5fb5c6f38e..94cc6a0f3e 100644 ---- a/target/s390x/cpu_models.c -+++ b/target/s390x/cpu_models.c -@@ -460,6 +460,7 @@ static void check_consistency(const S390CPUModel *model) - { S390_FEAT_VECTOR_PACKED_DECIMAL, S390_FEAT_VECTOR }, - { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH, S390_FEAT_VECTOR_PACKED_DECIMAL }, - { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH2, S390_FEAT_VECTOR_PACKED_DECIMAL_ENH }, -+ { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH3, S390_FEAT_VECTOR_PACKED_DECIMAL_ENH2 }, - { S390_FEAT_VECTOR_ENH, S390_FEAT_VECTOR }, - { S390_FEAT_VECTOR_ENH2, S390_FEAT_VECTOR_ENH }, - { S390_FEAT_VECTOR_ENH3, S390_FEAT_VECTOR_ENH2 }, --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-add-msa10-subfunctions.patch b/kvm-s390x-cpumodel-add-msa10-subfunctions.patch deleted file mode 100644 index c0a15bc..0000000 --- a/kvm-s390x-cpumodel-add-msa10-subfunctions.patch +++ /dev/null @@ -1,133 +0,0 @@ -From be8c87d33304948258dad5e46582c588ff795344 Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:37 +0100 -Subject: [PATCH 02/18] s390x/cpumodel: add msa10 subfunctions -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [2/16] 967e78e0d496cf5241bfcee7b96b0308b5cedbda (thuth/qemu-kvm-cs9) - -MSA10 introduces new AES XTS subfunctions. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Christian Borntraeger -Message-ID: <20241206122751.189721-2-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 1029cd5b9827ba6aa7f5e02eed1928a928e2fa5e) ---- - target/s390x/cpu_features.c | 2 ++ - target/s390x/cpu_features_def.h.inc | 6 ++++++ - target/s390x/cpu_models.c | 4 ++++ - target/s390x/gen-features.c | 20 ++++++++++++++++++++ - 4 files changed, 32 insertions(+) - -diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c -index cb4e2b8920..a3c239595a 100644 ---- a/target/s390x/cpu_features.c -+++ b/target/s390x/cpu_features.c -@@ -252,6 +252,8 @@ static S390FeatGroupDef s390_feature_groups[] = { - FEAT_GROUP_INIT("msa8", MSA_EXT_8, "Message-security-assist-extension 8 facility"), - FEAT_GROUP_INIT("msa9", MSA_EXT_9, "Message-security-assist-extension 9 facility"), - FEAT_GROUP_INIT("msa9_pckmo", MSA_EXT_9_PCKMO, "Message-security-assist-extension 9 PCKMO subfunctions"), -+ FEAT_GROUP_INIT("msa10", MSA_EXT_10, "Message-security-assist-extension 10 facility"), -+ FEAT_GROUP_INIT("msa10_pckmo", MSA_EXT_10_PCKMO, "Message-security-assist-extension 10 PCKMO subfunctions"), - FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), - FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), - FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"), -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index c53ac13352..104d186c3f 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -233,6 +233,10 @@ DEF_FEAT(KM_XTS_AES_128, "km-xts-aes-128", KM, 50, "KM XTS-AES-128") - DEF_FEAT(KM_XTS_AES_256, "km-xts-aes-256", KM, 52, "KM XTS-AES-256") - DEF_FEAT(KM_XTS_EAES_128, "km-xts-eaes-128", KM, 58, "KM XTS-Encrypted-AES-128") - DEF_FEAT(KM_XTS_EAES_256, "km-xts-eaes-256", KM, 60, "KM XTS-Encrypted-AES-256") -+DEF_FEAT(KM_FULL_XTS_AES_128, "km-full-xts-aes-128", KM, 82, "KM Full-XTS-AES-128") -+DEF_FEAT(KM_FULL_XTS_AES_256, "km-full-xts-aes-256", KM, 84, "KM Full-XTS-AES-256") -+DEF_FEAT(KM_FULL_XTS_EAES_128, "km-full-xts-eaes-128", KM, 90, "KM Full-XTS-Encrypted-AES-128") -+DEF_FEAT(KM_FULL_XTS_EAES_256, "km-full-xts-eaes-256", KM, 92, "KM Full-XTS-Encrypted-AES-256") - - /* Features exposed via the KIMD instruction. */ - DEF_FEAT(KIMD_SHA_1, "kimd-sha-1", KIMD, 1, "KIMD SHA-1") -@@ -264,6 +268,8 @@ DEF_FEAT(PCKMO_ETDEA_256, "pckmo-etdea-192", PCKMO, 3, "PCKMO Encrypted-TDEA-192 - DEF_FEAT(PCKMO_AES_128, "pckmo-aes-128", PCKMO, 18, "PCKMO Encrypted-AES-128-Key") - DEF_FEAT(PCKMO_AES_192, "pckmo-aes-192", PCKMO, 19, "PCKMO Encrypted-AES-192-Key") - DEF_FEAT(PCKMO_AES_256, "pckmo-aes-256", PCKMO, 20, "PCKMO Encrypted-AES-256-Key") -+DEF_FEAT(PCKMO_AES_XTS_128_DK, "pckmo-aes-xts-128-dk", PCKMO, 21, "PCKMO Encrypt-AES-XTS-128-Double-Key") -+DEF_FEAT(PCKMO_AES_XTS_256_DK, "pckmo-aes-xts-256-dk", PCKMO, 22, "PCKMO Encrypt-AES-XTS-256-Double-Key") - DEF_FEAT(PCKMO_ECC_P256, "pckmo-ecc-p256", PCKMO, 32, "PCKMO Encrypt-ECC-P256-Key") - DEF_FEAT(PCKMO_ECC_P384, "pckmo-ecc-p384", PCKMO, 33, "PCKMO Encrypt-ECC-P384-Key") - DEF_FEAT(PCKMO_ECC_P521, "pckmo-ecc-p521", PCKMO, 34, "PCKMO Encrypt-ECC-P521-Key") -diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c -index 8afa9af1a5..e71c445379 100644 ---- a/target/s390x/cpu_models.c -+++ b/target/s390x/cpu_models.c -@@ -480,6 +480,10 @@ static void check_consistency(const S390CPUModel *model) - { S390_FEAT_KLMD_SHA3_512, S390_FEAT_MSA }, - { S390_FEAT_KLMD_SHAKE_128, S390_FEAT_MSA }, - { S390_FEAT_KLMD_SHAKE_256, S390_FEAT_MSA }, -+ { S390_FEAT_KM_FULL_XTS_AES_128, S390_FEAT_MSA_EXT_4 }, -+ { S390_FEAT_KM_FULL_XTS_AES_256, S390_FEAT_MSA_EXT_4 }, -+ { S390_FEAT_KM_FULL_XTS_EAES_128, S390_FEAT_MSA_EXT_4 }, -+ { S390_FEAT_KM_FULL_XTS_EAES_256, S390_FEAT_MSA_EXT_4 }, - { S390_FEAT_PRNO_TRNG_QRTCR, S390_FEAT_MSA_EXT_5 }, - { S390_FEAT_PRNO_TRNG, S390_FEAT_MSA_EXT_5 }, - { S390_FEAT_SIE_KSS, S390_FEAT_SIE_F2 }, -diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c -index 2b2bfc3736..06c3bf64f3 100644 ---- a/target/s390x/gen-features.c -+++ b/target/s390x/gen-features.c -@@ -246,6 +246,16 @@ - S390_FEAT_PCKMO_ECC_ED25519, \ - S390_FEAT_PCKMO_ECC_ED448 - -+#define S390_FEAT_GROUP_MSA_EXT_10 \ -+ S390_FEAT_KM_FULL_XTS_AES_128, \ -+ S390_FEAT_KM_FULL_XTS_AES_256, \ -+ S390_FEAT_KM_FULL_XTS_EAES_128, \ -+ S390_FEAT_KM_FULL_XTS_EAES_256 -+ -+#define S390_FEAT_GROUP_MSA_EXT_10_PCKMO \ -+ S390_FEAT_PCKMO_AES_XTS_128_DK, \ -+ S390_FEAT_PCKMO_AES_XTS_256_DK -+ - #define S390_FEAT_GROUP_ENH_SORT \ - S390_FEAT_ESORT_BASE, \ - S390_FEAT_SORTL_SFLR, \ -@@ -307,10 +317,18 @@ static uint16_t group_MSA_EXT_9[] = { - S390_FEAT_GROUP_MSA_EXT_9, - }; - -+static uint16_t group_MSA_EXT_10[] = { -+ S390_FEAT_GROUP_MSA_EXT_10, -+}; -+ - static uint16_t group_MSA_EXT_9_PCKMO[] = { - S390_FEAT_GROUP_MSA_EXT_9_PCKMO, - }; - -+static uint16_t group_MSA_EXT_10_PCKMO[] = { -+ S390_FEAT_GROUP_MSA_EXT_10_PCKMO, -+}; -+ - static uint16_t group_ENH_SORT[] = { - S390_FEAT_GROUP_ENH_SORT, - }; -@@ -858,6 +876,8 @@ static FeatGroupDefSpec FeatGroupDef[] = { - FEAT_GROUP_INITIALIZER(MSA_EXT_8), - FEAT_GROUP_INITIALIZER(MSA_EXT_9), - FEAT_GROUP_INITIALIZER(MSA_EXT_9_PCKMO), -+ FEAT_GROUP_INITIALIZER(MSA_EXT_10), -+ FEAT_GROUP_INITIALIZER(MSA_EXT_10_PCKMO), - FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), - FEAT_GROUP_INITIALIZER(ENH_SORT), - FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION), --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-add-msa11-subfunctions.patch b/kvm-s390x-cpumodel-add-msa11-subfunctions.patch deleted file mode 100644 index 59d7369..0000000 --- a/kvm-s390x-cpumodel-add-msa11-subfunctions.patch +++ /dev/null @@ -1,148 +0,0 @@ -From 328b55dd31fce9e849d8dd10124cda47013d3035 Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:38 +0100 -Subject: [PATCH 03/18] s390x/cpumodel: add msa11 subfunctions -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [3/16] 8b4158361a17d973fa30a7bcb9d911a2c5a42b14 (thuth/qemu-kvm-cs9) - -MSA11 introduces new HMAC subfunctions. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Christian Borntraeger -Message-ID: <20241206122751.189721-3-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 11dc9020824c81552b021fbe0e2910e0348e7f8e) ---- - target/s390x/cpu_features.c | 2 ++ - target/s390x/cpu_features_def.h.inc | 10 ++++++++++ - target/s390x/cpu_models.c | 8 ++++++++ - target/s390x/gen-features.c | 24 ++++++++++++++++++++++++ - 4 files changed, 44 insertions(+) - -diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c -index a3c239595a..36930feccd 100644 ---- a/target/s390x/cpu_features.c -+++ b/target/s390x/cpu_features.c -@@ -254,6 +254,8 @@ static S390FeatGroupDef s390_feature_groups[] = { - FEAT_GROUP_INIT("msa9_pckmo", MSA_EXT_9_PCKMO, "Message-security-assist-extension 9 PCKMO subfunctions"), - FEAT_GROUP_INIT("msa10", MSA_EXT_10, "Message-security-assist-extension 10 facility"), - FEAT_GROUP_INIT("msa10_pckmo", MSA_EXT_10_PCKMO, "Message-security-assist-extension 10 PCKMO subfunctions"), -+ FEAT_GROUP_INIT("msa11", MSA_EXT_11, "Message-security-assist-extension 11 facility"), -+ FEAT_GROUP_INIT("msa11_pckmo", MSA_EXT_11_PCKMO, "Message-security-assist-extension 11 PCKMO subfunctions"), - FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), - FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), - FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"), -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index 104d186c3f..15ea51fc54 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -200,6 +200,14 @@ DEF_FEAT(KMAC_AES_256, "kmac-aes-256", KMAC, 20, "KMAC AES-256") - DEF_FEAT(KMAC_EAES_128, "kmac-eaes-128", KMAC, 26, "KMAC Encrypted-AES-128") - DEF_FEAT(KMAC_EAES_192, "kmac-eaes-192", KMAC, 27, "KMAC Encrypted-AES-192") - DEF_FEAT(KMAC_EAES_256, "kmac-eaes-256", KMAC, 28, "KMAC Encrypted-AES-256") -+DEF_FEAT(KMAC_HMAC_SHA_224, "kmac-hmac-sha-224", KMAC, 112, "KMAC HMAC-SHA-224") -+DEF_FEAT(KMAC_HMAC_SHA_256, "kmac-hmac-sha-246", KMAC, 113, "KMAC HMAC-SHA-256") -+DEF_FEAT(KMAC_HMAC_SHA_384, "kmac-hmac-sha-384", KMAC, 114, "KMAC HMAC-SHA-384") -+DEF_FEAT(KMAC_HMAC_SHA_512, "kmac-hmac-sha-512", KMAC, 115, "KMAC HMAC-SHA-512") -+DEF_FEAT(KMAC_HMAC_ESHA_224, "kmac-hmac-esha-224", KMAC, 120, "KMAC HMAC-Encrypted-SHA-224") -+DEF_FEAT(KMAC_HMAC_ESHA_256, "kmac-hmac-esha-246", KMAC, 121, "KMAC HMAC-Encrypted-SHA-256") -+DEF_FEAT(KMAC_HMAC_ESHA_384, "kmac-hmac-esha-384", KMAC, 122, "KMAC HMAC-Encrypted-SHA-384") -+DEF_FEAT(KMAC_HMAC_ESHA_512, "kmac-hmac-esha-512", KMAC, 123, "KMAC HMAC-Encrypted-SHA-512") - - /* Features exposed via the KMC instruction. */ - DEF_FEAT(KMC_DEA, "kmc-dea", KMC, 1, "KMC DEA") -@@ -275,6 +283,8 @@ DEF_FEAT(PCKMO_ECC_P384, "pckmo-ecc-p384", PCKMO, 33, "PCKMO Encrypt-ECC-P384-Ke - DEF_FEAT(PCKMO_ECC_P521, "pckmo-ecc-p521", PCKMO, 34, "PCKMO Encrypt-ECC-P521-Key") - DEF_FEAT(PCKMO_ECC_ED25519, "pckmo-ecc-ed25519", PCKMO, 40 , "PCKMO Encrypt-ECC-Ed25519-Key") - DEF_FEAT(PCKMO_ECC_ED448, "pckmo-ecc-ed448", PCKMO, 41 , "PCKMO Encrypt-ECC-Ed448-Key") -+DEF_FEAT(PCKMO_HMAC_512, "pckmo-hmac-512", PCKMO, 118, "PCKMO Encrypt-HMAC-512-Key") -+DEF_FEAT(PCKMO_HMAC_1024, "pckmo-hmac-1024", PCKMO, 122, "PCKMO Encrypt-HMAC-1024-Key") - - /* Features exposed via the KMCTR instruction. */ - DEF_FEAT(KMCTR_DEA, "kmctr-dea", KMCTR, 1, "KMCTR DEA") -diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c -index e71c445379..da441b7b10 100644 ---- a/target/s390x/cpu_models.c -+++ b/target/s390x/cpu_models.c -@@ -480,6 +480,14 @@ static void check_consistency(const S390CPUModel *model) - { S390_FEAT_KLMD_SHA3_512, S390_FEAT_MSA }, - { S390_FEAT_KLMD_SHAKE_128, S390_FEAT_MSA }, - { S390_FEAT_KLMD_SHAKE_256, S390_FEAT_MSA }, -+ { S390_FEAT_KMAC_HMAC_SHA_224, S390_FEAT_MSA_EXT_3 }, -+ { S390_FEAT_KMAC_HMAC_SHA_256, S390_FEAT_MSA_EXT_3 }, -+ { S390_FEAT_KMAC_HMAC_SHA_384, S390_FEAT_MSA_EXT_3 }, -+ { S390_FEAT_KMAC_HMAC_SHA_512, S390_FEAT_MSA_EXT_3 }, -+ { S390_FEAT_KMAC_HMAC_ESHA_224, S390_FEAT_MSA_EXT_3 }, -+ { S390_FEAT_KMAC_HMAC_ESHA_256, S390_FEAT_MSA_EXT_3 }, -+ { S390_FEAT_KMAC_HMAC_ESHA_384, S390_FEAT_MSA_EXT_3 }, -+ { S390_FEAT_KMAC_HMAC_ESHA_512, S390_FEAT_MSA_EXT_3 }, - { S390_FEAT_KM_FULL_XTS_AES_128, S390_FEAT_MSA_EXT_4 }, - { S390_FEAT_KM_FULL_XTS_AES_256, S390_FEAT_MSA_EXT_4 }, - { S390_FEAT_KM_FULL_XTS_EAES_128, S390_FEAT_MSA_EXT_4 }, -diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c -index 06c3bf64f3..d6305f945a 100644 ---- a/target/s390x/gen-features.c -+++ b/target/s390x/gen-features.c -@@ -256,6 +256,20 @@ - S390_FEAT_PCKMO_AES_XTS_128_DK, \ - S390_FEAT_PCKMO_AES_XTS_256_DK - -+#define S390_FEAT_GROUP_MSA_EXT_11 \ -+ S390_FEAT_KMAC_HMAC_SHA_224, \ -+ S390_FEAT_KMAC_HMAC_SHA_256, \ -+ S390_FEAT_KMAC_HMAC_SHA_384, \ -+ S390_FEAT_KMAC_HMAC_SHA_512, \ -+ S390_FEAT_KMAC_HMAC_ESHA_224, \ -+ S390_FEAT_KMAC_HMAC_ESHA_256, \ -+ S390_FEAT_KMAC_HMAC_ESHA_384, \ -+ S390_FEAT_KMAC_HMAC_ESHA_512 -+ -+#define S390_FEAT_GROUP_MSA_EXT_11_PCKMO \ -+ S390_FEAT_PCKMO_HMAC_512, \ -+ S390_FEAT_PCKMO_HMAC_1024 -+ - #define S390_FEAT_GROUP_ENH_SORT \ - S390_FEAT_ESORT_BASE, \ - S390_FEAT_SORTL_SFLR, \ -@@ -321,6 +335,10 @@ static uint16_t group_MSA_EXT_10[] = { - S390_FEAT_GROUP_MSA_EXT_10, - }; - -+static uint16_t group_MSA_EXT_11[] = { -+ S390_FEAT_GROUP_MSA_EXT_11, -+}; -+ - static uint16_t group_MSA_EXT_9_PCKMO[] = { - S390_FEAT_GROUP_MSA_EXT_9_PCKMO, - }; -@@ -329,6 +347,10 @@ static uint16_t group_MSA_EXT_10_PCKMO[] = { - S390_FEAT_GROUP_MSA_EXT_10_PCKMO, - }; - -+static uint16_t group_MSA_EXT_11_PCKMO[] = { -+ S390_FEAT_GROUP_MSA_EXT_11_PCKMO, -+}; -+ - static uint16_t group_ENH_SORT[] = { - S390_FEAT_GROUP_ENH_SORT, - }; -@@ -878,6 +900,8 @@ static FeatGroupDefSpec FeatGroupDef[] = { - FEAT_GROUP_INITIALIZER(MSA_EXT_9_PCKMO), - FEAT_GROUP_INITIALIZER(MSA_EXT_10), - FEAT_GROUP_INITIALIZER(MSA_EXT_10_PCKMO), -+ FEAT_GROUP_INITIALIZER(MSA_EXT_11), -+ FEAT_GROUP_INITIALIZER(MSA_EXT_11_PCKMO), - FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), - FEAT_GROUP_INITIALIZER(ENH_SORT), - FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION), --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-add-msa12-changes.patch b/kvm-s390x-cpumodel-add-msa12-changes.patch deleted file mode 100644 index 44a1bef..0000000 --- a/kvm-s390x-cpumodel-add-msa12-changes.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 2016aa4ba5c5aecae350ce6ea81462c9ab5956c3 Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:39 +0100 -Subject: [PATCH 04/18] s390x/cpumodel: add msa12 changes -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [4/16] c878296ee5c4f99f67f1c68172536b521be60e04 (thuth/qemu-kvm-cs9) - -MSA12 changes the KIMD/KLMD instruction format for SHA3/SHAKE. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Christian Borntraeger -Message-ID: <20241206122751.189721-4-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 496fc02e0e532f8917fa96e45fa531231e821c31) ---- - target/s390x/cpu_features.c | 1 + - target/s390x/cpu_features_def.h.inc | 1 + - target/s390x/gen-features.c | 8 ++++++++ - 3 files changed, 10 insertions(+) - -diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c -index 36930feccd..0e0b37ab95 100644 ---- a/target/s390x/cpu_features.c -+++ b/target/s390x/cpu_features.c -@@ -256,6 +256,7 @@ static S390FeatGroupDef s390_feature_groups[] = { - FEAT_GROUP_INIT("msa10_pckmo", MSA_EXT_10_PCKMO, "Message-security-assist-extension 10 PCKMO subfunctions"), - FEAT_GROUP_INIT("msa11", MSA_EXT_11, "Message-security-assist-extension 11 facility"), - FEAT_GROUP_INIT("msa11_pckmo", MSA_EXT_11_PCKMO, "Message-security-assist-extension 11 PCKMO subfunctions"), -+ FEAT_GROUP_INIT("msa12", MSA_EXT_12, "Message-security-assist-extension 12 facility"), - FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), - FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), - FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"), -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index 15ea51fc54..2e5dc96984 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -90,6 +90,7 @@ DEF_FEAT(EDAT_2, "edat2", STFL, 78, "Enhanced-DAT facility 2") - DEF_FEAT(DFP_PACKED_CONVERSION, "dfppc", STFL, 80, "Decimal-floating-point packed-conversion facility") - DEF_FEAT(PPA15, "ppa15", STFL, 81, "PPA15 is installed") - DEF_FEAT(BPB, "bpb", STFL, 82, "Branch prediction blocking") -+DEF_FEAT(MSA_EXT_12, "msa12-base", STFL, 86, "Message-security-assist-extension-12 facility (excluding subfunctions)") - DEF_FEAT(VECTOR, "vx", STFL, 129, "Vector facility") - DEF_FEAT(INSTRUCTION_EXEC_PROT, "iep", STFL, 130, "Instruction-execution-protection facility") - DEF_FEAT(SIDE_EFFECT_ACCESS_ESOP2, "sea_esop2", STFL, 131, "Side-effect-access facility and Enhanced-suppression-on-protection facility 2") -diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c -index d6305f945a..ab9ad51d5e 100644 ---- a/target/s390x/gen-features.c -+++ b/target/s390x/gen-features.c -@@ -270,6 +270,9 @@ - S390_FEAT_PCKMO_HMAC_512, \ - S390_FEAT_PCKMO_HMAC_1024 - -+#define S390_FEAT_GROUP_MSA_EXT_12 \ -+ S390_FEAT_MSA_EXT_12 -+ - #define S390_FEAT_GROUP_ENH_SORT \ - S390_FEAT_ESORT_BASE, \ - S390_FEAT_SORTL_SFLR, \ -@@ -339,6 +342,10 @@ static uint16_t group_MSA_EXT_11[] = { - S390_FEAT_GROUP_MSA_EXT_11, - }; - -+static uint16_t group_MSA_EXT_12[] = { -+ S390_FEAT_GROUP_MSA_EXT_12, -+}; -+ - static uint16_t group_MSA_EXT_9_PCKMO[] = { - S390_FEAT_GROUP_MSA_EXT_9_PCKMO, - }; -@@ -902,6 +909,7 @@ static FeatGroupDefSpec FeatGroupDef[] = { - FEAT_GROUP_INITIALIZER(MSA_EXT_10_PCKMO), - FEAT_GROUP_INITIALIZER(MSA_EXT_11), - FEAT_GROUP_INITIALIZER(MSA_EXT_11_PCKMO), -+ FEAT_GROUP_INITIALIZER(MSA_EXT_12), - FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), - FEAT_GROUP_INITIALIZER(ENH_SORT), - FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION), --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-add-msa13-subfunctions.patch b/kvm-s390x-cpumodel-add-msa13-subfunctions.patch deleted file mode 100644 index 98d9932..0000000 --- a/kvm-s390x-cpumodel-add-msa13-subfunctions.patch +++ /dev/null @@ -1,200 +0,0 @@ -From 003efbebc77300d3004f4613255e04058165ff33 Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:40 +0100 -Subject: [PATCH 05/18] s390x/cpumodel: add msa13 subfunctions -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [5/16] b3f42a4a831bc0582e3c14da6387d7db440c3c41 (thuth/qemu-kvm-cs9) - -MSA13 introduces query authentication information (QAI) subfunctions. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Janosch Frank -Message-ID: <20241206122751.189721-5-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit ba4614fdacc2ea55060ddb48bdb2ebd21d0c3464) ---- - target/s390x/cpu_features.c | 2 ++ - target/s390x/cpu_features_def.h.inc | 12 ++++++++++++ - target/s390x/gen-features.c | 26 ++++++++++++++++++++++++++ - 3 files changed, 40 insertions(+) - -diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c -index 0e0b37ab95..9ba127e386 100644 ---- a/target/s390x/cpu_features.c -+++ b/target/s390x/cpu_features.c -@@ -257,6 +257,8 @@ static S390FeatGroupDef s390_feature_groups[] = { - FEAT_GROUP_INIT("msa11", MSA_EXT_11, "Message-security-assist-extension 11 facility"), - FEAT_GROUP_INIT("msa11_pckmo", MSA_EXT_11_PCKMO, "Message-security-assist-extension 11 PCKMO subfunctions"), - FEAT_GROUP_INIT("msa12", MSA_EXT_12, "Message-security-assist-extension 12 facility"), -+ FEAT_GROUP_INIT("msa13", MSA_EXT_13, "Message-security-assist-extension 13 facility"), -+ FEAT_GROUP_INIT("msa13_pckmo", MSA_EXT_13_PCKMO, "Message-security-assist-extension 13 PCKMO subfunctions"), - FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), - FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), - FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"), -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index 2e5dc96984..2132837ffe 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -209,6 +209,7 @@ DEF_FEAT(KMAC_HMAC_ESHA_224, "kmac-hmac-esha-224", KMAC, 120, "KMAC HMAC-Encrypt - DEF_FEAT(KMAC_HMAC_ESHA_256, "kmac-hmac-esha-246", KMAC, 121, "KMAC HMAC-Encrypted-SHA-256") - DEF_FEAT(KMAC_HMAC_ESHA_384, "kmac-hmac-esha-384", KMAC, 122, "KMAC HMAC-Encrypted-SHA-384") - DEF_FEAT(KMAC_HMAC_ESHA_512, "kmac-hmac-esha-512", KMAC, 123, "KMAC HMAC-Encrypted-SHA-512") -+DEF_FEAT(KMAC_QAI, "kmac-qai", KMAC, 127, "KMAC Query-Authentication-Information") - - /* Features exposed via the KMC instruction. */ - DEF_FEAT(KMC_DEA, "kmc-dea", KMC, 1, "KMC DEA") -@@ -246,6 +247,7 @@ DEF_FEAT(KM_FULL_XTS_AES_128, "km-full-xts-aes-128", KM, 82, "KM Full-XTS-AES-12 - DEF_FEAT(KM_FULL_XTS_AES_256, "km-full-xts-aes-256", KM, 84, "KM Full-XTS-AES-256") - DEF_FEAT(KM_FULL_XTS_EAES_128, "km-full-xts-eaes-128", KM, 90, "KM Full-XTS-Encrypted-AES-128") - DEF_FEAT(KM_FULL_XTS_EAES_256, "km-full-xts-eaes-256", KM, 92, "KM Full-XTS-Encrypted-AES-256") -+DEF_FEAT(KM_QAI, "km-qai", KM, 127, "KM Query-Authentication-Information") - - /* Features exposed via the KIMD instruction. */ - DEF_FEAT(KIMD_SHA_1, "kimd-sha-1", KIMD, 1, "KIMD SHA-1") -@@ -258,6 +260,7 @@ DEF_FEAT(KIMD_SHA3_512, "kimd-sha3-512", KIMD, 35, "KIMD SHA3-512") - DEF_FEAT(KIMD_SHAKE_128, "kimd-shake-128", KIMD, 36, "KIMD SHAKE-128") - DEF_FEAT(KIMD_SHAKE_256, "kimd-shake-256", KIMD, 37, "KIMD SHAKE-256") - DEF_FEAT(KIMD_GHASH, "kimd-ghash", KIMD, 65, "KIMD GHASH") -+DEF_FEAT(KIMD_QAI, "kimd-qai", KIMD, 127, "KIMD Query-Authentication-Information") - - /* Features exposed via the KLMD instruction. */ - DEF_FEAT(KLMD_SHA_1, "klmd-sha-1", KLMD, 1, "KLMD SHA-1") -@@ -269,6 +272,7 @@ DEF_FEAT(KLMD_SHA3_384, "klmd-sha3-384", KLMD, 34, "KLMD SHA3-384") - DEF_FEAT(KLMD_SHA3_512, "klmd-sha3-512", KLMD, 35, "KLMD SHA3-512") - DEF_FEAT(KLMD_SHAKE_128, "klmd-shake-128", KLMD, 36, "KLMD SHAKE-128") - DEF_FEAT(KLMD_SHAKE_256, "klmd-shake-256", KLMD, 37, "KLMD SHAKE-256") -+DEF_FEAT(KLMD_QAI, "klmd-qai", KLMD, 127, "KLMD Query-Authentication-Information") - - /* Features exposed via the PCKMO instruction. */ - DEF_FEAT(PCKMO_EDEA, "pckmo-edea", PCKMO, 1, "PCKMO Encrypted-DEA-Key") -@@ -286,6 +290,7 @@ DEF_FEAT(PCKMO_ECC_ED25519, "pckmo-ecc-ed25519", PCKMO, 40 , "PCKMO Encrypt-ECC- - DEF_FEAT(PCKMO_ECC_ED448, "pckmo-ecc-ed448", PCKMO, 41 , "PCKMO Encrypt-ECC-Ed448-Key") - DEF_FEAT(PCKMO_HMAC_512, "pckmo-hmac-512", PCKMO, 118, "PCKMO Encrypt-HMAC-512-Key") - DEF_FEAT(PCKMO_HMAC_1024, "pckmo-hmac-1024", PCKMO, 122, "PCKMO Encrypt-HMAC-1024-Key") -+DEF_FEAT(PCKMO_QAI, "pckmo-qai", PCKMO, 127, "PCKMO Query-Authentication-Information") - - /* Features exposed via the KMCTR instruction. */ - DEF_FEAT(KMCTR_DEA, "kmctr-dea", KMCTR, 1, "KMCTR DEA") -@@ -300,6 +305,7 @@ DEF_FEAT(KMCTR_AES_256, "kmctr-aes-256", KMCTR, 20, "KMCTR AES-256") - DEF_FEAT(KMCTR_EAES_128, "kmctr-eaes-128", KMCTR, 26, "KMCTR Encrypted-AES-128") - DEF_FEAT(KMCTR_EAES_192, "kmctr-eaes-192", KMCTR, 27, "KMCTR Encrypted-AES-192") - DEF_FEAT(KMCTR_EAES_256, "kmctr-eaes-256", KMCTR, 28, "KMCTR Encrypted-AES-256") -+DEF_FEAT(KMCTR_QAI, "kmctr-qai", KMCTR, 127, "KMCTR Query-Authentication-Information") - - /* Features exposed via the KMF instruction. */ - DEF_FEAT(KMF_DEA, "kmf-dea", KMF, 1, "KMF DEA") -@@ -314,6 +320,7 @@ DEF_FEAT(KMF_AES_256, "kmf-aes-256", KMF, 20, "KMF AES-256") - DEF_FEAT(KMF_EAES_128, "kmf-eaes-128", KMF, 26, "KMF Encrypted-AES-128") - DEF_FEAT(KMF_EAES_192, "kmf-eaes-192", KMF, 27, "KMF Encrypted-AES-192") - DEF_FEAT(KMF_EAES_256, "kmf-eaes-256", KMF, 28, "KMF Encrypted-AES-256") -+DEF_FEAT(KMF_QAI, "kmf-qai", KMF, 127, "KMF Query-Authentication-Information") - - /* Features exposed via the KMO instruction. */ - DEF_FEAT(KMO_DEA, "kmo-dea", KMO, 1, "KMO DEA") -@@ -328,6 +335,7 @@ DEF_FEAT(KMO_AES_256, "kmo-aes-256", KMO, 20, "KMO AES-256") - DEF_FEAT(KMO_EAES_128, "kmo-eaes-128", KMO, 26, "KMO Encrypted-AES-128") - DEF_FEAT(KMO_EAES_192, "kmo-eaes-192", KMO, 27, "KMO Encrypted-AES-192") - DEF_FEAT(KMO_EAES_256, "kmo-eaes-256", KMO, 28, "KMO Encrypted-AES-256") -+DEF_FEAT(KMO_QAI, "kmo-qai", KMO, 127, "KMO Query-Authentication-Information") - - /* Features exposed via the PCC instruction. */ - DEF_FEAT(PCC_CMAC_DEA, "pcc-cmac-dea", PCC, 1, "PCC Compute-Last-Block-CMAC-Using-DEA") -@@ -353,11 +361,13 @@ DEF_FEAT(PCC_SCALAR_MULT_ED25519, "pcc-scalar-mult-ed25519", PCC, 72, "PCC Scala - DEF_FEAT(PCC_SCALAR_MULT_ED448, "pcc-scalar-mult-ed448", PCC, 73, "PCC Scalar-Multiply-Ed448") - DEF_FEAT(PCC_SCALAR_MULT_X25519, "pcc-scalar-mult-x25519", PCC, 80, "PCC Scalar-Multiply-X25519") - DEF_FEAT(PCC_SCALAR_MULT_X448, "pcc-scalar-mult-x448", PCC, 81, "PCC Scalar-Multiply-X448") -+DEF_FEAT(PCC_QAI, "pcc-qai", PCC, 127, "PCC Query-Authentication-Information") - - /* Features exposed via the PPNO/PRNO instruction. */ - DEF_FEAT(PPNO_SHA_512_DRNG, "ppno-sha-512-drng", PPNO, 3, "PPNO SHA-512-DRNG") - DEF_FEAT(PRNO_TRNG_QRTCR, "prno-trng-qrtcr", PPNO, 112, "PRNO TRNG-Query-Raw-to-Conditioned-Ratio") - DEF_FEAT(PRNO_TRNG, "prno-trng", PPNO, 114, "PRNO TRNG") -+DEF_FEAT(PRNO_QAI, "prno-qai", PPNO, 127, "PRNO Query-Authentication-Information") - - /* Features exposed via the KMA instruction. */ - DEF_FEAT(KMA_GCM_AES_128, "kma-gcm-aes-128", KMA, 18, "KMA GCM-AES-128") -@@ -366,6 +376,7 @@ DEF_FEAT(KMA_GCM_AES_256, "kma-gcm-aes-256", KMA, 20, "KMA GCM-AES-256") - DEF_FEAT(KMA_GCM_EAES_128, "kma-gcm-eaes-128", KMA, 26, "KMA GCM-Encrypted-AES-128") - DEF_FEAT(KMA_GCM_EAES_192, "kma-gcm-eaes-192", KMA, 27, "KMA GCM-Encrypted-AES-192") - DEF_FEAT(KMA_GCM_EAES_256, "kma-gcm-eaes-256", KMA, 28, "KMA GCM-Encrypted-AES-256") -+DEF_FEAT(KMA_QAI, "kma-qai", KMA, 127, "KMA Query-Authentication-Information") - - /* Features exposed via the KDSA instruction. */ - DEF_FEAT(KDSA_ECDSA_VERIFY_P256, "kdsa-ecdsa-verify-p256", KDSA, 1, "KDSA ECDSA-Verify-P256") -@@ -383,6 +394,7 @@ DEF_FEAT(KDSA_EDDSA_SIGN_ED25519, "kdsa-eddsa-sign-ed25519", KDSA, 40, "KDSA EdD - DEF_FEAT(KDSA_EDDSA_SIGN_ED448, "kdsa-eddsa-sign-ed448", KDSA, 44, "KDSA EdDSA-Sign-Ed448") - DEF_FEAT(KDSA_EEDDSA_SIGN_ED25519, "kdsa-eeddsa-sign-ed25519", KDSA, 48, "KDSA Encrypted-EdDSA-Sign-Ed25519") - DEF_FEAT(KDSA_EEDDSA_SIGN_ED448, "kdsa-eeddsa-sign-ed448", KDSA, 52, "KDSA Encrypted-EdDSA-Sign-Ed448") -+DEF_FEAT(KDSA_QAI, "kdsa-qai", KDSA, 127, "KDSA Query-Authentication-Information") - - /* Features exposed via the SORTL instruction. */ - DEF_FEAT(SORTL_SFLR, "sortl-sflr", SORTL, 1, "SORTL SFLR") -diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c -index ab9ad51d5e..3326e7df43 100644 ---- a/target/s390x/gen-features.c -+++ b/target/s390x/gen-features.c -@@ -273,6 +273,22 @@ - #define S390_FEAT_GROUP_MSA_EXT_12 \ - S390_FEAT_MSA_EXT_12 - -+#define S390_FEAT_GROUP_MSA_EXT_13 \ -+ S390_FEAT_KDSA_QAI, \ -+ S390_FEAT_KIMD_QAI, \ -+ S390_FEAT_KLMD_QAI, \ -+ S390_FEAT_KMAC_QAI, \ -+ S390_FEAT_KMA_QAI, \ -+ S390_FEAT_KMCTR_QAI, \ -+ S390_FEAT_KMF_QAI, \ -+ S390_FEAT_KMO_QAI, \ -+ S390_FEAT_KM_QAI, \ -+ S390_FEAT_PCC_QAI, \ -+ S390_FEAT_PRNO_QAI -+ -+#define S390_FEAT_GROUP_MSA_EXT_13_PCKMO \ -+ S390_FEAT_PCKMO_QAI -+ - #define S390_FEAT_GROUP_ENH_SORT \ - S390_FEAT_ESORT_BASE, \ - S390_FEAT_SORTL_SFLR, \ -@@ -346,6 +362,10 @@ static uint16_t group_MSA_EXT_12[] = { - S390_FEAT_GROUP_MSA_EXT_12, - }; - -+static uint16_t group_MSA_EXT_13[] = { -+ S390_FEAT_GROUP_MSA_EXT_13, -+}; -+ - static uint16_t group_MSA_EXT_9_PCKMO[] = { - S390_FEAT_GROUP_MSA_EXT_9_PCKMO, - }; -@@ -358,6 +378,10 @@ static uint16_t group_MSA_EXT_11_PCKMO[] = { - S390_FEAT_GROUP_MSA_EXT_11_PCKMO, - }; - -+static uint16_t group_MSA_EXT_13_PCKMO[] = { -+ S390_FEAT_GROUP_MSA_EXT_13_PCKMO, -+}; -+ - static uint16_t group_ENH_SORT[] = { - S390_FEAT_GROUP_ENH_SORT, - }; -@@ -910,6 +934,8 @@ static FeatGroupDefSpec FeatGroupDef[] = { - FEAT_GROUP_INITIALIZER(MSA_EXT_11), - FEAT_GROUP_INITIALIZER(MSA_EXT_11_PCKMO), - FEAT_GROUP_INITIALIZER(MSA_EXT_12), -+ FEAT_GROUP_INITIALIZER(MSA_EXT_13), -+ FEAT_GROUP_INITIALIZER(MSA_EXT_13_PCKMO), - FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), - FEAT_GROUP_INITIALIZER(ENH_SORT), - FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION), --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-correct-PLO-feature-wording.patch b/kvm-s390x-cpumodel-correct-PLO-feature-wording.patch deleted file mode 100644 index da0855a..0000000 --- a/kvm-s390x-cpumodel-correct-PLO-feature-wording.patch +++ /dev/null @@ -1,69 +0,0 @@ -From bec777b1ca5107cea4f4104c58cdd0c5d9613e33 Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:49 +0100 -Subject: [PATCH 14/18] s390x/cpumodel: correct PLO feature wording -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [14/16] 346fd03bd68222125b0b04113a432ae739af84f1 (thuth/qemu-kvm-cs9) - -The PLO functions 0, 4, 8, 12, 16, and 20 use 32-bit registers -values. The plo-*gr variants use 64-bit instead and, thus, correct -the wording. - -Signed-off-by: Hendrik Brueckner -Reviewed-by: Janosch Frank -Message-ID: <20241206122751.189721-14-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 5a0a136df71b858d01f346af4a30ae1da23e8b3c) ---- - target/s390x/cpu_features_def.h.inc | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc -index 09a80844a7..fe7e1bd19c 100644 ---- a/target/s390x/cpu_features_def.h.inc -+++ b/target/s390x/cpu_features_def.h.inc -@@ -158,27 +158,27 @@ DEF_FEAT(AP, "ap", MISC, 0, "AP instructions installed") - /* Features exposed via the PLO instruction. */ - DEF_FEAT(PLO_CL, "plo-cl", PLO, 0, "PLO Compare and load (32 bit in general registers)") - DEF_FEAT(PLO_CLG, "plo-clg", PLO, 1, "PLO Compare and load (64 bit in parameter list)") --DEF_FEAT(PLO_CLGR, "plo-clgr", PLO, 2, "PLO Compare and load (32 bit in general registers)") -+DEF_FEAT(PLO_CLGR, "plo-clgr", PLO, 2, "PLO Compare and load (64 bit in general registers)") - DEF_FEAT(PLO_CLX, "plo-clx", PLO, 3, "PLO Compare and load (128 bit in parameter list)") - DEF_FEAT(PLO_CS, "plo-cs", PLO, 4, "PLO Compare and swap (32 bit in general registers)") - DEF_FEAT(PLO_CSG, "plo-csg", PLO, 5, "PLO Compare and swap (64 bit in parameter list)") --DEF_FEAT(PLO_CSGR, "plo-csgr", PLO, 6, "PLO Compare and swap (32 bit in general registers)") -+DEF_FEAT(PLO_CSGR, "plo-csgr", PLO, 6, "PLO Compare and swap (64 bit in general registers)") - DEF_FEAT(PLO_CSX, "plo-csx", PLO, 7, "PLO Compare and swap (128 bit in parameter list)") - DEF_FEAT(PLO_DCS, "plo-dcs", PLO, 8, "PLO Double compare and swap (32 bit in general registers)") - DEF_FEAT(PLO_DCSG, "plo-dcsg", PLO, 9, "PLO Double compare and swap (64 bit in parameter list)") --DEF_FEAT(PLO_DCSGR, "plo-dcsgr", PLO, 10, "PLO Double compare and swap (32 bit in general registers)") -+DEF_FEAT(PLO_DCSGR, "plo-dcsgr", PLO, 10, "PLO Double compare and swap (64 bit in general registers)") - DEF_FEAT(PLO_DCSX, "plo-dcsx", PLO, 11, "PLO Double compare and swap (128 bit in parameter list)") - DEF_FEAT(PLO_CSST, "plo-csst", PLO, 12, "PLO Compare and swap and store (32 bit in general registers)") - DEF_FEAT(PLO_CSSTG, "plo-csstg", PLO, 13, "PLO Compare and swap and store (64 bit in parameter list)") --DEF_FEAT(PLO_CSSTGR, "plo-csstgr", PLO, 14, "PLO Compare and swap and store (32 bit in general registers)") -+DEF_FEAT(PLO_CSSTGR, "plo-csstgr", PLO, 14, "PLO Compare and swap and store (64 bit in general registers)") - DEF_FEAT(PLO_CSSTX, "plo-csstx", PLO, 15, "PLO Compare and swap and store (128 bit in parameter list)") - DEF_FEAT(PLO_CSDST, "plo-csdst", PLO, 16, "PLO Compare and swap and double store (32 bit in general registers)") - DEF_FEAT(PLO_CSDSTG, "plo-csdstg", PLO, 17, "PLO Compare and swap and double store (64 bit in parameter list)") --DEF_FEAT(PLO_CSDSTGR, "plo-csdstgr", PLO, 18, "PLO Compare and swap and double store (32 bit in general registers)") -+DEF_FEAT(PLO_CSDSTGR, "plo-csdstgr", PLO, 18, "PLO Compare and swap and double store (64 bit in general registers)") - DEF_FEAT(PLO_CSDSTX, "plo-csdstx", PLO, 19, "PLO Compare and swap and double store (128 bit in parameter list)") - DEF_FEAT(PLO_CSTST, "plo-cstst", PLO, 20, "PLO Compare and swap and triple store (32 bit in general registers)") - DEF_FEAT(PLO_CSTSTG, "plo-cststg", PLO, 21, "PLO Compare and swap and triple store (64 bit in parameter list)") --DEF_FEAT(PLO_CSTSTGR, "plo-cststgr", PLO, 22, "PLO Compare and swap and triple store (32 bit in general registers)") -+DEF_FEAT(PLO_CSTSTGR, "plo-cststgr", PLO, 22, "PLO Compare and swap and triple store (64 bit in general registers)") - DEF_FEAT(PLO_CSTSTX, "plo-cststx", PLO, 23, "PLO Compare and swap and triple store (128 bit in parameter list)") - - /* Features exposed via the PTFF instruction. */ --- -2.39.3 - diff --git a/kvm-s390x-cpumodel-gen17-model.patch b/kvm-s390x-cpumodel-gen17-model.patch deleted file mode 100644 index 7fc91ae..0000000 --- a/kvm-s390x-cpumodel-gen17-model.patch +++ /dev/null @@ -1,107 +0,0 @@ -From bf9dd3db72e0e8cde010f649fbe484fdd929ac96 Mon Sep 17 00:00:00 2001 -From: Hendrik Brueckner -Date: Fri, 6 Dec 2024 13:27:51 +0100 -Subject: [PATCH 16/18] s390x/cpumodel: gen17 model -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware -RH-Jira: RHEL-32665 -RH-Acked-by: Cornelia Huck -RH-Acked-by: Cédric Le Goater -RH-Commit: [16/16] 97b19706656f5510d1aab760f01e501c1c332bc4 (thuth/qemu-kvm-cs9) - -This commit introduces the definition of the gen17a/gen17b CPU model. - -Signed-off-by: Hendrik Brueckner -Message-ID: <20241206122751.189721-16-brueckner@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit 21b8db229901a51f16aebe342c0508f588ea5006) ---- - target/s390x/cpu_models.c | 2 ++ - target/s390x/gen-features.c | 33 +++++++++++++++++++++++++++++++++ - 2 files changed, 35 insertions(+) - -diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c -index 3fb5b0980e..c326a71237 100644 ---- a/target/s390x/cpu_models.c -+++ b/target/s390x/cpu_models.c -@@ -97,6 +97,8 @@ static S390CPUDef s390_cpu_defs[] = { - CPUDEF_INIT(0x8562, 15, 1, 47, 0x08000000U, "gen15b", "IBM z15 T02 GA1"), - CPUDEF_INIT(0x3931, 16, 1, 47, 0x08000000U, "gen16a", "IBM 3931 GA1"), - CPUDEF_INIT(0x3932, 16, 1, 47, 0x08000000U, "gen16b", "IBM 3932 GA1"), -+ CPUDEF_INIT(0x9175, 17, 1, 47, 0x08000000U, "gen17a", "IBM 9175 GA1"), -+ CPUDEF_INIT(0x9176, 17, 1, 47, 0x08000000U, "gen17b", "IBM 9176 GA1"), - }; - - #define QEMU_MAX_CPU_TYPE 0x8561 -diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c -index 680d45d303..41840677ce 100644 ---- a/target/s390x/gen-features.c -+++ b/target/s390x/gen-features.c -@@ -561,6 +561,13 @@ static uint16_t base_GEN15_GA1[] = { - - #define base_GEN16_GA1 EmptyFeat - -+static uint16_t base_GEN17_GA1[] = { -+ S390_FEAT_MISC_INSTRUCTION_EXT4, -+ S390_FEAT_SIF, -+ S390_FEAT_GROUP_MSA_EXT_12, -+ S390_FEAT_GROUP_PLO_EXT, -+}; -+ - /* Full features (in order of release) - * Automatically includes corresponding base features. - * Full features are all features this hardware supports even if kvm/QEMU do not -@@ -715,6 +722,20 @@ static uint16_t full_GEN16_GA1[] = { - S390_FEAT_UV_FEAT_AP_INTR, - }; - -+static uint16_t full_GEN17_GA1[] = { -+ S390_FEAT_VECTOR_ENH3, -+ S390_FEAT_VECTOR_PACKED_DECIMAL_ENH3, -+ S390_FEAT_INEFF_NC_TX, -+ S390_FEAT_GROUP_GEN17_PTFF, -+ S390_FEAT_GROUP_MSA_EXT_10, -+ S390_FEAT_GROUP_MSA_EXT_10_PCKMO, -+ S390_FEAT_GROUP_MSA_EXT_11, -+ S390_FEAT_GROUP_MSA_EXT_11_PCKMO, -+ S390_FEAT_GROUP_MSA_EXT_13, -+ S390_FEAT_GROUP_MSA_EXT_13_PCKMO, -+ S390_FEAT_GROUP_CONCURRENT_FUNCTIONS, -+}; -+ - - /* Default features (in order of release) - * Automatically includes corresponding base features. -@@ -810,6 +831,17 @@ static uint16_t default_GEN16_GA1[] = { - S390_FEAT_PAIE, - }; - -+static uint16_t default_GEN17_GA1[] = { -+ S390_FEAT_VECTOR_ENH3, -+ S390_FEAT_VECTOR_PACKED_DECIMAL_ENH3, -+ S390_FEAT_GROUP_MSA_EXT_10, -+ S390_FEAT_GROUP_MSA_EXT_10_PCKMO, -+ S390_FEAT_GROUP_MSA_EXT_11, -+ S390_FEAT_GROUP_MSA_EXT_11_PCKMO, -+ S390_FEAT_GROUP_MSA_EXT_13, -+ S390_FEAT_GROUP_MSA_EXT_13_PCKMO, -+}; -+ - /* QEMU (CPU model) features */ - - static uint16_t qemu_V2_11[] = { -@@ -958,6 +990,7 @@ static CpuFeatDefSpec CpuFeatDef[] = { - CPU_FEAT_INITIALIZER(GEN14_GA2), - CPU_FEAT_INITIALIZER(GEN15_GA1), - CPU_FEAT_INITIALIZER(GEN16_GA1), -+ CPU_FEAT_INITIALIZER(GEN17_GA1), - }; - - #define FEAT_GROUP_INITIALIZER(_name) \ --- -2.39.3 - diff --git a/kvm-scripts-improve-error-from-qemu-trace-stap-on-missin.patch b/kvm-scripts-improve-error-from-qemu-trace-stap-on-missin.patch deleted file mode 100644 index a8fcd35..0000000 --- a/kvm-scripts-improve-error-from-qemu-trace-stap-on-missin.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 804d6d4fe3e5fde1fe5e21b5c4a33b6f279fe407 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= -Date: Fri, 6 Dec 2024 11:45:24 +0000 -Subject: [PATCH 2/3] scripts: improve error from qemu-trace-stap on missing - 'stap' -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Daniel P. Berrangé -RH-MergeRequest: 346: scripts: improve error from qemu-trace-stap on missing 'stap' -RH-Jira: RHEL-83535 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/2] 2b2425b5c8cd8d59e9d8d4b228d2d97156bba510 (berrange/centos-src-qemu) - -If the 'stap' binary is missing in $PATH, a huge trace is thrown - - $ qemu-trace-stap list /usr/bin/qemu-system-x86_64 - Traceback (most recent call last): - File "/usr/bin/qemu-trace-stap", line 169, in - main() - File "/usr/bin/qemu-trace-stap", line 165, in main - args.func(args) - File "/usr/bin/qemu-trace-stap", line 83, in cmd_run - subprocess.call(stapargs) - File "/usr/lib64/python3.12/subprocess.py", line 389, in call - with Popen(*popenargs, **kwargs) as p: - ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/usr/lib64/python3.12/subprocess.py", line 1026, in {}init{} - self._execute_child(args, executable, preexec_fn, close_fds, - File "/usr/lib64/python3.12/subprocess.py", line 1955, in _execute_child - raise child_exception_type(errno_num, err_msg, err_filename) - FileNotFoundError: [Errno 2] No such file or directory: 'stap' - -With this change the user now gets - - $ qemu-trace-stap list /usr/bin/qemu-system-x86_64 - Unable to find 'stap' in $PATH - -Signed-off-by: Daniel P. Berrangé -Reviewed-by: Philippe Mathieu-Daudé -Message-id: 20241206114524.1666664-1-berrange@redhat.com -Signed-off-by: Stefan Hajnoczi -(cherry picked from commit 9976be3911a2d0503f026ae37c17077273bf30ee) ---- - scripts/qemu-trace-stap | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/scripts/qemu-trace-stap b/scripts/qemu-trace-stap -index eb6e951ff2..e983460ee7 100755 ---- a/scripts/qemu-trace-stap -+++ b/scripts/qemu-trace-stap -@@ -56,6 +56,7 @@ def tapset_dir(binary): - - - def cmd_run(args): -+ stap = which("stap") - prefix = probe_prefix(args.binary) - tapsets = tapset_dir(args.binary) - -@@ -76,7 +77,7 @@ def cmd_run(args): - - # We request an 8MB buffer, since the stap default 1MB buffer - # can be easily overflowed by frequently firing QEMU traces -- stapargs = ["stap", "-s", "8", "-I", tapsets ] -+ stapargs = [stap, "-s", "8", "-I", tapsets ] - if args.pid is not None: - stapargs.extend(["-x", args.pid]) - stapargs.extend(["-e", script]) -@@ -84,6 +85,7 @@ def cmd_run(args): - - - def cmd_list(args): -+ stap = which("stap") - tapsets = tapset_dir(args.binary) - - if args.verbose: -@@ -96,7 +98,7 @@ def cmd_list(args): - - if verbose: - print("Listing probes with name '%s'" % script) -- proc = subprocess.Popen(["stap", "-I", tapsets, "-l", script], -+ proc = subprocess.Popen([stap, "-I", tapsets, "-l", script], - stdout=subprocess.PIPE, - universal_newlines=True) - out, err = proc.communicate() --- -2.39.3 - diff --git a/kvm-scsi-fix-allocation-for-s390x-loadparm.patch b/kvm-scsi-fix-allocation-for-s390x-loadparm.patch deleted file mode 100644 index 8c58632..0000000 --- a/kvm-scsi-fix-allocation-for-s390x-loadparm.patch +++ /dev/null @@ -1,44 +0,0 @@ -From f03d8c917543a5b92e26fcd8bd7c1cf006ea37df Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Tue, 19 Nov 2024 22:31:22 +0100 -Subject: [PATCH 6/9] scsi: fix allocation for s390x loadparm - -RH-Author: Thomas Huth -RH-MergeRequest: 297: [c10s] Fixes for the new s390x "boot order" feature -RH-Jira: RHEL-68444 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [5/8] b5a906d74fb4ad5a89e1880f07447bd3a5b3f2e9 (thuth/qemu-kvm-cs9) - -Coverity reports a possible buffer overrun due to a non-NUL-terminated -string in scsi_property_set_loadparm(). While things are not so easy, -because qdev_prop_sanitize_s390x_loadparm is designed to operate on a -buffer that is not NUL-terminated, in this case the string *does* have -to be NUL-terminated because it is read by scsi_property_get_loadparm -and s390_build_iplb. - -Reviewed-by: jrossi@linux.ibm.com -Cc: thuth@redhat.com -Fixes: 429442e52d9 ("hw: Add "loadparm" property to scsi disk devices for booting on s390x", 2024-11-18) -Signed-off-by: Paolo Bonzini -(cherry picked from commit b73d7eff1eedb2399cd594bc872d5db13506d951) -Signed-off-by: Thomas Huth ---- - hw/scsi/scsi-disk.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c -index 7566a5f531..de0c295173 100644 ---- a/hw/scsi/scsi-disk.c -+++ b/hw/scsi/scsi-disk.c -@@ -3152,7 +3152,7 @@ static void scsi_property_set_loadparm(Object *obj, const char *value, - return; - } - -- lp_str = g_malloc0(strlen(value)); -+ lp_str = g_malloc0(strlen(value) + 1); - if (!qdev_prop_sanitize_s390x_loadparm(lp_str, value, errp)) { - g_free(lp_str); - return; --- -2.39.3 - diff --git a/kvm-target-i386-Add-AVX512-state-when-AVX10-is-supported.patch b/kvm-target-i386-Add-AVX512-state-when-AVX10-is-supported.patch deleted file mode 100644 index 81565b3..0000000 --- a/kvm-target-i386-Add-AVX512-state-when-AVX10-is-supported.patch +++ /dev/null @@ -1,56 +0,0 @@ -From a246db2fbd892b572fced12da843628f1aab8cd2 Mon Sep 17 00:00:00 2001 -From: Tao Su -Date: Thu, 31 Oct 2024 16:52:32 +0800 -Subject: [PATCH 36/38] target/i386: Add AVX512 state when AVX10 is supported - -RH-Author: Paolo Bonzini -RH-MergeRequest: 280: Add support for the AVX10.1, SHA512, SM3 and SM4 instruction sets -RH-Jira: RHEL-30315 RHEL-45110 -RH-Acked-by: Vitaly Kuznetsov -RH-Acked-by: Miroslav Rezanina -RH-Commit: [7/9] 6f791fae9a3255140795b709435b25159226becf (bonzini/rhel-qemu-kvm) - -AVX10 state enumeration in CPUID leaf D and enabling in XCR0 register -are identical to AVX512 state regardless of the supported vector lengths. - -Given that some E-cores will support AVX10 but not support AVX512, add -AVX512 state components to guest when AVX10 is enabled. - -Based on a patch by Tao Su - -Signed-off-by: Paolo Bonzini -Reviewed-by: Zhao Liu -Tested-by: Xuelian Guo -Signed-off-by: Tao Su -Link: https://lore.kernel.org/r/20241031085233.425388-8-tao1.su@linux.intel.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit 0d7475be3b402c25d74c5a4573cbeb733c8f3559) -Signed-off-by: Paolo Bonzini ---- - target/i386/cpu.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/target/i386/cpu.c b/target/i386/cpu.c -index a740429fdd..ddec461dd4 100644 ---- a/target/i386/cpu.c -+++ b/target/i386/cpu.c -@@ -7140,7 +7140,15 @@ static bool cpuid_has_xsave_feature(CPUX86State *env, const ExtSaveArea *esa) - return false; - } - -- return (env->features[esa->feature] & esa->bits); -+ if (env->features[esa->feature] & esa->bits) { -+ return true; -+ } -+ if (esa->feature == FEAT_7_0_EBX && esa->bits == CPUID_7_0_EBX_AVX512F -+ && (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10)) { -+ return true; -+ } -+ -+ return false; - } - - static void x86_cpu_reset_hold(Object *obj, ResetType type) --- -2.39.3 - diff --git a/kvm-target-i386-Add-feature-dependencies-for-AVX10.patch b/kvm-target-i386-Add-feature-dependencies-for-AVX10.patch deleted file mode 100644 index f116f49..0000000 --- a/kvm-target-i386-Add-feature-dependencies-for-AVX10.patch +++ /dev/null @@ -1,89 +0,0 @@ -From c44f6f57898eb9f382545201033586a17bbde83c Mon Sep 17 00:00:00 2001 -From: Tao Su -Date: Thu, 31 Oct 2024 16:52:31 +0800 -Subject: [PATCH 35/38] target/i386: Add feature dependencies for AVX10 - -RH-Author: Paolo Bonzini -RH-MergeRequest: 280: Add support for the AVX10.1, SHA512, SM3 and SM4 instruction sets -RH-Jira: RHEL-30315 RHEL-45110 -RH-Acked-by: Vitaly Kuznetsov -RH-Acked-by: Miroslav Rezanina -RH-Commit: [6/9] 38b1a79032d7acdb264a6403fd4d8239d89b68c4 (bonzini/rhel-qemu-kvm) - -Since the highest supported vector length for a processor implies that -all lesser vector lengths are also supported, add the dependencies of -the supported vector lengths. If all vector lengths aren't supported, -clear AVX10 enable bit as well. - -Note that the order of AVX10 related dependencies should be kept as: - CPUID_24_0_EBX_AVX10_128 -> CPUID_24_0_EBX_AVX10_256, - CPUID_24_0_EBX_AVX10_256 -> CPUID_24_0_EBX_AVX10_512, - CPUID_24_0_EBX_AVX10_VL_MASK -> CPUID_7_1_EDX_AVX10, - CPUID_7_1_EDX_AVX10 -> CPUID_24_0_EBX, -so that prevent user from setting weird CPUID combinations, e.g. 256-bits -and 512-bits are supported but 128-bits is not, no vector lengths are -supported but AVX10 enable bit is still set. - -Since AVX10_128 will be reserved as 1, adding these dependencies has the -bonus that when user sets -cpu host,-avx10-128, CPUID_7_1_EDX_AVX10 and -CPUID_24_0_EBX will be disabled automatically. - -Tested-by: Xuelian Guo -Signed-off-by: Tao Su -Link: https://lore.kernel.org/r/20241028024512.156724-5-tao1.su@linux.intel.com -Reviewed-by: Zhao Liu -Signed-off-by: Paolo Bonzini -Link: https://lore.kernel.org/r/20241031085233.425388-7-tao1.su@linux.intel.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit 150ab84b2d0083e6af344cca70290614d4fe568d) -Signed-off-by: Paolo Bonzini ---- - target/i386/cpu.c | 16 ++++++++++++++++ - target/i386/cpu.h | 4 ++++ - 2 files changed, 20 insertions(+) - -diff --git a/target/i386/cpu.c b/target/i386/cpu.c -index 958cbff54d..a740429fdd 100644 ---- a/target/i386/cpu.c -+++ b/target/i386/cpu.c -@@ -1766,6 +1766,22 @@ static FeatureDep feature_dependencies[] = { - .from = { FEAT_7_0_EBX, CPUID_7_0_EBX_SGX }, - .to = { FEAT_SGX_12_1_EAX, ~0ull }, - }, -+ { -+ .from = { FEAT_24_0_EBX, CPUID_24_0_EBX_AVX10_128 }, -+ .to = { FEAT_24_0_EBX, CPUID_24_0_EBX_AVX10_256 }, -+ }, -+ { -+ .from = { FEAT_24_0_EBX, CPUID_24_0_EBX_AVX10_256 }, -+ .to = { FEAT_24_0_EBX, CPUID_24_0_EBX_AVX10_512 }, -+ }, -+ { -+ .from = { FEAT_24_0_EBX, CPUID_24_0_EBX_AVX10_VL_MASK }, -+ .to = { FEAT_7_1_EDX, CPUID_7_1_EDX_AVX10 }, -+ }, -+ { -+ .from = { FEAT_7_1_EDX, CPUID_7_1_EDX_AVX10 }, -+ .to = { FEAT_24_0_EBX, ~0ull }, -+ }, - }; - - typedef struct X86RegisterInfo32 { -diff --git a/target/i386/cpu.h b/target/i386/cpu.h -index c60290b8d5..4da9ed5930 100644 ---- a/target/i386/cpu.h -+++ b/target/i386/cpu.h -@@ -997,6 +997,10 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w); - #define CPUID_24_0_EBX_AVX10_256 (1U << 17) - /* AVX10 512-bit vector support is present */ - #define CPUID_24_0_EBX_AVX10_512 (1U << 18) -+/* AVX10 vector length support mask */ -+#define CPUID_24_0_EBX_AVX10_VL_MASK (CPUID_24_0_EBX_AVX10_128 | \ -+ CPUID_24_0_EBX_AVX10_256 | \ -+ CPUID_24_0_EBX_AVX10_512) - - /* RAS Features */ - #define CPUID_8000_0007_EBX_OVERFLOW_RECOV (1U << 0) --- -2.39.3 - diff --git a/kvm-target-i386-Introduce-GraniteRapids-v2-model.patch b/kvm-target-i386-Introduce-GraniteRapids-v2-model.patch deleted file mode 100644 index d9a94af..0000000 --- a/kvm-target-i386-Introduce-GraniteRapids-v2-model.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 32437dacd0f0d5076af2d549317b92432ee52abd Mon Sep 17 00:00:00 2001 -From: Tao Su -Date: Thu, 31 Oct 2024 16:52:33 +0800 -Subject: [PATCH 37/38] target/i386: Introduce GraniteRapids-v2 model - -RH-Author: Paolo Bonzini -RH-MergeRequest: 280: Add support for the AVX10.1, SHA512, SM3 and SM4 instruction sets -RH-Jira: RHEL-30315 RHEL-45110 -RH-Acked-by: Vitaly Kuznetsov -RH-Acked-by: Miroslav Rezanina -RH-Commit: [8/9] c53ba67dd616c9f376db0ab4f1478dd50f5dd874 (bonzini/rhel-qemu-kvm) - -Update GraniteRapids CPU model to add AVX10 and the missing features(ss, -tsc-adjust, cldemote, movdiri, movdir64b). - -Tested-by: Xuelian Guo -Signed-off-by: Tao Su -Link: https://lore.kernel.org/r/20241028024512.156724-7-tao1.su@linux.intel.com -Reviewed-by: Zhao Liu -Signed-off-by: Paolo Bonzini -Link: https://lore.kernel.org/r/20241031085233.425388-9-tao1.su@linux.intel.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit 1a519388a882fbb352e49cbebb0ed8f62d05842d) -Signed-off-by: Paolo Bonzini ---- - target/i386/cpu.c | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/target/i386/cpu.c b/target/i386/cpu.c -index ddec461dd4..e7367cfe82 100644 ---- a/target/i386/cpu.c -+++ b/target/i386/cpu.c -@@ -4385,6 +4385,23 @@ static const X86CPUDefinition builtin_x86_defs[] = { - .model_id = "Intel Xeon Processor (GraniteRapids)", - .versions = (X86CPUVersionDefinition[]) { - { .version = 1 }, -+ { -+ .version = 2, -+ .props = (PropValue[]) { -+ { "ss", "on" }, -+ { "tsc-adjust", "on" }, -+ { "cldemote", "on" }, -+ { "movdiri", "on" }, -+ { "movdir64b", "on" }, -+ { "avx10", "on" }, -+ { "avx10-128", "on" }, -+ { "avx10-256", "on" }, -+ { "avx10-512", "on" }, -+ { "avx10-version", "1" }, -+ { "stepping", "1" }, -+ { /* end of list */ } -+ } -+ }, - { /* end of list */ }, - }, - }, --- -2.39.3 - diff --git a/kvm-target-i386-Make-sure-SynIC-state-is-really-updated-.patch b/kvm-target-i386-Make-sure-SynIC-state-is-really-updated-.patch deleted file mode 100644 index fd18705..0000000 --- a/kvm-target-i386-Make-sure-SynIC-state-is-really-updated-.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 327e8c65d28dc357c02b508e6485e7c57d4d1efa Mon Sep 17 00:00:00 2001 -From: Vitaly Kuznetsov -Date: Tue, 7 Jan 2025 13:43:32 +0100 -Subject: [PATCH 1/4] target/i386: Make sure SynIC state is really updated - before KVM_RUN - -RH-Author: Vitaly Kuznetsov -RH-MergeRequest: 314: target/i386: Make sure SynIC state is really updated before KVM_RUN -RH-Jira: RHEL-73002 -RH-Acked-by: Paolo Bonzini -RH-Acked-by: Maxim Levitsky -RH-Commit: [1/1] 2d8f7605e3efd3c76d16a2cb9e7c0898786fb4e9 (vkuznets/qemu-kvm) - -'hyperv_synic' test from KVM unittests was observed to be flaky on certain -hardware (hangs sometimes). Debugging shows that the problem happens in -hyperv_sint_route_new() when the test tries to set up a new SynIC -route. The function bails out on: - - if (!synic->sctl_enabled) { - goto cleanup; - } - -but the test writes to HV_X64_MSR_SCONTROL just before it starts -establishing SINT routes. Further investigation shows that -synic_update() (called from async_synic_update()) happens after the SINT -setup attempt and not before. Apparently, the comment before -async_safe_run_on_cpu() in kvm_hv_handle_exit() does not correctly describe -the guarantees async_safe_run_on_cpu() gives. In particular, async worked -added to a CPU is actually processed from qemu_wait_io_event() which is not -always called before KVM_RUN, i.e. kvm_cpu_exec() checks whether an exit -request is pending for a CPU and if not, keeps running the vCPU until it -meets an exit it can't handle internally. Hyper-V specific MSR writes are -not automatically trigger an exit. - -Fix the issue by simply raising an exit request for the vCPU where SynIC -update was queued. This is not a performance critical path as SynIC state -does not get updated so often (and async_safe_run_on_cpu() is a big hammer -anyways). - -Reported-by: Jan Richter -Signed-off-by: Vitaly Kuznetsov -Link: https://lore.kernel.org/r/20240917160051.2637594-4-vkuznets@redhat.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit d3177e2e4353824a650434c57471615d43507500) -Signed-off-by: Vitaly Kuznetsov ---- - target/i386/kvm/hyperv.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/target/i386/kvm/hyperv.c b/target/i386/kvm/hyperv.c -index b94f12acc2..70b89cacf9 100644 ---- a/target/i386/kvm/hyperv.c -+++ b/target/i386/kvm/hyperv.c -@@ -80,6 +80,7 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) - * necessary because memory hierarchy is being changed - */ - async_safe_run_on_cpu(CPU(cpu), async_synic_update, RUN_ON_CPU_NULL); -+ cpu_exit(CPU(cpu)); - - return EXCP_INTERRUPT; - case KVM_EXIT_HYPERV_HCALL: { --- -2.39.3 - diff --git a/kvm-target-i386-add-AVX10-feature-and-AVX10-version-prop.patch b/kvm-target-i386-add-AVX10-feature-and-AVX10-version-prop.patch deleted file mode 100644 index e60ecf4..0000000 --- a/kvm-target-i386-add-AVX10-feature-and-AVX10-version-prop.patch +++ /dev/null @@ -1,224 +0,0 @@ -From 704bfed342ca7cfbef44b639aadfeada1841b091 Mon Sep 17 00:00:00 2001 -From: Tao Su -Date: Thu, 31 Oct 2024 16:52:29 +0800 -Subject: [PATCH 33/38] target/i386: add AVX10 feature and AVX10 version - property - -RH-Author: Paolo Bonzini -RH-MergeRequest: 280: Add support for the AVX10.1, SHA512, SM3 and SM4 instruction sets -RH-Jira: RHEL-30315 RHEL-45110 -RH-Acked-by: Vitaly Kuznetsov -RH-Acked-by: Miroslav Rezanina -RH-Commit: [4/9] 8101218e0a5789770fcef7ca277f7b39df48f176 (bonzini/rhel-qemu-kvm) - -When AVX10 enable bit is set, the 0x24 leaf will be present as "AVX10 -Converged Vector ISA leaf" containing fields for the version number and -the supported vector bit lengths. - -Introduce avx10-version property so that avx10 version can be controlled -by user and cpu model. Per spec, avx10 version can never be 0, the default -value of avx10-version is set to 0 to determine whether it is specified by -user. The default can come from the device model or, for the max model, -from KVM's reported value. - -Signed-off-by: Tao Su -Link: https://lore.kernel.org/r/20241028024512.156724-3-tao1.su@linux.intel.com -Link: https://lore.kernel.org/r/20241028024512.156724-4-tao1.su@linux.intel.com -Signed-off-by: Paolo Bonzini -Tested-by: Xuelian Guo -Link: https://lore.kernel.org/r/20241031085233.425388-5-tao1.su@linux.intel.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit bccfb846fd52d6f20704ecfa4d01b60b43c6f640) -Signed-off-by: Paolo Bonzini ---- - target/i386/cpu.c | 64 ++++++++++++++++++++++++++++++++++++++----- - target/i386/cpu.h | 4 +++ - target/i386/kvm/kvm.c | 3 +- - 3 files changed, 63 insertions(+), 8 deletions(-) - -diff --git a/target/i386/cpu.c b/target/i386/cpu.c -index 353f50a1b9..a2e1a18537 100644 ---- a/target/i386/cpu.c -+++ b/target/i386/cpu.c -@@ -47,6 +47,9 @@ - #include "cpu-internal.h" - - static void x86_cpu_realizefn(DeviceState *dev, Error **errp); -+static void x86_cpu_get_supported_cpuid(uint32_t func, uint32_t index, -+ uint32_t *eax, uint32_t *ebx, -+ uint32_t *ecx, uint32_t *edx); - - /* Helpers for building CPUID[2] descriptors: */ - -@@ -1133,7 +1136,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = { - "avx-vnni-int8", "avx-ne-convert", NULL, NULL, - "amx-complex", NULL, "avx-vnni-int16", NULL, - NULL, NULL, "prefetchiti", NULL, -- NULL, NULL, NULL, NULL, -+ NULL, NULL, NULL, "avx10", - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, -@@ -1961,6 +1964,7 @@ typedef struct X86CPUDefinition { - int family; - int model; - int stepping; -+ uint8_t avx10_version; - FeatureWordArray features; - const char *model_id; - const CPUCaches *const cache_info; -@@ -6326,6 +6330,9 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model) - */ - object_property_set_str(OBJECT(cpu), "vendor", def->vendor, &error_abort); - -+ object_property_set_uint(OBJECT(cpu), "avx10-version", def->avx10_version, -+ &error_abort); -+ - x86_cpu_apply_version_props(cpu, model); - - /* -@@ -6854,6 +6861,16 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, - } - break; - } -+ case 0x24: { -+ *eax = 0; -+ *ebx = 0; -+ *ecx = 0; -+ *edx = 0; -+ if ((env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) && count == 0) { -+ *ebx = env->features[FEAT_24_0_EBX] | env->avx10_version; -+ } -+ break; -+ } - case 0x40000000: - /* - * CPUID code in kvm_arch_init_vcpu() ignores stuff -@@ -7434,6 +7451,12 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp) - ~env->user_features[w] & - ~feature_word_info[w].no_autoenable_flags; - } -+ -+ if ((env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) && !env->avx10_version) { -+ uint32_t eax, ebx, ecx, edx; -+ x86_cpu_get_supported_cpuid(0x24, 0, &eax, &ebx, &ecx, &edx); -+ env->avx10_version = ebx & 0xff; -+ } - } - - for (i = 0; i < ARRAY_SIZE(feature_dependencies); i++) { -@@ -7497,6 +7520,11 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp) - x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x1F); - } - -+ /* Advanced Vector Extensions 10 (AVX10) requires CPUID[0x24] */ -+ if (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) { -+ x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x24); -+ } -+ - /* SVM requires CPUID[0x8000000A] */ - if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) { - x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A); -@@ -7547,6 +7575,10 @@ static bool x86_cpu_filter_features(X86CPU *cpu, bool verbose) - CPUX86State *env = &cpu->env; - FeatureWord w; - const char *prefix = NULL; -+ bool have_filtered_features; -+ -+ uint32_t eax_0, ebx_0, ecx_0, edx_0; -+ uint32_t eax_1, ebx_1, ecx_1, edx_1; - - if (verbose) { - prefix = accel_uses_host_cpuid() -@@ -7568,13 +7600,10 @@ static bool x86_cpu_filter_features(X86CPU *cpu, bool verbose) - */ - if ((env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_INTEL_PT) && - kvm_enabled()) { -- uint32_t eax_0, ebx_0, ecx_0, edx_0_unused; -- uint32_t eax_1, ebx_1, ecx_1_unused, edx_1_unused; -- - x86_cpu_get_supported_cpuid(0x14, 0, -- &eax_0, &ebx_0, &ecx_0, &edx_0_unused); -+ &eax_0, &ebx_0, &ecx_0, &edx_0); - x86_cpu_get_supported_cpuid(0x14, 1, -- &eax_1, &ebx_1, &ecx_1_unused, &edx_1_unused); -+ &eax_1, &ebx_1, &ecx_1, &edx_1); - - if (!eax_0 || - ((ebx_0 & INTEL_PT_MINIMAL_EBX) != INTEL_PT_MINIMAL_EBX) || -@@ -7595,7 +7624,27 @@ static bool x86_cpu_filter_features(X86CPU *cpu, bool verbose) - } - } - -- return x86_cpu_have_filtered_features(cpu); -+ have_filtered_features = x86_cpu_have_filtered_features(cpu); -+ -+ if (env->features[FEAT_7_1_EDX] & CPUID_7_1_EDX_AVX10) { -+ x86_cpu_get_supported_cpuid(0x24, 0, -+ &eax_0, &ebx_0, &ecx_0, &edx_0); -+ uint8_t version = ebx_0 & 0xff; -+ -+ if (version < env->avx10_version) { -+ if (prefix) { -+ warn_report("%s: avx10.%d. Adjust to avx10.%d", -+ prefix, env->avx10_version, version); -+ } -+ env->avx10_version = version; -+ have_filtered_features = true; -+ } -+ } else if (env->avx10_version && prefix) { -+ warn_report("%s: avx10.%d.", prefix, env->avx10_version); -+ have_filtered_features = true; -+ } -+ -+ return have_filtered_features; - } - - static void x86_cpu_hyperv_realize(X86CPU *cpu) -@@ -8376,6 +8425,7 @@ static Property x86_cpu_properties[] = { - DEFINE_PROP_UINT32("min-level", X86CPU, env.cpuid_min_level, 0), - DEFINE_PROP_UINT32("min-xlevel", X86CPU, env.cpuid_min_xlevel, 0), - DEFINE_PROP_UINT32("min-xlevel2", X86CPU, env.cpuid_min_xlevel2, 0), -+ DEFINE_PROP_UINT8("avx10-version", X86CPU, env.avx10_version, 0), - DEFINE_PROP_UINT64("ucode-rev", X86CPU, ucode_rev, 0), - DEFINE_PROP_BOOL("full-cpuid-auto-level", X86CPU, full_cpuid_auto_level, true), - DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor), -diff --git a/target/i386/cpu.h b/target/i386/cpu.h -index 14edd57a37..591113349d 100644 ---- a/target/i386/cpu.h -+++ b/target/i386/cpu.h -@@ -972,6 +972,8 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w); - #define CPUID_7_1_EDX_AMX_COMPLEX (1U << 8) - /* PREFETCHIT0/1 Instructions */ - #define CPUID_7_1_EDX_PREFETCHITI (1U << 14) -+/* Support for Advanced Vector Extensions 10 */ -+#define CPUID_7_1_EDX_AVX10 (1U << 19) - /* Flexible return and event delivery (FRED) */ - #define CPUID_7_1_EAX_FRED (1U << 17) - /* Load into IA32_KERNEL_GS_BASE (LKGS) */ -@@ -1914,6 +1916,8 @@ typedef struct CPUArchState { - uint32_t cpuid_vendor3; - uint32_t cpuid_version; - FeatureWordArray features; -+ /* AVX10 version */ -+ uint8_t avx10_version; - /* Features that were explicitly enabled/disabled */ - FeatureWordArray user_features; - uint32_t cpuid_model[12]; -diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c -index 814f93da19..d0329a4ed7 100644 ---- a/target/i386/kvm/kvm.c -+++ b/target/i386/kvm/kvm.c -@@ -1891,7 +1891,8 @@ static uint32_t kvm_x86_build_cpuid(CPUX86State *env, - case 0x7: - case 0x14: - case 0x1d: -- case 0x1e: { -+ case 0x1e: -+ case 0x24: { - uint32_t times; - - c->function = i; --- -2.39.3 - diff --git a/kvm-target-i386-add-CPUID.24-features-for-AVX10.patch b/kvm-target-i386-add-CPUID.24-features-for-AVX10.patch deleted file mode 100644 index 36a0aff..0000000 --- a/kvm-target-i386-add-CPUID.24-features-for-AVX10.patch +++ /dev/null @@ -1,91 +0,0 @@ -From cfb4964556facf1cb4500f0e3a754e4e20c13aed Mon Sep 17 00:00:00 2001 -From: Tao Su -Date: Thu, 31 Oct 2024 16:52:30 +0800 -Subject: [PATCH 34/38] target/i386: add CPUID.24 features for AVX10 - -RH-Author: Paolo Bonzini -RH-MergeRequest: 280: Add support for the AVX10.1, SHA512, SM3 and SM4 instruction sets -RH-Jira: RHEL-30315 RHEL-45110 -RH-Acked-by: Vitaly Kuznetsov -RH-Acked-by: Miroslav Rezanina -RH-Commit: [5/9] a8b6f9edc330b412fbd27eece2f4961f4f876e5b (bonzini/rhel-qemu-kvm) - -Introduce features for the supported vector bit lengths. - -Signed-off-by: Tao Su -Link: https://lore.kernel.org/r/20241028024512.156724-3-tao1.su@linux.intel.com -Link: https://lore.kernel.org/r/20241028024512.156724-4-tao1.su@linux.intel.com -Signed-off-by: Paolo Bonzini -Reviewed-by: Zhao Liu -Tested-by: Xuelian Guo -Link: https://lore.kernel.org/r/20241031085233.425388-6-tao1.su@linux.intel.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit 2d055b8fe11ee567c2ae8047311fd83697e494b6) -Signed-off-by: Paolo Bonzini ---- - target/i386/cpu.c | 15 +++++++++++++++ - target/i386/cpu.h | 8 ++++++++ - 2 files changed, 23 insertions(+) - -diff --git a/target/i386/cpu.c b/target/i386/cpu.c -index a2e1a18537..958cbff54d 100644 ---- a/target/i386/cpu.c -+++ b/target/i386/cpu.c -@@ -902,6 +902,7 @@ void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1, - #define TCG_SGX_12_0_EAX_FEATURES 0 - #define TCG_SGX_12_0_EBX_FEATURES 0 - #define TCG_SGX_12_1_EAX_FEATURES 0 -+#define TCG_24_0_EBX_FEATURES 0 - - #if defined CONFIG_USER_ONLY - #define CPUID_8000_0008_EBX_KERNEL_FEATURES (CPUID_8000_0008_EBX_IBPB | \ -@@ -1167,6 +1168,20 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = { - }, - .tcg_features = TCG_7_2_EDX_FEATURES, - }, -+ [FEAT_24_0_EBX] = { -+ .type = CPUID_FEATURE_WORD, -+ .feat_names = { -+ [16] = "avx10-128", -+ [17] = "avx10-256", -+ [18] = "avx10-512", -+ }, -+ .cpuid = { -+ .eax = 0x24, -+ .needs_ecx = true, .ecx = 0, -+ .reg = R_EBX, -+ }, -+ .tcg_features = TCG_24_0_EBX_FEATURES, -+ }, - [FEAT_8000_0007_EDX] = { - .type = CPUID_FEATURE_WORD, - .feat_names = { -diff --git a/target/i386/cpu.h b/target/i386/cpu.h -index 591113349d..c60290b8d5 100644 ---- a/target/i386/cpu.h -+++ b/target/i386/cpu.h -@@ -666,6 +666,7 @@ typedef enum FeatureWord { - FEAT_XSAVE_XSS_HI, /* CPUID[EAX=0xd,ECX=1].EDX */ - FEAT_7_1_EDX, /* CPUID[EAX=7,ECX=1].EDX */ - FEAT_7_2_EDX, /* CPUID[EAX=7,ECX=2].EDX */ -+ FEAT_24_0_EBX, /* CPUID[EAX=0x24,ECX=0].EBX */ - FEATURE_WORDS, - } FeatureWord; - -@@ -990,6 +991,13 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w); - /* Packets which contain IP payload have LIP values */ - #define CPUID_14_0_ECX_LIP (1U << 31) - -+/* AVX10 128-bit vector support is present */ -+#define CPUID_24_0_EBX_AVX10_128 (1U << 16) -+/* AVX10 256-bit vector support is present */ -+#define CPUID_24_0_EBX_AVX10_256 (1U << 17) -+/* AVX10 512-bit vector support is present */ -+#define CPUID_24_0_EBX_AVX10_512 (1U << 18) -+ - /* RAS Features */ - #define CPUID_8000_0007_EBX_OVERFLOW_RECOV (1U << 0) - #define CPUID_8000_0007_EBX_SUCCOR (1U << 1) --- -2.39.3 - diff --git a/kvm-target-i386-add-sha512-sm3-sm4-feature-bits.patch b/kvm-target-i386-add-sha512-sm3-sm4-feature-bits.patch deleted file mode 100644 index 7f6c82a..0000000 --- a/kvm-target-i386-add-sha512-sm3-sm4-feature-bits.patch +++ /dev/null @@ -1,43 +0,0 @@ -From d457fd42e0752855d8370bac1cf3c07cd1fc46a3 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Wed, 3 Jul 2024 13:42:49 +0200 -Subject: [PATCH 38/38] target/i386: add sha512, sm3, sm4 feature bits - -RH-Author: Paolo Bonzini -RH-MergeRequest: 280: Add support for the AVX10.1, SHA512, SM3 and SM4 instruction sets -RH-Jira: RHEL-30315 RHEL-45110 -RH-Acked-by: Vitaly Kuznetsov -RH-Acked-by: Miroslav Rezanina -RH-Commit: [9/9] 80a6ce9fe3b7225f74a2822ce263d539148cda56 (bonzini/rhel-qemu-kvm) - -Status: queued for QEMU 10.0 - -SHA512, SM3, SM4 (CPUID[EAX=7,ECX=1).EAX bits 0 to 2) is supported by -Clearwater Forest processor, add it to QEMU as it does not need any -specific enablement. - -See https://lore.kernel.org/kvm/20241105054825.870939-1-tao1.su@linux.intel.com/ -for reference. - -Reviewed-by: Tao Su -Signed-off-by: Paolo Bonzini ---- - target/i386/cpu.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/target/i386/cpu.c b/target/i386/cpu.c -index e7367cfe82..ff063a9a50 100644 ---- a/target/i386/cpu.c -+++ b/target/i386/cpu.c -@@ -1114,7 +1114,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = { - [FEAT_7_1_EAX] = { - .type = CPUID_FEATURE_WORD, - .feat_names = { -- NULL, NULL, NULL, NULL, -+ "sha512", "sm3", "sm4", NULL, - "avx-vnni", "avx512-bf16", NULL, "cmpccxadd", - NULL, NULL, "fzrm", "fsrs", - "fsrc", NULL, NULL, NULL, --- -2.39.3 - diff --git a/kvm-target-i386-cpu-set-correct-supported-XCR0-features-.patch b/kvm-target-i386-cpu-set-correct-supported-XCR0-features-.patch deleted file mode 100644 index c385b88..0000000 --- a/kvm-target-i386-cpu-set-correct-supported-XCR0-features-.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 2424960a48dfa6bb499c4cb798b0e5c256deba10 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Thu, 31 Oct 2024 16:52:26 +0800 -Subject: [PATCH 30/38] target/i386: cpu: set correct supported XCR0 features - for TCG - -RH-Author: Paolo Bonzini -RH-MergeRequest: 280: Add support for the AVX10.1, SHA512, SM3 and SM4 instruction sets -RH-Jira: RHEL-30315 RHEL-45110 -RH-Acked-by: Vitaly Kuznetsov -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/9] 0516319354addebf36f9d364fbae5cda7a98473b (bonzini/rhel-qemu-kvm) - -Signed-off-by: Paolo Bonzini -Reviewed-by: Zhao Liu -Link: https://lore.kernel.org/r/20241031085233.425388-2-tao1.su@linux.intel.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit 33098002a838a0450f243f5e17463aca700e923d) -Signed-off-by: Paolo Bonzini ---- - target/i386/cpu.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/target/i386/cpu.c b/target/i386/cpu.c -index 34e0ce5e62..dbdab0f821 100644 ---- a/target/i386/cpu.c -+++ b/target/i386/cpu.c -@@ -1297,7 +1297,9 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = { - .needs_ecx = true, .ecx = 0, - .reg = R_EAX, - }, -- .tcg_features = ~0U, -+ .tcg_features = XSTATE_FP_MASK | XSTATE_SSE_MASK | -+ XSTATE_YMM_MASK | XSTATE_BNDREGS_MASK | XSTATE_BNDCSR_MASK | -+ XSTATE_PKRU_MASK, - .migratable_flags = XSTATE_FP_MASK | XSTATE_SSE_MASK | - XSTATE_YMM_MASK | XSTATE_BNDREGS_MASK | XSTATE_BNDCSR_MASK | - XSTATE_OPMASK_MASK | XSTATE_ZMM_Hi256_MASK | XSTATE_Hi16_ZMM_MASK | -@@ -1310,7 +1312,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = { - .needs_ecx = true, .ecx = 0, - .reg = R_EDX, - }, -- .tcg_features = ~0U, -+ .tcg_features = 0U, - }, - /*Below are MSR exposed features*/ - [FEAT_ARCH_CAPABILITIES] = { --- -2.39.3 - diff --git a/kvm-target-i386-do-not-rely-on-ExtSaveArea-for-accelerat.patch b/kvm-target-i386-do-not-rely-on-ExtSaveArea-for-accelerat.patch deleted file mode 100644 index 73353ea..0000000 --- a/kvm-target-i386-do-not-rely-on-ExtSaveArea-for-accelerat.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 6df46774aa41872a706f1a535d5c547a8ef73556 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Thu, 31 Oct 2024 16:52:27 +0800 -Subject: [PATCH 31/38] target/i386: do not rely on ExtSaveArea for - accelerator-supported XCR0 bits - -RH-Author: Paolo Bonzini -RH-MergeRequest: 280: Add support for the AVX10.1, SHA512, SM3 and SM4 instruction sets -RH-Jira: RHEL-30315 RHEL-45110 -RH-Acked-by: Vitaly Kuznetsov -RH-Acked-by: Miroslav Rezanina -RH-Commit: [2/9] 70d54c2101fd1d30a891a414a8c50566c2ddef67 (bonzini/rhel-qemu-kvm) - -Right now, QEMU is using the "feature" and "bits" fields of ExtSaveArea -to query the accelerator for the support status of extended save areas. -This is a problem for AVX10, which attaches two feature bits (AVX512F -and AVX10) to the same extended save states. - -To keep the AVX10 hacks to the minimum, limit usage of esa->features -and esa->bits. Instead, just query the accelerator for the 0xD leaf. -Do it in common code and clear esa->size if an extended save state is -unsupported. - -Signed-off-by: Paolo Bonzini -Reviewed-by: Zhao Liu -Link: https://lore.kernel.org/r/20241031085233.425388-3-tao1.su@linux.intel.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit b888c7807049cc044d10d70139cb945202fb7cd2) -Signed-off-by: Paolo Bonzini ---- - target/i386/cpu.c | 33 +++++++++++++++++++++++++++++++-- - target/i386/kvm/kvm-cpu.c | 4 ---- - 2 files changed, 31 insertions(+), 6 deletions(-) - -diff --git a/target/i386/cpu.c b/target/i386/cpu.c -index dbdab0f821..d23f15e99a 100644 ---- a/target/i386/cpu.c -+++ b/target/i386/cpu.c -@@ -7086,6 +7086,15 @@ static void x86_cpu_set_sgxlepubkeyhash(CPUX86State *env) - #endif - } - -+static bool cpuid_has_xsave_feature(CPUX86State *env, const ExtSaveArea *esa) -+{ -+ if (!esa->size) { -+ return false; -+ } -+ -+ return (env->features[esa->feature] & esa->bits); -+} -+ - static void x86_cpu_reset_hold(Object *obj, ResetType type) - { - CPUState *cs = CPU(obj); -@@ -7194,7 +7203,7 @@ static void x86_cpu_reset_hold(Object *obj, ResetType type) - if (!((1 << i) & CPUID_XSTATE_XCR0_MASK)) { - continue; - } -- if (env->features[esa->feature] & esa->bits) { -+ if (cpuid_has_xsave_feature(env, esa)) { - xcr0 |= 1ull << i; - } - } -@@ -7332,7 +7341,7 @@ static void x86_cpu_enable_xsave_components(X86CPU *cpu) - mask = 0; - for (i = 0; i < ARRAY_SIZE(x86_ext_save_areas); i++) { - const ExtSaveArea *esa = &x86_ext_save_areas[i]; -- if (env->features[esa->feature] & esa->bits) { -+ if (cpuid_has_xsave_feature(env, esa)) { - mask |= (1ULL << i); - } - } -@@ -8003,6 +8012,26 @@ static void x86_cpu_register_feature_bit_props(X86CPUClass *xcc, - - static void x86_cpu_post_initfn(Object *obj) - { -+ static bool first = true; -+ uint64_t supported_xcr0; -+ int i; -+ -+ if (first) { -+ first = false; -+ -+ supported_xcr0 = -+ ((uint64_t) x86_cpu_get_supported_feature_word(NULL, FEAT_XSAVE_XCR0_HI) << 32) | -+ x86_cpu_get_supported_feature_word(NULL, FEAT_XSAVE_XCR0_LO); -+ -+ for (i = XSTATE_SSE_BIT + 1; i < XSAVE_STATE_AREA_COUNT; i++) { -+ ExtSaveArea *esa = &x86_ext_save_areas[i]; -+ -+ if (!(supported_xcr0 & (1 << i))) { -+ esa->size = 0; -+ } -+ } -+ } -+ - accel_cpu_instance_init(CPU(obj)); - } - -diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c -index 684e731cbc..961b87e98e 100644 ---- a/target/i386/kvm/kvm-cpu.c -+++ b/target/i386/kvm/kvm-cpu.c -@@ -143,10 +143,6 @@ static void kvm_cpu_xsave_init(void) - if (!esa->size) { - continue; - } -- if ((x86_cpu_get_supported_feature_word(NULL, esa->feature) & esa->bits) -- != esa->bits) { -- continue; -- } - host_cpuid(0xd, i, &eax, &ebx, &ecx, &edx); - if (eax != 0) { - assert(esa->size == eax); --- -2.39.3 - diff --git a/kvm-target-i386-kvm-Report-which-action-failed-in-kvm_ar.patch b/kvm-target-i386-kvm-Report-which-action-failed-in-kvm_ar.patch deleted file mode 100644 index ceff6b7..0000000 --- a/kvm-target-i386-kvm-Report-which-action-failed-in-kvm_ar.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 6bae9faff44415edf51bb7f919fc816f8fe3cd12 Mon Sep 17 00:00:00 2001 -From: Julia Suvorova -Date: Fri, 27 Sep 2024 12:47:41 +0200 -Subject: [PATCH 29/38] target/i386/kvm: Report which action failed in - kvm_arch_put/get_registers - -RH-Author: Julia Suvorova -RH-MergeRequest: 287: kvm: Allow kvm_arch_get/put_registers to accept Error** -RH-Jira: RHEL-20574 -RH-Acked-by: Juraj Marcin -RH-Acked-by: Peter Xu -RH-Commit: [2/2] 1e430500be009393846a19451472b3d1031c1283 - -To help debug and triage future failure reports (akin to [1,2]) that -may occur during kvm_arch_put/get_registers, the error path of each -action is accompanied by unique error message. - -[1] https://issues.redhat.com/browse/RHEL-7558 -[2] https://issues.redhat.com/browse/RHEL-21761 - -Signed-off-by: Julia Suvorova -Reviewed-by: Peter Xu -Link: https://lore.kernel.org/r/20240927104743.218468-3-jusual@redhat.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit fc058618d1596d29e89016750a1aaf64c9fe8832) ---- - target/i386/kvm/kvm.c | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c -index 423e6922d8..814f93da19 100644 ---- a/target/i386/kvm/kvm.c -+++ b/target/i386/kvm/kvm.c -@@ -5136,6 +5136,7 @@ int kvm_arch_put_registers(CPUState *cpu, int level, Error **errp) - if (level >= KVM_PUT_RESET_STATE) { - ret = kvm_put_msr_feature_control(x86_cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set feature control MSR"); - return ret; - } - } -@@ -5143,12 +5144,14 @@ int kvm_arch_put_registers(CPUState *cpu, int level, Error **errp) - /* must be before kvm_put_nested_state so that EFER.SVME is set */ - ret = has_sregs2 ? kvm_put_sregs2(x86_cpu) : kvm_put_sregs(x86_cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set special registers"); - return ret; - } - - if (level >= KVM_PUT_RESET_STATE) { - ret = kvm_put_nested_state(x86_cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set nested state"); - return ret; - } - } -@@ -5166,6 +5169,7 @@ int kvm_arch_put_registers(CPUState *cpu, int level, Error **errp) - if (xen_mode == XEN_EMULATE && level == KVM_PUT_FULL_STATE) { - ret = kvm_put_xen_state(cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set Xen state"); - return ret; - } - } -@@ -5173,37 +5177,45 @@ int kvm_arch_put_registers(CPUState *cpu, int level, Error **errp) - - ret = kvm_getput_regs(x86_cpu, 1); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set general purpose registers"); - return ret; - } - ret = kvm_put_xsave(x86_cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set XSAVE"); - return ret; - } - ret = kvm_put_xcrs(x86_cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set XCRs"); - return ret; - } - ret = kvm_put_msrs(x86_cpu, level); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set MSRs"); - return ret; - } - ret = kvm_put_vcpu_events(x86_cpu, level); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set vCPU events"); - return ret; - } - if (level >= KVM_PUT_RESET_STATE) { - ret = kvm_put_mp_state(x86_cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set MP state"); - return ret; - } - } - - ret = kvm_put_tscdeadline_msr(x86_cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set TSC deadline MSR"); - return ret; - } - ret = kvm_put_debugregs(x86_cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to set debug registers"); - return ret; - } - return 0; -@@ -5218,6 +5230,7 @@ int kvm_arch_get_registers(CPUState *cs, Error **errp) - - ret = kvm_get_vcpu_events(cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to get vCPU events"); - goto out; - } - /* -@@ -5226,44 +5239,54 @@ int kvm_arch_get_registers(CPUState *cs, Error **errp) - */ - ret = kvm_get_mp_state(cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to get MP state"); - goto out; - } - ret = kvm_getput_regs(cpu, 0); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to get general purpose registers"); - goto out; - } - ret = kvm_get_xsave(cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to get XSAVE"); - goto out; - } - ret = kvm_get_xcrs(cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to get XCRs"); - goto out; - } - ret = has_sregs2 ? kvm_get_sregs2(cpu) : kvm_get_sregs(cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to get special registers"); - goto out; - } - ret = kvm_get_msrs(cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to get MSRs"); - goto out; - } - ret = kvm_get_apic(cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to get APIC"); - goto out; - } - ret = kvm_get_debugregs(cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to get debug registers"); - goto out; - } - ret = kvm_get_nested_state(cpu); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to get nested state"); - goto out; - } - #ifdef CONFIG_XEN_EMU - if (xen_mode == XEN_EMULATE) { - ret = kvm_get_xen_state(cs); - if (ret < 0) { -+ error_setg_errno(errp, -ret, "Failed to get Xen state"); - goto out; - } - } --- -2.39.3 - diff --git a/kvm-target-i386-return-bool-from-x86_cpu_filter_features.patch b/kvm-target-i386-return-bool-from-x86_cpu_filter_features.patch deleted file mode 100644 index e3defc5..0000000 --- a/kvm-target-i386-return-bool-from-x86_cpu_filter_features.patch +++ /dev/null @@ -1,83 +0,0 @@ -From c4792fc23bf28618601514e3af5f331b4292bdf7 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Thu, 31 Oct 2024 16:52:28 +0800 -Subject: [PATCH 32/38] target/i386: return bool from x86_cpu_filter_features - -RH-Author: Paolo Bonzini -RH-MergeRequest: 280: Add support for the AVX10.1, SHA512, SM3 and SM4 instruction sets -RH-Jira: RHEL-30315 RHEL-45110 -RH-Acked-by: Vitaly Kuznetsov -RH-Acked-by: Miroslav Rezanina -RH-Commit: [3/9] e5ae5d2050ad75411d8db6f9f9519bcaf88c4850 (bonzini/rhel-qemu-kvm) - -Prepare for filtering non-boolean features such as AVX10 version. - -Signed-off-by: Paolo Bonzini -Reviewed-by: Zhao Liu -Signed-off-by: Tao Su -Link: https://lore.kernel.org/r/20241031085233.425388-4-tao1.su@linux.intel.com -Signed-off-by: Paolo Bonzini -(cherry picked from commit 3507c6f04606593711408a6d26141bdbceff9377) -Signed-off-by: Paolo Bonzini ---- - target/i386/cpu.c | 20 +++++++++++--------- - 1 file changed, 11 insertions(+), 9 deletions(-) - -diff --git a/target/i386/cpu.c b/target/i386/cpu.c -index d23f15e99a..353f50a1b9 100644 ---- a/target/i386/cpu.c -+++ b/target/i386/cpu.c -@@ -5835,7 +5835,7 @@ static void x86_cpu_parse_featurestr(const char *typename, char *features, - } - } - --static void x86_cpu_filter_features(X86CPU *cpu, bool verbose); -+static bool x86_cpu_filter_features(X86CPU *cpu, bool verbose); - - /* Build a list with the name of all features on a feature word array */ - static void x86_cpu_list_feature_names(FeatureWordArray features, -@@ -7540,9 +7540,9 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp) - * Finishes initialization of CPUID data, filters CPU feature - * words based on host availability of each feature. - * -- * Returns: 0 if all flags are supported by the host, non-zero otherwise. -+ * Returns: true if any flag is not supported by the host, false otherwise. - */ --static void x86_cpu_filter_features(X86CPU *cpu, bool verbose) -+static bool x86_cpu_filter_features(X86CPU *cpu, bool verbose) - { - CPUX86State *env = &cpu->env; - FeatureWord w; -@@ -7594,6 +7594,8 @@ static void x86_cpu_filter_features(X86CPU *cpu, bool verbose) - mark_unavailable_features(cpu, FEAT_7_0_EBX, CPUID_7_0_EBX_INTEL_PT, prefix); - } - } -+ -+ return x86_cpu_have_filtered_features(cpu); - } - - static void x86_cpu_hyperv_realize(X86CPU *cpu) -@@ -7691,14 +7693,14 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) - } - } - -- x86_cpu_filter_features(cpu, cpu->check_cpuid || cpu->enforce_cpuid); -- -- if (cpu->enforce_cpuid && x86_cpu_have_filtered_features(cpu)) { -- error_setg(&local_err, -- accel_uses_host_cpuid() ? -+ if (x86_cpu_filter_features(cpu, cpu->check_cpuid || cpu->enforce_cpuid)) { -+ if (cpu->enforce_cpuid) { -+ error_setg(&local_err, -+ accel_uses_host_cpuid() ? - "Host doesn't support requested features" : - "TCG doesn't support requested features"); -- goto out; -+ goto out; -+ } - } - - /* On AMD CPUs, some CPUID[8000_0001].EDX bits must match the bits on --- -2.39.3 - diff --git a/kvm-tests-avocado-hotplug_blk-Fix-addr-in-device_add-com.patch b/kvm-tests-avocado-hotplug_blk-Fix-addr-in-device_add-com.patch deleted file mode 100644 index 93fe1e0..0000000 --- a/kvm-tests-avocado-hotplug_blk-Fix-addr-in-device_add-com.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 693f65e183cc578eed213b1ea5dc11e9c2697f15 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Fri, 22 Nov 2024 23:40:42 +0100 -Subject: [PATCH 2/7] tests/avocado/hotplug_blk: Fix addr in device_add command - -RH-Author: Stefan Hajnoczi -RH-MergeRequest: 312: qdev-monitor: avoid QemuOpts in QMP device_add -RH-Jira: RHEL-43412 -RH-Acked-by: Kevin Wolf -RH-Acked-by: Hanna Czenczek -RH-Commit: [2/4] 7e2d360d3bb8e606d868c17d6032f9fb8ee15814 (stefanha/centos-stream-qemu-kvm) - -pci_devfn properties accept both integer and string values, but -integer 1 and string '1' have different meanings: The integer value -means device 0, function 1 whereas the string value '1' is short for -'1.0' and means device 1, function 0. - -This test wants the string version so that the device actually becomes -visible for the guest. device_add hides the problem because it goes -through QemuOpts, which turns all properties into strings - this is a -QEMU bug that we want to fix, but that cancelled out the bug in this -test. - -Fix the test first so that device_add can be fixed afterwards. - -Signed-off-by: Kevin Wolf -Message-ID: <20241122224042.149258-1-kwolf@redhat.com> -Reviewed-by: Markus Armbruster -Signed-off-by: Kevin Wolf -(cherry picked from commit 770de685353e8c495ad4773fbd4bc0db997e4dfd) -Signed-off-by: Stefan Hajnoczi ---- - tests/avocado/hotplug_blk.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/avocado/hotplug_blk.py b/tests/avocado/hotplug_blk.py -index d55ded1c1d..b36bca02ec 100644 ---- a/tests/avocado/hotplug_blk.py -+++ b/tests/avocado/hotplug_blk.py -@@ -33,7 +33,7 @@ def plug(self) -> None: - 'drive': 'disk', - 'id': 'virtio-disk0', - 'bus': 'pci.1', -- 'addr': 1 -+ 'addr': '1', - } - - self.assert_no_vda() --- -2.39.3 - diff --git a/kvm-tests-qtest-Add-s390x-boot-order-tests-to-cdrom-test.patch b/kvm-tests-qtest-Add-s390x-boot-order-tests-to-cdrom-test.patch deleted file mode 100644 index 9e993ab..0000000 --- a/kvm-tests-qtest-Add-s390x-boot-order-tests-to-cdrom-test.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 8b3125e03d0b20987e1b0a963c24d38cb382f99c Mon Sep 17 00:00:00 2001 -From: Jared Rossi -Date: Sat, 19 Oct 2024 21:29:53 -0400 -Subject: [PATCH 21/38] tests/qtest: Add s390x boot order tests to cdrom-test.c -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Thomas Huth -RH-MergeRequest: 278: Full boot order support for s390x [Centos 10] -RH-Jira: RHEL-58153 -RH-Acked-by: Cédric Le Goater -RH-Acked-by: Miroslav Rezanina -RH-Commit: [20/23] 1e79fbbd76e5bbf933fadda82dabf95fb60ead8c (thuth/qemu-kvm-cs9) - -Add two new qtests to verify that a valid IPL device can successfully boot after -failed IPL attempts from one or more invalid devices. - -cdrom-test/as-fallback-device: Defines the primary boot target as a device that -is invalid for IPL and a second boot target that is valid for IPL. Ensures that -the valid device will be selected after the initial failed IPL. - -cdrom-test/as-last-option: Defines the maximum number of boot devices (8) -where only the final entry in the boot order is valid. Ensures that a valid -device will be selected even after multiple failed IPL attempts from both -virtio-blk and virtio-scsi device types. - -Signed-off-by: Jared Rossi -Reviewed-by: Thomas Huth -Message-ID: <20241020012953.1380075-20-jrossi@linux.ibm.com> -Signed-off-by: Thomas Huth -(cherry picked from commit f5aa2d9d4c6480fa73b89c935050afe57e5d8bd9) ---- - tests/qtest/cdrom-test.c | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - -diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c -index 5d89e62515..ecba648144 100644 ---- a/tests/qtest/cdrom-test.c -+++ b/tests/qtest/cdrom-test.c -@@ -206,6 +206,30 @@ static void add_s390x_tests(void) - "-drive driver=null-co,read-zeroes=on,if=none,id=d1 " - "-device virtio-blk,drive=d2,bootindex=1 " - "-drive if=none,id=d2,media=cdrom,file=", test_cdboot); -+ qtest_add_data_func("cdrom/boot/as-fallback-device", -+ "-device virtio-serial -device virtio-scsi " -+ "-device virtio-blk,drive=d1,bootindex=1 " -+ "-drive driver=null-co,read-zeroes=on,if=none,id=d1 " -+ "-device virtio-blk,drive=d2,bootindex=2 " -+ "-drive if=none,id=d2,media=cdrom,file=", test_cdboot); -+ qtest_add_data_func("cdrom/boot/as-last-option", -+ "-device virtio-serial -device virtio-scsi " -+ "-device virtio-blk,drive=d1,bootindex=1 " -+ "-drive driver=null-co,read-zeroes=on,if=none,id=d1 " -+ "-device virtio-blk,drive=d2,bootindex=2 " -+ "-drive driver=null-co,read-zeroes=on,if=none,id=d2 " -+ "-device virtio-blk,drive=d3,bootindex=3 " -+ "-drive driver=null-co,read-zeroes=on,if=none,id=d3 " -+ "-device scsi-hd,drive=d4,bootindex=4 " -+ "-drive driver=null-co,read-zeroes=on,if=none,id=d4 " -+ "-device scsi-hd,drive=d5,bootindex=5 " -+ "-drive driver=null-co,read-zeroes=on,if=none,id=d5 " -+ "-device virtio-blk,drive=d6,bootindex=6 " -+ "-drive driver=null-co,read-zeroes=on,if=none,id=d6 " -+ "-device scsi-hd,drive=d7,bootindex=7 " -+ "-drive driver=null-co,read-zeroes=on,if=none,id=d7 " -+ "-device scsi-cd,drive=d8,bootindex=8 " -+ "-drive if=none,id=d8,media=cdrom,file=", test_cdboot); - if (qtest_has_device("x-terminal3270")) { - qtest_add_data_func("cdrom/boot/without-bootindex", - "-device virtio-scsi -device virtio-serial " --- -2.39.3 - diff --git a/kvm-vfio-container-Fix-container-object-destruction.patch b/kvm-vfio-container-Fix-container-object-destruction.patch deleted file mode 100644 index aa9bcb9..0000000 --- a/kvm-vfio-container-Fix-container-object-destruction.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 21236464550a1a4c844de937e48ff88619228ed7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= -Date: Mon, 18 Nov 2024 16:34:40 +0100 -Subject: [PATCH 1/3] vfio/container: Fix container object destruction -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Cédric Le Goater -RH-MergeRequest: 294: vfio/container: Fix container object destruction -RH-Jira: RHEL-67936 -RH-Acked-by: Eric Auger -RH-Acked-by: Alex Williamson -RH-Commit: [1/1] 5ae46457515b16aee12f5e010d9ef3179525f57f (clegoate/qemu-kvm-centos) - -JIRA: https://issues.redhat.com/browse/RHEL-67936 - -commit ebbf7c60bbd1ceedf9faf962e428ceda2388c248 -Author: Cédric Le Goater -Date: Fri Nov 15 09:34:40 2024 +0100 - - vfio/container: Fix container object destruction - - When commit 96b7af4388b3 intoduced a .instance_finalize() handler, - it did not take into account that the container was not necessarily - inserted into the container list of the address space. Hence, if - the container object is destroyed, by calling object_unref() for - example, before vfio_address_space_insert() is called, QEMU may - crash when removing the container from the list as done in - vfio_container_instance_finalize(). This was seen with an SEV-SNP - guest for which discarding of RAM fails. - - To resolve this issue, use the safe version of QLIST_REMOVE(). - - Cc: Zhenzhong Duan - Cc: Eric Auger - Fixes: 96b7af4388b3 ("vfio/container: Move vfio_container_destroy() to an instance_finalize() handler") - Reviewed-by: Zhenzhong Duan - Signed-off-by: Cédric Le Goater - -Signed-off-by: Cédric Le Goater ---- - hw/vfio/container-base.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/vfio/container-base.c b/hw/vfio/container-base.c -index 809b157674..6f86c37d97 100644 ---- a/hw/vfio/container-base.c -+++ b/hw/vfio/container-base.c -@@ -103,7 +103,7 @@ static void vfio_container_instance_finalize(Object *obj) - VFIOContainerBase *bcontainer = VFIO_IOMMU(obj); - VFIOGuestIOMMU *giommu, *tmp; - -- QLIST_REMOVE(bcontainer, next); -+ QLIST_SAFE_REMOVE(bcontainer, next); - - QLIST_FOREACH_SAFE(giommu, &bcontainer->giommu_list, giommu_next, tmp) { - memory_region_unregister_iommu_notifier( --- -2.39.3 - diff --git a/kvm-vfio-migration-Change-trace-formats-from-hex-to-deci.patch b/kvm-vfio-migration-Change-trace-formats-from-hex-to-deci.patch deleted file mode 100644 index d0a5cdf..0000000 --- a/kvm-vfio-migration-Change-trace-formats-from-hex-to-deci.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 85752ed0d3bdf707a9c84a12b8b717d932b882a6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= -Date: Wed, 6 Nov 2024 17:31:16 +0100 -Subject: [PATCH 27/38] vfio/migration: Change trace formats from hex to - decimal -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Cédric Le Goater -RH-MergeRequest: 283: vfio/migration: Report only stop-copy size in vfio_state_pending_exact() -RH-Jira: RHEL-64308 -RH-Acked-by: Peter Xu -RH-Acked-by: Alex Williamson -RH-Commit: [2/2] c4f7485b3ad4f779a2f13b6f09c9bb5712a45401 (clegoate/qemu-kvm-c9s) - -JIRA: https://issues.redhat.com/browse/RHEL-64308 - -commit fa4e20defe239e42af0a1b5c030dec114f799f56 -Author: Avihai Horon -Date: Sun Oct 20 16:01:08 2024 +0300 - - vfio/migration: Change trace formats from hex to decimal - - Data sizes in VFIO migration trace events are printed in hex format - while in migration core trace events they are printed in decimal format. - - This inconsistency makes it less readable when using both trace event - types. Hence, change the data sizes print format to decimal in VFIO - migration trace events. - - Signed-off-by: Avihai Horon - Reviewed-by: Cédric Le Goater - -Signed-off-by: Cédric Le Goater ---- - hw/vfio/trace-events | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events -index 98bd4dccea..3756ff660e 100644 ---- a/hw/vfio/trace-events -+++ b/hw/vfio/trace-events -@@ -151,7 +151,7 @@ vfio_display_edid_write_error(void) "" - vfio_load_cleanup(const char *name) " (%s)" - vfio_load_device_config_state(const char *name) " (%s)" - vfio_load_state(const char *name, uint64_t data) " (%s) data 0x%"PRIx64 --vfio_load_state_device_data(const char *name, uint64_t data_size, int ret) " (%s) size 0x%"PRIx64" ret %d" -+vfio_load_state_device_data(const char *name, uint64_t data_size, int ret) " (%s) size %"PRIu64" ret %d" - vfio_migration_realize(const char *name) " (%s)" - vfio_migration_set_device_state(const char *name, const char *state) " (%s) state %s" - vfio_migration_set_state(const char *name, const char *new_state, const char *recover_state) " (%s) new state %s, recover state %s" -@@ -160,10 +160,10 @@ vfio_save_block(const char *name, int data_size) " (%s) data_size %d" - vfio_save_cleanup(const char *name) " (%s)" - vfio_save_complete_precopy(const char *name, int ret) " (%s) ret %d" - vfio_save_device_config_state(const char *name) " (%s)" --vfio_save_iterate(const char *name, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy initial size 0x%"PRIx64" precopy dirty size 0x%"PRIx64 --vfio_save_setup(const char *name, uint64_t data_buffer_size) " (%s) data buffer size 0x%"PRIx64 --vfio_state_pending_estimate(const char *name, uint64_t precopy, uint64_t postcopy, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy 0x%"PRIx64" postcopy 0x%"PRIx64" precopy initial size 0x%"PRIx64" precopy dirty size 0x%"PRIx64 --vfio_state_pending_exact(const char *name, uint64_t precopy, uint64_t postcopy, uint64_t stopcopy_size, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy 0x%"PRIx64" postcopy 0x%"PRIx64" stopcopy size 0x%"PRIx64" precopy initial size 0x%"PRIx64" precopy dirty size 0x%"PRIx64 -+vfio_save_iterate(const char *name, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy initial size %"PRIu64" precopy dirty size %"PRIu64 -+vfio_save_setup(const char *name, uint64_t data_buffer_size) " (%s) data buffer size %"PRIu64 -+vfio_state_pending_estimate(const char *name, uint64_t precopy, uint64_t postcopy, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy %"PRIu64" postcopy %"PRIu64" precopy initial size %"PRIu64" precopy dirty size %"PRIu64 -+vfio_state_pending_exact(const char *name, uint64_t precopy, uint64_t postcopy, uint64_t stopcopy_size, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy %"PRIu64" postcopy %"PRIu64" stopcopy size %"PRIu64" precopy initial size %"PRIu64" precopy dirty size %"PRIu64 - vfio_vmstate_change(const char *name, int running, const char *reason, const char *dev_state) " (%s) running %d reason %s device state %s" - vfio_vmstate_change_prepare(const char *name, int running, const char *reason, const char *dev_state) " (%s) running %d reason %s device state %s" - --- -2.39.3 - diff --git a/kvm-vfio-migration-Report-only-stop-copy-size-in-vfio_st.patch b/kvm-vfio-migration-Report-only-stop-copy-size-in-vfio_st.patch deleted file mode 100644 index bb62e86..0000000 --- a/kvm-vfio-migration-Report-only-stop-copy-size-in-vfio_st.patch +++ /dev/null @@ -1,66 +0,0 @@ -From d32c2291e836f912a72aedaf2ace31d4e1679f95 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= -Date: Wed, 6 Nov 2024 17:31:16 +0100 -Subject: [PATCH 26/38] vfio/migration: Report only stop-copy size in - vfio_state_pending_exact() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Cédric Le Goater -RH-MergeRequest: 283: vfio/migration: Report only stop-copy size in vfio_state_pending_exact() -RH-Jira: RHEL-64308 -RH-Acked-by: Peter Xu -RH-Acked-by: Alex Williamson -RH-Commit: [1/2] 85956ae33c6aea99dba95500595e0ca7dc9dcdad (clegoate/qemu-kvm-c9s) - -JIRA: https://issues.redhat.com/browse/RHEL-64308 - -commit 3b5948f808e3b99aedfa0aff45cffbe8b7ec07ed -Author: Avihai Horon -Date: Sun Oct 20 16:01:06 2024 +0300 - - vfio/migration: Report only stop-copy size in vfio_state_pending_exact() - - vfio_state_pending_exact() is used to update migration core how much - device data is left for the device migration. Currently, the sum of - pre-copy and stop-copy sizes of the VFIO device are reported. - - The pre-copy size is obtained via the VFIO_MIG_GET_PRECOPY_INFO ioctl, - which returns the amount of device data available to be transferred - while the device is in the PRE_COPY states. - - The stop-copy size is obtained via the VFIO_DEVICE_FEATURE_MIG_DATA_SIZE - ioctl, which returns the total amount of device data left to be - transferred in order to complete the device migration. - - According to the above, current implementation is wrong -- it reports - extra overlapping data because pre-copy size is already contained in - stop-copy size. Fix it by reporting only stop-copy size. - - Fixes: eda7362af959 ("vfio/migration: Add VFIO migration pre-copy support") - Signed-off-by: Avihai Horon - Reviewed-by: Cédric Le Goater - -Signed-off-by: Cédric Le Goater ---- - hw/vfio/migration.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c -index 262d42a46e..dd717e8d6c 100644 ---- a/hw/vfio/migration.c -+++ b/hw/vfio/migration.c -@@ -576,9 +576,6 @@ static void vfio_state_pending_exact(void *opaque, uint64_t *must_precopy, - - if (vfio_device_state_is_precopy(vbasedev)) { - vfio_query_precopy_size(migration); -- -- *must_precopy += -- migration->precopy_init_size + migration->precopy_dirty_size; - } - - trace_vfio_state_pending_exact(vbasedev->name, *must_precopy, *can_postcopy, --- -2.39.3 - diff --git a/kvm-vhost-Add-stubs-for-the-migration-state-transfer-int.patch b/kvm-vhost-Add-stubs-for-the-migration-state-transfer-int.patch deleted file mode 100644 index 427e75e..0000000 --- a/kvm-vhost-Add-stubs-for-the-migration-state-transfer-int.patch +++ /dev/null @@ -1,87 +0,0 @@ -From dcf22c934f3c3672d4a4b58a74b1f99619da1d3d Mon Sep 17 00:00:00 2001 -From: Laurent Vivier -Date: Wed, 15 Jan 2025 14:50:43 +0100 -Subject: [PATCH 2/3] vhost: Add stubs for the migration state transfer - interface - -RH-Author: Laurent Vivier -RH-MergeRequest: 336: virtio-net: vhost-user: Implement internal migration -RH-Jira: RHEL-78370 -RH-Acked-by: Hanna Czenczek -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/2] 4afc9b5f73e5ef2941bcf36e31c4771d2b3ab3ba (lvivier/qemu-kvm-centos) - -JIRA: https://issues.redhat.com/browse/RHEL-78370 - -Migration state transfer interface is only used by vhost-user-fs, -so the interface needs to be defined only when vhost is built. - -But I need to use this interface with virtio-net and vhost is not always -enabled, and to avoid undefined reference error during build, define stub -functions for vhost_supports_device_state(), vhost_save_backend_state() and -vhost_load_backend_state(). - -Cc: Hanna Czenczek -Signed-off-by: Laurent Vivier -Message-Id: <20250115135044.799698-2-lvivier@redhat.com> -Reviewed-by: Michael S. Tsirkin -Signed-off-by: Michael S. Tsirkin -(cherry picked from commit 3f65357313e0f928e0bd3ff868b705855d0405bc) -Signed-off-by: Laurent Vivier ---- - include/hw/virtio/vhost.h | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h -index d75faf46e9..1d524f85b9 100644 ---- a/include/hw/virtio/vhost.h -+++ b/include/hw/virtio/vhost.h -@@ -363,7 +363,14 @@ static inline int vhost_reset_device(struct vhost_dev *hdev) - * Returns true if the device supports these commands, and false if it - * does not. - */ -+#ifdef CONFIG_VHOST - bool vhost_supports_device_state(struct vhost_dev *dev); -+#else -+static inline bool vhost_supports_device_state(struct vhost_dev *dev) -+{ -+ return false; -+} -+#endif - - /** - * vhost_set_device_state_fd(): Begin transfer of internal state from/to -@@ -446,7 +453,15 @@ int vhost_check_device_state(struct vhost_dev *dev, Error **errp); - * - * Returns 0 on success, and -errno otherwise. - */ -+#ifdef CONFIG_VHOST - int vhost_save_backend_state(struct vhost_dev *dev, QEMUFile *f, Error **errp); -+#else -+static inline int vhost_save_backend_state(struct vhost_dev *dev, QEMUFile *f, -+ Error **errp) -+{ -+ return -ENOSYS; -+} -+#endif - - /** - * vhost_load_backend_state(): High-level function to load a vhost -@@ -463,6 +478,14 @@ int vhost_save_backend_state(struct vhost_dev *dev, QEMUFile *f, Error **errp); - * - * Returns 0 on success, and -errno otherwise. - */ -+#ifdef CONFIG_VHOST - int vhost_load_backend_state(struct vhost_dev *dev, QEMUFile *f, Error **errp); -+#else -+static inline int vhost_load_backend_state(struct vhost_dev *dev, QEMUFile *f, -+ Error **errp) -+{ -+ return -ENOSYS; -+} -+#endif - - #endif --- -2.39.3 - diff --git a/kvm-vhost-fail-device-start-if-iotlb-update-fails.patch b/kvm-vhost-fail-device-start-if-iotlb-update-fails.patch deleted file mode 100644 index 854bb04..0000000 --- a/kvm-vhost-fail-device-start-if-iotlb-update-fails.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 2b12ea393b9a5d8392cb510406626f4c99c9f4c5 Mon Sep 17 00:00:00 2001 -From: Prasad Pandit -Date: Thu, 7 Nov 2024 17:02:47 +0530 -Subject: [PATCH 6/7] vhost: fail device start if iotlb update fails - -RH-Author: Prasad Pandit -RH-MergeRequest: 318: vhost: fail device start if iotlb update fails -RH-Jira: RHEL-73005 -RH-Acked-by: Stefano Garzarella -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/1] f185f02378ebbf36a38aef0ea608b70c637a4816 (pjp/cs-qemu-kvm) - -While starting a vhost device, updating iotlb entries -via 'vhost_device_iotlb_miss' may return an error. - - qemu-kvm: vhost_device_iotlb_miss: - 700871,700871: Fail to update device iotlb - -Fail device start when such an error occurs. - -Jira: https://issues.redhat.com/browse/RHEL-73005 -Signed-off-by: Prasad Pandit -Message-Id: <20241107113247.46532-1-ppandit@redhat.com> -Reviewed-by: Michael S. Tsirkin -Signed-off-by: Michael S. Tsirkin -Reviewed-by: Stefano Garzarella -(cherry picked from commit 571bdc97b83646dfd3746ec56fb2f70bca55b9a2) -Signed-off-by: Prasad Pandit ---- - hw/virtio/vhost.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c -index 06fc71746e..e25fdce3dd 100644 ---- a/hw/virtio/vhost.c -+++ b/hw/virtio/vhost.c -@@ -2151,11 +2151,22 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings) - * vhost-kernel code requires for this.*/ - for (i = 0; i < hdev->nvqs; ++i) { - struct vhost_virtqueue *vq = hdev->vqs + i; -- vhost_device_iotlb_miss(hdev, vq->used_phys, true); -+ r = vhost_device_iotlb_miss(hdev, vq->used_phys, true); -+ if (r) { -+ goto fail_iotlb; -+ } - } - } - vhost_start_config_intr(hdev); - return 0; -+fail_iotlb: -+ if (vhost_dev_has_iommu(hdev) && -+ hdev->vhost_ops->vhost_set_iotlb_callback) { -+ hdev->vhost_ops->vhost_set_iotlb_callback(hdev, false); -+ } -+ if (hdev->vhost_ops->vhost_dev_start) { -+ hdev->vhost_ops->vhost_dev_start(hdev, false); -+ } - fail_start: - if (vrings) { - vhost_dev_set_vring_enable(hdev, false); --- -2.39.3 - diff --git a/kvm-virtio-net-Add-queues-before-loading-them.patch b/kvm-virtio-net-Add-queues-before-loading-them.patch deleted file mode 100644 index 9ff0150..0000000 --- a/kvm-virtio-net-Add-queues-before-loading-them.patch +++ /dev/null @@ -1,94 +0,0 @@ -From cff01d88d59e4227c6801f9f4605f6d1333e0c37 Mon Sep 17 00:00:00 2001 -From: Akihiko Odaki -Date: Tue, 22 Oct 2024 15:49:01 +0900 -Subject: [PATCH 1/9] virtio-net: Add queues before loading them -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: 小田喜陽彦 -RH-MergeRequest: 274: virtio-net: Add queues before loading them -RH-Jira: RHEL-58316 -RH-Acked-by: Laurent Vivier -RH-Acked-by: Jason Wang -RH-Commit: [1/1] 0cdfea34b1466538abad0d9d216ea6bcfd21ac67 (akihiko.odaki/qemu-kvm) - -Call virtio_net_set_multiqueue() to add queues before loading their -states. Otherwise the loaded queues will not have handlers and elements -in them will not be processed. - -Cc: qemu-stable@nongnu.org -Fixes: 8c49756825da ("virtio-net: Add only one queue pair when realizing") -Reported-by: Laurent Vivier -Signed-off-by: Akihiko Odaki -Acked-by: Michael S. Tsirkin -Signed-off-by: Jason Wang -(cherry picked from commit 9379ea9db3c0064fa2787db0794a23a30f7b2d2d) ---- - hw/net/virtio-net.c | 10 ++++++++++ - hw/virtio/virtio.c | 7 +++++++ - include/hw/virtio/virtio.h | 2 ++ - 3 files changed, 19 insertions(+) - -diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c -index ed33a32877..90d05f94d4 100644 ---- a/hw/net/virtio-net.c -+++ b/hw/net/virtio-net.c -@@ -3032,6 +3032,15 @@ static void virtio_net_set_multiqueue(VirtIONet *n, int multiqueue) - virtio_net_set_queue_pairs(n); - } - -+static int virtio_net_pre_load_queues(VirtIODevice *vdev) -+{ -+ virtio_net_set_multiqueue(VIRTIO_NET(vdev), -+ virtio_has_feature(vdev->guest_features, VIRTIO_NET_F_RSS) || -+ virtio_has_feature(vdev->guest_features, VIRTIO_NET_F_MQ)); -+ -+ return 0; -+} -+ - static int virtio_net_post_load_device(void *opaque, int version_id) - { - VirtIONet *n = opaque; -@@ -4010,6 +4019,7 @@ static void virtio_net_class_init(ObjectClass *klass, void *data) - vdc->guest_notifier_mask = virtio_net_guest_notifier_mask; - vdc->guest_notifier_pending = virtio_net_guest_notifier_pending; - vdc->legacy_features |= (0x1 << VIRTIO_NET_F_GSO); -+ vdc->pre_load_queues = virtio_net_pre_load_queues; - vdc->post_load = virtio_net_post_load_virtio; - vdc->vmsd = &vmstate_virtio_net_device; - vdc->primary_unplug_pending = primary_unplug_pending; -diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c -index 9e10cbc058..10f24a58dd 100644 ---- a/hw/virtio/virtio.c -+++ b/hw/virtio/virtio.c -@@ -3251,6 +3251,13 @@ virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id) - config_len--; - } - -+ if (vdc->pre_load_queues) { -+ ret = vdc->pre_load_queues(vdev); -+ if (ret) { -+ return ret; -+ } -+ } -+ - num = qemu_get_be32(f); - - if (num > VIRTIO_QUEUE_MAX) { -diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h -index 0fcbc5c0c6..953dfca27c 100644 ---- a/include/hw/virtio/virtio.h -+++ b/include/hw/virtio/virtio.h -@@ -210,6 +210,8 @@ struct VirtioDeviceClass { - void (*guest_notifier_mask)(VirtIODevice *vdev, int n, bool mask); - int (*start_ioeventfd)(VirtIODevice *vdev); - void (*stop_ioeventfd)(VirtIODevice *vdev); -+ /* Called before loading queues. Useful to add queues before loading. */ -+ int (*pre_load_queues)(VirtIODevice *vdev); - /* Saving and loading of a device; trying to deprecate save/load - * use vmsd for new devices. - */ --- -2.39.3 - diff --git a/kvm-virtio-net-disable-USO-for-RHEL9.patch b/kvm-virtio-net-disable-USO-for-RHEL9.patch deleted file mode 100644 index 6b32588..0000000 --- a/kvm-virtio-net-disable-USO-for-RHEL9.patch +++ /dev/null @@ -1,49 +0,0 @@ -From cd94a5c750554f21ddbff37f53ff629128200259 Mon Sep 17 00:00:00 2001 -From: "Michael S. Tsirkin" -Date: Wed, 6 Nov 2024 17:29:35 -0500 -Subject: [PATCH 2/3] virtio-net: disable USO for RHEL9 - -RH-Author: MST -RH-MergeRequest: 289: Disable USO for virtio-net to fix RHEL10 to RHEL9 migration -RH-Jira: RHEL-40950 -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/1] 9fc588b66c5bad72df1e9b644f48a2a7aa82bfa3 (mstredhat/qemu-kvm-centos) - -Theoretically, QEMU from RHEL9.3 and on supports USO, -but practically we clear the support because RHEL9 -kernels do not support that. - -Now that RHEL10 beta does we suddenly get a migration compatibility -issue. We should not have enabled the feature in RHEL9 userspace, -but luckily, it's not too late to fix that. - -Note: if we ever change RHEL9 kernel to enable USO, we will need to -mask this in RHEL9 QEMU, too. - -Upstream status: n/a: upstream has no guarantee if kernel features change -Tested: lightly on developer's machine. -JIRA: https://issues.redhat.com/browse/RHEL-40950 -Signed-off-by: Michael S. Tsirkin ---- - hw/core/machine.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/hw/core/machine.c b/hw/core/machine.c -index d95f246f66..04d180eac4 100644 ---- a/hw/core/machine.c -+++ b/hw/core/machine.c -@@ -337,6 +337,11 @@ GlobalProperty hw_compat_rhel_9_5[] = { - { 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" }, -+ /* supported by userspace, but RHEL 9 *kernels* do not support USO. */ -+ /* TODO: if we ever add 9.6 compat, this has to be there, too */ -+ { TYPE_VIRTIO_NET, "host_uso", "off"}, -+ { TYPE_VIRTIO_NET, "guest_uso4", "off"}, -+ { TYPE_VIRTIO_NET, "guest_uso6", "off"}, - }; - const size_t hw_compat_rhel_9_5_len = G_N_ELEMENTS(hw_compat_rhel_9_5); - --- -2.39.3 - diff --git a/kvm-virtio-net-disable-USO-for-all-RHEL9.patch b/kvm-virtio-net-disable-USO-for-all-RHEL9.patch deleted file mode 100644 index 07fb75e..0000000 --- a/kvm-virtio-net-disable-USO-for-all-RHEL9.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 76376a85ff5cbe555db6a6d729fcb83f56988f25 Mon Sep 17 00:00:00 2001 -From: "Michael S. Tsirkin" -Date: Wed, 6 Nov 2024 17:29:35 -0500 -Subject: [PATCH 7/7] virtio-net: disable USO for all RHEL9 - -RH-Author: MST -RH-MergeRequest: 319: virtio-net migration: ensure compatibility of rhel9* -RH-Jira: RHEL-69500 -RH-Acked-by: Peter Xu -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/1] c7518d8293e1cfdd928f0ce454249ecb7bd7117a (mstredhat/qemu-kvm-centos) - -With commit 298dae99b77f ("virtio-net: disable USO for RHEL9") -we fixed migration for 9.6 but we forgot to apply the fix -for 9.6 when it was created. - -To help us not forget in 9.7 and beyond, create a generic RHEL9 compat -and apply it. - -Upstream status: n/a: upstream has no guarantee if kernel features change -Tested: lightly on developer's machine. -JIRA: https://issues.redhat.com/browse/RHEL-69500 -Signed-off-by: Michael S. Tsirkin - -Patch-name: kvm-virtio-net-disable-USO-for-RHEL9.patch -Patch-id: 83 -Patch-present-in-specfile: True ---- - hw/arm/virt.c | 3 +++ - hw/core/machine.c | 13 ++++++++----- - hw/i386/pc_q35.c | 3 +++ - hw/s390x/s390-virtio-ccw.c | 3 +++ - include/hw/boards.h | 3 +++ - 5 files changed, 20 insertions(+), 5 deletions(-) - -diff --git a/hw/arm/virt.c b/hw/arm/virt.c -index 078098ec3a..6d55bba241 100644 ---- a/hw/arm/virt.c -+++ b/hw/arm/virt.c -@@ -3595,6 +3595,9 @@ 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); -+ -+ /* NB: remember to move this line to the *latest* RHEL 9 machine */ -+ compat_props_add(mc->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len); - } - DEFINE_VIRT_MACHINE(9, 6, 0) - -diff --git a/hw/core/machine.c b/hw/core/machine.c -index 04d180eac4..1ee0e1dee8 100644 ---- a/hw/core/machine.c -+++ b/hw/core/machine.c -@@ -327,6 +327,14 @@ GlobalProperty hw_compat_rhel_10_0[] = { - }; - const size_t hw_compat_rhel_10_0_len = G_N_ELEMENTS(hw_compat_rhel_10_0); - -+/* Apply this to all RHEL9 boards going backward and forward */ -+GlobalProperty hw_compat_rhel_9[] = { -+ /* supported by userspace, but RHEL 9 *kernels* do not support USO. */ -+ { TYPE_VIRTIO_NET, "host_uso", "off"}, -+ { TYPE_VIRTIO_NET, "guest_uso4", "off"}, -+ { TYPE_VIRTIO_NET, "guest_uso6", "off"}, -+}; -+const size_t hw_compat_rhel_9_len = G_N_ELEMENTS(hw_compat_rhel_9); - - GlobalProperty hw_compat_rhel_9_5[] = { - /* hw_compat_rhel_9_5 from hw_compat_8_2 */ -@@ -337,11 +345,6 @@ GlobalProperty hw_compat_rhel_9_5[] = { - { 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" }, -- /* supported by userspace, but RHEL 9 *kernels* do not support USO. */ -- /* TODO: if we ever add 9.6 compat, this has to be there, too */ -- { TYPE_VIRTIO_NET, "host_uso", "off"}, -- { TYPE_VIRTIO_NET, "guest_uso4", "off"}, -- { TYPE_VIRTIO_NET, "guest_uso6", "off"}, - }; - const size_t hw_compat_rhel_9_5_len = G_N_ELEMENTS(hw_compat_rhel_9_5); - -diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c -index 506f9dc0c0..b2b8124225 100644 ---- a/hw/i386/pc_q35.c -+++ b/hw/i386/pc_q35.c -@@ -690,6 +690,9 @@ static void pc_q35_rhel_machine_9_6_0_options(MachineClass *m) - m->alias = NULL; - pcmc->smbios_stream_product = "RHEL"; - pcmc->smbios_stream_version = "9.6.0"; -+ -+ /* NB: remember to move this line to the *latest* RHEL 9 machine */ -+ compat_props_add(m->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len); - } - - DEFINE_Q35_MACHINE_BUGFIX(9, 6, 0); -diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c -index 0347dc69ca..2e276ad72b 100644 ---- a/hw/s390x/s390-virtio-ccw.c -+++ b/hw/s390x/s390-virtio-ccw.c -@@ -1305,6 +1305,9 @@ static void ccw_rhel_machine_9_6_0_instance_options(MachineState *machine) - static void ccw_rhel_machine_9_6_0_class_options(MachineClass *mc) - { - ccw_rhel_machine_10_0_0_class_options(mc); -+ -+ /* NB: remember to move this line to the *latest* RHEL 9 machine */ -+ compat_props_add(mc->compat_props, hw_compat_rhel_9, hw_compat_rhel_9_len); - } - DEFINE_CCW_MACHINE(9, 6, 0); - -diff --git a/include/hw/boards.h b/include/hw/boards.h -index ac917b87fb..83d11de42f 100644 ---- a/include/hw/boards.h -+++ b/include/hw/boards.h -@@ -805,6 +805,9 @@ 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[]; -+extern const size_t hw_compat_rhel_9_len; -+ - extern GlobalProperty hw_compat_rhel_9_5[]; - extern const size_t hw_compat_rhel_9_5_len; - --- -2.39.3 - diff --git a/kvm-virtio-net-vhost-user-Implement-internal-migration.patch b/kvm-virtio-net-vhost-user-Implement-internal-migration.patch deleted file mode 100644 index 8f70917..0000000 --- a/kvm-virtio-net-vhost-user-Implement-internal-migration.patch +++ /dev/null @@ -1,161 +0,0 @@ -From bb1d7e0dd85a37912540c173f573e40dd1425e72 Mon Sep 17 00:00:00 2001 -From: Laurent Vivier -Date: Wed, 15 Jan 2025 14:50:44 +0100 -Subject: [PATCH 3/3] virtio-net: vhost-user: Implement internal migration - -RH-Author: Laurent Vivier -RH-MergeRequest: 336: virtio-net: vhost-user: Implement internal migration -RH-Jira: RHEL-78370 -RH-Acked-by: Hanna Czenczek -RH-Acked-by: Miroslav Rezanina -RH-Commit: [2/2] b7a9c887c47cea1a38ae8aee8901b74c84a6cd0d (lvivier/qemu-kvm-centos) - -JIRA: https://issues.redhat.com/browse/RHEL-78370 - -Add support of VHOST_USER_PROTOCOL_F_DEVICE_STATE in virtio-net -with vhost-user backend. - -Cc: Hanna Czenczek -Signed-off-by: Laurent Vivier -Message-Id: <20250115135044.799698-3-lvivier@redhat.com> -Reviewed-by: Michael S. Tsirkin -Signed-off-by: Michael S. Tsirkin -(cherry picked from commit 60f543ad917fad731e39ff8ce2ca83b9a9cc9d90) -Signed-off-by: Laurent Vivier ---- - hw/net/virtio-net.c | 105 ++++++++++++++++++++++++++++++++++++++++---- - 1 file changed, 97 insertions(+), 8 deletions(-) - -diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c -index 90d05f94d4..3d2b2460ad 100644 ---- a/hw/net/virtio-net.c -+++ b/hw/net/virtio-net.c -@@ -3305,6 +3305,102 @@ static const VMStateDescription vmstate_virtio_net_rss = { - }, - }; - -+static struct vhost_dev *virtio_net_get_vhost(VirtIODevice *vdev) -+{ -+ VirtIONet *n = VIRTIO_NET(vdev); -+ NetClientState *nc = qemu_get_queue(n->nic); -+ struct vhost_net *net = get_vhost_net(nc->peer); -+ return &net->dev; -+} -+ -+static int vhost_user_net_save_state(QEMUFile *f, void *pv, size_t size, -+ const VMStateField *field, -+ JSONWriter *vmdesc) -+{ -+ VirtIONet *n = pv; -+ VirtIODevice *vdev = VIRTIO_DEVICE(n); -+ struct vhost_dev *vhdev; -+ Error *local_error = NULL; -+ int ret; -+ -+ vhdev = virtio_net_get_vhost(vdev); -+ if (vhdev == NULL) { -+ error_reportf_err(local_error, -+ "Error getting vhost back-end of %s device %s: ", -+ vdev->name, vdev->parent_obj.canonical_path); -+ return -1; -+ } -+ -+ ret = vhost_save_backend_state(vhdev, f, &local_error); -+ if (ret < 0) { -+ error_reportf_err(local_error, -+ "Error saving back-end state of %s device %s: ", -+ vdev->name, vdev->parent_obj.canonical_path); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int vhost_user_net_load_state(QEMUFile *f, void *pv, size_t size, -+ const VMStateField *field) -+{ -+ VirtIONet *n = pv; -+ VirtIODevice *vdev = VIRTIO_DEVICE(n); -+ struct vhost_dev *vhdev; -+ Error *local_error = NULL; -+ int ret; -+ -+ vhdev = virtio_net_get_vhost(vdev); -+ if (vhdev == NULL) { -+ error_reportf_err(local_error, -+ "Error getting vhost back-end of %s device %s: ", -+ vdev->name, vdev->parent_obj.canonical_path); -+ return -1; -+ } -+ -+ ret = vhost_load_backend_state(vhdev, f, &local_error); -+ if (ret < 0) { -+ error_reportf_err(local_error, -+ "Error loading back-end state of %s device %s: ", -+ vdev->name, vdev->parent_obj.canonical_path); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static bool vhost_user_net_is_internal_migration(void *opaque) -+{ -+ VirtIONet *n = opaque; -+ VirtIODevice *vdev = VIRTIO_DEVICE(n); -+ struct vhost_dev *vhdev; -+ -+ vhdev = virtio_net_get_vhost(vdev); -+ if (vhdev == NULL) { -+ return false; -+ } -+ -+ return vhost_supports_device_state(vhdev); -+} -+ -+static const VMStateDescription vhost_user_net_backend_state = { -+ .name = "virtio-net-device/backend", -+ .version_id = 0, -+ .needed = vhost_user_net_is_internal_migration, -+ .fields = (const VMStateField[]) { -+ { -+ .name = "backend", -+ .info = &(const VMStateInfo) { -+ .name = "virtio-net vhost-user backend state", -+ .get = vhost_user_net_load_state, -+ .put = vhost_user_net_save_state, -+ }, -+ }, -+ VMSTATE_END_OF_LIST() -+ } -+}; -+ - static const VMStateDescription vmstate_virtio_net_device = { - .name = "virtio-net-device", - .version_id = VIRTIO_NET_VM_VERSION, -@@ -3357,6 +3453,7 @@ static const VMStateDescription vmstate_virtio_net_device = { - }, - .subsections = (const VMStateDescription * const []) { - &vmstate_virtio_net_rss, -+ &vhost_user_net_backend_state, - NULL - } - }; -@@ -3902,14 +3999,6 @@ static bool dev_unplug_pending(void *opaque) - return vdc->primary_unplug_pending(dev); - } - --static struct vhost_dev *virtio_net_get_vhost(VirtIODevice *vdev) --{ -- VirtIONet *n = VIRTIO_NET(vdev); -- NetClientState *nc = qemu_get_queue(n->nic); -- struct vhost_net *net = get_vhost_net(nc->peer); -- return &net->dev; --} -- - static const VMStateDescription vmstate_virtio_net = { - .name = "virtio-net", - .minimum_version_id = VIRTIO_NET_VM_VERSION, --- -2.39.3 - diff --git a/kvm-vl-use-qmp_device_add-in-qemu_create_cli_devices.patch b/kvm-vl-use-qmp_device_add-in-qemu_create_cli_devices.patch deleted file mode 100644 index 987eed8..0000000 --- a/kvm-vl-use-qmp_device_add-in-qemu_create_cli_devices.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 59fe7329e9f1660a3b26e5147de2df348b1bbaed Mon Sep 17 00:00:00 2001 -From: Stefan Hajnoczi -Date: Tue, 27 Aug 2024 15:27:51 -0400 -Subject: [PATCH 4/7] vl: use qmp_device_add() in qemu_create_cli_devices() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Stefan Hajnoczi -RH-MergeRequest: 312: qdev-monitor: avoid QemuOpts in QMP device_add -RH-Jira: RHEL-43412 -RH-Acked-by: Kevin Wolf -RH-Acked-by: Hanna Czenczek -RH-Commit: [4/4] b581207df4723f8a278452c92cb1b71a207aabe8 (stefanha/centos-stream-qemu-kvm) - -qemu_create_cli_devices() should use qmp_device_add() to match the -behavior of the QMP monitor. A comment explained that libvirt changes -implementing strict CLI syntax were needed. - -Peter Krempa has confirmed that modern libvirt uses -the same JSON for -device (CLI) and device_add (QMP). Go ahead and use -qmp_device_add(). - -Cc: Peter Krempa -Reviewed-by: Markus Armbruster -Signed-off-by: Stefan Hajnoczi -Message-ID: <20240827192751.948633-3-stefanha@redhat.com> -Reviewed-by: Daniel P. Berrangé -Reviewed-by: Kevin Wolf -Signed-off-by: Kevin Wolf -(cherry picked from commit 11bf1d6aa06138e93b274e942d6992af63ffc510) -Signed-off-by: Stefan Hajnoczi ---- - system/vl.c | 14 ++++---------- - 1 file changed, 4 insertions(+), 10 deletions(-) - -diff --git a/system/vl.c b/system/vl.c -index 5359231bf5..900d471f5e 100644 ---- a/system/vl.c -+++ b/system/vl.c -@@ -2661,17 +2661,11 @@ static void qemu_create_cli_devices(void) - qemu_opts_foreach(qemu_find_opts("device"), - device_init_func, NULL, &error_fatal); - QTAILQ_FOREACH(opt, &device_opts, next) { -- DeviceState *dev; -+ QObject *ret_data = NULL; -+ - loc_push_restore(&opt->loc); -- /* -- * TODO Eventually we should call qmp_device_add() here to make sure it -- * behaves the same, but QMP still has to accept incorrectly typed -- * options until libvirt is fixed and we want to be strict on the CLI -- * from the start, so call qdev_device_add_from_qdict() directly for -- * now. -- */ -- dev = qdev_device_add_from_qdict(opt->opts, true, &error_fatal); -- object_unref(OBJECT(dev)); -+ qmp_device_add(opt->opts, &ret_data, &error_fatal); -+ assert(ret_data == NULL); /* error_fatal aborts */ - loc_pop(&opt->loc); - } - rom_reset_order_override(); --- -2.39.3 - diff --git a/kvm-vnc-fix-crash-when-no-console-attached.patch b/kvm-vnc-fix-crash-when-no-console-attached.patch deleted file mode 100644 index 0e9d1cc..0000000 --- a/kvm-vnc-fix-crash-when-no-console-attached.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 9e58f195620d723a2a0b609aa1c59d4938551835 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= -Date: Tue, 20 Aug 2024 17:11:12 +0400 -Subject: [PATCH 25/38] vnc: fix crash when no console attached -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -RH-Author: Marc-André Lureau -RH-MergeRequest: 279: vnc: fix crash when no console attached -RH-Jira: RHEL-50529 -RH-Acked-by: Paolo Bonzini -RH-Acked-by: Miroslav Rezanina -RH-Commit: [1/1] 0ea2135d95786752fe50c00271be997144adb4bc (marcandre.lureau-rh/qemu-kvm-centos) - -JIRA: https://issues.redhat.com/browse/RHEL-50529 - -Since commit e99441a3793b5 ("ui/curses: Do not use console_select()") -qemu_text_console_put_keysym() no longer checks for NULL console -argument, which leads to a later crash: - -Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. -0x00005555559ee186 in qemu_text_console_handle_keysym (s=0x0, keysym=31) at ../ui/console-vc.c:332 -332 } else if (s->echo && (keysym == '\r' || keysym == '\n')) { -(gdb) bt - #0 0x00005555559ee186 in qemu_text_console_handle_keysym (s=0x0, keysym=31) at ../ui/console-vc.c:332 - #1 0x00005555559e18e5 in qemu_text_console_put_keysym (s=, keysym=) at ../ui/console.c:303 - #2 0x00005555559f2e88 in do_key_event (vs=vs@entry=0x5555579045c0, down=down@entry=1, keycode=keycode@entry=60, sym=sym@entry=65471) at ../ui/vnc.c:2034 - #3 0x00005555559f845c in ext_key_event (vs=0x5555579045c0, down=1, sym=65471, keycode=) at ../ui/vnc.c:2070 - #4 protocol_client_msg (vs=0x5555579045c0, data=, len=) at ../ui/vnc.c:2514 - #5 0x00005555559f515c in vnc_client_read (vs=0x5555579045c0) at ../ui/vnc.c:1607 - -Fixes: e99441a3793b5 ("ui/curses: Do not use console_select()") -Fixes: https://issues.redhat.com/browse/RHEL-50529 -Cc: qemu-stable@nongnu.org -Signed-off-by: Marc-André Lureau -Reviewed-by: Akihiko Odaki -Reviewed-by: Michael Tokarev -Signed-off-by: Michael Tokarev - -(cherry picked from commit 0e60fc80938d9ce84274a36ddfaaa640bdef2be8) -Signed-off-by: Marc-André Lureau ---- - ui/vnc.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ui/vnc.c b/ui/vnc.c -index dae5d51210..5057ec8680 100644 ---- a/ui/vnc.c -+++ b/ui/vnc.c -@@ -1935,7 +1935,7 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) - } - - qkbd_state_key_event(vs->vd->kbd, qcode, down); -- if (!qemu_console_is_graphic(vs->vd->dcl.con)) { -+ if (QEMU_IS_TEXT_CONSOLE(vs->vd->dcl.con)) { - QemuTextConsole *con = QEMU_TEXT_CONSOLE(vs->vd->dcl.con); - bool numlock = qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_NUMLOCK); - bool control = qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_CTRL); --- -2.39.3 - diff --git a/kvm-x86-create-new-pc-q35-machine-type-for-rhel-9.6.patch b/kvm-x86-create-new-pc-q35-machine-type-for-rhel-9.6.patch deleted file mode 100644 index 55f3618..0000000 --- a/kvm-x86-create-new-pc-q35-machine-type-for-rhel-9.6.patch +++ /dev/null @@ -1,50 +0,0 @@ -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/kvm-x86-create-pc-i440fx-machine-type-for-rhel10.patch b/kvm-x86-create-pc-i440fx-machine-type-for-rhel10.patch deleted file mode 100644 index 41f065d..0000000 --- a/kvm-x86-create-pc-i440fx-machine-type-for-rhel10.patch +++ /dev/null @@ -1,79 +0,0 @@ -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/kvm-x86-create-pc-q35-machine-type-for-rhel10.patch b/kvm-x86-create-pc-q35-machine-type-for-rhel10.patch deleted file mode 100644 index 47a7be3..0000000 --- a/kvm-x86-create-pc-q35-machine-type-for-rhel10.patch +++ /dev/null @@ -1,59 +0,0 @@ -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/kvm-x86-remove-deprecated-rhel-machine-types.patch b/kvm-x86-remove-deprecated-rhel-machine-types.patch deleted file mode 100644 index 98acd71..0000000 --- a/kvm-x86-remove-deprecated-rhel-machine-types.patch +++ /dev/null @@ -1,274 +0,0 @@ -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/qemu-kvm.spec b/qemu-kvm.spec index 1c53cf6..c8e718f 100644 --- a/qemu-kvm.spec +++ b/qemu-kvm.spec @@ -102,6 +102,10 @@ %ifarch aarch64 %global kvm_target aarch64 %endif +%ifarch riscv64 + %global kvm_target riscv64 +%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 @@ -157,15 +161,15 @@ Obsoletes: %{name}-block-ssh <= %{epoch}:%{version} \ Summary: QEMU is a machine emulator and virtualizer Name: qemu-kvm -Version: 9.1.0 -Release: 17%{?rcrel}%{?dist}%{?cc_suffix}.alma.1 +Version: 10.0.0 +Release: 1%{?rcrel}%{?dist}%{?cc_suffix}.alma.1 # 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 +ExclusiveArch: x86_64 %{power64} aarch64 s390x riscv64 Source0: http://wiki.qemu.org/download/qemu-%{version}%{?rcstr}.tar.xz @@ -199,308 +203,6 @@ 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 -# For RHEL-58936 - [RHEL-10.0] QEMU core dump on applying merge property to memory backend -Patch35: kvm-hostmem-Apply-merge-property-after-the-memory-region.patch -# For RHEL-58928 - Boot SNP guests failed with qemu-kvm: kvm_set_user_memory_region -Patch36: kvm-accel-kvm-check-for-KVM_CAP_READONLY_MEM-on-VM.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch37: kvm-hw-s390x-ipl-Provide-more-memory-to-the-s390-ccw.img.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch38: kvm-pc-bios-s390-ccw-Use-the-libc-from-SLOF-and-remove-s.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch39: kvm-pc-bios-s390-ccw-Link-the-netboot-code-into-the-main.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch41: kvm-hw-s390x-Remove-the-possibility-to-load-the-s390-net.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch42: kvm-pc-bios-s390-ccw-Merge-netboot.mak-into-the-main-Mak.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch43: kvm-docs-system-s390x-bootdevices-Update-the-documentati.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch44: kvm-pc-bios-s390-ccw-Remove-panics-from-ISO-IPL-path.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch45: kvm-pc-bios-s390-ccw-Remove-panics-from-ECKD-IPL-path.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch46: kvm-pc-bios-s390-ccw-Remove-panics-from-SCSI-IPL-path.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch47: kvm-pc-bios-s390-ccw-Remove-panics-from-DASD-IPL-path.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch48: kvm-pc-bios-s390-ccw-Remove-panics-from-Netboot-IPL-path.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch49: kvm-pc-bios-s390-ccw-Enable-failed-IPL-to-return-after-e.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch50: kvm-include-hw-s390x-Add-include-files-for-common-IPL-st.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch51: kvm-s390x-Add-individual-loadparm-assignment-to-CCW-devi.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch52: kvm-hw-s390x-Build-an-IPLB-for-each-boot-device.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch53: kvm-s390x-Rebuild-IPLB-for-SCSI-device-directly-from-DIA.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch54: kvm-pc-bios-s390x-Enable-multi-device-boot-loop.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch55: kvm-docs-system-Update-documentation-for-s390x-IPL.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch56: kvm-tests-qtest-Add-s390x-boot-order-tests-to-cdrom-test.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch57: kvm-pc-bios-s390-ccw-Clarify-alignment-is-in-bytes.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch58: kvm-pc-bios-s390-ccw-Don-t-generate-TEXTRELs.patch -# For RHEL-58153 - [IBM 10.0 FEAT] KVM: Full boot order support - qemu part -Patch59: kvm-pc-bios-s390-ccw-Introduce-EXTRA_LDFLAGS.patch -# For RHEL-50529 - Qemu-kvm crashed if no display device setting and switching display by remote-viewer -Patch60: kvm-vnc-fix-crash-when-no-console-attached.patch -# For RHEL-64308 - High threshold value observed in vGPU live migration -Patch61: kvm-vfio-migration-Report-only-stop-copy-size-in-vfio_st.patch -# For RHEL-64308 - High threshold value observed in vGPU live migration -Patch62: kvm-vfio-migration-Change-trace-formats-from-hex-to-deci.patch -# For RHEL-20574 - Fail migration properly when put cpu register fails -Patch63: kvm-kvm-Allow-kvm_arch_get-put_registers-to-accept-Error.patch -# For RHEL-20574 - Fail migration properly when put cpu register fails -Patch64: kvm-target-i386-kvm-Report-which-action-failed-in-kvm_ar.patch -# For RHEL-30315 - [Intel 10.0 FEAT] [GNR] Virt-QEMU: Add AVX10.1 instruction support -# For RHEL-45110 - [Intel 10.0 FEAT] [CWF][DMR] Virt-QEMU: Advertise new instructions SHA2-512NI, SM3, and SM4 -Patch65: kvm-target-i386-cpu-set-correct-supported-XCR0-features-.patch -# For RHEL-30315 - [Intel 10.0 FEAT] [GNR] Virt-QEMU: Add AVX10.1 instruction support -# For RHEL-45110 - [Intel 10.0 FEAT] [CWF][DMR] Virt-QEMU: Advertise new instructions SHA2-512NI, SM3, and SM4 -Patch66: kvm-target-i386-do-not-rely-on-ExtSaveArea-for-accelerat.patch -# For RHEL-30315 - [Intel 10.0 FEAT] [GNR] Virt-QEMU: Add AVX10.1 instruction support -# For RHEL-45110 - [Intel 10.0 FEAT] [CWF][DMR] Virt-QEMU: Advertise new instructions SHA2-512NI, SM3, and SM4 -Patch67: kvm-target-i386-return-bool-from-x86_cpu_filter_features.patch -# For RHEL-30315 - [Intel 10.0 FEAT] [GNR] Virt-QEMU: Add AVX10.1 instruction support -# For RHEL-45110 - [Intel 10.0 FEAT] [CWF][DMR] Virt-QEMU: Advertise new instructions SHA2-512NI, SM3, and SM4 -Patch68: kvm-target-i386-add-AVX10-feature-and-AVX10-version-prop.patch -# For RHEL-30315 - [Intel 10.0 FEAT] [GNR] Virt-QEMU: Add AVX10.1 instruction support -# For RHEL-45110 - [Intel 10.0 FEAT] [CWF][DMR] Virt-QEMU: Advertise new instructions SHA2-512NI, SM3, and SM4 -Patch69: kvm-target-i386-add-CPUID.24-features-for-AVX10.patch -# For RHEL-30315 - [Intel 10.0 FEAT] [GNR] Virt-QEMU: Add AVX10.1 instruction support -# For RHEL-45110 - [Intel 10.0 FEAT] [CWF][DMR] Virt-QEMU: Advertise new instructions SHA2-512NI, SM3, and SM4 -Patch70: kvm-target-i386-Add-feature-dependencies-for-AVX10.patch -# For RHEL-30315 - [Intel 10.0 FEAT] [GNR] Virt-QEMU: Add AVX10.1 instruction support -# For RHEL-45110 - [Intel 10.0 FEAT] [CWF][DMR] Virt-QEMU: Advertise new instructions SHA2-512NI, SM3, and SM4 -Patch71: kvm-target-i386-Add-AVX512-state-when-AVX10-is-supported.patch -# For RHEL-30315 - [Intel 10.0 FEAT] [GNR] Virt-QEMU: Add AVX10.1 instruction support -# For RHEL-45110 - [Intel 10.0 FEAT] [CWF][DMR] Virt-QEMU: Advertise new instructions SHA2-512NI, SM3, and SM4 -Patch72: kvm-target-i386-Introduce-GraniteRapids-v2-model.patch -# For RHEL-30315 - [Intel 10.0 FEAT] [GNR] Virt-QEMU: Add AVX10.1 instruction support -# For RHEL-45110 - [Intel 10.0 FEAT] [CWF][DMR] Virt-QEMU: Advertise new instructions SHA2-512NI, SM3, and SM4 -Patch73: kvm-target-i386-add-sha512-sm3-sm4-feature-bits.patch -# For RHEL-63051 - qemu crashed after killed virtiofsd during migration -Patch74: kvm-migration-Ensure-vmstate_save-sets-errp.patch -# For RHEL-57685 - Bad migration performance when performing vGPU VM live migration -Patch75: kvm-kvm-replace-fprintf-with-error_report-printf-in-kvm_.patch -# For RHEL-57685 - Bad migration performance when performing vGPU VM live migration -Patch76: kvm-kvm-refactor-core-virtual-machine-creation-into-its-.patch -# For RHEL-57685 - Bad migration performance when performing vGPU VM live migration -Patch77: kvm-accel-kvm-refactor-dirty-ring-setup.patch -# For RHEL-57685 - Bad migration performance when performing vGPU VM live migration -Patch78: kvm-KVM-Dynamic-sized-kvm-memslots-array.patch -# For RHEL-57685 - Bad migration performance when performing vGPU VM live migration -Patch79: kvm-KVM-Define-KVM_MEMSLOTS_NUM_MAX_DEFAULT.patch -# For RHEL-57685 - Bad migration performance when performing vGPU VM live migration -Patch80: kvm-KVM-Rename-KVMMemoryListener.nr_used_slots-to-nr_slo.patch -# For RHEL-57685 - Bad migration performance when performing vGPU VM live migration -Patch81: kvm-KVM-Rename-KVMState-nr_slots-to-nr_slots_max.patch -# For RHEL-67936 - QEMU should fail gracefully with passthrough devices in SEV-SNP guests -Patch82: kvm-vfio-container-Fix-container-object-destruction.patch -# For RHEL-40950 - [Stable_Guest_ABI][USO]From 10-beta to RHEL.9.5.0 the guest with 9.4 machine type only, the guest crashed with - qemu-kvm: Features 0x1c0010130afffa7 unsupported. Allowed features: 0x10179bfffe7 -Patch83: kvm-virtio-net-disable-USO-for-RHEL9.patch -# For RHEL-58316 - qemu crashed when migrate vm with multiqueue from rhel9.4 to rhel10.0 -Patch84: kvm-virtio-net-Add-queues-before-loading-them.patch -# For RHEL-68444 - The new "boot order" feature is sometimes not working as expected [RHEL 10] -Patch85: kvm-docs-system-s390x-bootdevices-Update-loadparm-docume.patch -# For RHEL-68444 - The new "boot order" feature is sometimes not working as expected [RHEL 10] -Patch86: kvm-docs-system-bootindex-Make-it-clear-that-s390x-can-a.patch -# For RHEL-68444 - The new "boot order" feature is sometimes not working as expected [RHEL 10] -Patch87: kvm-hw-s390x-Restrict-loadparm-property-to-devices-that-.patch -# For RHEL-68444 - The new "boot order" feature is sometimes not working as expected [RHEL 10] -Patch88: kvm-hw-Add-loadparm-property-to-scsi-disk-devices-for-bo.patch -# For RHEL-68444 - The new "boot order" feature is sometimes not working as expected [RHEL 10] -Patch89: kvm-scsi-fix-allocation-for-s390x-loadparm.patch -# For RHEL-68444 - The new "boot order" feature is sometimes not working as expected [RHEL 10] -Patch90: kvm-pc-bios-s390x-Initialize-cdrom-type-to-false-for-eac.patch -# For RHEL-68444 - The new "boot order" feature is sometimes not working as expected [RHEL 10] -Patch91: kvm-pc-bios-s390x-Initialize-machine-loadparm-before-pro.patch -# For RHEL-68444 - The new "boot order" feature is sometimes not working as expected [RHEL 10] -Patch92: kvm-pc-bios-s390-ccw-Re-initialize-receive-queue-index-b.patch -# For RHEL-69047 - warning: fd: migration to a file is deprecated when create or revert a snapshot -Patch93: kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch94: kvm-linux-headers-Update-to-Linux-v6.12-rc5.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch95: kvm-s390x-cpumodel-add-msa10-subfunctions.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch96: kvm-s390x-cpumodel-add-msa11-subfunctions.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch97: kvm-s390x-cpumodel-add-msa12-changes.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch98: kvm-s390x-cpumodel-add-msa13-subfunctions.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch99: kvm-s390x-cpumodel-Add-ptff-Query-Time-Stamp-Event-QTSE-.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch100: kvm-linux-headers-Update-to-Linux-6.13-rc1.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch101: kvm-s390x-cpumodel-add-Concurrent-functions-facility-sup.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch102: kvm-s390x-cpumodel-add-Vector-Enhancements-facility-3.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch103: kvm-s390x-cpumodel-add-Miscellaneous-Instruction-Extensi.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch104: kvm-s390x-cpumodel-add-Vector-Packed-Decimal-Enhancement.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch105: kvm-s390x-cpumodel-add-Ineffective-nonconstrained-transa.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch106: kvm-s390x-cpumodel-Add-Sequential-Instruction-Fetching-f.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch107: kvm-s390x-cpumodel-correct-PLO-feature-wording.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch108: kvm-s390x-cpumodel-Add-PLO-extension-facility.patch -# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part -Patch109: kvm-s390x-cpumodel-gen17-model.patch -# For RHEL-71939 - qemu-ga cannot freeze filesystems with sentinelone -Patch110: kvm-qga-skip-bind-mounts-in-fs-list.patch -# For RHEL-67108 - [aarch64] [rhel-10.0] Backport some important post 9.1 qemu fixes -Patch111: kvm-hw-char-pl011-Use-correct-masks-for-IBRD-and-FBRD.patch -# For RHEL-43412 - qom-get iothread-vq-mapping is empty on new hotplug disk [rhel-10.0-beta] -Patch112: kvm-qdev-Fix-set_pci_devfn-to-visit-option-only-once.patch -# For RHEL-43412 - qom-get iothread-vq-mapping is empty on new hotplug disk [rhel-10.0-beta] -Patch113: kvm-tests-avocado-hotplug_blk-Fix-addr-in-device_add-com.patch -# For RHEL-43412 - qom-get iothread-vq-mapping is empty on new hotplug disk [rhel-10.0-beta] -Patch114: kvm-qdev-monitor-avoid-QemuOpts-in-QMP-device_add.patch -# For RHEL-43412 - qom-get iothread-vq-mapping is empty on new hotplug disk [rhel-10.0-beta] -Patch115: kvm-vl-use-qmp_device_add-in-qemu_create_cli_devices.patch -# For RHEL-57668 - [RFE] [HPEMC] [RHEL-10.0] qemu-kvm: support up to 4096 VCPUs -Patch116: kvm-pc-q35-Bump-max_cpus-to-4096-vcpus.patch -# For RHEL-73005 - qemu-kvm: vhost: reports error while updating IOTLB entries -Patch117: kvm-vhost-fail-device-start-if-iotlb-update-fails.patch -# For RHEL-69500 - [Stable_Guest_ABI][USO][9.6.0-machine-type]From 10.0 to RHEL.9.6.0 the guest with 9.6 machine type only, the guest crashed with - qemu-kvm: Features 0x1c0010130afffa7 unsupported. Allowed features: 0x10179bfffe7 -Patch118: kvm-virtio-net-disable-USO-for-all-RHEL9.patch -# For RHEL-73002 - kvm-unti kvm-hyperv_synic test is stuck on AMD with COS9 [rhel-10] -Patch119: kvm-target-i386-Make-sure-SynIC-state-is-really-updated-.patch -# For RHEL-73835 - VM crashes when requesting domstats [rhel-10] -Patch120: kvm-hw-virtio-fix-crash-in-processing-balloon-stats.patch -# For RHEL-74361 - qemu-ga logs only "guest-fsfreeze called" (but not "guest-fsthaw called") -Patch121: kvm-qga-Add-log-to-guest-fsfreeze-thaw-command.patch -# For RHEL-74461 - fsfreeze hooks doesn't log error on system logs when running hook fails [rhel-10] -Patch122: kvm-qemu-ga-Optimize-freeze-hook-script-logic-of-logging.patch -# For RHEL-65618 - [RHEL10] Failed to hot add PCIe device behind xio3130 downstream -Patch123: kvm-pci-ensure-valid-link-status-bits-for-downstream-por.patch -# For RHEL-72717 - Boot fall back to cdrom from network not always working -Patch124: kvm-pc-bios-s390-ccw-Abort-IPL-on-invalid-loadparm.patch -# For RHEL-72717 - Boot fall back to cdrom from network not always working -Patch125: kvm-pc-bios-s390-ccw-virtio-Add-a-function-to-reset-a-vi.patch -# For RHEL-72717 - Boot fall back to cdrom from network not always working -Patch126: kvm-pc-bios-s390-ccw-Fix-boot-problem-with-virtio-net-de.patch -# For RHEL-72717 - Boot fall back to cdrom from network not always working -Patch127: kvm-pc-bios-s390-ccw-netmain-Fix-error-messages-with-reg.patch -# For RHEL-71761 - [Nvidia "Grace"] Lack of "PAuth" CPU feature results in live migration failure from RHEL 9.6 to 10 -Patch128: kvm-arm-disable-pauth-for-virt-rhel9-in-RHEL10.patch -# For RHEL-76908 - Ensure qemu as NBD server does not flood logs [rhel-10] -Patch129: kvm-nbd-server-Silence-server-warnings-on-port-probes.patch -# For RHEL-73894 - No RARP packets on the destination after migration [rhel-10] -Patch130: kvm-net-Fix-announce_self.patch -# For RHEL-78370 - Add vhost-user internal migration for passt -Patch131: kvm-vhost-Add-stubs-for-the-migration-state-transfer-int.patch -# For RHEL-78370 - Add vhost-user internal migration for passt -Patch132: kvm-virtio-net-vhost-user-Implement-internal-migration.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch133: kvm-migration-Add-helper-to-get-target-runstate.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch134: kvm-qmp-cont-Only-activate-disks-if-migration-completed.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch135: kvm-migration-block-Make-late-block-active-the-default.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch136: kvm-migration-block-Apply-late-block-active-behavior-to-.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch137: kvm-migration-block-Fix-possible-race-with-block_inactiv.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch138: kvm-migration-block-Rewrite-disk-activation.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch139: kvm-block-Add-active-field-to-BlockDeviceInfo.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch140: kvm-block-Allow-inactivating-already-inactive-nodes.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch141: kvm-block-Inactivate-external-snapshot-overlays-when-nec.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch142: kvm-migration-block-active-Remove-global-active-flag.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch143: kvm-block-Don-t-attach-inactive-child-to-active-node.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch144: kvm-block-Fix-crash-on-block_resize-on-inactive-node.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch145: kvm-block-Add-option-to-create-inactive-nodes.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch146: kvm-block-Add-blockdev-set-active-QMP-command.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch147: kvm-block-Support-inactive-nodes-in-blk_insert_bs.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch148: kvm-block-export-Don-t-ignore-image-activation-error-in-.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch149: kvm-block-Drain-nodes-before-inactivating-them.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch150: kvm-block-export-Add-option-to-allow-export-of-inactive-.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch151: kvm-nbd-server-Support-inactive-nodes.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch152: kvm-iotests-Add-filter_qtest.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch153: kvm-iotests-Add-qsd-migrate-case.patch -# For RHEL-54670 - Provide QMP command for block device reactivation after migration [rhel-10.0] -Patch154: kvm-iotests-Add-NBD-based-tests-for-inactive-nodes.patch -# For RHEL-69776 - [rhel10]Guest crashed on the target host when the migration was canceled -Patch155: kvm-migration-Fix-UAF-for-incoming-migration-on-Migratio.patch -# For RHEL-83535 - [Qemu RHEL-10] qemu-trace-stap should handle lack of stap more gracefully -Patch156: kvm-scripts-improve-error-from-qemu-trace-stap-on-missin.patch # AlmaLinux Patch Patch2001: 2001-Add-ppc64-support.patch @@ -614,6 +316,9 @@ Requires: edk2-ovmf %ifarch aarch64 Requires: edk2-aarch64 %endif +%ifarch riscv64 +Requires: edk2-riscv64 +%endif Requires: libseccomp >= %{libseccomp_version} Requires: libusbx >= %{libusbx_version} @@ -868,6 +573,7 @@ ulimit -n 10240 %define disable_everything \\\ --audio-drv-list= \\\ --disable-alsa \\\ + --disable-asan \\\ --disable-attr \\\ --disable-auth-pam \\\ --disable-avx2 \\\ @@ -945,6 +651,7 @@ ulimit -n 10240 --disable-parallels \\\ --disable-pie \\\ --disable-plugins \\\ + --disable-pvg \\\ --disable-qcow1 \\\ --disable-qed \\\ --disable-qga-vss \\\ @@ -954,7 +661,6 @@ ulimit -n 10240 --disable-replication \\\ --disable-rng-none \\\ --disable-safe-stack \\\ - --disable-sanitizers \\\ --disable-sdl \\\ --disable-sdl-image \\\ --disable-seccomp \\\ @@ -973,6 +679,7 @@ ulimit -n 10240 --disable-tools \\\ --disable-tpm \\\ --disable-u2f \\\ + --disable-ubsan \\\ --disable-usb-redir \\\ --disable-user \\\ --disable-vde \\\ @@ -1022,7 +729,7 @@ run_configure() { --with-coroutine=ucontext \ --tls-priority=@QEMU,SYSTEM \ %{disable_everything} \ -%ifarch aarch64 s390x x86_64 +%ifarch aarch64 s390x x86_64 riscv64 --with-devices-%{kvm_target}=%{kvm_target}-rh-devices \ %endif %ifarch %{power64} @@ -1167,6 +874,7 @@ cp -a qemu-system-%{kvm_target} qemu-kvm cp pc-bios/s390-ccw/s390-ccw.img pc-bios/ %endif + popd # endif !tools_only %endif @@ -1303,6 +1011,7 @@ 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}/pnv-pnor.bin rm -rf %{buildroot}%{_datadir}/%{name}/s390-ccw.img rm -rf %{buildroot}%{_datadir}/%{name}/hppa-firmware.img @@ -1324,6 +1033,7 @@ rm -rf %{buildroot}%{_datadir}/%{name}/qemu-nsis.bmp rm -rf %{buildroot}%{_datadir}/%{name}/npcm7xx_bootrom.bin rm -rf %{buildroot}%{_libdir}/%{name}/ui-spice-app.so +rm -rf %{buildroot}%{_datadir}/%{name}/npcm8xx_bootrom.bin # Remove virtfs-proxy-helper files rm -rf %{buildroot}%{_libexecdir}/virtfs-proxy-helper @@ -1368,6 +1078,9 @@ rm -rf %{buildroot}%{_datadir}/%{name}/bios*.bin rm -rf %{buildroot}%{_datadir}/%{name}/vof-nvram.bin rm -rf %{buildroot}%{_datadir}/%{name}/vof.bin +# Remove uefi vars +rm -rf %{buildroot}%{_libdir}/%{name}/hw-uefi-vars.so + %if %{have_modules_load} install -D -p -m 644 %{_sourcedir}/modules-load.conf %{buildroot}%{_sysconfdir}/modules-load.d/kvm.conf %endif @@ -1532,6 +1245,9 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %endif %files core +%ifarch ppc64le + %{_datadir}/%{name}/slof.bin +%endif %{_libexecdir}/qemu-kvm %{_datadir}/systemtap/tapset/qemu-kvm.stp %{_datadir}/systemtap/tapset/qemu-kvm-log.stp @@ -1543,14 +1259,6 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %{_datadir}/systemtap/tapset/qemu-nbd*.stp %{_datadir}/systemtap/tapset/qemu-storage-daemon*.stp -%ifarch x86_64 - %{_libdir}/%{name}/accel-tcg-%{kvm_target}.so -%endif - -%ifarch ppc64le - %{_datadir}/%{name}/slof.bin -%endif - %files device-display-virtio-gpu %{_libdir}/%{name}/hw-display-virtio-gpu.so @@ -1619,12 +1327,17 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %endif %changelog -* Wed Apr 09 2025 Eduard Abdullin - 18:9.1.0-17.alma.1 +* Thu Apr 24 2025 Eduard Abdullin - 18:10.0.0-1.alma.1 - Enable QXL device build - Enable building for ppc64le - Re-added Spice support - Don't remove slof.bin for ppc64le +* Wed Apr 23 2025 Miroslav Rezanina - 10.0.0-1 +- Rebase to QEMU 10.0.0 [RHEL-74473] +- Resolves: RHEL-74473 + (Rebase qemu-kvm to QEMU 10.0.0) + * Mon Apr 07 2025 Miroslav Rezanina - 9.1.0-17 - kvm-Also-recommend-systemtap-devel-from-qemu-tools.patch [RHEL-83535] - Resolves: RHEL-83535 diff --git a/sources b/sources index 5f32cdc..b2a8ce2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (qemu-9.1.0.tar.xz) = bf61d65e37945fa8ee8640712c719ace05164d86e6df700b98bdc5f79e0a8d5e8f85bd48e726edb62b2419db20673f63ec8b63a60393a914b09cb365621b35e2 +SHA512 (qemu-10.0.0.tar.xz) = 2215458ed8be3ab0b0032fe2a96e79183f5fc2da323d927018412ea3d980b022a07ba87d4f446229eaaa7d1b19a577d438dbcaa3af3bd537c7720b56734a2d8b