What were you trying to do that didn't work?
Boot windows guest with IOMMU, enable VBS inside guest and reboot , then hotplug memory to guest.
What is the impact of this issue to you?
The hotplugged memory is not recognized by guest.
Please provide the package NVR for which the bug is seen:
qemu-kvm-9.1.0-1.el9
kernel-5.14.0-524.el9.x86_64
edk2-ovmf-20240524-7.el9.noarch
How reproducible is this bug?:
3/3
Steps to reproduce
- Boot up a Windows guest
- Enable VBS on the guest. For doing so you can use https://github.com/MicrosoftDocs/windows-itpro-docs/files/4020040/DG_Readinessv3.7.zip. Then, in Windows powershell, run 'Set-ExecutionPolicy -ExecutionPolicy Unrestricte' and 'DG_Readiness_Tool_3.6.ps1 -Enable'.
- Reboot the guest.
- Hotplug memory to guest
{"execute": "object-add", "arguments": {"qom-type": "memory-backend-file", "id": "mem-plug1", "size": 1073741824, "mem-path": "/mnt/kvm_hugepage", "policy": "default"}, "id": "ZQtUcyli"} {"execute": "device_add", "arguments": {"node": "0", "driver": "pc-dimm", "id": "dimm-plug1", "memdev": "mem-plug1"}, "id": "qcvQhUxS"}
Expected results
The hotplugged memory is recognized by guest.
Actual results
The hotplugged memory is NOT recognized by guest.
Additional Info:
[1] QEMU cli:
/usr/libexec/qemu-kvm \ -S \ -name 'avocado-vt-vm1' \ -sandbox on,elevateprivileges=deny,obsolete=deny,resourcecontrol=deny,spawn=deny \ -blockdev '{"node-name": "file_ovmf_code", "driver": "file", "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", "auto-read-only": true, "discard": "unmap"}' \ -blockdev '{"node-name": "drive_ovmf_code", "driver": "raw", "read-only": true, "file": "file_ovmf_code"}' \ -blockdev '{"node-name": "file_ovmf_vars", "driver": "file", "filename": "/root/avocado/data/avocado-vt/avocado-vt-vm1_win2022-64-virtio-scsi-ovmf_qcow2_filesystem_VARS.raw", "auto-read-only": true, "discard": "unmap"}' \ -blockdev '{"node-name": "drive_ovmf_vars", "driver": "raw", "read-only": false, "file": "file_ovmf_vars"}' \ -machine q35,kernel-irqchip=split,pflash0=drive_ovmf_code,pflash1=drive_ovmf_vars \ -device '{"id": "pcie-root-port-0", "driver": "pcie-root-port", "multifunction": true, "bus": "pcie.0", "addr": "0x1", "chassis": 1}' \ -device '{"id": "pcie-pci-bridge-0", "driver": "pcie-pci-bridge", "addr": "0x0", "bus": "pcie-root-port-0"}' \ -nodefaults \ -device '{"intremap": "on", "device-iotlb": true, "eim": "off", "aw-bits": 48, "driver": "intel-iommu"}' \ -device '{"driver": "VGA", "bus": "pcie.0", "addr": "0x2"}' \ -m 4096,maxmem=32G,slots=4 \ -object '{"size": 1073741824, "mem-path": "/mnt/kvm_hugepage", "policy": "default", "id": "mem-mem1", "qom-type": "memory-backend-file"}' \ -device '{"node": 1, "driver": "pc-dimm", "id": "dimm-mem1", "memdev": "mem-mem1"}' \ -object '{"size": 1073741824, "mem-path": "/mnt/kvm_hugepage", "policy": "default", "id": "mem-mem2", "qom-type": "memory-backend-file"}' \ -device '{"node": 0, "driver": "pc-dimm", "id": "dimm-mem2", "memdev": "mem-mem2"}' \ -object '{"size": 2147483648, "policy": "default", "id": "mem-memN0", "qom-type": "memory-backend-ram"}' \ -object '{"size": 2147483648, "policy": "default", "id": "mem-memN1", "qom-type": "memory-backend-ram"}' \ -smp 20,maxcpus=20,cores=10,threads=1,dies=1,sockets=2 \ -numa node,memdev=mem-memN0,nodeid=0 \ -numa node,memdev=mem-memN1,nodeid=1 \ -cpu 'Haswell-noTSX-IBRS',vmx=on,pdcm=on,f16c=on,rdrand=on,hypervisor=on,vme=on,ss=on,arat=on,tsc-adjust=on,umip=on,md-clear=on,stibp=on,flush-l1d=on,arch-capabilities=on,ssbd=on,xsaveopt=on,abm=on,pdpe1gb=on,ibpb=on,ibrs=on,amd-stibp=on,amd-ssbd=on,skip-l1dfl-vmentry=on,pschange-mc-no=on,gds-no=on,rfds-no=on,vmx-ins-outs=on,vmx-true-ctls=on,vmx-store-lma=on,vmx-activity-hlt=on,vmx-activity-wait-sipi=on,vmx-vmwrite-vmexit-fields=on,vmx-apicv-xapic=on,vmx-ept=on,vmx-desc-exit=on,vmx-rdtscp-exit=on,vmx-apicv-x2apic=on,vmx-vpid=on,vmx-wbinvd-exit=on,vmx-unrestricted-guest=on,vmx-apicv-register=on,vmx-apicv-vid=on,vmx-rdrand-exit=on,vmx-invpcid-exit=on,vmx-vmfunc=on,vmx-shadow-vmcs=on,vmx-pml=on,vmx-ept-execonly=on,vmx-page-walk-4=on,vmx-ept-2mb=on,vmx-ept-1gb=on,vmx-invept=on,vmx-eptad=on,vmx-invept-single-context=on,vmx-invept-all-context=on,vmx-invvpid=on,vmx-invvpid-single-addr=on,vmx-invvpid-all-context=on,vmx-intr-exit=on,vmx-nmi-exit=on,vmx-vnmi=on,vmx-preemption-timer=on,vmx-posted-intr=on,vmx-vintr-pending=on,vmx-tsc-offset=on,vmx-hlt-exit=on,vmx-invlpg-exit=on,vmx-mwait-exit=on,vmx-rdpmc-exit=on,vmx-rdtsc-exit=on,vmx-cr3-load-noexit=on,vmx-cr3-store-noexit=on,vmx-cr8-load-exit=on,vmx-cr8-store-exit=on,vmx-flexpriority=on,vmx-vnmi-pending=on,vmx-movdr-exit=on,vmx-io-exit=on,vmx-io-bitmap=on,vmx-mtf=on,vmx-msr-bitmap=on,vmx-monitor-exit=on,vmx-pause-exit=on,vmx-secondary-ctls=on,vmx-exit-nosave-debugctl=on,vmx-exit-load-perf-global-ctrl=on,vmx-exit-ack-intr=on,vmx-exit-save-pat=on,vmx-exit-load-pat=on,vmx-exit-save-efer=on,vmx-exit-load-efer=on,vmx-exit-save-preemption-timer=on,vmx-entry-noload-debugctl=on,vmx-entry-ia32e-mode=on,vmx-entry-load-perf-global-ctrl=on,vmx-entry-load-pat=on,vmx-entry-load-efer=on,vmx-eptp-switching=on,hv_stimer,hv_synic,hv_vpindex,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_frequencies,hv_runtime,hv_tlbflush,hv_reenlightenment,hv_stimer_direct,hv_ipi,hv-xmm-input,hv_tlbflush_ext,kvm_pv_unhalt=on \ -chardev socket,path=/var/tmp/avocado_zobn_0b0/monitor-qmpmonitor1-20241105-014504-vUM1hxeK,server=on,id=qmp_id_qmpmonitor1,wait=off \ -mon chardev=qmp_id_qmpmonitor1,mode=control \ -chardev socket,path=/var/tmp/avocado_zobn_0b0/monitor-catch_monitor-20241105-014504-vUM1hxeK,server=on,id=qmp_id_catch_monitor,wait=off \ -mon chardev=qmp_id_catch_monitor,mode=control \ -device '{"ioport": 1285, "driver": "pvpanic", "id": "idgKnxPe"}' \ -chardev socket,path=/var/tmp/avocado_zobn_0b0/serial-serial0-20241105-014504-vUM1hxeK,server=on,id=chardev_serial0,wait=off \ -device '{"id": "serial0", "driver": "isa-serial", "chardev": "chardev_serial0"}' \ -chardev socket,id=seabioslog_id_20241105-014504-vUM1hxeK,path=/var/tmp/avocado_zobn_0b0/seabios-20241105-014504-vUM1hxeK,server=on,wait=off \ -device isa-debugcon,chardev=seabioslog_id_20241105-014504-vUM1hxeK,iobase=0x402 \ -device '{"id": "pcie-root-port-1", "port": 1, "driver": "pcie-root-port", "addr": "0x1.0x1", "bus": "pcie.0", "chassis": 2}' \ -device '{"driver": "qemu-xhci", "id": "usb1", "bus": "pcie-root-port-1", "addr": "0x0"}' \ -device '{"driver": "usb-tablet", "id": "usb-tablet1", "bus": "usb1.0", "port": "1"}' \ -device '{"id": "pcie-root-port-2", "port": 2, "driver": "pcie-root-port", "addr": "0x1.0x2", "bus": "pcie.0", "chassis": 3}' \ -device '{"id": "virtio_scsi_pci0", "driver": "virtio-scsi-pci", "bus": "pcie-root-port-2", "addr": "0x0", "iommu_platform": true, "ats": true, "aer": true}' \ -blockdev '{"node-name": "file_image1", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/win2022-64-virtio-scsi-ovmf.qcow2", "cache": {"direct": true, "no-flush": false}}' \ -blockdev '{"node-name": "drive_image1", "driver": "qcow2", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "file_image1"}' \ -device '{"driver": "scsi-hd", "id": "image1", "drive": "drive_image1", "write-cache": "on"}' \ -device '{"id": "pcie-root-port-3", "port": 3, "driver": "pcie-root-port", "addr": "0x1.0x3", "bus": "pcie.0", "chassis": 4}' \ -device '{"driver": "virtio-net-pci", "mac": "9a:73:3d:54:72:82", "id": "idfyQUbs", "netdev": "idiNOm4x", "bus": "pcie-root-port-3", "addr": "0x0", "iommu_platform": true, "ats": true, "aer": true}' \ -netdev '{"id": "idiNOm4x", "type": "tap", "vhost": true, "vhostfd": "16", "fd": "13"}' \ -blockdev '{"node-name": "drive_cd1", "driver": "file", "read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/iso/windows/winutils.iso", "cache": {"direct": true, "no-flush": false}}' \ -device '{"driver": "scsi-cd", "id": "cd1", "drive": "drive_cd1", "write-cache": "on"}' \ -vnc :0 \ -rtc base=localtime,clock=host,driftfix=slew \ -boot menu=off,order=cdn,once=c,strict=off \ -chardev socket,id=char_vtpm_avocado-vt-vm1_tpm0,path=/root/avocado/data/avocado-vt/swtpm/avocado-vt-vm1_tpm0_swtpm.sock \ -tpmdev emulator,chardev=char_vtpm_avocado-vt-vm1_tpm0,id=emulator_vtpm_avocado-vt-vm1_tpm0 \ -device '{"id": "tpm-crb_vtpm_avocado-vt-vm1_tpm0", "tpmdev": "emulator_vtpm_avocado-vt-vm1_tpm0", "driver": "tpm-crb"}' \ -enable-kvm \ -device '{"id": "pcie_extra_root_port_0", "driver": "pcie-root-port", "multifunction": true, "bus": "pcie.0", "addr": "0x3", "chassis": 5}'
[2] Secure boot is enabled in the test.
[3] Tested on both Icelake Server and Haswell host, the results are the same.
[4] If boot the guest without IOMMU, memory hotplug is working well.
[5] If disable VBS inside guest, memory hotplug is working well.