75a96ee029
- Remove deprecated patch "work-around-SA_RESTART-race" (boo#982208) - Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.6 * Patches dropped: 0002-XXX-work-around-SA_RESTART-race-wit.patch 0003-qemu-0.9.0.cvs-binfmt.patch 0004-qemu-cvs-alsa_bitfield.patch 0005-qemu-cvs-alsa_ioctl.patch 0006-qemu-cvs-alsa_mmap.patch 0007-qemu-cvs-gettimeofday.patch 0008-qemu-cvs-ioctl_debug.patch 0009-qemu-cvs-ioctl_nodirection.patch 0010-block-vmdk-Support-creation-of-SCSI.patch 0011-linux-user-add-binfmt-wrapper-for-a.patch 0012-PPC-KVM-Disable-mmu-notifier-check.patch 0013-linux-user-fix-segfault-deadlock.patch 0014-linux-user-binfmt-support-host-bina.patch 0015-linux-user-Ignore-broken-loop-ioctl.patch 0016-linux-user-lock-tcg.patch 0017-linux-user-Run-multi-threaded-code-.patch 0018-linux-user-lock-tb-flushing-too.patch 0019-linux-user-Fake-proc-cpuinfo.patch 0020-linux-user-implement-FS_IOC_GETFLAG.patch 0021-linux-user-implement-FS_IOC_SETFLAG.patch 0022-linux-user-XXX-disable-fiemap.patch 0023-slirp-nooutgoing.patch 0024-vnc-password-file-and-incoming-conn.patch 0025-linux-user-add-more-blk-ioctls.patch 0026-linux-user-use-target_ulong.patch 0027-block-Add-support-for-DictZip-enabl.patch 0028-block-Add-tar-container-format.patch OBS-URL: https://build.opensuse.org/request/show/408549 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=305
41 lines
1.5 KiB
Diff
41 lines
1.5 KiB
Diff
From a2f095e01371ff9d00524fb4c0e7d3bd941227da Mon Sep 17 00:00:00 2001
|
|
From: Alexander Graf <agraf@suse.de>
|
|
Date: Tue, 10 Jul 2012 20:40:55 +0200
|
|
Subject: [PATCH] linux-user: Run multi-threaded code on a single core
|
|
|
|
Running multi-threaded code can easily expose some of the fundamental
|
|
breakages in QEMU's design. It's just not a well supported scenario.
|
|
|
|
So if we pin the whole process to a single host CPU, we guarantee that
|
|
we will never have concurrent memory access actually happen. We can still
|
|
get scheduled away at any time, so it's no complete guarantee, but apparently
|
|
it reduces the odds well enough to get my test cases to pass.
|
|
|
|
This gets Java 1.7 working for me again on my test box.
|
|
|
|
Signed-off-by: Alexander Graf <agraf@suse.de>
|
|
---
|
|
linux-user/syscall.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
|
index 758f747..b36273d 100644
|
|
--- a/linux-user/syscall.c
|
|
+++ b/linux-user/syscall.c
|
|
@@ -4704,6 +4704,15 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp,
|
|
if (nptl_flags & CLONE_SETTLS)
|
|
cpu_set_tls (new_env, newtls);
|
|
|
|
+ /* agraf: Pin ourselves to a single CPU when running multi-threaded.
|
|
+ This turned out to improve stability for me. */
|
|
+ {
|
|
+ cpu_set_t mask;
|
|
+ CPU_ZERO(&mask);
|
|
+ CPU_SET(0, &mask);
|
|
+ sched_setaffinity(0, sizeof(mask), &mask);
|
|
+ }
|
|
+
|
|
/* Grab a mutex so that thread setup appears atomic. */
|
|
pthread_mutex_lock(&clone_lock);
|
|
|