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