Re: [libvirt PATCH 4/4] qemu: increase locked memory limit when a vDPA device is present

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 3/23/21 3:50 PM, Laine Stump wrote:
Just like VFIO devices, vDPA devices may need to have all guest memory
pages locked/pinned in order to operate properly. In the case of VFIO
devices (including mdev and NVME, which also use VFIO) libvirt
automatically increases the locked memory limit when one of those
devices is present. This patch modifies that code to also increase the
limit if there are any vDPA devices present.

Resolves: https://bugzilla.redhat.com/1939776
Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---

Reviewed-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>

  src/qemu/qemu_domain.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e0379e81ba..76e8903dbc 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -9199,7 +9199,7 @@ getPPC64MemLockLimitBytes(virDomainDefPtr def,
          passthroughLimit = maxMemory +
                             128 * (1ULL<<30) / 512 * nPCIHostBridges +
                             8192;
-    } else if (forceVFIO || qemuDomainNeedsVFIO(def)) {
+    } else if (forceVFIO || qemuDomainNeedsVFIO(def) || virDomainDefHasVDPANet(def)) {
          /* For regular (non-NVLink2 present) VFIO passthrough, the value
           * of passthroughLimit is:
           *
@@ -9289,7 +9289,7 @@ qemuDomainGetMemLockLimitBytes(virDomainDefPtr def,
       *
       * Note that this may not be valid for all platforms.
       */
-    if (forceVFIO || qemuDomainNeedsVFIO(def))
+    if (forceVFIO || qemuDomainNeedsVFIO(def) || virDomainDefHasVDPANet(def))
          memKB = virDomainDefGetMemoryTotal(def) + 1024 * 1024;
return memKB << 10;





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux