aboutsummaryrefslogtreecommitdiff
path: root/sysutils/xen-tools
diff options
context:
space:
mode:
authorRoger Pau Monné <royger@FreeBSD.org>2019-03-15 12:37:54 +0000
committerRoger Pau Monné <royger@FreeBSD.org>2019-03-15 12:37:54 +0000
commit4b54fba456869fd61dc89ecb4fb45aa9276aeab8 (patch)
treea0e70bf5dcd1df95d8fd20dc1beb9ca8fe06ae54 /sysutils/xen-tools
parenta7f18f544c6e8bf1d03649f5039f07322ef66181 (diff)
downloadports-4b54fba456869fd61dc89ecb4fb45aa9276aeab8.tar.gz
ports-4b54fba456869fd61dc89ecb4fb45aa9276aeab8.zip
sysutils/xen-tools: add QEMU migration fix
Add a QEMU fix to make migration more reliable. Sponsored by: Citrix Systems R&D Reviewed by: novel Differential revision: https://reviews.freebsd.org/D19591
Notes
Notes: svn path=/head/; revision=495786
Diffstat (limited to 'sysutils/xen-tools')
-rw-r--r--sysutils/xen-tools/Makefile2
-rw-r--r--sysutils/xen-tools/files/0001-xen-mapcache-use-MAP_FIXED-flag-so-the-mmap-address-qemuu.patch56
2 files changed, 57 insertions, 1 deletions
diff --git a/sysutils/xen-tools/Makefile b/sysutils/xen-tools/Makefile
index 3eb7d0717826..84805221d7c9 100644
--- a/sysutils/xen-tools/Makefile
+++ b/sysutils/xen-tools/Makefile
@@ -3,7 +3,7 @@
PORTNAME= xen
PKGNAMESUFFIX= -tools
PORTVERSION= 4.11.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= sysutils emulators
MASTER_SITES= http://downloads.xenproject.org/release/xen/${PORTVERSION}/
diff --git a/sysutils/xen-tools/files/0001-xen-mapcache-use-MAP_FIXED-flag-so-the-mmap-address-qemuu.patch b/sysutils/xen-tools/files/0001-xen-mapcache-use-MAP_FIXED-flag-so-the-mmap-address-qemuu.patch
new file mode 100644
index 000000000000..e73814ead8f7
--- /dev/null
+++ b/sysutils/xen-tools/files/0001-xen-mapcache-use-MAP_FIXED-flag-so-the-mmap-address-qemuu.patch
@@ -0,0 +1,56 @@
+From f3069a581c0f96b62c59b06a43b57561f7418813 Mon Sep 17 00:00:00 2001
+From: Roger Pau Monne <roger.pau@citrix.com>
+Date: Fri, 15 Mar 2019 09:27:19 +0100
+Subject: [PATCH] xen-mapcache: use MAP_FIXED flag so the mmap address hint is
+ always honored
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Or if it's not possible to honor the hinted address an error is returned
+instead. This makes it easier to spot the actual failure, instead of
+failing later on when the caller of xen_remap_bucket realizes the
+mapping has not been created at the requested address.
+
+Also note that at least on FreeBSD using MAP_FIXED will cause mmap to
+try harder to honor the passed address.
+
+Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
+---
+Cc: Stefano Stabellini <sstabellini@kernel.org>
+Cc: Anthony Perard <anthony.perard@citrix.com>
+Cc: Paul Durrant <paul.durrant@citrix.com>
+Cc: Igor Druzhinin <igor.druzhinin@citrix.com>
+Cc: Paolo Bonzini <pbonzini@redhat.com>
+Cc: Richard Henderson <rth@twiddle.net>
+Cc: Eduardo Habkost <ehabkost@redhat.com>
+Cc: "Michael S. Tsirkin" <mst@redhat.com>
+Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
+Cc: xen-devel@lists.xenproject.org
+---
+ hw/i386/xen/xen-mapcache.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c
+index 349f72d00c..0e2870b320 100644
+--- a/hw/i386/xen/xen-mapcache.c
++++ b/hw/i386/xen/xen-mapcache.c
+@@ -185,8 +185,14 @@ static void xen_remap_bucket(MapCacheEntry *entry,
+ }
+
+ if (!dummy) {
++ /*
++ * If the caller has requested the mapping at a specific address use
++ * MAP_FIXED to make sure it's honored. Note that with MAP_FIXED at
++ * least FreeBSD will try harder to honor the passed address.
++ */
+ vaddr_base = xenforeignmemory_map2(xen_fmem, xen_domid, vaddr,
+- PROT_READ | PROT_WRITE, 0,
++ PROT_READ | PROT_WRITE,
++ vaddr ? MAP_FIXED : 0,
+ nb_pfn, pfns, err);
+ if (vaddr_base == NULL) {
+ perror("xenforeignmemory_map2");
+--
+2.17.2 (Apple Git-113)
+