diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2018-12-14 11:24:26 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-12-14 11:24:26 +0000 |
commit | 05aabd99257ae84e15323bef14149cd7d1d6bfbc (patch) | |
tree | bfdc9d8de1293cd7750802062f0fb1232790cd4b | |
parent | c0f3aaa805d38021afa9458325bee5249e265f2f (diff) | |
download | aports-05aabd99257ae84e15323bef14149cd7d1d6bfbc.tar.bz2 aports-05aabd99257ae84e15323bef14149cd7d1d6bfbc.tar.xz |
main/xen: upgrade to 4.11.1 and fix build with gcc8
-rw-r--r-- | main/xen/APKBUILD | 16 | ||||
-rw-r--r-- | main/xen/fuzz-test-x86_emulator_disable_sse_before_including_always_inline.patch | 131 | ||||
-rw-r--r-- | main/xen/mini-os-__divmoddi4.patch | 19 | ||||
-rw-r--r-- | main/xen/tools-update-ipxe-changeset.patch | 27 |
4 files changed, 188 insertions, 5 deletions
diff --git a/main/xen/APKBUILD b/main/xen/APKBUILD index 55028c4bfe..3d42c54a8d 100644 --- a/main/xen/APKBUILD +++ b/main/xen/APKBUILD @@ -2,8 +2,8 @@ # Contributor: Roger Pau Monne <roger.pau@entel.upc.edu> # Maintainer: William Pitcock <nenolod@dereferenced.org> pkgname=xen -pkgver=4.11.0 -pkgrel=1 +pkgver=4.11.1 +pkgrel=0 pkgdesc="Xen hypervisor" url="https://www.xenproject.org/" arch="x86_64 armhf aarch64" # enable armv7 when builds with gcc8 @@ -159,7 +159,7 @@ _POLARSSL_VERSION="1.1.4" _TPMEMU_VERSION="0.7.4" # grep ^IPXE_GIT_TAG tools/firmware/etherboot/Makefile -_IPXE_GIT_TAG=356f6c1b64d7a97746d1816cef8ca22bdd8d0b5d +_IPXE_GIT_TAG=d2063b7693e0e35db97b2264aa987eb6341ae779 source="https://downloads.xenproject.org/release/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz https://xenbits.xen.org/xen-extfiles/gmp-$_GMP_VERSION.tar.bz2 @@ -172,6 +172,9 @@ source="https://downloads.xenproject.org/release/$pkgname/$pkgver/$pkgname-$pkgv https://xenbits.xen.org/xen-extfiles/zlib-$_ZLIB_VERSION.tar.gz https://xenbits.xen.org/xen-extfiles/ipxe-git-$_IPXE_GIT_TAG.tar.gz + fuzz-test-x86_emulator_disable_sse_before_including_always_inline.patch + tools-update-ipxe-changeset.patch + mini-os-__divmoddi4.patch qemu-xen_paths.patch hotplug-vif-vtrill.patch @@ -422,7 +425,7 @@ EOF } -sha512sums="33d431c194f10d5ee767558404a1f80a66b3df019012b0bbd587fcbc9524e1bba7ea04269020ce891fe9d211d2f81c63bf78abedcdbe1595aee26251c803a50a xen-4.11.0.tar.gz +sha512sums="c1655c5decdaed95a2b9a99652318cfc72f6cfdae957cfe60d635f7787e8850f33e8fafc4c4b8d61fb579c9b9d93028a6382903e71808a0418b931e76d72a649 xen-4.11.1.tar.gz 2e0b0fd23e6f10742a5517981e5171c6e88b0a93c83da701b296f5c0861d72c19782daab589a7eac3f9032152a0fc7eff7f5362db8fccc4859564a9aa82329cf gmp-4.3.2.tar.bz2 c2bc9ffc8583aeae71cee9ddcc4418969768d4e3764d47307da54f93981c0109fb07d84b061b3a3628bd00ba4d14a54742bc04848110eb3ae8ca25dbfbaabadb grub-0.97.tar.gz 1465b58279af1647f909450e394fe002ca165f0ff4a0254bfa9fe0e64316f50facdde2729d79a4e632565b4500cf4d6c74192ac0dd3bc9fe09129bbd67ba089d lwip-1.3.0.tar.gz @@ -431,7 +434,10 @@ c2bc9ffc8583aeae71cee9ddcc4418969768d4e3764d47307da54f93981c0109fb07d84b061b3a36 88da614e4d3f4409c4fd3bb3e44c7587ba051e3fed4e33d526069a67e8180212e1ea22da984656f50e290049f60ddca65383e5983c0f8884f648d71f698303ad polarssl-1.1.4-gpl.tgz 4928b5b82f57645be9408362706ff2c4d9baa635b21b0d41b1c82930e8c60a759b1ea4fa74d7e6c7cae1b7692d006aa5cb72df0c3b88bf049779aa2b566f9d35 tpm_emulator-0.7.4.tar.gz 021b958fcd0d346c4ba761bcf0cc40f3522de6186cf5a0a6ea34a70504ce9622b1c2626fce40675bc8282cf5f5ade18473656abc38050f72f5d6480507a2106e zlib-1.2.3.tar.gz -bbcce5e55040e7e29adebd4a5253a046016a6e2e7ff34cf801a42d147e1ec1af57e0297318249bfa9c5bbeac969fe4b37c18cbf845a80b2136d65387a4fc31da ipxe-git-356f6c1b64d7a97746d1816cef8ca22bdd8d0b5d.tar.gz +2b4ae8e65cd678dbb376f24001294eb54aead8d66456e06fc270dec178d90b282c1eb19731234d8b458054e49c5b8b8c4a89345c63ed0a4dafaf205e642b00b7 ipxe-git-d2063b7693e0e35db97b2264aa987eb6341ae779.tar.gz +2d5a2fa1eec7f666db1b1748570076c252bf03023f354b46c12d9acfc796778f0bdb6ee2fe57ffd4b617283ae53005372c65d2762b759dd3749567dc6a0621dd fuzz-test-x86_emulator_disable_sse_before_including_always_inline.patch +df51f4d90b9ff0bf52506270ca9acfb51320de45a64714d03adf8f370ab070a5d9e458f21c93cac563d3d046afddd732c33252a6a1c7423093ec29843cf50255 tools-update-ipxe-changeset.patch +b9c754220187955d01ffbb6e030dace9d9aaae755db1765d07e407858c71a2cb0de04e0ab2099cd121d9e1bc1978af06c7dbd2fd805e06eca12ac5d527f15a52 mini-os-__divmoddi4.patch 1936ab39a1867957fa640eb81c4070214ca4856a2743ba7e49c0cd017917071a9680d015f002c57fa7b9600dbadd29dcea5887f50e6c133305df2669a7a933f3 qemu-xen_paths.patch f095ea373f36381491ad36f0662fb4f53665031973721256b23166e596318581da7cbb0146d0beb2446729adfdb321e01468e377793f6563a67d68b8b0f7ffe3 hotplug-vif-vtrill.patch 77b08e9655e091b0352e4630d520b54c6ca6d659d1d38fbb4b3bfc9ff3e66db433a2e194ead32bb10ff962c382d800a670e82b7a62835b238e294b22808290ea musl-hvmloader-fix-stdint.patch diff --git a/main/xen/fuzz-test-x86_emulator_disable_sse_before_including_always_inline.patch b/main/xen/fuzz-test-x86_emulator_disable_sse_before_including_always_inline.patch new file mode 100644 index 0000000000..95dfbe80f8 --- /dev/null +++ b/main/xen/fuzz-test-x86_emulator_disable_sse_before_including_always_inline.patch @@ -0,0 +1,131 @@ +From e8dfbc2962365ffa3d7ddcacaa5baaf4ed24b2af Mon Sep 17 00:00:00 2001 +From: Christopher Clark <christopher.clark6@baesystems.com> +Date: Tue, 25 Sep 2018 16:30:32 +0200 +Subject: [PATCH] fuzz, test x86_emulator: disable sse before including + always_inline fns + +Workaround for compiler rejection of SSE-using always_inlines defined before +SSE is disabled. + +Compiling with _FORTIFY_SOURCE or higher levels of optimization enabled +will always_inline several library fns (memset, memcpy, ...) +(with gcc 8.2.0 and glibc 2.28). + +In fuzz and x86_emulator test, the compiler is instructed not +to generate SSE instructions via: #pragma GCC target("no-sse") +because those registers are needed for use by the workload. + +The combination above causes compilation failure as the inline functions +use those instructions. This is resolved by reordering the inclusion of +<stdio.h> and <string.h> to after the pragma disabling SSE generation. + +It would be preferable to locate the no-sse pragma within x86-emulate.h at the +top of the file, prior to including any other headers; unfortunately doing so +before <stdlib.h> causes compilation failure due to declaration of 'atof' with: + "SSE register return with SSE disabled". +Fortunately there is no (known) current dependency on any always_inline +SSE-inclined function declared in <stdlib.h> or any of its dependencies, so the +pragma is therefore issued immediately after inclusion of <stdlib.h> with a +comment introduced to explain its location there. + +Add compile-time checks for unwanted prior inclusion of <string.h> and +<stdio.h>, which are the two headers that provide the library functions that +are handled with wrappers and listed within "x86-emulate.h" as ones "we think +might access any of the FPU state". +* Use standard-defined "EOF" macro to detect prior <stdio.h> inclusion. +* Use "_STRING_H" (non-standardized guard macro) as best-effort + for detection of prior <string.h> inclusion. This is non-universally + viable but will provide error output on common GLIBC systems, so + provides some defensive coverage. + +Adds conditional #include <stdio.h> to x86-emulate.h because fwrite, printf, +etc. are referenced when WRAP has been defined. + +Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com> +Reviewed-by: Jan Beulich <jbeulich@suse.com> +--- + .../fuzz/x86_instruction_emulator/fuzz-emul.c | 10 +++++-- + tools/tests/x86_emulator/wrappers.c | 1 - + tools/tests/x86_emulator/x86-emulate.h | 28 +++++++++++++++++-- + 3 files changed, 34 insertions(+), 5 deletions(-) + +diff --git a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c +index 03a2473cdb3..0ffd0fbfe1c 100644 +--- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c ++++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c +@@ -6,9 +6,7 @@ + #include <stdbool.h> + #include <stddef.h> + #include <stdint.h> +-#include <stdio.h> + #include <stdlib.h> +-#include <string.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/mman.h> +@@ -16,6 +14,14 @@ + #include <xen/xen.h> + + #include "x86-emulate.h" ++/* ++ * include "x86-emulate.h" prior to <stdio.h> and <string.h>: ++ * x86-emulate.h disables use of SSE registers, while <stdio.h> and <string.h> ++ * declare functions that may be always_inline and use those registers ++ * unless they have been disabled earlier, which can fail to compile. ++ */ ++#include <stdio.h> ++#include <string.h> + #include "fuzz-emul.h" + + #define MSR_INDEX_MAX 16 +diff --git a/tools/tests/x86_emulator/wrappers.c b/tools/tests/x86_emulator/wrappers.c +index d02013c4b1d..eba7cc93c51 100644 +--- a/tools/tests/x86_emulator/wrappers.c ++++ b/tools/tests/x86_emulator/wrappers.c +@@ -1,5 +1,4 @@ + #include <stdarg.h> +-#include <stdio.h> + + #define WRAP(x) typeof(x) emul_##x + #include "x86-emulate.h" +diff --git a/tools/tests/x86_emulator/x86-emulate.h b/tools/tests/x86_emulator/x86-emulate.h +index b249e4673c3..08dead32fd7 100644 +--- a/tools/tests/x86_emulator/x86-emulate.h ++++ b/tools/tests/x86_emulator/x86-emulate.h +@@ -3,10 +3,34 @@ + #include <stddef.h> + #include <stdint.h> + #include <stdlib.h> ++/* ++ * Use of sse registers must be disabled prior to the definition of ++ * always_inline functions that would use them (memcpy, memset, etc), ++ * so do this as early as possible, aiming to be before any always_inline ++ * functions that are used are declared. ++ * Unfortunately, this cannot be done prior to inclusion of <stdlib.h> ++ * due to functions such as 'atof' that have SSE register return declared, ++ * so do so here, immediately after that. ++ */ ++#if __GNUC__ >= 6 ++# pragma GCC target("no-sse") ++#endif ++ /* ++ * Attempt detection of unwanted prior inclusion of some headers known to use ++ * always_inline with SSE registers in some library / compiler / optimization ++ * combinations. ++ */ ++#ifdef _STRING_H ++# error "Must not include <string.h> before x86-emulate.h" ++#endif + #include <string.h> + +-#if __GNUC__ >= 6 +-#pragma GCC target("no-sse") ++/* EOF is a standard macro defined in <stdio.h> so use it for detection */ ++#ifdef EOF ++# error "Must not include <stdio.h> before x86-emulate.h" ++#endif ++#ifdef WRAP ++# include <stdio.h> + #endif + + #include <xen/xen.h> diff --git a/main/xen/mini-os-__divmoddi4.patch b/main/xen/mini-os-__divmoddi4.patch new file mode 100644 index 0000000000..d12c61d56b --- /dev/null +++ b/main/xen/mini-os-__divmoddi4.patch @@ -0,0 +1,19 @@ +diff --git a/extras/mini-os/lib/math.c b/extras/mini-os/lib/math.c +index b98cc1d..1b63a83 100644 +--- a/extras/mini-os/lib/math.c ++++ b/extras/mini-os/lib/math.c +@@ -366,6 +366,14 @@ __divdi3(quad_t a, quad_t b) + return (neg ? -uq : uq); + } + ++quad_t ++__divmoddi4(quad_t a, quad_t b, quad_t *r) ++{ ++ quad_t d = __divdi3(a, b); ++ *r = a - (d * b); ++ return d; ++} ++ + /* + * From + * udivdi3.c diff --git a/main/xen/tools-update-ipxe-changeset.patch b/main/xen/tools-update-ipxe-changeset.patch new file mode 100644 index 0000000000..4941ca0865 --- /dev/null +++ b/main/xen/tools-update-ipxe-changeset.patch @@ -0,0 +1,27 @@ +From 9bf0dc74377bb2813a794e8080acf869ed9e0dc1 Mon Sep 17 00:00:00 2001 +From: Wei Liu <wei.liu2@citrix.com> +Date: Thu, 26 Jul 2018 15:58:53 +0100 +Subject: [PATCH] tools: update ipxe changeset + +This placates gcc 8.1. The commit comes from ipxe master branch as of +July 25, 2018. + +Signed-off-by: Wei Liu <wei.liu2@citrix.com> +Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> +--- + tools/firmware/etherboot/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/firmware/etherboot/Makefile b/tools/firmware/etherboot/Makefile +index 4de6d24a13e..3868f876ea3 100644 +--- a/tools/firmware/etherboot/Makefile ++++ b/tools/firmware/etherboot/Makefile +@@ -10,7 +10,7 @@ else + IPXE_GIT_URL ?= git://git.ipxe.org/ipxe.git + endif + +-IPXE_GIT_TAG := 356f6c1b64d7a97746d1816cef8ca22bdd8d0b5d ++IPXE_GIT_TAG := d2063b7693e0e35db97b2264aa987eb6341ae779 + + IPXE_TARBALL_URL ?= $(XEN_EXTFILES_URL)/ipxe-git-$(IPXE_GIT_TAG).tar.gz + |