Bug 1598780 - memballoon will not work when enable iommu
Summary: memballoon will not work when enable iommu
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: Jing Qi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-06 12:45 UTC by yalzhang@redhat.com
Modified: 2020-02-18 14:23 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-18 14:23:08 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description yalzhang@redhat.com 2018-07-06 12:45:25 UTC
Description of problem:
memballoon will not work when enable iommu

Version-Release number of selected component (if applicable):
libvirt-4.5.0-1.el7.x86_64
qemu-kvm-rhev-2.12.0-7.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare host support VT-d, add "intel_iommu=on" to kernel line

2. Prepare a q35 guest and add the xml as below in the guest 
....
 <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
.....
  <features>
   <ioapic driver='qemu'/>
...
 </features>
 ...
  <iommu model='intel'>
     <driver intremap='on' iotlb='on'/>
  </iommu>
 <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
      <driver iommu='on' ats='on'/>
    </memballoon>
...

3. Add "intel_iommu=on" to kernel line of q35  guest, then reboot the guest

4. check on guest for current memory size
[on guest] # cat /proc/meminfo | grep MemTotal
MemTotal:        1863840 kB

5. change the memory on host, then check, it do not work
[on host] # virsh setmem rhelq 1048576

[on host] # virsh dumpxml rhelq | grep -i mem
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>

6. check on guest, there is no change
[on guest] # cat /proc/meminfo | grep MemTotal
MemTotal:        1863840 kB

Actual results:
in step 5, 6, after setmem, the guest memory do not change

Expected results:
guest memory should be set correctly

Additional info:
destroy the guest, edit the xml to delete the "<driver iommu='on' ats='on'/>", start the guest and redo all the steps.
1. check before the test
[on guest]#  cat /proc/meminfo | grep MemTotal
MemTotal:        1863840 kB
[on host] # virsh dumpxml rhelq | grep -i mem
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>

2. change the memory size for guest, then check it works
[on host] #  virsh setmem rhelq 1048576
[on host] # virsh dumpxml rhelq | grep -i Mem
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>

3. check on guest, it works
[on guest] #  cat /proc/meminfo | grep MemTotal
MemTotal:         815264 kB

Comment 2 Jaroslav Suchanek 2020-02-18 14:23:08 UTC
This bug was closed deferred as a result of bug triage.

Please reopen if you disagree and provide justification why this bug should
get enough priority. Most important would be information about impact on
customer or layered product. Please indicate requested target release.


Note You need to log in before you can comment on or make changes to this bug.