38f2fd
From 3f49b7d6c486486baabcfa956bea6aa32f133a91 Mon Sep 17 00:00:00 2001
38f2fd
Message-Id: <3f49b7d6c486486baabcfa956bea6aa32f133a91@dist-git>
38f2fd
From: Andrea Bolognani <abologna@redhat.com>
38f2fd
Date: Fri, 20 Nov 2015 13:29:15 +0100
38f2fd
Subject: [PATCH] qemu: Always set locked memory limit for ppc64 domains
38f2fd
38f2fd
Unlike other architectures, ppc64 domains need to lock memory
38f2fd
even when VFIO is not used.
38f2fd
38f2fd
Change qemuDomainRequiresMlock() to reflect this fact.
38f2fd
38f2fd
(cherry picked from commit 16562bbc587add5a03a01c8eb8607c9e05819607)
38f2fd
38f2fd
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1283924
38f2fd
38f2fd
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
38f2fd
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
38f2fd
---
38f2fd
 src/qemu/qemu_domain.c | 9 +++++++--
38f2fd
 1 file changed, 7 insertions(+), 2 deletions(-)
38f2fd
38f2fd
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
38f2fd
index 4615e3e..d0df935 100644
38f2fd
--- a/src/qemu/qemu_domain.c
38f2fd
+++ b/src/qemu/qemu_domain.c
38f2fd
@@ -3551,8 +3551,9 @@ qemuDomainGetMlockLimitBytes(virDomainDefPtr def)
38f2fd
 /**
38f2fd
  * @def: domain definition
38f2fd
  *
38f2fd
- * Returns ture if the locked memory limit needs to be set or updated due to
38f2fd
- * configuration or passthrough devices.
38f2fd
+ * Returns true if the locked memory limit needs to be set or updated because
38f2fd
+ * of domain configuration, VFIO passthrough devices or architecture-specific
38f2fd
+ * requirements.
38f2fd
  * */
38f2fd
 bool
38f2fd
 qemuDomainRequiresMlock(virDomainDefPtr def)
38f2fd
@@ -3562,6 +3563,10 @@ qemuDomainRequiresMlock(virDomainDefPtr def)
38f2fd
     if (def->mem.locked)
38f2fd
         return true;
38f2fd
 
38f2fd
+    /* ppc64 domains need to lock some memory even when VFIO is not used */
38f2fd
+    if (ARCH_IS_PPC64(def->os.arch))
38f2fd
+        return true;
38f2fd
+
38f2fd
     for (i = 0; i < def->nhostdevs; i++) {
38f2fd
         virDomainHostdevDefPtr dev = def->hostdevs[i];
38f2fd
 
38f2fd
-- 
38f2fd
2.6.3
38f2fd