From 28221f9c999a9b34f58d94599da9c229df9a4fed Mon Sep 17 00:00:00 2001 From: Janosch Frank Date: Fri, 28 Sep 2018 11:34:35 +0200 Subject: s390x: Fence huge pages prior to 3.1 As the kernel has no way of disallowing the start of a huge page backed VM, we can migrate a running huge backed VM to a host that has no huge page KVM support. Let's glue huge page support support to the 3.1 machine, so we do not migrate to a destination host that doesn't have QEMU huge page support and can stop migration if KVM doesn't indicate support. Signed-off-by: Janosch Frank Message-Id: <20180928093435.198573-1-frankja@linux.ibm.com> Reviewed-by: David Hildenbrand Signed-off-by: Cornelia Huck --- target/s390x/kvm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'target') diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 348e8cc..323cb00 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -292,6 +292,12 @@ static int kvm_s390_configure_mempath_backing(KVMState *s) return 0; } + if (!hpage_1m_allowed()) { + error_report("This QEMU machine does not support huge page " + "mappings"); + return -EINVAL; + } + if (path_psize != 1 * MiB) { error_report("Memory backing with 2G pages was specified, " "but KVM does not support this memory backing"); -- cgit v1.1