summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/target-ppc-fix-user-mode.patch
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2017-01-31 16:10:24 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-05 09:22:16 +0000
commit8bf3f386f989ec9323c8399d1899d8b834e5ca94 (patch)
tree5d2f8e44a11e901e1173e36c6debcc1953d4507a /meta/recipes-devtools/qemu/qemu/target-ppc-fix-user-mode.patch
parentf27ce57b99c5b12df8aca065769d114cf060c044 (diff)
downloadpoky-8bf3f386f989ec9323c8399d1899d8b834e5ca94.tar.gz
qemu: Upgrade to 2.8.0
Added patches: - target-ppc-fix-user-mode.patch Rebased patches: - exclude-some-arm-EABI-obsolete-syscalls.patc Removed patches (already in upstream): - 0003-fix-CVE-2016-7908.patch - 0004-fix-CVE-2016-7909.patch - 0001-target-mips-add-24KEc-CPU-definition.patch Changelog, http://wiki.qemu.org/ChangeLog/2.8 (From OE-Core rev: ab7eb1c896e4ba38b6c16acae3d25534296f62b8) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/target-ppc-fix-user-mode.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/target-ppc-fix-user-mode.patch48
1 files changed, 48 insertions, 0 deletions
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 @@
1[Qemu-ppc] [PATCH 1/1] target-ppc, tcg: fix usermode segfault with pthread
2
3From: Sam Bobroff
4Subject: [Qemu-ppc] [PATCH 1/1] target-ppc, tcg: fix usermode segfault with pthread_create()
5Date: Mon, 30 Jan 2017 16:08:07 +1100
6Programs run under qemu-ppc64 on an x86_64 host currently segfault
7if they use pthread_create() due to the adjustment made to the NIP in
8commit bd6fefe71cec5a0c7d2be4ac96307f25db56abf9.
9
10This patch changes cpu_loop() to set the NIP back to the
11pre-incremented value before calling do_syscall(), which causes the
12correct address to be used for the new thread and corrects the fault.
13
14Signed-off-by: Sam Bobroff <address@hidden>
15
16Upstream-Status: Backport
17
18---
19
20linux-user/main.c | 4 +++-
211 file changed, 3 insertions(+), 1 deletion(-)
22
23diff --git a/linux-user/main.c b/linux-user/main.c
24index 30049581ef..b5dee01541 100644
25--- a/linux-user/main.c
26+++ b/linux-user/main.c
27@@ -1712,18 +1712,20 @@ void cpu_loop(CPUPPCState *env)
28 * in syscalls.
29 */
30 env->crf[0] &= ~0x1;
31+ env->nip += 4;
32 ret = do_syscall(env, env->gpr[0], env->gpr[3], env->gpr[4],
33 env->gpr[5], env->gpr[6], env->gpr[7],
34 env->gpr[8], 0, 0);
35 if (ret == -TARGET_ERESTARTSYS) {
36+ env->nip -= 4;
37 break;
38 }
39 if (ret == (target_ulong)(-TARGET_QEMU_ESIGRETURN)) {
40+ env->nip -= 4;
41 /* Returning from a successful sigreturn syscall.
42 Avoid corrupting register state. */
43 break;
44 }
45- env->nip += 4;
46 if (ret > (target_ulong)(-515)) {
47 env->crf[0] |= 0x1;
48 ret = -ret;