There are two scenarios here, if we have a regular, directly assigned
physical device (including VFs), vfio's page pinning will populate the
full memory footprint of the guest regardless of the balloon.  The
balloon is effectively fully deflated, but the balloon driver in the
guest hasn't released the pages back for guest kernel use.  In that case
marking the balloon as deflated at least allows those pages to be used
since they're allocated.  However, if the assigned device is an mdev
device, then the pages might only be pinned on usage, depending on the
vendor driver, and pages acquired by the guest balloon driver are
unlikely to be used by the in-guest driver for the device.  It's always
possible that the mdev vendor driver could pin them anyway, but there is
a chance that those pages are actually still freed to the host until
that point.  Latest QEMU will of course enable the  balloon inhibitor
for either case so further balloon inflation will no longer zap pages.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1762707

Title:
  VFIO device gets DMA failures when virtio-balloon leak from highmem to
  lowmem

Status in QEMU:
  Invalid

Bug description:
  Is there any known conflict between VFIO passthrough device and
  virtio-balloon?

  The VM has:
  1. 4GB system memory
  2. one VFIO passthrough device which supports high address memory DMA and 
uses GFP_HIGHUSER pages.
  3. Memory balloon device with 4GB target.

  When setting the memory balloon target to 1GB and 4GB in loop during
  runtime (I used the command "virsh qemu-monitor-command debian --hmp
  --cmd balloon 1024"), the VFIO device DMA randomly gets failure.

  More clues:
  1. configure 2GB system memory (no highmem) VM, no issue with similar 
operations
  2. setting the memory balloon to higher like 8GB, no issue with similar 
operations

  I'm also trying to narrow down this issue. It's appreciated for that
  you guys may share some thoughts.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1762707/+subscriptions

Reply via email to