[libvirt] [PATCH] qemu: Memory locking is only required for KVM guests on ppc64

Due to the way the hardware works, KVM on ppc64 always requires memory locking; however, that is not the case for non-KVM ppc64 guests, eg. ppc64 guests that are running on x86_64 with TCG. Only require memory locking for ppc64 guests if they are using KVM or, as it's the case for all architectures, they have host devices assigned using VFIO. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1350772 --- src/qemu/qemu_domain.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 304e617..42b5511 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5355,10 +5355,6 @@ qemuDomainRequiresMemLock(virDomainDefPtr def) if (def->mem.locked) return true; - /* ppc64 domains need to lock some memory even when VFIO is not used */ - if (ARCH_IS_PPC64(def->os.arch)) - return true; - for (i = 0; i < def->nhostdevs; i++) { virDomainHostdevDefPtr dev = def->hostdevs[i]; @@ -5368,6 +5364,10 @@ qemuDomainRequiresMemLock(virDomainDefPtr def) return true; } + /* ppc64 KVM domains need to lock some memory even when VFIO is not used */ + if (ARCH_IS_PPC64(def->os.arch) && def->virtType == VIR_DOMAIN_VIRT_KVM) + return true; + return false; } -- 2.7.4

On Mon, Jul 04, 2016 at 10:57:59AM +0200, Andrea Bolognani wrote:
Due to the way the hardware works, KVM on ppc64 always requires memory locking; however, that is not the case for non-KVM ppc64 guests, eg. ppc64 guests that are running on x86_64 with TCG.
Only require memory locking for ppc64 guests if they are using KVM or, as it's the case for all architectures, they have host devices assigned using VFIO.
How about ppc64 TCG on ppc64? Not needed as well?

On Mon, 2016-07-04 at 13:18 +0200, Martin Kletzander wrote:
On Mon, Jul 04, 2016 at 10:57:59AM +0200, Andrea Bolognani wrote:
Due to the way the hardware works, KVM on ppc64 always requires memory locking; however, that is not the case for non-KVM ppc64 guests, eg. ppc64 guests that are running on x86_64 with TCG.
Only require memory locking for ppc64 guests if they are using KVM or, as it's the case for all architectures, they have host devices assigned using VFIO.
How about ppc64 TCG on ppc64? Not needed as well?
That's right :) -- Andrea Bolognani / Red Hat / Virtualization

On Mon, Jul 04, 2016 at 01:25:45PM +0200, Andrea Bolognani wrote:
On Mon, 2016-07-04 at 13:18 +0200, Martin Kletzander wrote:
On Mon, Jul 04, 2016 at 10:57:59AM +0200, Andrea Bolognani wrote:
Due to the way the hardware works, KVM on ppc64 always requires memory locking; however, that is not the case for non-KVM ppc64 guests, eg. ppc64 guests that are running on x86_64 with TCG.
Only require memory locking for ppc64 guests if they are using KVM or, as it's the case for all architectures, they have host devices assigned using VFIO.
How about ppc64 TCG on ppc64? Not needed as well?
That's right :)
OK, ACK then.

On Mon, 2016-07-04 at 13:32 +0200, Martin Kletzander wrote:
On Mon, Jul 04, 2016 at 01:25:45PM +0200, Andrea Bolognani wrote:
On Mon, 2016-07-04 at 13:18 +0200, Martin Kletzander wrote:
On Mon, Jul 04, 2016 at 10:57:59AM +0200, Andrea Bolognani wrote:
Due to the way the hardware works, KVM on ppc64 always requires memory locking; however, that is not the case for non-KVM ppc64 guests, eg. ppc64 guests that are running on x86_64 with TCG.
Only require memory locking for ppc64 guests if they are using KVM or, as it's the case for all architectures, they have host devices assigned using VFIO.
How about ppc64 TCG on ppc64? Not needed as well?
That's right :)
OK, ACK then.
Pushed, thanks. -- Andrea Bolognani / Red Hat / Virtualization
participants (2)
-
Andrea Bolognani
-
Martin Kletzander