Bug 1828654

Summary: [virtio-win][balloon] balloon does not work after hotunplug/hotplug balloon device
Product: Red Hat Enterprise Linux 8 Reporter: xiagao
Component: virtio-winAssignee: Julia Suvorova <jusual>
virtio-win sub component: virtio-win-prewhql QA Contact: xiagao
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: ailan, demeng, ghammer, kanderso, lijin, vrozenfe, ybendito, yuhuang, yvugenfi
Version: 8.2Keywords: Reopened
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-16 14:24:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1744438    

Description xiagao 2020-04-28 03:45:23 UTC
Description of problem:
Balloon doesn't work after hotunplug/hotplug balloon device

Version-Release number of selected component (if applicable):
qemu-kvm-4.2.0-19.module+el8.2.1+6306+6069c690.x86_64
kernel-4.18.0-193.el8.x86_64
virtio-win-prewhql-181

How reproducible:
100%

Steps to Reproduce:
1.boot win10-64 guest with 8G mem and balloon device.
-device virtio-balloon-pci,id=balloon0,bus=pci.5 \

2. balloon memory to 4G
(qemu) info balloon
balloon: actual=8192
(qemu) balloon 4096
(qemu) info balloon
balloon: actual=4096
==========> balloon works

3. delete balloon device 
(qemu) device_del balloon0

4. add balloon device
(qemu) device_add virtio-balloon-pci,bus=pci.5,id=balloon0

5. balloon memory to 5G after hotunplug/hotplug
(qemu) info balloon
balloon: actual=8192
(qemu) balloon 5120
(qemu) info balloon
balloon: actual=8192
(qemu) info balloon
balloon: actual=8192
(qemu) info balloon
balloon: actual=8192
=========>balloon didn't work


Actual results:
balloon didn't work after step5

Expected results:
balloon works after hotunplug/hotplug.

Additional info:
1. qemu command line:
/usr/libexec/qemu-kvm -name win10-64 -enable-kvm -m 8192 -smp 3,maxcpus=24,cores=12,threads=1,sockets=2 -nodefaults -cpu 'EPYC',hv_stimer,hv_synic,hv_vpindex,hv_reset,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv-tlbflush,+kvm_pv_unhalt -rtc base=localtime,driftfix=none -boot order=cd,menu=on -monitor stdio -M q35 -vga std -vnc :11 -qmp tcp:0:4444,server,nowait \
-device piix3-usb-uhci,id=usb -device usb-tablet,id=input0 \
-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 \
-blockdev driver=file,cache.direct=off,cache.no-flush=on,filename=win1064.qcow2,node-name=system_file \
-blockdev driver=qcow2,node-name=drive_system_disk,file=system_file \
-object iothread,id=thread0 -device virtio-blk-pci,iothread=thread0,drive=drive_system_disk,id=virtio-disk0,bootindex=0 \
-netdev tap,script=/etc/qemu-ifup,downscript=no,id=hostnet0,vhost=on,queues=4 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:52:11:36:3f:0d,bus=pci.2,mq=on,vectors=10 \
-device virtio-balloon-pci,id=balloon0,bus=pci.5 \

2. if didn't do balloon operation before hotunplug/hotplug, can't hit this issue.

3. did not hit this issue on linux guest.

Comment 1 xiagao 2020-06-03 01:18:09 UTC
Hit similar issue when disable/enable balloon device when testing with automation, but only hit one time(62 times totally)

pkg:
virtio-win-prewhql-185

1.boot up with balloon device and install driver.
-m 14336  \
2.balloon mem to 3734
3.during step2, disable balloon device
4.enable balloon device
5.check balloon, it is 14336
6.balloon mem to 13196
==========> balloon doesn't work,it's still 14336.

Comment 6 Gal Hammer 2020-10-20 06:40:47 UTC
This bug have the similar behavior: the driver is loaded by Windows after it was removed by QEMU.

Comment 13 dehanmeng 2020-12-01 14:41:55 UTC
Reproduce with version qemu-kvm-4.2.0-19.module+el8.2.1+6306+6069c690.x86_64

Steps to Reproduce as comment0

Actual result:
info balloon
balloon: actual=8192
(qemu) balloon 4096
(qemu) info balloon
balloon: actual=4096
(qemu) device_del balloon0
(qemu) device_add virtio-balloon-pci,bus=pci.5,id=balloon0
(qemu) info balloon
balloon: actual=8192
(qemu) balloon 5120
(qemu) info balloon
balloon: actual=8192
(qemu) 

Expected result:
balloon works after hotunplug/hotplug.


Verified with version qemu-kvm-5.1.0-15.module+el8.3.1+8772+a3fdeccd

Steps to Reproduce as comment0

Actual result:
info balloon
balloon: actual=8192
(qemu) balloon 4096
(qemu) info balloon
balloon: actual=4096
(qemu) device_del balloon0
(qemu) device_add virtio-balloon-pci,bus=pci.5,id=balloon0
(qemu)  info balloon
balloon: actual=8192
(qemu) balloon 5120
(qemu) info balloon
balloon: actual=5120
(qemu) info balloon
balloon: actual=5120
(qemu) 

Expected result:
balloon still works after hotunplug/hotplug.

Comment 14 ybendito 2020-12-01 22:24:06 UTC
The bug was fixed in the guest driver virtio-win build 191
With which driver it was verified?

Comment 15 dehanmeng 2020-12-02 00:16:58 UTC
(In reply to ybendito from comment #14)
> The bug was fixed in the guest driver virtio-win build 191
> With which driver it was verified?

the version is virtio-win-prewhql-0.1-191.iso with balloon driver.

Comment 16 dehanmeng 2020-12-02 00:19:47 UTC
(In reply to dehanmeng from comment #13)
> Reproduce with version qemu-kvm-4.2.0-19.module+el8.2.1+6306+6069c690.x86_64
> 
kernel-4.18.0-193.el8.x86_64
virtio-win-prewhql-181

> 
> Verified with version qemu-kvm-5.1.0-15.module+el8.3.1+8772+a3fdeccd 
> 
kernel-4.18.0-250.el8.x86_64
virtio-win-prewhql-0.1-191.iso

Comment 19 errata-xmlrpc 2021-02-16 14:24:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virtio-win bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2021:0535