cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/0018-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch

b697b4
From 295ee942608d48ab167aa76adabf3697c28e6910 Mon Sep 17 00:00:00 2001
a83cc2
From: David Gibson <dgibson@redhat.com>
a83cc2
Date: Wed, 6 Feb 2019 03:58:56 +0000
a83cc2
Subject: BZ1653590: Require at least 64kiB pages for downstream guests & hosts
a83cc2
a83cc2
RH-Author: David Gibson <dgibson@redhat.com>
a83cc2
Message-id: <20190206035856.19058-1-dgibson@redhat.com>
a83cc2
Patchwork-id: 84246
a83cc2
O-Subject: [RHELAV-8.0/rhel qemu-kvm PATCH] BZ1653590: Require at least 64kiB pages for downstream guests & hosts
a83cc2
Bugzilla: 1653590
a83cc2
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
a83cc2
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
a83cc2
RH-Acked-by: Thomas Huth <thuth@redhat.com>
a83cc2
a83cc2
Most current POWER guests require 64kiB page support, so that's the default
a83cc2
for the cap-hpt-max-pagesize option in qemu which limits available guest
a83cc2
page sizes.  We warn if the value is set smaller than that, but don't
a83cc2
outright fail upstream, because we need to allow for the possibility of
a83cc2
guest (and/or host) kernels configured for 4kiB page sizes.
a83cc2
a83cc2
Downstream, however, we simply don't support 4kiB pagesize configured
a83cc2
kernels in guest or host, so we can have qemu simply error out in this
a83cc2
situation.
a83cc2
a83cc2
Testing: Attempted to start a guest with cap-hpt-max-page-size=4k and verified
a83cc2
         it failed immediately with a qemu error
a83cc2
a83cc2
Signed-off-by: David Gibson <dgibson@redhat.com>
a83cc2
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
a83cc2
---
a83cc2
 hw/ppc/spapr_caps.c | 7 +++++++
a83cc2
 1 file changed, 7 insertions(+)
a83cc2
a83cc2
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
77609c
index ed7c077a0d..48a8efe678 100644
a83cc2
--- a/hw/ppc/spapr_caps.c
a83cc2
+++ b/hw/ppc/spapr_caps.c
a83cc2
@@ -332,12 +332,19 @@ bool spapr_check_pagesize(SpaprMachineState *spapr, hwaddr pagesize,
a83cc2
 static void cap_hpt_maxpagesize_apply(SpaprMachineState *spapr,
a83cc2
                                       uint8_t val, Error **errp)
a83cc2
 {
a83cc2
+#if 0 /* disabled for RHEL */
a83cc2
     if (val < 12) {
a83cc2
         error_setg(errp, "Require at least 4kiB hpt-max-page-size");
a83cc2
         return;
a83cc2
     } else if (val < 16) {
a83cc2
         warn_report("Many guests require at least 64kiB hpt-max-page-size");
a83cc2
     }
a83cc2
+#else /* Only page sizes >=64kiB supported for RHEL */
a83cc2
+    if (val < 16) {
a83cc2
+        error_setg(errp, "Require at least 64kiB hpt-max-page-size");
a83cc2
+        return;
a83cc2
+    }
a83cc2
+#endif
a83cc2
 
a83cc2
     spapr_check_pagesize(spapr, qemu_minrampagesize(), errp);
a83cc2
 }
a83cc2
-- 
a83cc2
2.27.0
a83cc2