cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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