From dcc07572fde318e470952fa2a984fcee301c09bf Mon Sep 17 00:00:00 2001 From: Sona Sarmadi Date: Wed, 10 May 2017 14:17:36 +0200 Subject: qemu: Upgrade to 2.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added patches: - target-ppc-fix-user-mode.patch - qemu-2.5.0-cflags.patch Rebased patches: - exclude-some-arm-EABI-obsolete-syscalls.patc Removed patches: - Qemu-Arm-versatilepb-Add-memory-size-checking.patch Changelog: http://wiki.qemu.org/ChangeLog/2.8 This patch is backported from: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=pyro&id=8bf3f386f989ec9323c8399d1899d8b834e5ca94 Signed-off-by: Aníbal Limón Signed-off-by: Ross Burton Signed-off-by: Richard Purdie Signed-off-by: Sona Sarmadi Signed-off-by: Adrian Dudau --- ...-Arm-versatilepb-Add-memory-size-checking.patch | 46 --------------------- .../exclude-some-arm-EABI-obsolete-syscalls.patch | 22 ++++------ .../qemu/qemu/qemu-2.5.0-cflags.patch | 13 ++++++ .../qemu/qemu/target-ppc-fix-user-mode.patch | 48 ++++++++++++++++++++++ meta/recipes-devtools/qemu/qemu_2.7.1.bb | 22 ---------- meta/recipes-devtools/qemu/qemu_2.8.0.bb | 25 +++++++++++ 6 files changed, 94 insertions(+), 82 deletions(-) delete mode 100644 meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch create mode 100644 meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch create mode 100644 meta/recipes-devtools/qemu/qemu/target-ppc-fix-user-mode.patch delete mode 100644 meta/recipes-devtools/qemu/qemu_2.7.1.bb create mode 100644 meta/recipes-devtools/qemu/qemu_2.8.0.bb diff --git a/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch b/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch deleted file mode 100644 index 1a6cf5119b..0000000000 --- a/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 896fa02c24347e6e9259812cfda187b1d6ca6199 Mon Sep 17 00:00:00 2001 -From: Jiang Lu -Date: Wed, 13 Nov 2013 10:38:08 +0800 -Subject: [PATCH] Qemu:Arm:versatilepb: Add memory size checking - -The machine can not work with memory over 256M, so add a checking -at startup. If the memory size exceed 256M, just stop emulation then -throw out warning about memory limitation. - -Upstream-Status: Pending - -Signed-off-by: Jiang Lu - -Updated it on 2014-01-15 for rebasing - -Signed-off-by: Robert Yang - -Update it when upgrade qemu to 2.2.0 - -Signed-off-by: Kai Kang -Signed-off-by: Cristian Iorga ---- - hw/arm/versatilepb.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c -index 6c69f4e..9278d90 100644 ---- a/hw/arm/versatilepb.c -+++ b/hw/arm/versatilepb.c -@@ -204,6 +204,13 @@ static void versatile_init(MachineState *machine, int board_id) - exit(1); - } - -+ if (machine->ram_size > (256 << 20)) { -+ fprintf(stderr, -+ "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n", -+ ((unsigned int)ram_size / (1 << 20))); -+ exit(1); -+ } -+ - cpuobj = object_new(object_class_get_name(cpu_oc)); - - /* By default ARM1176 CPUs have EL3 enabled. This board does not --- -2.1.0 - diff --git a/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch b/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch index 171bda7e95..f593cf9ae0 100644 --- a/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch +++ b/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch @@ -27,14 +27,14 @@ or kernel header: Signed-off-by: Roy.Li --- - qemu-seccomp.c | 14 ++++++++------ - 1 file changed, 8 insertions(+), 6 deletions(-) + qemu-seccomp.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/qemu-seccomp.c b/qemu-seccomp.c -index caa926e..5a78502 100644 +index df75d9c..0e577f8 100644 --- a/qemu-seccomp.c +++ b/qemu-seccomp.c -@@ -25,15 +25,21 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { +@@ -35,15 +35,21 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { { SCMP_SYS(timer_settime), 255 }, { SCMP_SYS(timer_gettime), 254 }, { SCMP_SYS(futex), 253 }, @@ -58,7 +58,7 @@ index caa926e..5a78502 100644 { SCMP_SYS(mprotect), 246 }, { SCMP_SYS(execve), 245 }, { SCMP_SYS(open), 245 }, -@@ -48,13 +54,11 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { +@@ -58,7 +64,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { { SCMP_SYS(bind), 245 }, { SCMP_SYS(listen), 245 }, { SCMP_SYS(semget), 245 }, @@ -66,13 +66,7 @@ index caa926e..5a78502 100644 { SCMP_SYS(gettimeofday), 245 }, { SCMP_SYS(readlink), 245 }, { SCMP_SYS(access), 245 }, - { SCMP_SYS(prctl), 245 }, - { SCMP_SYS(signalfd), 245 }, -- { SCMP_SYS(getrlimit), 245 }, - { SCMP_SYS(set_tid_address), 245 }, - { SCMP_SYS(statfs), 245 }, - { SCMP_SYS(unlink), 245 }, -@@ -93,7 +97,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { +@@ -104,7 +109,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { { SCMP_SYS(times), 245 }, { SCMP_SYS(exit), 245 }, { SCMP_SYS(clock_gettime), 245 }, @@ -80,7 +74,7 @@ index caa926e..5a78502 100644 { SCMP_SYS(restart_syscall), 245 }, { SCMP_SYS(pwrite64), 245 }, { SCMP_SYS(nanosleep), 245 }, -@@ -182,7 +185,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { +@@ -194,7 +198,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { { SCMP_SYS(lstat64), 241 }, { SCMP_SYS(sendfile64), 241 }, { SCMP_SYS(ugetrlimit), 241 }, @@ -89,5 +83,5 @@ index caa926e..5a78502 100644 { SCMP_SYS(rt_sigqueueinfo), 241 }, { SCMP_SYS(rt_tgsigqueueinfo), 241 }, -- -1.9.1 +2.1.4 diff --git a/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch new file mode 100644 index 0000000000..173394fd02 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch @@ -0,0 +1,13 @@ +--- a/configure ++++ b/configure +@@ -4468,10 +4468,6 @@ fi + if test "$gcov" = "yes" ; then + CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS" + LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS" +-elif test "$fortify_source" = "yes" ; then +- CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" +-elif test "$debug" = "no"; then +- CFLAGS="-O2 $CFLAGS" + fi + + ########################################## diff --git a/meta/recipes-devtools/qemu/qemu/target-ppc-fix-user-mode.patch b/meta/recipes-devtools/qemu/qemu/target-ppc-fix-user-mode.patch new file mode 100644 index 0000000000..ba21e71b0f --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/target-ppc-fix-user-mode.patch @@ -0,0 +1,48 @@ +[Qemu-ppc] [PATCH 1/1] target-ppc, tcg: fix usermode segfault with pthread + +From: Sam Bobroff +Subject: [Qemu-ppc] [PATCH 1/1] target-ppc, tcg: fix usermode segfault with pthread_create() +Date: Mon, 30 Jan 2017 16:08:07 +1100 +Programs run under qemu-ppc64 on an x86_64 host currently segfault +if they use pthread_create() due to the adjustment made to the NIP in +commit bd6fefe71cec5a0c7d2be4ac96307f25db56abf9. + +This patch changes cpu_loop() to set the NIP back to the +pre-incremented value before calling do_syscall(), which causes the +correct address to be used for the new thread and corrects the fault. + +Signed-off-by: Sam Bobroff + +Upstream-Status: Backport + +--- + +linux-user/main.c | 4 +++- +1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/linux-user/main.c b/linux-user/main.c +index 30049581ef..b5dee01541 100644 +--- a/linux-user/main.c ++++ b/linux-user/main.c +@@ -1712,18 +1712,20 @@ void cpu_loop(CPUPPCState *env) + * in syscalls. + */ + env->crf[0] &= ~0x1; ++ env->nip += 4; + ret = do_syscall(env, env->gpr[0], env->gpr[3], env->gpr[4], + env->gpr[5], env->gpr[6], env->gpr[7], + env->gpr[8], 0, 0); + if (ret == -TARGET_ERESTARTSYS) { ++ env->nip -= 4; + break; + } + if (ret == (target_ulong)(-TARGET_QEMU_ESIGRETURN)) { ++ env->nip -= 4; + /* Returning from a successful sigreturn syscall. + Avoid corrupting register state. */ + break; + } +- env->nip += 4; + if (ret > (target_ulong)(-515)) { + env->crf[0] |= 0x1; + ret = -ret; diff --git a/meta/recipes-devtools/qemu/qemu_2.7.1.bb b/meta/recipes-devtools/qemu/qemu_2.7.1.bb deleted file mode 100644 index 118a49a942..0000000000 --- a/meta/recipes-devtools/qemu/qemu_2.7.1.bb +++ /dev/null @@ -1,22 +0,0 @@ -require qemu.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ - file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913" - -SRC_URI += "file://configure-fix-Darwin-target-detection.patch \ - file://qemu-enlarge-env-entry-size.patch \ - file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \ - file://no-valgrind.patch \ - file://pathlimit.patch \ - " -SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2" - -SRC_URI[md5sum] = "a315bc51ed443a08d2cf1416d76b9ab4" -SRC_URI[sha256sum] = "68636788eb69bcb0b44ba220b32b50495d6bd5712a934c282217831c4822958f" - -COMPATIBLE_HOST_class-target_mips64 = "null" - -do_install_append() { - # Prevent QA warnings about installed ${localstatedir}/run - if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi -} diff --git a/meta/recipes-devtools/qemu/qemu_2.8.0.bb b/meta/recipes-devtools/qemu/qemu_2.8.0.bb new file mode 100644 index 0000000000..e0527a8fd9 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu_2.8.0.bb @@ -0,0 +1,25 @@ +require qemu.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ + file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913" + +SRC_URI += "file://configure-fix-Darwin-target-detection.patch \ + file://qemu-enlarge-env-entry-size.patch \ + file://no-valgrind.patch \ + file://pathlimit.patch \ + file://qemu-2.5.0-cflags.patch \ + file://target-ppc-fix-user-mode.patch \ +" + +SRC_URI =+ "http://wiki.qemu-project.org/download/${BP}.tar.bz2" + +SRC_URI[md5sum] = "17940dce063b6ce450a12e719a6c9c43" +SRC_URI[sha256sum] = "dafd5d7f649907b6b617b822692f4c82e60cf29bc0fc58bc2036219b591e5e62" + +COMPATIBLE_HOST_mipsarchn32 = "null" +COMPATIBLE_HOST_mipsarchn64 = "null" + +do_install_append() { + # Prevent QA warnings about installed ${localstatedir}/run + if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi +} -- cgit v1.2.3-54-g00ecf