Hello community,
here is the log from the commit of package qemu for openSUSE:Factory checked in at 2012-03-17 13:23:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/qemu (Old)
and /work/SRC/openSUSE:Factory/.qemu.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qemu", Maintainer is "BROGERS@suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/qemu/qemu.changes 2012-02-29 14:11:03.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/qemu.changes 2012-03-17 13:23:07.000000000 +0100
@@ -1,0 +2,17 @@
+Wed Mar 7 15:16:16 UTC 2012 - agraf@suse.com
+
+- cut off patch file names after 40 bytes, support older git versions
+ for update_git.sh
+
+-------------------------------------------------------------------
+Mon Mar 5 01:31:42 UTC 2012 - agraf@suse.com
+
+- resolve VMAs downwards, fixes arm git build for real
+
+-------------------------------------------------------------------
+Sat Mar 3 23:27:14 UTC 2012 - agraf@suse.com
+
+- update update_git.sh for 1.0.1
+- add fixes for reserved_va mmap(NULL) case, fixes git build on arm
+
+-------------------------------------------------------------------
Old:
----
0001-Handle-CPU-interrupts-by-inline-checking-of-a-flag.patch
0002-linux-user-fix-QEMU_STRACE-1-segfault.patch
0003-linux-user-save-auxv-length.patch
0004-linux-user-add-open-hijack-infrastructure.patch
0005-linux-user-fake-proc-self-maps.patch
0006-linux-user-fake-proc-self-stat.patch
0007-linux-user-fake-proc-self-auxv.patch
0008-XXX-dont-dump-core-on-sigabort.patch
0009-linux-user-fix-wait-syscall-status-returns.patch
0010-Revert-linux-user-fix-wait-syscall-status-returns.patch
0011-linux-user-fix-wait-syscall-status-returns.patch
0012-XXX-linux-user-fake-proc-self-maps-even-more.patch
0013-XXX-work-around-SA_RESTART-race-with-boehm-gc-ARM-o.patch
0014-XXX-move-qemu-binary-lower-in-address-space-so-we-ha.patch
0015-linux-user-map-lower-in-address-space.patch
0016-XXX-fake-proc-self-maps-also-fclose-real-file.patch
0017-XXX-map-qemu-higher-again-so-we-have-space-for-brk.patch
0018-qemu-0.9.0.cvs-binfmt.patch
0019-qemu-cvs-alsa_bitfield.patch
0020-qemu-cvs-alsa_ioctl.patch
0021-qemu-cvs-alsa_mmap.patch
0022-qemu-cvs-gettimeofday.patch
0023-qemu-cvs-ioctl_debug.patch
0024-qemu-cvs-ioctl_nodirection.patch
0025-qemu-img-vmdk-scsi.patch
0026-qemu-nonvoid_return.patch
0027-fix-mipsn32-linux-user-builds.patch
0028-Integrating-Dynamips-and-GNS3-UDP-tunnels-Patches.patch
0029-linux-user-add-binfmt-wrapper-for-argv-0-handling.patch
0030-linux-user-Ignore-timer_create-syscall.patch
0031-linux-user-be-silent-about-capget-failures.patch
0032-linux-user-reserve-4GB-of-vmem-for-32-on-64.patch
0033-PPC-KVM-Disable-mmu-notifier-check.patch
0034-linux-user-improve-fake-proc-self-stat-making-ps.patch
0035-linux-user-target_argv-is-placed-on-ts-bprm-argv.patch
0036-PPC-KVM-Ignore-SET_ONE_REG-failures.patch
0037-PPC-KVM-Ignore-ENABLE_PAPR-to-support-very-old-HV.patch
0038-linux-user-fix-segfault-deadlock.patch
0039-linux-user-implement-device-mapper-ioctls.patch
0040-linux-user-add-struct-old_dev_t-compat.patch
0041-linux-user-fix-BLK-ioctl-arguments.patch
0042-linux-user-add-BLKSSZGET-ioctl-wrapper.patch
0043-linux-user-Add-ioctl-for-BLKBSZGET.patch
0044-linux-user-take-RESERVED_VA-into-account-for-g2h_va.patch
0045-linux-user-binfmt-support-host-binaries.patch
0046-linux-user-fix-fallocate.patch
New:
----
0001-Handle-CPU-interrupts-by-inline-che.patch
0002-linux-user-fix-QEMU_STRACE-1-segfau.patch
0003-linux-user-save-auxv-length.patch.patch
0004-linux-user-add-open-hijack-infrastr.patch
0005-linux-user-fake-proc-self-maps.patc.patch
0006-linux-user-fake-proc-self-stat.patc.patch
0007-linux-user-fake-proc-self-auxv.patc.patch
0008-XXX-dont-dump-core-on-sigabort.patc.patch
0009-linux-user-fix-wait-syscall-status-.patch
0010-Revert-linux-user-fix-wait-syscall-.patch
0011-linux-user-fix-wait-syscall-status-.patch
0012-XXX-linux-user-fake-proc-self-maps-.patch
0013-XXX-work-around-SA_RESTART-race-wit.patch
0014-XXX-move-qemu-binary-lower-in-addre.patch
0015-linux-user-map-lower-in-address-spa.patch
0016-XXX-fake-proc-self-maps-also-fclose.patch
0017-XXX-map-qemu-higher-again-so-we-hav.patch
0018-qemu-0.9.0.cvs-binfmt.patch.patch
0019-qemu-cvs-alsa_bitfield.patch.patch
0020-qemu-cvs-alsa_ioctl.patch.patch
0021-qemu-cvs-alsa_mmap.patch.patch
0022-qemu-cvs-gettimeofday.patch.patch
0023-qemu-cvs-ioctl_debug.patch.patch
0024-qemu-cvs-ioctl_nodirection.patch.patch
0025-qemu-img-vmdk-scsi.patch.patch
0026-qemu-nonvoid_return.patch.patch
0027-fix-mipsn32-linux-user-builds.patch.patch
0028-Integrating-Dynamips-and-GNS3-UDP-t.patch
0029-linux-user-add-binfmt-wrapper-for-a.patch
0030-linux-user-Ignore-timer_create-sysc.patch
0031-linux-user-be-silent-about-capget-f.patch
0032-linux-user-reserve-4GB-of-vmem-for-.patch
0033-PPC-KVM-Disable-mmu-notifier-check..patch
0034-linux-user-improve-fake-proc-self-s.patch
0035-linux-user-target_argv-is-placed-on.patch
0037-PPC-KVM-Ignore-ENABLE_PAPR-to-suppo.patch
0038-linux-user-fix-segfault-deadlock.pa.patch
0039-linux-user-implement-device-mapper-.patch
0040-linux-user-add-struct-old_dev_t-com.patch
0041-linux-user-fix-BLK-ioctl-arguments..patch
0042-linux-user-add-BLKSSZGET-ioctl-wrap.patch
0043-linux-user-Add-ioctl-for-BLKBSZGET..patch
0044-linux-user-take-RESERVED_VA-into-ac.patch
0045-linux-user-binfmt-support-host-bina.patch
0046-linux-user-fix-fallocate.patch.patch
0047-linux-user-resolve-reserved_va-vma-.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ qemu.spec ++++++
--- /var/tmp/diff_new_pack.37qdAq/_old 2012-03-17 13:23:11.000000000 +0100
+++ /var/tmp/diff_new_pack.37qdAq/_new 2012-03-17 13:23:11.000000000 +0100
@@ -16,6 +16,7 @@
#
+
Name: qemu
Url: http://fabrice.bellard.free.fr/qemu/
Summary: Universal CPU emulator
@@ -24,52 +25,52 @@
Version: 1.0.1
Release: 0
Source: %name-%version.tar.bz2
-Patch0001: 0001-Handle-CPU-interrupts-by-inline-checking-of-a-flag.patch
-Patch0002: 0002-linux-user-fix-QEMU_STRACE-1-segfault.patch
-Patch0003: 0003-linux-user-save-auxv-length.patch
-Patch0004: 0004-linux-user-add-open-hijack-infrastructure.patch
-Patch0005: 0005-linux-user-fake-proc-self-maps.patch
-Patch0006: 0006-linux-user-fake-proc-self-stat.patch
-Patch0007: 0007-linux-user-fake-proc-self-auxv.patch
-Patch0008: 0008-XXX-dont-dump-core-on-sigabort.patch
-Patch0009: 0009-linux-user-fix-wait-syscall-status-returns.patch
-Patch0010: 0010-Revert-linux-user-fix-wait-syscall-status-returns.patch
-Patch0011: 0011-linux-user-fix-wait-syscall-status-returns.patch
-Patch0012: 0012-XXX-linux-user-fake-proc-self-maps-even-more.patch
-Patch0013: 0013-XXX-work-around-SA_RESTART-race-with-boehm-gc-ARM-o.patch
-Patch0014: 0014-XXX-move-qemu-binary-lower-in-address-space-so-we-ha.patch
-Patch0015: 0015-linux-user-map-lower-in-address-space.patch
-Patch0016: 0016-XXX-fake-proc-self-maps-also-fclose-real-file.patch
-Patch0017: 0017-XXX-map-qemu-higher-again-so-we-have-space-for-brk.patch
-Patch0018: 0018-qemu-0.9.0.cvs-binfmt.patch
-Patch0019: 0019-qemu-cvs-alsa_bitfield.patch
-Patch0020: 0020-qemu-cvs-alsa_ioctl.patch
-Patch0021: 0021-qemu-cvs-alsa_mmap.patch
-Patch0022: 0022-qemu-cvs-gettimeofday.patch
-Patch0023: 0023-qemu-cvs-ioctl_debug.patch
-Patch0024: 0024-qemu-cvs-ioctl_nodirection.patch
-Patch0025: 0025-qemu-img-vmdk-scsi.patch
-Patch0026: 0026-qemu-nonvoid_return.patch
-Patch0027: 0027-fix-mipsn32-linux-user-builds.patch
-Patch0028: 0028-Integrating-Dynamips-and-GNS3-UDP-tunnels-Patches.patch
-Patch0029: 0029-linux-user-add-binfmt-wrapper-for-argv-0-handling.patch
-Patch0030: 0030-linux-user-Ignore-timer_create-syscall.patch
-Patch0031: 0031-linux-user-be-silent-about-capget-failures.patch
-Patch0032: 0032-linux-user-reserve-4GB-of-vmem-for-32-on-64.patch
-Patch0033: 0033-PPC-KVM-Disable-mmu-notifier-check.patch
-Patch0034: 0034-linux-user-improve-fake-proc-self-stat-making-ps.patch
-Patch0035: 0035-linux-user-target_argv-is-placed-on-ts-bprm-argv.patch
-Patch0036: 0036-PPC-KVM-Ignore-SET_ONE_REG-failures.patch
-Patch0037: 0037-PPC-KVM-Ignore-ENABLE_PAPR-to-support-very-old-HV.patch
-Patch0038: 0038-linux-user-fix-segfault-deadlock.patch
-Patch0039: 0039-linux-user-implement-device-mapper-ioctls.patch
-Patch0040: 0040-linux-user-add-struct-old_dev_t-compat.patch
-Patch0041: 0041-linux-user-fix-BLK-ioctl-arguments.patch
-Patch0042: 0042-linux-user-add-BLKSSZGET-ioctl-wrapper.patch
-Patch0043: 0043-linux-user-Add-ioctl-for-BLKBSZGET.patch
-Patch0044: 0044-linux-user-take-RESERVED_VA-into-account-for-g2h_va.patch
-Patch0045: 0045-linux-user-binfmt-support-host-binaries.patch
-Patch0046: 0046-linux-user-fix-fallocate.patch
+Patch0001: 0001-Handle-CPU-interrupts-by-inline-che.patch
+Patch0002: 0002-linux-user-fix-QEMU_STRACE-1-segfau.patch
+Patch0003: 0003-linux-user-save-auxv-length.patch.patch
+Patch0004: 0004-linux-user-add-open-hijack-infrastr.patch
+Patch0005: 0005-linux-user-fake-proc-self-maps.patc.patch
+Patch0006: 0006-linux-user-fake-proc-self-stat.patc.patch
+Patch0007: 0007-linux-user-fake-proc-self-auxv.patc.patch
+Patch0008: 0008-XXX-dont-dump-core-on-sigabort.patc.patch
+Patch0009: 0009-linux-user-fix-wait-syscall-status-.patch
+Patch0010: 0010-Revert-linux-user-fix-wait-syscall-.patch
+Patch0011: 0011-linux-user-fix-wait-syscall-status-.patch
+Patch0012: 0012-XXX-linux-user-fake-proc-self-maps-.patch
+Patch0013: 0013-XXX-work-around-SA_RESTART-race-wit.patch
+Patch0014: 0014-XXX-move-qemu-binary-lower-in-addre.patch
+Patch0015: 0015-linux-user-map-lower-in-address-spa.patch
+Patch0016: 0016-XXX-fake-proc-self-maps-also-fclose.patch
+Patch0017: 0017-XXX-map-qemu-higher-again-so-we-hav.patch
+Patch0018: 0018-qemu-0.9.0.cvs-binfmt.patch.patch
+Patch0019: 0019-qemu-cvs-alsa_bitfield.patch.patch
+Patch0020: 0020-qemu-cvs-alsa_ioctl.patch.patch
+Patch0021: 0021-qemu-cvs-alsa_mmap.patch.patch
+Patch0022: 0022-qemu-cvs-gettimeofday.patch.patch
+Patch0023: 0023-qemu-cvs-ioctl_debug.patch.patch
+Patch0024: 0024-qemu-cvs-ioctl_nodirection.patch.patch
+Patch0025: 0025-qemu-img-vmdk-scsi.patch.patch
+Patch0026: 0026-qemu-nonvoid_return.patch.patch
+Patch0027: 0027-fix-mipsn32-linux-user-builds.patch.patch
+Patch0028: 0028-Integrating-Dynamips-and-GNS3-UDP-t.patch
+Patch0029: 0029-linux-user-add-binfmt-wrapper-for-a.patch
+Patch0030: 0030-linux-user-Ignore-timer_create-sysc.patch
+Patch0031: 0031-linux-user-be-silent-about-capget-f.patch
+Patch0032: 0032-linux-user-reserve-4GB-of-vmem-for-.patch
+Patch0033: 0033-PPC-KVM-Disable-mmu-notifier-check..patch
+Patch0034: 0034-linux-user-improve-fake-proc-self-s.patch
+Patch0035: 0035-linux-user-target_argv-is-placed-on.patch
+Patch0037: 0037-PPC-KVM-Ignore-ENABLE_PAPR-to-suppo.patch
+Patch0038: 0038-linux-user-fix-segfault-deadlock.pa.patch
+Patch0039: 0039-linux-user-implement-device-mapper-.patch
+Patch0040: 0040-linux-user-add-struct-old_dev_t-com.patch
+Patch0041: 0041-linux-user-fix-BLK-ioctl-arguments..patch
+Patch0042: 0042-linux-user-add-BLKSSZGET-ioctl-wrap.patch
+Patch0043: 0043-linux-user-Add-ioctl-for-BLKBSZGET..patch
+Patch0044: 0044-linux-user-take-RESERVED_VA-into-ac.patch
+Patch0045: 0045-linux-user-binfmt-support-host-bina.patch
+Patch0046: 0046-linux-user-fix-fallocate.patch.patch
+Patch0047: 0047-linux-user-resolve-reserved_va-vma-.patch
# this is to make lint happy
Source300: rpmlintrc
Source400: update_git.sh
@@ -172,7 +173,6 @@
%patch0033 -p1
%patch0034 -p1
%patch0035 -p1
-%patch0036 -p1
%patch0037 -p1
%patch0038 -p1
%patch0039 -p1
@@ -183,24 +183,25 @@
%patch0044 -p1
%patch0045 -p1
%patch0046 -p1
+%patch0047 -p1
%build
# build QEMU
mkdir -p dynamic
# build qemu-system
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
---interp-prefix=%_datadir/%name/qemu-i386 \
---audio-card-list="ac97 es1370 sb16 cs4231a adlib gus" \
---audio-drv-list="alsa sdl" --enable-mixemu --enable-vde \
---extra-cflags="$QEMU_OPT_FLAGS" --enable-system --disable-linux-user \
+ --interp-prefix=%_datadir/%name/qemu-i386 \
+ --audio-card-list="ac97 es1370 sb16 cs4231a adlib gus" \
+ --audio-drv-list="alsa sdl" --enable-mixemu --enable-vde \
+ --extra-cflags="$QEMU_OPT_FLAGS" --enable-system --disable-linux-user \
%if 0%{?suse_version} >= 1130
%ifarch %ix86 x86_64
---enable-spice
+ --enable-spice
%else
---disable-spice
+ --disable-spice
%endif
%else
---disable-spice
+ --disable-spice
%endif
# curl test fails for no reason in build system
echo "CONFIG_CURL=y" >> config-host.mak
@@ -212,11 +213,11 @@
make clean
# build userland emus
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
---interp-prefix=%_datadir/%name/qemu-i386 \
---enable-linux-user \
---disable-system \
---static --disable-linux-aio \
---extra-cflags="$QEMU_OPT_FLAGS"
+ --interp-prefix=%_datadir/%name/qemu-i386 \
+ --enable-linux-user \
+ --disable-system \
+ --static --disable-linux-aio \
+ --extra-cflags="$QEMU_OPT_FLAGS"
make %{?jobs:-j%jobs} V=1
%install
++++++ 0001-Handle-CPU-interrupts-by-inline-checking-of-a-flag.patch -> 0001-Handle-CPU-interrupts-by-inline-che.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0001-Handle-CPU-interrupts-by-inline-checking-of-a-flag.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0001-Handle-CPU-interrupts-by-inline-che.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,4 +1,4 @@
-From 4cc09e9530fb08123594be6c72dfc381df5dcddc Mon Sep 17 00:00:00 2001
+From 46def18ae5e55d5d5287ff2c4fc3b8aed446f564 Mon Sep 17 00:00:00 2001
From: Peter Maydell
Date: Wed, 5 Oct 2011 10:04:02 +0100
Subject: [PATCH] Handle CPU interrupts by inline checking of a flag
@@ -52,7 +52,7 @@
int insns_left;
tb = (TranslationBlock *)(long)(next_tb & ~3);
diff --git a/exec.c b/exec.c
-index 6b92198..6c923f2 100644
+index 6c206ff..bb221cf 100644
--- a/exec.c
+++ b/exec.c
@@ -125,6 +125,8 @@ DEFINE_TLS(CPUState *,cpu_single_env);
@@ -207,6 +207,3 @@
case QEMU_OPTION_acpitable:
do_acpitable_option(optarg);
break;
---
-1.6.0.2
-
++++++ 0002-linux-user-fix-QEMU_STRACE-1-segfault.patch -> 0002-linux-user-fix-QEMU_STRACE-1-segfau.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0002-linux-user-fix-QEMU_STRACE-1-segfault.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0002-linux-user-fix-QEMU_STRACE-1-segfau.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,4 +1,4 @@
-From 0588bc446fd48bdb1965a6773d008c05a4ba16c1 Mon Sep 17 00:00:00 2001
+From 7c38fac0f55fad6c8506796bbbee3ab036c6350f Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Sun, 20 Nov 2011 13:02:54 +0100
Subject: [PATCH] linux-user: fix QEMU_STRACE=1 segfault
@@ -83,6 +83,3 @@
return strerror(target_to_host_errno(err));
}
---
-1.6.0.2
-
++++++ 0003-linux-user-save-auxv-length.patch.patch ++++++
From e968f21cebfd85c10405e5d4c8cc8f70361590ad Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Wed, 2 Nov 2011 09:23:22 +0000
Subject: [PATCH] linux-user: save auxv length
We create our own AUXV segment on stack and save a pointer to it.
However we don't save the length of it, so any code that wants to
do anything useful with it later on has to walk it again.
Instead, let's remember the length of our AUXV segment. This
simplifies later uses by a lot.
Signed-off-by: Alexander Graf
---
linux-user/elfload.c | 15 ++++-----------
linux-user/qemu.h | 1 +
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 4635bb2..62bb543 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1245,6 +1245,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
struct image_info *interp_info)
{
abi_ulong sp;
+ abi_ulong sp_auxv;
int size;
int i;
abi_ulong u_rand_bytes;
@@ -1316,6 +1317,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
sp -= n; put_user_ual(id, sp); \
} while(0)
+ sp_auxv = sp;
NEW_AUX_ENT (AT_NULL, 0);
/* There must be exactly DLINFO_ITEMS entries here. */
@@ -1346,6 +1348,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
#undef NEW_AUX_ENT
info->saved_auxv = sp;
+ info->auxv_len = sp_auxv - sp;
sp = loader_build_argptr(envc, argc, sp, p, 0);
return sp;
@@ -2329,9 +2332,8 @@ static void fill_auxv_note(struct memelfnote *note, const TaskState *ts)
{
elf_addr_t auxv = (elf_addr_t)ts->info->saved_auxv;
elf_addr_t orig_auxv = auxv;
- abi_ulong val;
void *ptr;
- int i, len;
+ int len = ts->info->auxv_len;
/*
* Auxiliary vector is stored in target process stack. It contains
@@ -2339,15 +2341,6 @@ static void fill_auxv_note(struct memelfnote *note, const TaskState *ts)
* strictly necessary but we do it here for sake of completeness.
*/
- /* find out lenght of the vector, AT_NULL is terminator */
- i = len = 0;
- do {
- get_user_ual(val, auxv);
- i += 2;
- auxv += 2 * sizeof (elf_addr_t);
- } while (val != AT_NULL);
- len = i * sizeof (elf_addr_t);
-
/* read in whole auxv vector and copy it to memelfnote */
ptr = lock_user(VERIFY_READ, orig_auxv, len, 0);
if (ptr != NULL) {
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 55ad9d8..ef08d39 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -48,6 +48,7 @@ struct image_info {
abi_ulong code_offset;
abi_ulong data_offset;
abi_ulong saved_auxv;
+ abi_ulong auxv_len;
abi_ulong arg_start;
abi_ulong arg_end;
int personality;
++++++ 0004-linux-user-add-open-hijack-infrastructure.patch -> 0004-linux-user-add-open-hijack-infrastr.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0004-linux-user-add-open-hijack-infrastructure.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0004-linux-user-add-open-hijack-infrastr.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,4 +1,4 @@
-From 99590488e94b6b7f10ecf9a99398fd24a69a7039 Mon Sep 17 00:00:00 2001
+From a1508f441692e958ee11ac10648ed7941c242be8 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Wed, 2 Nov 2011 09:23:23 +0000
Subject: [PATCH] linux-user: add open() hijack infrastructure
@@ -83,6 +83,3 @@
unlock_user(p, arg1, 0);
break;
#if defined(TARGET_NR_openat) && defined(__NR_openat)
---
-1.6.0.2
-
++++++ 0005-linux-user-fake-proc-self-maps.patc.patch ++++++
From a28f243a16b5e2e13645fba6d26c8ce26e9b399b Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Wed, 2 Nov 2011 09:23:24 +0000
Subject: [PATCH] linux-user: fake /proc/self/maps
glibc's pthread_attr_getstack tries to find the stack range from
/proc/self/maps. Unfortunately, /proc is usually the host's /proc
which means linux-user guests see qemu's stack there.
Fake the file with a constructed maps entry that exposes the guest's
stack range.
Signed-off-by: Alexander Graf
---
linux-user/syscall.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1ecc0e1..8727249 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4603,6 +4603,20 @@ int get_osversion(void)
return osversion;
}
+
+static int open_self_maps(void *cpu_env, int fd)
+{
+ TaskState *ts = ((CPUState *)cpu_env)->opaque;
+
+ dprintf(fd, "%08llx-%08llx rw-p %08llx 00:00 0 [stack]\n",
+ (unsigned long long)ts->info->stack_limit,
+ (unsigned long long)(ts->stack_base + (TARGET_PAGE_SIZE - 1))
+ & TARGET_PAGE_MASK,
+ (unsigned long long)ts->stack_base);
+
+ return 0;
+}
+
static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode)
{
struct fake_open {
@@ -4611,6 +4625,7 @@ static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode)
};
const struct fake_open *fake_open;
static const struct fake_open fakes[] = {
+ { "/proc/self/maps", open_self_maps },
{ NULL, NULL }
};
++++++ 0006-linux-user-fake-proc-self-stat.patc.patch ++++++
From ddbcc8e3bf832386832322146235e251bc7bc0d7 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Wed, 2 Nov 2011 09:23:25 +0000
Subject: [PATCH] linux-user: fake /proc/self/stat
The boehm gc finds the program's stack starting pointer by
checking /proc/self/stat. Unfortunately, so far it reads
qemu's stack pointer which clearly is wrong.
So let's instead fake the file so the guest program sees the
right address.
Signed-off-by: Alexander Graf
---
linux-user/syscall.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8727249..5eefd01 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4617,6 +4617,31 @@ static int open_self_maps(void *cpu_env, int fd)
return 0;
}
+static int open_self_stat(void *cpu_env, int fd)
+{
+ TaskState *ts = ((CPUState *)cpu_env)->opaque;
+ abi_ulong start_stack = ts->info->start_stack;
+ int i;
+
+ for (i = 0; i < 44; i++) {
+ char buf[128];
+ int len;
+ uint64_t val = 0;
+
+ if (i == 27) {
+ /* stack bottom */
+ val = start_stack;
+ }
+ snprintf(buf, sizeof(buf), "%"PRId64 "%c", val, i == 43 ? '\n' : ' ');
+ len = strlen(buf);
+ if (write(fd, buf, len) != len) {
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode)
{
struct fake_open {
@@ -4626,6 +4651,7 @@ static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode)
const struct fake_open *fake_open;
static const struct fake_open fakes[] = {
{ "/proc/self/maps", open_self_maps },
+ { "/proc/self/stat", open_self_stat },
{ NULL, NULL }
};
++++++ 0007-linux-user-fake-proc-self-auxv.patc.patch ++++++
From 53bd82c12dac42df6c602aee6a93b3ea39e134da Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Wed, 2 Nov 2011 09:23:26 +0000
Subject: [PATCH] linux-user: fake /proc/self/auxv
Gtk tries to read /proc/self/auxv to find its auxv table instead of
taking it from its own program memory space.
However, when running with linux-user, we see the host's auxv which
clearly exposes wrong information. so let's instead expose the guest
memory backed auxv tables via /proc/self/auxv as well.
Signed-off-by: Alexander Graf
---
linux-user/syscall.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5eefd01..3e6f3bd 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4642,6 +4642,35 @@ static int open_self_stat(void *cpu_env, int fd)
return 0;
}
+static int open_self_auxv(void *cpu_env, int fd)
+{
+ TaskState *ts = ((CPUState *)cpu_env)->opaque;
+ abi_ulong auxv = ts->info->saved_auxv;
+ abi_ulong len = ts->info->auxv_len;
+ char *ptr;
+
+ /*
+ * Auxiliary vector is stored in target process stack.
+ * read in whole auxv vector and copy it to file
+ */
+ ptr = lock_user(VERIFY_READ, auxv, len, 0);
+ if (ptr != NULL) {
+ while (len > 0) {
+ ssize_t r;
+ r = write(fd, ptr, len);
+ if (r <= 0) {
+ break;
+ }
+ len -= r;
+ ptr += r;
+ }
+ lseek(fd, 0, SEEK_SET);
+ unlock_user(ptr, auxv, len);
+ }
+
+ return 0;
+}
+
static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode)
{
struct fake_open {
@@ -4652,6 +4681,7 @@ static int do_open(void *cpu_env, const char *pathname, int flags, mode_t mode)
static const struct fake_open fakes[] = {
{ "/proc/self/maps", open_self_maps },
{ "/proc/self/stat", open_self_stat },
+ { "/proc/self/auxv", open_self_auxv },
{ NULL, NULL }
};
++++++ 0008-XXX-dont-dump-core-on-sigabort.patc.patch ++++++
From f48d5facfbfa643ff2d89fa215d7982877468f02 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Mon, 21 Nov 2011 23:50:36 +0100
Subject: [PATCH] XXX dont dump core on sigabort
---
linux-user/signal.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 78e3380..cfa92b9 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -373,6 +373,10 @@ static void QEMU_NORETURN force_sig(int target_sig)
host_sig = target_to_host_signal(target_sig);
gdb_signalled(thread_env, target_sig);
+ if (target_sig == 6) {
+ goto no_core;
+ }
+
/* dump core if supported by target binary format */
if (core_dump_signal(target_sig) && (ts->bprm->core_dump != NULL)) {
stop_all_tasks();
@@ -390,6 +394,8 @@ static void QEMU_NORETURN force_sig(int target_sig)
target_sig, strsignal(host_sig), "core dumped" );
}
+no_core:
+
/* The proper exit code for dying from an uncaught signal is
* -<signal>. The kernel doesn't allow exit() or _exit() to pass
* a negative value. To get the proper exit code we need to
++++++ 0009-linux-user-fix-wait-syscall-status-returns.patch -> 0009-linux-user-fix-wait-syscall-status-.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0009-linux-user-fix-wait-syscall-status-returns.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0009-linux-user-fix-wait-syscall-status-.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,4 +1,4 @@
-From ee5137d38109fdcb55a58be447c2c27be2b16eb0 Mon Sep 17 00:00:00 2001
+From c2c3a707453bc853b73cf2d3f2663ff2277b6563 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Tue, 22 Nov 2011 17:53:40 +0100
Subject: [PATCH] linux-user: fix wait* syscall status returns
@@ -50,6 +50,3 @@
ret = get_errno(wait4(arg1, &status, arg3, rusage_ptr));
if (!is_error(ret)) {
if (status_ptr) {
---
-1.6.0.2
-
++++++ 0010-Revert-linux-user-fix-wait-syscall-status-returns.patch -> 0010-Revert-linux-user-fix-wait-syscall-.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0010-Revert-linux-user-fix-wait-syscall-status-returns.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0010-Revert-linux-user-fix-wait-syscall-.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,4 +1,4 @@
-From 5cfce885dd1b3a229cd2ea7a94dfe2445ec29417 Mon Sep 17 00:00:00 2001
+From e300580980d4ac564a7c458717f7415f2528c41f Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Thu, 24 Nov 2011 00:38:22 +0100
Subject: [PATCH] Revert "linux-user: fix wait* syscall status returns"
@@ -34,6 +34,3 @@
ret = get_errno(wait4(arg1, &status, arg3, rusage_ptr));
if (!is_error(ret)) {
if (status_ptr) {
---
-1.6.0.2
-
++++++ 0009-linux-user-fix-wait-syscall-status-returns.patch -> 0011-linux-user-fix-wait-syscall-status-.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0009-linux-user-fix-wait-syscall-status-returns.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0011-linux-user-fix-wait-syscall-status-.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,6 +1,6 @@
-From ee5137d38109fdcb55a58be447c2c27be2b16eb0 Mon Sep 17 00:00:00 2001
+From d9e44fedae2abdc61ea12000719cc74dee54200c Mon Sep 17 00:00:00 2001
From: Alexander Graf
-Date: Tue, 22 Nov 2011 17:53:40 +0100
+Date: Thu, 24 Nov 2011 00:39:35 +0100
Subject: [PATCH] linux-user: fix wait* syscall status returns
When calling wait4 or waitpid with a status pointer and WNOHANG, the
@@ -20,36 +20,36 @@
This patch fixes some test cases when building yast2-core in OBS for ARM.
Signed-off-by: Alexander Graf
+
---
- linux-user/syscall.c | 8 +++++++-
- 1 files changed, 7 insertions(+), 1 deletions(-)
+
+v1 -> v2:
+
+ - take Peter's comment into account and just not write status back when
+ wait*'s return value is 0
+---
+ linux-user/syscall.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
-index 3e6f3bd..f86fe4a 100644
+index 3e6f3bd..5810e2a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
-@@ -4833,7 +4833,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
- #ifdef TARGET_NR_waitpid
- case TARGET_NR_waitpid:
+@@ -4835,7 +4835,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
{
-- int status;
-+ int status = 0;
-+ if (arg2) {
-+ get_user_s32(status, arg2);
-+ }
+ int status;
ret = get_errno(waitpid(arg1, &status, arg3));
- if (!is_error(ret) && arg2
+- if (!is_error(ret) && arg2
++ if (!is_error(ret) && arg2 && ret
&& put_user_s32(host_to_target_waitstatus(status), arg2))
-@@ -6389,6 +6392,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
- rusage_ptr = &rusage;
- else
+ goto efault;
+ }
+@@ -6391,7 +6391,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
rusage_ptr = NULL;
-+ if (status_ptr) {
-+ get_user_s32(status, status_ptr);
-+ }
ret = get_errno(wait4(arg1, &status, arg3, rusage_ptr));
if (!is_error(ret)) {
- if (status_ptr) {
---
-1.6.0.2
-
+- if (status_ptr) {
++ if (status_ptr && ret) {
+ status = host_to_target_waitstatus(status);
+ if (put_user_s32(status, status_ptr))
+ goto efault;
++++++ 0012-XXX-linux-user-fake-proc-self-maps-even-more.patch -> 0012-XXX-linux-user-fake-proc-self-maps-.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0012-XXX-linux-user-fake-proc-self-maps-even-more.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0012-XXX-linux-user-fake-proc-self-maps-.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,4 +1,4 @@
-From 146dddbec44c48417f776d54f823093b464e596c Mon Sep 17 00:00:00 2001
+From 1e34dbb17e1ce60d2c2afd7803dd6b9af8043140 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Mon, 28 Nov 2011 17:05:24 +0100
Subject: [PATCH] XXX linux-user: fake /proc/self/maps even more
@@ -64,6 +64,3 @@
return 0;
}
---
-1.6.0.2
-
++++++ 0013-XXX-work-around-SA_RESTART-race-with-boehm-gc-ARM-o.patch -> 0013-XXX-work-around-SA_RESTART-race-wit.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0013-XXX-work-around-SA_RESTART-race-with-boehm-gc-ARM-o.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0013-XXX-work-around-SA_RESTART-race-wit.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,4 +1,4 @@
-From 79a59902304b66e9270d11901a554e5b22042d6e Mon Sep 17 00:00:00 2001
+From e093a96fb61a17b9b0ee88d35fbe8871ec205797 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Thu, 1 Dec 2011 19:00:01 +0100
Subject: [PATCH] XXX work around SA_RESTART race with boehm-gc (ARM only)
@@ -242,6 +242,3 @@
return ret;
efault:
ret = -TARGET_EFAULT;
---
-1.6.0.2
-
++++++ 0014-XXX-move-qemu-binary-lower-in-address-space-so-we-ha.patch -> 0014-XXX-move-qemu-binary-lower-in-addre.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0014-XXX-move-qemu-binary-lower-in-address-space-so-we-ha.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0014-XXX-move-qemu-binary-lower-in-addre.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,4 +1,4 @@
-From e534a77a0e1f880d0f74514ac50de5de3dd4811a Mon Sep 17 00:00:00 2001
+From 4c1134246f3bd0af9b9b512a2094010ed12e7895 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Mon, 5 Dec 2011 23:37:52 +0100
Subject: [PATCH] XXX move qemu binary lower in address space so we have space for guest stuff
@@ -20,6 +20,3 @@
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
---
-1.6.0.2
-
++++++ 0015-linux-user-map-lower-in-address-space.patch -> 0015-linux-user-map-lower-in-address-spa.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0015-linux-user-map-lower-in-address-space.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0015-linux-user-map-lower-in-address-spa.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,4 +1,4 @@
-From edda5e8f49b7857379733d652d6b259488bd7b70 Mon Sep 17 00:00:00 2001
+From b2e723019225ba03cef46b204dbfc51102f83259 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Tue, 6 Dec 2011 00:39:50 +0100
Subject: [PATCH] linux-user: map lower in address space
@@ -29,6 +29,3 @@
#endif
static abi_ulong mmap_next_start = TASK_UNMAPPED_BASE;
---
-1.6.0.2
-
++++++ 0016-XXX-fake-proc-self-maps-also-fclose-real-file.patch -> 0016-XXX-fake-proc-self-maps-also-fclose.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0016-XXX-fake-proc-self-maps-also-fclose-real-file.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0016-XXX-fake-proc-self-maps-also-fclose.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,4 +1,4 @@
-From 3580a90d40df10410b7268f89aae58ce05dd2bed Mon Sep 17 00:00:00 2001
+From 8132af006535df8bbf5c4f23c9f37b7d45851950 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Thu, 8 Dec 2011 23:19:32 +0100
Subject: [PATCH] XXX fake /proc/self/maps: also fclose real file
@@ -19,6 +19,3 @@
#if defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_UNICORE32)
dprintf(fd, "%08llx-%08llx rw-p %08llx 00:00 0 [stack]\n",
---
-1.6.0.2
-
++++++ 0017-XXX-map-qemu-higher-again-so-we-have-space-for-brk.patch -> 0017-XXX-map-qemu-higher-again-so-we-hav.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0017-XXX-map-qemu-higher-again-so-we-have-space-for-brk.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0017-XXX-map-qemu-higher-again-so-we-hav.patch 2012-03-17 13:23:04.000000000 +0100
@@ -1,4 +1,4 @@
-From 91f12fe177833e0112cd7f7cf5781b26377667a5 Mon Sep 17 00:00:00 2001
+From 1021c91ed33c597aec0665501c1bfef96386046b Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Sat, 10 Dec 2011 00:03:56 +0100
Subject: [PATCH] XXX map qemu higher again so we have space for brk
@@ -34,6 +34,3 @@
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
---
-1.6.0.2
-
++++++ 0018-qemu-0.9.0.cvs-binfmt.patch.patch ++++++
From 68c582bd8f27e48828c3ea90aceb4bbead37382b Mon Sep 17 00:00:00 2001
From: Ulrich Hecht
Date: Tue, 14 Apr 2009 16:18:44 +0200
Subject: [PATCH] qemu-0.9.0.cvs-binfmt
Fixes binfmt_misc setup script:
- x86_64 is i386-compatible
- m68k signature fixed
- path to QEMU
Signed-off-by: Ulrich Hecht
---
scripts/qemu-binfmt-conf.sh | 37 ++++++++++++++++++++-----------------
1 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
index 83a44d8..d0fe4e1 100644
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -27,42 +27,45 @@ case "$cpu" in
armv[4-9]*)
cpu="arm"
;;
+ sparc*)
+ cpu="sparc"
+ ;;
esac
# register the interpreter for each cpu except for the native one
if [ $cpu != "i386" ] ; then
- echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
- echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
+ echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
+ echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
fi
if [ $cpu != "alpha" ] ; then
- echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-alpha:' > /proc/sys/fs/binfmt_misc/register
+ echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha:' > /proc/sys/fs/binfmt_misc/register
fi
if [ $cpu != "arm" ] ; then
- echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register
- echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register
+ echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register
+ echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register
fi
if [ $cpu != "sparc" ] ; then
- echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register
+ echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register
fi
if [ $cpu != "ppc" ] ; then
- echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-ppc:' > /proc/sys/fs/binfmt_misc/register
+ echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc:' > /proc/sys/fs/binfmt_misc/register
fi
if [ $cpu != "m68k" ] ; then
echo 'Please check cpu value and header information for m68k!'
- echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-m68k:' > /proc/sys/fs/binfmt_misc/register
+ echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k:' > /proc/sys/fs/binfmt_misc/register
fi
if [ $cpu != "mips" ] ; then
# FIXME: We could use the other endianness on a MIPS host.
- echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mips:' > /proc/sys/fs/binfmt_misc/register
- echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mipsel:' > /proc/sys/fs/binfmt_misc/register
- echo ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mipsn32:' > /proc/sys/fs/binfmt_misc/register
- echo ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mipsn32el:' > /proc/sys/fs/binfmt_misc/register
- echo ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mips64:' > /proc/sys/fs/binfmt_misc/register
- echo ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mips64el:' > /proc/sys/fs/binfmt_misc/register
+ echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips:' > /proc/sys/fs/binfmt_misc/register
+ echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel:' > /proc/sys/fs/binfmt_misc/register
+ echo ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32:' > /proc/sys/fs/binfmt_misc/register
+ echo ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el:' > /proc/sys/fs/binfmt_misc/register
+ echo ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64:' > /proc/sys/fs/binfmt_misc/register
+ echo ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el:' > /proc/sys/fs/binfmt_misc/register
fi
if [ $cpu != "sh" ] ; then
- echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register
- echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register
+ echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register
+ echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register
if [ $cpu != "s390x" ] ; then
- echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-s390x:' > /proc/sys/fs/binfmt_misc/register
+ echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x:' > /proc/sys/fs/binfmt_misc/register
fi
++++++ 0019-qemu-cvs-alsa_bitfield.patch.patch ++++++
From dafb3a450b28740afb77a503af84c4217cf47f49 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Tue, 14 Apr 2009 16:20:50 +0200
Subject: [PATCH] qemu-cvs-alsa_bitfield
Implements TYPE_INTBITFIELD partially. (required for ALSA support)
Signed-off-by: Alexander Graf
Signed-off-by: Ulrich Hecht
---
thunk.c | 21 +++++++++++++++++++++
thunk.h | 3 +++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/thunk.c b/thunk.c
index 0657188..34bc7d1 100644
--- a/thunk.c
+++ b/thunk.c
@@ -41,6 +41,7 @@ static inline const argtype *thunk_type_next(const argtype *type_ptr)
case TYPE_CHAR:
case TYPE_SHORT:
case TYPE_INT:
+ case TYPE_INTBITFIELD:
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
case TYPE_LONG:
@@ -139,6 +140,26 @@ const argtype *thunk_convert(void *dst, const void *src,
case TYPE_INT:
*(uint32_t *)dst = tswap32(*(uint32_t *)src);
break;
+ case TYPE_INTBITFIELD:
+#if defined(TARGET_I386) && defined(__powerpc__)
+ /* powerpc uses the MSB, whereas i386 uses the LSB
+ * to store the first bit in a field */
+ {
+ unsigned char byte = *(uint8_t *)src;
+ *(uint8_t *)dst = ((byte >> 7) & 1)
+ | ((byte >> 5) & 2)
+ | ((byte >> 3) & 4)
+ | ((byte >> 1) & 8)
+ | ((byte << 1) & 16)
+ | ((byte << 3) & 32)
+ | ((byte << 5) & 64)
+ | ((byte << 7) & 128);
+ /* FIXME: implement for bitfields > 1 byte and other archs */
+ }
+#else
+ *(uint32_t *)dst = tswap32(*(uint32_t *)src);
+#endif
+ break;
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
*(uint64_t *)dst = tswap64(*(uint64_t *)src);
diff --git a/thunk.h b/thunk.h
index 109c541..55890f3 100644
--- a/thunk.h
+++ b/thunk.h
@@ -37,6 +37,7 @@ typedef enum argtype {
TYPE_PTR,
TYPE_ARRAY,
TYPE_STRUCT,
+ TYPE_INTBITFIELD,
} argtype;
#define MK_PTR(type) TYPE_PTR, type
@@ -90,6 +91,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host)
case TYPE_SHORT:
return 2;
case TYPE_INT:
+ case TYPE_INTBITFIELD:
return 4;
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
@@ -127,6 +129,7 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host)
case TYPE_SHORT:
return 2;
case TYPE_INT:
+ case TYPE_INTBITFIELD:
return 4;
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
++++++ 0020-qemu-cvs-alsa_ioctl.patch.patch ++++++
++++ 3624 lines (skipped)
++++++ 0021-qemu-cvs-alsa_mmap.patch.patch ++++++
From 361d8917165009c3897a5116a5b6e87c2db2dd68 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Tue, 14 Apr 2009 16:24:15 +0200
Subject: [PATCH] qemu-cvs-alsa_mmap
Hack to prevent ALSA from using mmap() interface to simplify emulation.
Signed-off-by: Alexander Graf
Signed-off-by: Ulrich Hecht
---
linux-user/mmap.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 46e8bf8..e4db455 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -364,6 +364,9 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
}
}
+#define SNDRV_PCM_MMAP_OFFSET_STATUS 0x80000000
+#define SNDRV_PCM_MMAP_OFFSET_CONTROL 0x81000000
+
/* NOTE: all the constants are the HOST ones */
abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
int flags, int fd, abi_ulong offset)
@@ -399,6 +402,17 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
}
#endif
+ /* Alsa tries to communcate with the kernel via mmap. This usually
+ * is a good idea when user- and kernelspace are running on the
+ * same architecture but does not work out when not. To make alsa
+ * not to use mmap, we can just have it fail on the mmap calls that
+ * would initiate this.
+ */
+ if(offset == SNDRV_PCM_MMAP_OFFSET_STATUS || offset == SNDRV_PCM_MMAP_OFFSET_CONTROL) {
+ errno = EINVAL;
+ return -1;
+ }
+
if (offset & ~TARGET_PAGE_MASK) {
errno = EINVAL;
goto fail;
++++++ 0022-qemu-cvs-gettimeofday.patch.patch ++++++
From 58ab3b92c4406b87b2ef2dbd230b397e2bec9f18 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht
Date: Tue, 14 Apr 2009 16:25:41 +0200
Subject: [PATCH] qemu-cvs-gettimeofday
No clue what this is for.
---
linux-user/syscall.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9fabcba..cd120a4 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5901,6 +5901,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_gettimeofday:
{
struct timeval tv;
+ if(copy_from_user_timeval(&tv, arg1))
+ goto efault;
ret = get_errno(gettimeofday(&tv, NULL));
if (!is_error(ret)) {
if (copy_to_user_timeval(arg1, &tv))
++++++ 0023-qemu-cvs-ioctl_debug.patch.patch ++++++
From c73ada0bb889ac958c21dafd410ff8210ca92850 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Tue, 14 Apr 2009 16:26:33 +0200
Subject: [PATCH] qemu-cvs-ioctl_debug
Extends unsupported ioctl debug output.
Signed-off-by: Alexander Graf
Signed-off-by: Ulrich Hecht
---
linux-user/syscall.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index cd120a4..4f1a5b4 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3343,7 +3343,12 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)
ie = ioctl_entries;
for(;;) {
if (ie->target_cmd == 0) {
- gemu_log("Unsupported ioctl: cmd=0x%04lx\n", (long)cmd);
+ int i;
+ gemu_log("Unsupported ioctl: cmd=0x%04lx (%x)\n", (unsigned long)cmd, (unsigned int)(cmd & (TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) >> TARGET_IOC_SIZESHIFT);
+ for (i = 0; ioctl_entries[i].target_cmd; i++) {
+ if ((ioctl_entries[i].target_cmd & ~(TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) == (cmd & ~(TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)))
+ gemu_log("%p\t->\t%s (%x)\n", (void *)(unsigned long)ioctl_entries[i].host_cmd, ioctl_entries[i].name, (ioctl_entries[i].target_cmd & (TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) >> TARGET_IOC_SIZESHIFT);
+ }
return -TARGET_ENOSYS;
}
if (ie->target_cmd == cmd)
++++++ 0024-qemu-cvs-ioctl_nodirection.patch.patch ++++++
From a2ccdcc82fc7b094d8e23d9beb2dd3351bb43e23 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Tue, 14 Apr 2009 16:27:36 +0200
Subject: [PATCH] qemu-cvs-ioctl_nodirection
the direction given in the ioctl should be correct so we can assume the
communication is uni-directional. The alsa developers did not like this
concept though and declared ioctls IOC_R and IOC_W even though they were
IOC_RW.
Signed-off-by: Alexander Graf
Signed-off-by: Ulrich Hecht
---
linux-user/syscall.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4f1a5b4..eabeee6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3377,6 +3377,11 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)
arg_type++;
target_size = thunk_type_size(arg_type, 0);
switch(ie->access) {
+ /* FIXME: actually the direction given in the ioctl should be
+ * correct so we can assume the communication is uni-directional.
+ * The alsa developers did not like this concept though and
+ * declared ioctls IOC_R and IOC_W even though they were IOC_RW.*/
+/*
case IOC_R:
ret = get_errno(ioctl(fd, ie->host_cmd, buf_temp));
if (!is_error(ret)) {
@@ -3395,6 +3400,7 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)
unlock_user(argptr, arg, 0);
ret = get_errno(ioctl(fd, ie->host_cmd, buf_temp));
break;
+*/
default:
case IOC_RW:
argptr = lock_user(VERIFY_READ, arg, target_size, 1);
++++++ 0025-qemu-img-vmdk-scsi.patch.patch ++++++
From dca5711f3a271a3a0f41207e03f7bf5c7c24d08f Mon Sep 17 00:00:00 2001
From: Ulrich Hecht
Date: Tue, 14 Apr 2009 16:37:42 +0200
Subject: [PATCH] qemu-img-vmdk-scsi
Support creation of SCSI VMDK images in qemu-img.
Signed-off-by: Ulrich Hecht
---
block.c | 5 ++++-
block/vmdk.c | 12 ++++++++++--
block_int.h | 2 ++
qemu-img.c | 8 +++++++-
4 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index d015887..4b9f81d 100644
--- a/block.c
+++ b/block.c
@@ -3151,7 +3151,7 @@ int bdrv_img_create(const char *filename, const char *fmt,
char *options, uint64_t img_size, int flags)
{
QEMUOptionParameter *param = NULL, *create_options = NULL;
- QEMUOptionParameter *backing_fmt, *backing_file, *size;
+ QEMUOptionParameter *backing_fmt, *backing_file, *size, *scsi;
BlockDriverState *bs = NULL;
BlockDriver *drv, *proto_drv;
BlockDriver *backing_drv = NULL;
@@ -3261,6 +3261,9 @@ int bdrv_img_create(const char *filename, const char *fmt,
printf("Formatting '%s', fmt=%s ", filename, fmt);
print_option_parameters(param);
+ scsi = get_option_parameter(param, BLOCK_OPT_SCSI);
+ if (scsi && scsi->value.n)
+ printf(", SCSI");
puts("");
ret = bdrv_create(drv, filename, param);
diff --git a/block/vmdk.c b/block/vmdk.c
index f544159..2b9531d 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1375,7 +1375,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
"ddb.geometry.cylinders = \"%" PRId64 "\"\n"
"ddb.geometry.heads = \"16\"\n"
"ddb.geometry.sectors = \"63\"\n"
- "ddb.adapterType = \"ide\"\n";
+ "ddb.adapterType = \"%s\"\n";
if (filename_decompose(filename, path, prefix, postfix, PATH_MAX)) {
return -EINVAL;
@@ -1390,6 +1390,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
flags |= options->value.n ? BLOCK_FLAG_COMPAT6 : 0;
} else if (!strcmp(options->name, BLOCK_OPT_SUBFMT)) {
fmt = options->value.s;
+ } else if (!strcmp(options->name, BLOCK_OPT_SCSI)) {
+ flags |= options->value.n ? BLOCK_FLAG_SCSI: 0;
}
options++;
}
@@ -1480,7 +1482,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
parent_desc_line,
ext_desc_lines,
(flags & BLOCK_FLAG_COMPAT6 ? 6 : 4),
- total_size / (int64_t)(63 * 16 * 512));
+ total_size / (int64_t)(63 * 16 * 512),
+ flags & BLOCK_FLAG_SCSI ? "lsilogic" : "ide");
if (split || flat) {
fd = open(
filename,
@@ -1583,6 +1586,11 @@ static QEMUOptionParameter vmdk_create_options[] = {
"VMDK flat extent format, can be one of "
"{monolithicSparse (default) | monolithicFlat | twoGbMaxExtentSparse | twoGbMaxExtentFlat | streamOptimized} "
},
+ {
+ .name = BLOCK_OPT_SCSI,
+ .type = OPT_FLAG,
+ .help = "SCSI image"
+ },
{ NULL }
};
diff --git a/block_int.h b/block_int.h
index 77c0187..b79ab4b 100644
--- a/block_int.h
+++ b/block_int.h
@@ -33,10 +33,12 @@
#define BLOCK_FLAG_ENCRYPT 1
#define BLOCK_FLAG_COMPAT6 4
+#define BLOCK_FLAG_SCSI 8
#define BLOCK_OPT_SIZE "size"
#define BLOCK_OPT_ENCRYPT "encryption"
#define BLOCK_OPT_COMPAT6 "compat6"
+#define BLOCK_OPT_SCSI "scsi"
#define BLOCK_OPT_BACKING_FILE "backing_file"
#define BLOCK_OPT_BACKING_FMT "backing_fmt"
#define BLOCK_OPT_CLUSTER_SIZE "cluster_size"
diff --git a/qemu-img.c b/qemu-img.c
index 01cc0d3..21f3544 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -661,7 +661,7 @@ static int img_convert(int argc, char **argv)
const uint8_t *buf1;
BlockDriverInfo bdi;
QEMUOptionParameter *param = NULL, *create_options = NULL;
- QEMUOptionParameter *out_baseimg_param;
+ QEMUOptionParameter *out_baseimg_param, *scsi;
char *options = NULL;
const char *snapshot_name = NULL;
float local_progress;
@@ -852,6 +852,12 @@ static int img_convert(int argc, char **argv)
}
}
+ if ((scsi = get_option_parameter(param, BLOCK_OPT_SCSI)) && scsi->value.n && strcmp(drv->format_name, "vmdk")) {
+ error_report("SCSI devices not supported for this file format");
+ ret = -1;
+ goto out;
+ }
+
/* Create the new image */
ret = bdrv_create(drv, out_filename, param);
if (ret < 0) {
++++++ 0026-qemu-nonvoid_return.patch.patch ++++++
From 04b073cd49c1e86a663978d5bca1610456afc80c Mon Sep 17 00:00:00 2001
From: Ulrich Hecht
Date: Tue, 14 Apr 2009 16:38:20 +0200
Subject: [PATCH] qemu-nonvoid_return
Squelches GCC warnings about undefined return values.
Signed-off-by: Ulrich Hecht
---
hw/mpcore.c | 1 +
target-m68k/translate.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/hw/mpcore.c b/hw/mpcore.c
index d6175cf..58dfd09 100644
--- a/hw/mpcore.c
+++ b/hw/mpcore.c
@@ -106,6 +106,7 @@ static uint32_t mpcore_timer_read(mpcore_timer_state *s, int offset)
default:
return 0;
}
+ return 0;
}
static void mpcore_timer_write(mpcore_timer_state *s, int offset,
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 0e7f1fe..bfaf116 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -436,6 +436,7 @@ static inline int opsize_bytes(int opsize)
qemu_assert(0, "bad operand size");
return 0;
}
+ return 0;
}
/* Assign value to a register. If the width is less than the register width
++++++ 0027-fix-mipsn32-linux-user-builds.patch.patch ++++++
From c376a21e31202c85164b247ba6332efddfcb9c3b Mon Sep 17 00:00:00 2001
From: Ulrich Hecht
Date: Wed, 25 Aug 2010 14:23:43 +0200
Subject: [PATCH] fix mipsn32*-linux-user builds
Signed-off-by: Ulrich Hecht
---
configure | 2 ++
default-configs/mipsn32-linux-user.mak | 1 +
default-configs/mipsn32el-linux-user.mak | 1 +
linux-user/mipsn32/syscall.h | 3 ++-
4 files changed, 6 insertions(+), 1 deletions(-)
create mode 100644 default-configs/mipsn32-linux-user.mak
create mode 100644 default-configs/mipsn32el-linux-user.mak
diff --git a/configure b/configure
index b113f60..a21b1e6 100755
--- a/configure
+++ b/configure
@@ -915,6 +915,8 @@ microblaze-linux-user \
microblazeel-linux-user \
mips-linux-user \
mipsel-linux-user \
+mipsn32-linux-user \
+mipsn32el-linux-user \
ppc-linux-user \
ppc64-linux-user \
ppc64abi32-linux-user \
diff --git a/default-configs/mipsn32-linux-user.mak b/default-configs/mipsn32-linux-user.mak
new file mode 100644
index 0000000..31df570
--- /dev/null
+++ b/default-configs/mipsn32-linux-user.mak
@@ -0,0 +1 @@
+# Default configuration for mips-linux-user
diff --git a/default-configs/mipsn32el-linux-user.mak b/default-configs/mipsn32el-linux-user.mak
new file mode 100644
index 0000000..4d0e4af
--- /dev/null
+++ b/default-configs/mipsn32el-linux-user.mak
@@ -0,0 +1 @@
+# Default configuration for mipsel-linux-user
diff --git a/linux-user/mipsn32/syscall.h b/linux-user/mipsn32/syscall.h
index 4ec506c..beeeb3c 100644
--- a/linux-user/mipsn32/syscall.h
+++ b/linux-user/mipsn32/syscall.h
@@ -216,6 +216,7 @@ struct target_pt_regs {
#undef TARGET_ENOTRECOVERABLE
#define TARGET_ENOTRECOVERABLE 166 /* State not recoverable */
-
+/* Nasty hack: define a fake errno value for use by sigreturn. */
+#define TARGET_QEMU_ESIGRETURN 255
#define UNAME_MACHINE "mips64"
++++++ 0028-Integrating-Dynamips-and-GNS3-UDP-tunnels-Patches.patch -> 0028-Integrating-Dynamips-and-GNS3-UDP-t.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0028-Integrating-Dynamips-and-GNS3-UDP-tunnels-Patches.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0028-Integrating-Dynamips-and-GNS3-UDP-t.patch 2012-03-17 13:23:06.000000000 +0100
@@ -1,4 +1,4 @@
-From 15d6a32b38abc6c2f8143ebccfcdd05d204f0fcd Mon Sep 17 00:00:00 2001
+From dbaddb35cf05035c5efe05a7272c3a4e8f29033b Mon Sep 17 00:00:00 2001
From: Benjamin
Date: Sat, 8 Oct 2011 07:31:33 +0000
Subject: [PATCH] Integrating Dynamips and GNS3 UDP tunnels (Patches)
@@ -43,7 +43,7 @@
create mode 100644 net/udp.h
diff --git a/Makefile.objs b/Makefile.objs
-index d7a6539..1a28830 100644
+index 3a699ee..97c2b75 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -46,6 +46,7 @@ net-obj-y = net.o
@@ -77,10 +77,10 @@
if (s->hfile == INVALID_HANDLE_VALUE) {
int err = GetLastError();
diff --git a/hw/e1000.c b/hw/e1000.c
-index 986ed9c..19ca5bf 100644
+index e164d79..22a601a 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
-@@ -577,7 +577,7 @@ receive_filter(E1000State *s, const uint8_t *buf, int size)
+@@ -580,7 +580,7 @@ receive_filter(E1000State *s, const uint8_t *buf, int size)
if (rctl & E1000_RCTL_UPE) // promiscuous
return 1;
@@ -153,7 +153,7 @@
NET_CLIENT_TYPE_MAX
diff --git a/net/udp.c b/net/udp.c
new file mode 100644
-index 0000000..6080919
+index 0000000..d2a67e7
--- /dev/null
+++ b/net/udp.c
@@ -0,0 +1,138 @@
@@ -250,7 +250,7 @@
+ UDPState *s;
+ struct sockaddr_in receiver;
+ int ret;
-+
++
+ nc = qemu_new_net_client(&net_udp_info, vlan, NULL, model, name);
+
+ snprintf(nc->info_str, sizeof(nc->info_str),"udp: %i->%s:%i",
@@ -263,7 +263,7 @@
+ receiver.sin_addr.s_addr = INADDR_ANY;
+ receiver.sin_port = htons(sport);
+ ret = bind(s->rfd, (struct sockaddr *)&receiver, sizeof(receiver));
-+
++
+ if (ret == -1) {
+ fprintf (stderr, "bind error:%s\n", strerror(errno));
+ return ret;
@@ -346,6 +346,3 @@
#ifdef CONFIG_VDE
"-net vde[,vlan=n][,name=str][,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
" connect the vlan 'n' to port 'n' of a vde switch running\n"
---
-1.6.0.2
-
++++++ 0029-linux-user-add-binfmt-wrapper-for-argv-0-handling.patch -> 0029-linux-user-add-binfmt-wrapper-for-a.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0029-linux-user-add-binfmt-wrapper-for-argv-0-handling.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0029-linux-user-add-binfmt-wrapper-for-a.patch 2012-03-17 13:23:06.000000000 +0100
@@ -1,4 +1,4 @@
-From 47ff084e9af71b217e6f842f720d12fe9e12f2fd Mon Sep 17 00:00:00 2001
+From e8b8530dd87efb4bbbb9819af1d2019c49a4b58a Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Fri, 30 Sep 2011 19:40:36 +0200
Subject: [PATCH] linux-user: add binfmt wrapper for argv[0] handling
@@ -169,6 +169,3 @@
- echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x:' > /proc/sys/fs/binfmt_misc/register
+ echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x-binfmt:P' > /proc/sys/fs/binfmt_misc/register
fi
---
-1.6.0.2
-
++++++ 0030-linux-user-Ignore-timer_create-syscall.patch -> 0030-linux-user-Ignore-timer_create-sysc.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0030-linux-user-Ignore-timer_create-syscall.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0030-linux-user-Ignore-timer_create-sysc.patch 2012-03-17 13:23:06.000000000 +0100
@@ -1,4 +1,4 @@
-From 269d801698bf7640dd325cfb4b195c4a207a07ee Mon Sep 17 00:00:00 2001
+From a4f0bf51a11607d4ab025719b1c13fc402aac9b7 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Sun, 11 Dec 2011 01:19:24 +0100
Subject: [PATCH] linux-user: Ignore timer_create syscall
@@ -27,6 +27,3 @@
#if defined(TARGET_NR_tkill) && defined(__NR_tkill)
case TARGET_NR_tkill:
ret = get_errno(sys_tkill((int)arg1, target_to_host_signal(arg2)));
---
-1.6.0.2
-
++++++ 0031-linux-user-be-silent-about-capget-failures.patch -> 0031-linux-user-be-silent-about-capget-f.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0031-linux-user-be-silent-about-capget-failures.patch 2012-02-10 17:19:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0031-linux-user-be-silent-about-capget-f.patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From 36f403e159ecb5fcaeda5346c2df762cc904a91b Mon Sep 17 00:00:00 2001
+From 853112747ffa9a9747c670d36508b8f51fbaf798 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Sun, 11 Dec 2011 01:21:51 +0100
Subject: [PATCH] linux-user: be silent about capget failures
@@ -25,6 +25,3 @@
case TARGET_NR_capset:
goto unimplemented;
case TARGET_NR_sigaltstack:
---
-1.6.0.2
-
++++++ 0032-linux-user-reserve-4GB-of-vmem-for-32-on-64.patch -> 0032-linux-user-reserve-4GB-of-vmem-for-.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0032-linux-user-reserve-4GB-of-vmem-for-32-on-64.patch 2012-02-24 06:54:11.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0032-linux-user-reserve-4GB-of-vmem-for-.patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From ac233b323ad7e498c665e8c74df7e44de4a542c0 Mon Sep 17 00:00:00 2001
+From 8954d20f70430ddd4f6add000fd8bf82d5ddcb27 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Wed, 14 Dec 2011 00:33:28 +0100
Subject: [PATCH] linux-user: reserve 4GB of vmem for 32-on-64
@@ -39,6 +39,3 @@
static void usage(void);
extern int use_stopflag;
---
-1.6.0.2
-
++++++ 0033-PPC-KVM-Disable-mmu-notifier-check.patch -> 0033-PPC-KVM-Disable-mmu-notifier-check..patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0033-PPC-KVM-Disable-mmu-notifier-check.patch 2012-02-24 06:54:11.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0033-PPC-KVM-Disable-mmu-notifier-check..patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From 96ac7aa8753cb2d79121c5a579a6e93160428a40 Mon Sep 17 00:00:00 2001
+From c81d26928073f06432c701a28d745dffacc69c98 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Fri, 6 Jan 2012 01:05:55 +0100
Subject: [PATCH] PPC: KVM: Disable mmu notifier check
@@ -13,7 +13,7 @@
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/exec.c b/exec.c
-index 6c923f2..9f10868 100644
+index bb221cf..e71a82d 100644
--- a/exec.c
+++ b/exec.c
@@ -2831,10 +2831,12 @@ static void *file_ram_alloc(RAMBlock *block,
@@ -29,6 +29,3 @@
if (asprintf(&filename, "%s/qemu_back_mem.XXXXXX", path) == -1) {
return NULL;
---
-1.6.0.2
-
++++++ 0034-linux-user-improve-fake-proc-self-stat-making-ps.patch -> 0034-linux-user-improve-fake-proc-self-s.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0034-linux-user-improve-fake-proc-self-stat-making-ps.patch 2012-02-24 06:54:11.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0034-linux-user-improve-fake-proc-self-s.patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From 872ebeaa24ed1c4b0c1596a7ad37f2bf2275efb0 Mon Sep 17 00:00:00 2001
+From 9a72708a58d7bcbc1ba036a44cea920a238b0312 Mon Sep 17 00:00:00 2001
From: Fabio Erculiani
Date: Tue, 3 Jan 2012 09:38:34 +0000
Subject: [PATCH] linux-user: improve fake /proc/self/stat making `ps` not segfault.
@@ -49,6 +49,3 @@
len = strlen(buf);
if (write(fd, buf, len) != len) {
return -1;
---
-1.6.0.2
-
++++++ 0035-linux-user-target_argv-is-placed-on-ts-bprm-argv.patch -> 0035-linux-user-target_argv-is-placed-on.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0035-linux-user-target_argv-is-placed-on-ts-bprm-argv.patch 2012-02-24 06:54:11.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0035-linux-user-target_argv-is-placed-on.patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From 7dc45b21c5ef8a9445463f8d3754e502621192a7 Mon Sep 17 00:00:00 2001
+From e8171f6d129e129fe632721ab603f800385b0609 Mon Sep 17 00:00:00 2001
From: Fabio Erculiani
Date: Tue, 3 Jan 2012 09:38:35 +0000
Subject: [PATCH] linux-user: target_argv is placed on ts->bprm->argv and can't be freed()
@@ -32,6 +32,3 @@
for (wrk = target_environ; *wrk; wrk++) {
free(*wrk);
}
---
-1.6.0.2
-
++++++ 0037-PPC-KVM-Ignore-ENABLE_PAPR-to-support-very-old-HV.patch -> 0037-PPC-KVM-Ignore-ENABLE_PAPR-to-suppo.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0037-PPC-KVM-Ignore-ENABLE_PAPR-to-support-very-old-HV.patch 2012-02-24 06:54:12.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0037-PPC-KVM-Ignore-ENABLE_PAPR-to-suppo.patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From 9ef61f2a197f9dbae104fc1d18634c29d91b4a4e Mon Sep 17 00:00:00 2001
+From 351142c287c874f959828c6360cda977306dfa47 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Tue, 10 Jan 2012 17:03:02 +0100
Subject: [PATCH] PPC: KVM: Ignore ENABLE_PAPR to support very old HV KVM kernels
@@ -12,7 +12,7 @@
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
-index a03e99c..923677c 100644
+index 6c6278a..2f39e77 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -745,7 +745,7 @@ void kvmppc_set_papr(CPUState *env)
@@ -24,6 +24,3 @@
}
/*
---
-1.6.0.2
-
++++++ 0038-linux-user-fix-segfault-deadlock.pa.patch ++++++
From 1e747ef08ad5f5901e183cfd2151ae2988fb06ea Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Fri, 13 Jan 2012 17:05:41 +0100
Subject: [PATCH] linux-user: fix segfault deadlock
When entering the guest we take a lock to ensure that nobody else messes
with our TB chaining while we're doing it. If we get a segfault inside that
code, we manage to work on, but will not unlock the lock.
This patch forces unlocking of that lock in the segv handler. I'm not sure
this is the right approach though. Maybe we should rather make sure we don't
segfault in the code? I would greatly appreciate someone more intelligible
than me to look at this :).
Example code to trigger this is at: http://csgraf.de/tmp/conftest.c
Reported-by: Fabio Erculiani
Signed-off-by: Alexander Graf
---
qemu-lock.h | 10 ++++++++++
user-exec.c | 4 ++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/qemu-lock.h b/qemu-lock.h
index a72edda..e460e12 100644
--- a/qemu-lock.h
+++ b/qemu-lock.h
@@ -24,6 +24,12 @@
#include
#define spin_lock pthread_mutex_lock
#define spin_unlock pthread_mutex_unlock
+static inline void spin_unlock_safe(pthread_mutex_t *lock)
+{
+ /* unlocking an unlocked mutex results in undefined behavior */
+ pthread_mutex_trylock(lock);
+ pthread_mutex_unlock(lock);
+}
#define spinlock_t pthread_mutex_t
#define SPIN_LOCK_UNLOCKED PTHREAD_MUTEX_INITIALIZER
@@ -46,4 +52,8 @@ static inline void spin_unlock(spinlock_t *lock)
{
}
+static inline void spin_unlock_safe(spinlock_t *lock)
+{
+}
+
#endif
diff --git a/user-exec.c b/user-exec.c
index abf6885..2826bd1 100644
--- a/user-exec.c
+++ b/user-exec.c
@@ -96,6 +96,10 @@ static inline int handle_cpu_signal(unsigned long pc, unsigned long address,
qemu_printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n",
pc, address, is_write, *(unsigned long *)old_set);
#endif
+
+ /* Maybe we're still holding the TB fiddling lock? */
+ spin_unlock_safe(&tb_lock);
+
/* XXX: locking issue */
if (is_write && page_unprotect(h2g(address), pc, puc)) {
return 1;
++++++ 0039-linux-user-implement-device-mapper-ioctls.patch -> 0039-linux-user-implement-device-mapper-.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0039-linux-user-implement-device-mapper-ioctls.patch 2012-02-24 06:54:12.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0039-linux-user-implement-device-mapper-.patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From df8bec1f09754015f3b43591e1b8e9de70910c9a Mon Sep 17 00:00:00 2001
+From 0f7996403949df0249e833d7e0f250042eed3384 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Tue, 31 Jan 2012 18:42:06 +0100
Subject: [PATCH] linux-user: implement device mapper ioctls
@@ -8,17 +8,17 @@
Signed-off-by: Alexander Graf
---
- linux-user/ioctls.h | 33 +++++++
+ linux-user/ioctls.h | 32 ++++++
linux-user/syscall.c | 226 ++++++++++++++++++++++++++++++++++++++++++++
linux-user/syscall_defs.h | 18 ++++
linux-user/syscall_types.h | 36 +++++++
- 4 files changed, 313 insertions(+), 0 deletions(-)
+ 4 files changed, 312 insertions(+), 0 deletions(-)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
-index 224dbc6..05b7290 100644
+index 224dbc6..8647d64 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
-@@ -350,3 +350,36 @@
+@@ -350,3 +350,35 @@
IOCTL(VT_SETMODE, IOC_RW, MK_PTR(MK_STRUCT(STRUCT_vt_mode)))
IOCTL(VT_RELDISP, 0, TYPE_INT)
IOCTL(VT_DISALLOCATE, 0, TYPE_INT)
@@ -54,7 +54,6 @@
+ MK_PTR(MK_STRUCT(STRUCT_dm_ioctl)))
+ IOCTL_SPECIAL(DM_DEV_SET_GEOMETRY, IOC_RW, do_ioctl_dm,
+ MK_PTR(MK_STRUCT(STRUCT_dm_ioctl)))
-+
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 3e8e3dd..7a20af4 100644
--- a/linux-user/syscall.c
@@ -375,6 +374,3 @@
STRUCT(fiemap_extent,
TYPE_ULONGLONG, /* fe_logical */
TYPE_ULONGLONG, /* fe_physical */
---
-1.6.0.2
-
++++++ 0040-linux-user-add-struct-old_dev_t-compat.patch -> 0040-linux-user-add-struct-old_dev_t-com.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0040-linux-user-add-struct-old_dev_t-compat.patch 2012-02-24 06:54:12.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0040-linux-user-add-struct-old_dev_t-com.patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From 79df307311156580da72aff94e73ad54c73bc4e7 Mon Sep 17 00:00:00 2001
+From 1c1448c93345613871dac849cfd6786cf4a394ae Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Tue, 31 Jan 2012 19:44:41 +0100
Subject: [PATCH] linux-user: add struct old_dev_t compat
@@ -131,6 +131,3 @@
case TYPE_ARRAY:
return thunk_type_align_array(type_ptr + 2, is_host);
case TYPE_STRUCT:
---
-1.6.0.2
-
++++++ 0041-linux-user-fix-BLK-ioctl-arguments.patch -> 0041-linux-user-fix-BLK-ioctl-arguments..patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0041-linux-user-fix-BLK-ioctl-arguments.patch 2012-02-24 06:54:12.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0041-linux-user-fix-BLK-ioctl-arguments..patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From 8563ceced36263dbc91af9d6941e18626bd9f488 Mon Sep 17 00:00:00 2001
+From e9c0b65bbf4f8df8dcddf619d8473afecac8166c Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Tue, 31 Jan 2012 20:10:20 +0100
Subject: [PATCH] linux-user: fix BLK ioctl arguments
@@ -31,6 +31,3 @@
#define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */
#define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used for bmap */
#define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap)
---
-1.6.0.2
-
++++++ 0042-linux-user-add-BLKSSZGET-ioctl-wrapper.patch -> 0042-linux-user-add-BLKSSZGET-ioctl-wrap.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0042-linux-user-add-BLKSSZGET-ioctl-wrapper.patch 2012-02-24 06:54:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0042-linux-user-add-BLKSSZGET-ioctl-wrap.patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From 3977eaddfd8aad7fcab30dab3c9bab52bd79bdeb Mon Sep 17 00:00:00 2001
+From 62783a25efd8a6c5e6272950e8fc7f2dd0fd28e5 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Tue, 31 Jan 2012 20:11:37 +0100
Subject: [PATCH] linux-user: add BLKSSZGET ioctl wrapper
@@ -11,7 +11,7 @@
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
-index 05b7290..f938050 100644
+index 8647d64..07463d3 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -74,6 +74,7 @@
@@ -22,6 +22,3 @@
#ifdef FIBMAP
IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG))
#endif
---
-1.6.0.2
-
++++++ 0043-linux-user-Add-ioctl-for-BLKBSZGET.patch -> 0043-linux-user-Add-ioctl-for-BLKBSZGET..patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0043-linux-user-Add-ioctl-for-BLKBSZGET.patch 2012-02-24 06:54:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0043-linux-user-Add-ioctl-for-BLKBSZGET..patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From 3f2fdae967bb91a2c02020369c0af53c9cafd8b5 Mon Sep 17 00:00:00 2001
+From cd606a848069e4adfbf65f33468ab1471b26d85e Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Thu, 2 Feb 2012 02:22:34 +0100
Subject: [PATCH] linux-user: Add ioctl for BLKBSZGET
@@ -11,7 +11,7 @@
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
-index f938050..c261063 100644
+index 07463d3..e8c1c69 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -75,6 +75,7 @@
@@ -22,6 +22,3 @@
#ifdef FIBMAP
IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG))
#endif
---
-1.6.0.2
-
++++++ 0044-linux-user-take-RESERVED_VA-into-account-for-g2h_va.patch -> 0044-linux-user-take-RESERVED_VA-into-ac.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0044-linux-user-take-RESERVED_VA-into-account-for-g2h_va.patch 2012-02-24 06:54:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0044-linux-user-take-RESERVED_VA-into-ac.patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From 63ad8e6ca106981bc18f2d49cf0bed79a7b2cbfe Mon Sep 17 00:00:00 2001
+From e142d9e8baf58cd6f3ae688db188721d9207f8ca Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Thu, 2 Feb 2012 03:14:18 +0100
Subject: [PATCH] linux-user: take RESERVED_VA into account for g2h_valid()
@@ -29,6 +29,3 @@
})
#endif
---
-1.6.0.2
-
++++++ 0045-linux-user-binfmt-support-host-binaries.patch -> 0045-linux-user-binfmt-support-host-bina.patch ++++++
--- /work/SRC/openSUSE:Factory/qemu/0045-linux-user-binfmt-support-host-binaries.patch 2012-02-24 06:54:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.qemu.new/0045-linux-user-binfmt-support-host-bina.patch 2012-03-17 13:23:07.000000000 +0100
@@ -1,4 +1,4 @@
-From 20d9c73417a401a79a3c5ae9aa07d635a06e9519 Mon Sep 17 00:00:00 2001
+From 69a6177e055dcb4978a22e78971ff2d047534afa Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Thu, 2 Feb 2012 18:02:33 +0100
Subject: [PATCH] linux-user: binfmt: support host binaries
@@ -54,6 +54,3 @@
new_argv = (char **)malloc((argc + 2) * sizeof(*new_argv));
if (argc > 3) {
memcpy(&new_argv[4], &argv[3], (argc - 3) * sizeof(*new_argv));
---
-1.6.0.2
-
++++++ 0046-linux-user-fix-fallocate.patch.patch ++++++
From 0a9d9af253f5ff946b86fc7e9d95f1a2a30a34d7 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Mon, 6 Feb 2012 21:37:07 +0100
Subject: [PATCH] linux-user: fix fallocate
Fallocate gets off_t parameters passed in, so we should also read them out
accordingly.
Signed-off-by: Alexander Graf
---
v1 -> v2:
- unbreak 64-bit guests
---
linux-user/syscall.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7a20af4..cbd37f6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8479,7 +8479,12 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#endif /* CONFIG_EVENTFD */
#if defined(CONFIG_FALLOCATE) && defined(TARGET_NR_fallocate)
case TARGET_NR_fallocate:
+#if TARGET_ABI_BITS == 32
+ ret = get_errno(fallocate(arg1, arg2, target_offset64(arg3, arg4),
+ target_offset64(arg5, arg6)));
+#else
ret = get_errno(fallocate(arg1, arg2, arg3, arg4));
+#endif
break;
#endif
#if defined(CONFIG_SYNC_FILE_RANGE)
++++++ 0047-linux-user-resolve-reserved_va-vma-.patch ++++++
From a6664afab4b925f8ae74b6fe20e3634f42690e90 Mon Sep 17 00:00:00 2001
From: Alexander Graf
Date: Sun, 4 Mar 2012 02:41:14 +0100
Subject: [PATCH] linux-user: resolve reserved_va vma downwards
After consulting with Paul Brook, we concluded that it's best to search
the VMA space downwards, so that we don't even get the chance to conflict
with the brk range.
This patch resolves a bunch of allocation conflicts when using -R.
Signed-off-by: Alexander Graf
---
This replaces the other patches I sent out earlier today.
---
linux-user/main.c | 1 +
linux-user/mmap.c | 35 ++++++++++++++++++++++++-----------
linux-user/qemu.h | 1 +
3 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 6a5dfde..d61d731 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3437,6 +3437,7 @@ int main(int argc, char **argv, char **envp)
guest_base = HOST_PAGE_ALIGN((unsigned long)p);
}
qemu_log("Reserved 0x%lx bytes of guest address space\n", reserved_va);
+ mmap_next_start = reserved_va;
}
if (reserved_va || have_guest_base) {
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index e4db455..2620f88 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -212,7 +212,7 @@ static int mmap_frag(abi_ulong real_start,
#else
# define TASK_UNMAPPED_BASE 0x18000000
#endif
-static abi_ulong mmap_next_start = TASK_UNMAPPED_BASE;
+abi_ulong mmap_next_start = TASK_UNMAPPED_BASE;
unsigned long last_brk;
@@ -222,7 +222,7 @@ unsigned long last_brk;
static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size)
{
abi_ulong addr;
- abi_ulong last_addr;
+ abi_ulong end_addr;
int prot;
int looped = 0;
@@ -230,25 +230,38 @@ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size)
return (abi_ulong)-1;
}
- last_addr = start;
- for (addr = start; last_addr + size != addr; addr += qemu_host_page_size) {
- if (last_addr + size >= RESERVED_VA
- || (abi_ulong)(last_addr + size) < last_addr) {
+ size = HOST_PAGE_ALIGN(size);
+ end_addr = start + size;
+ if (end_addr > RESERVED_VA) {
+ end_addr = RESERVED_VA;
+ }
+ addr = end_addr - qemu_host_page_size;
+
+ while (1) {
+ if (addr > end_addr) {
if (looped) {
return (abi_ulong)-1;
}
- last_addr = qemu_host_page_size;
- addr = 0;
+ end_addr = RESERVED_VA;
+ addr = end_addr - qemu_host_page_size;
looped = 1;
continue;
}
prot = page_get_flags(addr);
if (prot) {
- last_addr = addr + qemu_host_page_size;
+ end_addr = addr;
+ }
+ if (addr + size == end_addr) {
+ break;
}
+ addr -= qemu_host_page_size;
+ }
+
+ if (start == mmap_next_start) {
+ mmap_next_start = addr;
}
- mmap_next_start = addr;
- return last_addr;
+
+ return addr;
}
#endif
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index aa06acf..5dc0720 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -254,6 +254,7 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
abi_ulong new_addr);
int target_msync(abi_ulong start, abi_ulong len, int flags);
extern unsigned long last_brk;
+extern abi_ulong mmap_next_start;
void mmap_lock(void);
void mmap_unlock(void);
abi_ulong mmap_find_vma(abi_ulong, abi_ulong);
++++++ qemu.spec.in ++++++
--- /var/tmp/diff_new_pack.37qdAq/_old 2012-03-17 13:23:11.000000000 +0100
+++ /var/tmp/diff_new_pack.37qdAq/_new 2012-03-17 13:23:11.000000000 +0100
@@ -47,8 +47,8 @@
BuildRequires: zlib-devel
%endif
%if 0%{?suse_version} >= 1210
-BuildRequires: libattr-devel-static
BuildRequires: glibc-devel-static
+BuildRequires: libattr-devel-static
BuildRequires: libfdt1-devel
%endif
%if 0%{?suse_version} >= 1140
@@ -60,10 +60,10 @@
BuildRequires: spice-protocol-devel
%endif
%endif
-BuildRequires: libvdeplug3-devel
+BuildRequires: fdupes
BuildRequires: glib2-devel
+BuildRequires: libvdeplug3-devel
BuildRequires: python
-BuildRequires: fdupes
Requires: timezone
Requires: virt-utils
@@ -75,8 +75,8 @@
as PC and PowerMac systems.
%package linux-user
-Group: System/Emulators/PC
Summary: Universal CPU emulator -- Linux User binaries
+Group: System/Emulators/PC
Provides: qemu:%_bindir/qemu-arm
%description linux-user
@@ -87,7 +87,7 @@
as PC and PowerMac systems.
This sub package contains static linked binaries for runnign linux-user
-emulations. This can be used together with the OBS build script to
+emulations. This can be used together with the OBS build script to
run cross architectures builds
%prep
@@ -98,19 +98,19 @@
# build QEMU
mkdir -p dynamic
# build qemu-system
-./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \\
- --interp-prefix=%_datadir/%name/qemu-i386 \\
- --audio-card-list="ac97 es1370 sb16 cs4231a adlib gus" \\
- --audio-drv-list="alsa sdl" --enable-mixemu --enable-vde \\
- --extra-cflags="$QEMU_OPT_FLAGS" --enable-system --disable-linux-user \\
+./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
+ --interp-prefix=%_datadir/%name/qemu-i386 \
+ --audio-card-list="ac97 es1370 sb16 cs4231a adlib gus" \
+ --audio-drv-list="alsa sdl" --enable-mixemu --enable-vde \
+ --extra-cflags="$QEMU_OPT_FLAGS" --enable-system --disable-linux-user \
%if 0%{?suse_version} >= 1130
%ifarch %ix86 x86_64
- --enable-spice
+ --enable-spice
%else
- --disable-spice
+ --disable-spice
%endif
%else
- --disable-spice
+ --disable-spice
%endif
# curl test fails for no reason in build system
echo "CONFIG_CURL=y" >> config-host.mak
@@ -121,11 +121,11 @@
mv */qemu */qemu-* qemu-io dynamic || true
make clean
# build userland emus
-./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \\
- --interp-prefix=%_datadir/%name/qemu-i386 \\
- --enable-linux-user \\
- --disable-system \\
- --static --disable-linux-aio \\
+./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
+ --interp-prefix=%_datadir/%name/qemu-i386 \
+ --enable-linux-user \
+ --disable-system \
+ --static --disable-linux-aio \
--extra-cflags="$QEMU_OPT_FLAGS"
make %{?jobs:-j%jobs} V=1
++++++ update_git.sh ++++++
--- /var/tmp/diff_new_pack.37qdAq/_old 2012-03-17 13:23:11.000000000 +0100
+++ /var/tmp/diff_new_pack.37qdAq/_new 2012-03-17 13:23:11.000000000 +0100
@@ -13,7 +13,7 @@
GIT_TREE=git://repo.or.cz/qemu/agraf.git
GIT_LOCAL_TREE=/suse/agraf/git/qemu
GIT_BRANCH=suse-1.0
-GIT_UPSTREAM_TAG=v1.0
+GIT_UPSTREAM_TAG=v1.0.1
# clean up
if [ -e 0001-* ]; then
@@ -22,23 +22,36 @@
rm -f qemu.spec
# fetch all patches
+rm -rf qemu-tmp
if [ -d "$GIT_LOCAL_TREE" ]; then
git clone -ls $GIT_LOCAL_TREE qemu-tmp
+ cd qemu-tmp
else
git clone $GIT_TREE qemu-tmp
+ cd qemu-tmp
+ git remote add upstream git://git.qemu.org/qemu.git
+ git remote update
fi
-cd qemu-tmp
git checkout $GIT_BRANCH
-git format-patch $GIT_UPSTREAM_TAG -o ..
+git format-patch -N $GIT_UPSTREAM_TAG -o ..
cd ..
rm -rf qemu-tmp
+# cut off file name after 40 bytes, so we work around git version differences
+# while at it, also remove the signature
+for i in 0*; do
+ PATCHNAME=${i%.patch}
+ PATCHNAME=${i:0:40}.patch
+ head -n $(expr $(wc -l $i | cut -d ' ' -f 1) - 3) $i > "$PATCHNAME"
+ rm "$i"
+done
+
# we have all patches as files now - generate the spec file!
-while read line; do
+while IFS= read -r line; do
if [ "$line" = "PATCH_FILES" ]; then
for i in 0*; do
NUM=${i%%-*}
- echo -e "Patch$NUM:\t$i"
+ echo -e "Patch$NUM: $i"
done
elif [ "$line" = "PATCH_EXEC" ]; then
for i in 0*; do
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org