thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

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

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