Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-67545

[virtio-win][viomem] Total mem size sometimes is not accurate after resize virtio-mem device, after reboot the data will return to normal.

    • rhel-sst-virtualization
    • ssg_virtualization
    • None
    • QE ack
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • x86_64
    • Windows
    • None

      Description of problem:

      Total mem size sometimes is not accurate after resize virtio-mem device

      Version-Release number of selected component (if applicable):

      kernel-5.14.0-526.el9.x86_64
      qemu-kvm-9.1.0-1.el9.x86_64
      edk2-ovmf-20240524-8.el9.noarch
      seabios-bin-1.16.3-2.el9.noarch
      virtio-win-prewhql-266.iso

      How reproducible:
      100%

      Steps to Reproduce:
      1. Boot a win2019(seabios+q35) guest with a viomem device

      /usr/libexec/qemu-kvm \
      -name 'win2019' \
      -machine q35 \
      -nodefaults \
      -vga std \
      -device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x3 \
      -device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x3.0x1 \
      -device pcie-root-port,port=0x12,chassis=3,id=pci.3,bus=pcie.0,addr=0x3.0x2 \
      -device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x3.0x3 \
      -device pcie-root-port,port=0x14,chassis=5,id=pci.5,bus=pcie.0,addr=0x3.0x4 \
      -device pcie-root-port,port=0x15,chassis=6,id=pci.6,bus=pcie.0,addr=0x3.0x5 \
      -device pcie-root-port,port=0x16,chassis=7,id=pci.7,bus=pcie.0,addr=0x3.0x6 \
      -device pcie-root-port,port=0x17,chassis=8,id=pci.8,bus=pcie.0,addr=0x3.0x7 \
      -blockdev node-name=file_stg1,driver=file,cache.direct=on,cache.no-flush=off,filename=win2019-64-virtio.qcow2,aio=threads \
      -blockdev node-name=drive_stg1,driver=qcow2,cache.direct=on,cache.no-flush=off,file=file_stg1 \
      -device virtio-blk-pci,id=stg1,drive=drive_stg1,bus=pci.8,addr=0x0,bootindex=0 \
      -device virtio-net-pci,mac=9a:36:83:b6:3d:05,id=idJVpmsF,netdev=id23ZUK6,bus=pci.3 \
      -netdev tap,id=id23ZUK6,vhost=on \
      -smp 8 \
      -cpu 'Skylake-Server',hv_stimer,hv_synic,hv_vpindex,hv_reset,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv-tlbflush,+kvm_pv_unhalt \
      -cdrom /home/kvm_autotest_root/iso/windows/virtio-win-prewhql-0.1-266.iso \
      -device piix3-usb-uhci,id=usb -device usb-tablet,id=input0 \
      -vnc :10 \
      -rtc base=localtime,clock=host,driftfix=slew \
      -boot order=cdn,once=c,menu=off,strict=off \
      -enable-kvm \
      -qmp tcp:0:1231,server,nowait \
      -monitor stdio \
      -m 4G,maxmem=80G,slots=20 \
      -object memory-backend-ram,id=vmem0,size=8G \
      -device virtio-mem-pci,id=vm0,memdev=vmem0,node=0,requested-size=1G,bus=pci.4 \

      2. Resize virtio-mem device, grow and shrink

      (qemu) qom-set vm0 requested-size 6G
      (qemu) qom-set vm0 requested-size 2G

      3.Check memory device in hmp and memory status inside guest

      (qemu) info memory-devices
      Memory device [virtio-mem]: "vm0"
      memaddr: 0x180000000
      node: 0
      requested-size: 2147483648
      size: 2680160256
      max-size: 8589934592
      block-size: 2097152
      memdev: /objects/vmem0

      Actual results:
      Total mem size show 6.5G

      Expected results:
      Total mem size should be 6.0G

      Other information:
      1. Not related guests.
      2. After reboot the guest, mem size change to expected size.

              mkedzier1 Marek Kedzierski
              rhn-support-menli Menghuan Li
              Meirav Dean Meirav Dean
              Menghuan Li Menghuan Li
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: