- add update_git.sh to simplify maintenance of the tree

- use -R automatically in linux-user to gain more address space
- drop MAP_32BIT patch (deprecated by the one above)

OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=36
This commit is contained in:
Alexander Graf 2011-12-14 01:35:41 +00:00 committed by Git OBS Bridge
parent 99b00bd87a
commit dbcbe663fd
27 changed files with 403 additions and 252 deletions

View File

@ -1,7 +1,7 @@
From 7e9ebc1d459247bd91f39a7489f1627874731533 Mon Sep 17 00:00:00 2001
From 146dddbec44c48417f776d54f823093b464e596c Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Mon, 28 Nov 2011 17:05:24 +0100
Subject: [PATCH 13/33] XXX linux-user: fake /proc/self/maps even more
Subject: [PATCH 12/33] XXX linux-user: fake /proc/self/maps even more
---
linux-user/syscall.c | 40 +++++++++++++++++++++++++++++++++++++++-

View File

@ -1,124 +0,0 @@
From 52a4e3af8ca37d895bcff2ede1073ebb2cb2dd29 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Sat, 19 Nov 2011 22:57:55 +0100
Subject: [PATCH 12/33] linux-user: Fix 32-on-64 mmap for x86_64
When running a 32 bit guest on a 64 bit host, we can run into trouble while
calling the host's mmap() because it could potentially give us a 64 bit
return value which the guest can't interpret.
There are 2 ways of dealing with this:
1) Only do MAP_FIXED mmap calls and implement our own vm management in QEMU
2) Tell the kernel that we only want mappings in the lower 32 bits
Way 1 is very involved and hard to do. It's been advocated forever now but
nobody sat down to actually implement it.
Way 2 is easy. It's what this patch does. However, it only works on x86_64
because that's the only platform implementing the MAP_32BIT flag. Since most
people are on x86_64 though, I think it's a good enough compromise for now
though
Signed-off-by: Alexander Graf <agraf@suse.de>
---
linux-user/mmap.c | 35 ++++++++++++++++++++++++++---------
1 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 994c02b..7d846f3 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -33,6 +33,22 @@
//#define DEBUG_MMAP
+/*
+ * On x86_64 we can tell mmap that we only want to map within the first 32
+ * bits to not get pointers that potentially exceed the return size. Without
+ * this flag set mmap will eventually break for users when running 32-on-64.
+ *
+ * However, Linux doesn't implement this for non-x86_64 systems. So we have
+ * to safeguard the bit with an empty flag which will be ignore on other
+ * architectures. At least we fixed the "common case" this way :).
+ *
+ * - agraf
+ */
+#if !defined(MAP_32BIT) || !defined(__x86_64__) || (TARGET_LONG_BITS != 32)
+#undef MAP_32BIT
+#define MAP_32BIT 0
+#endif
+
#if defined(CONFIG_USE_NPTL)
static pthread_mutex_t mmap_mutex = PTHREAD_MUTEX_INITIALIZER;
static __thread int mmap_lock_count;
@@ -169,7 +185,7 @@ static int mmap_frag(abi_ulong real_start,
if (prot1 == 0) {
/* no page was there, so we allocate one */
void *p = mmap(host_start, qemu_host_page_size, prot,
- flags | MAP_ANONYMOUS, -1, 0);
+ flags | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
if (p == MAP_FAILED)
return -1;
prot1 = prot;
@@ -292,7 +308,7 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
* - shmat() with SHM_REMAP flag
*/
ptr = mmap(g2h(addr), size, PROT_NONE,
- MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0);
+ MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE|MAP_32BIT, -1, 0);
/* ENOMEM, if host address space has no memory */
if (ptr == MAP_FAILED) {
@@ -454,14 +470,15 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
especially important if qemu_host_page_size >
qemu_real_host_page_size */
p = mmap(g2h(mmap_start),
- host_len, prot, flags | MAP_FIXED | MAP_ANONYMOUS, -1, 0);
+ host_len, prot, flags | MAP_FIXED | MAP_ANONYMOUS | MAP_32BIT,
+ -1, 0);
if (p == MAP_FAILED)
goto fail;
/* update start so that it points to the file position at 'offset' */
host_start = (unsigned long)p;
if (!(flags & MAP_ANONYMOUS)) {
p = mmap(g2h(mmap_start), len, prot,
- flags | MAP_FIXED, fd, host_offset);
+ flags | MAP_FIXED | MAP_32BIT, fd, host_offset);
host_start += offset - host_offset;
}
start = h2g(host_start);
@@ -495,8 +512,8 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
goto fail;
}
retaddr = target_mmap(start, len, prot | PROT_WRITE,
- MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS,
- -1, 0);
+ MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS |
+ MAP_32BIT, -1, 0);
if (retaddr == -1)
goto fail;
if (pread(fd, g2h(start), len, offset) == -1)
@@ -547,7 +564,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
else
offset1 = offset + real_start - start;
p = mmap(g2h(real_start), real_end - real_start,
- prot, flags, fd, offset1);
+ prot, flags | MAP_32BIT, fd, offset1);
if (p == MAP_FAILED)
goto fail;
}
@@ -603,8 +620,8 @@ static void mmap_reserve(abi_ulong start, abi_ulong size)
}
if (real_start != real_end) {
mmap(g2h(real_start), real_end - real_start, PROT_NONE,
- MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE,
- -1, 0);
+ MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE |
+ MAP_32BIT, -1, 0);
}
}
--
1.6.0.2

View File

@ -1,7 +1,7 @@
From e45be60a8f2e6148b40f358922a4f472fa0b2f8b Mon Sep 17 00:00:00 2001
From 79a59902304b66e9270d11901a554e5b22042d6e Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Thu, 1 Dec 2011 19:00:01 +0100
Subject: [PATCH 14/33] XXX work around SA_RESTART race with boehm-gc (ARM only)
Subject: [PATCH 13/33] XXX work around SA_RESTART race with boehm-gc (ARM only)
---
linux-user/main.c | 25 ++++++++-----

View File

@ -1,7 +1,7 @@
From bf5ca70551e87671e84a81d103db32ed6918a109 Mon Sep 17 00:00:00 2001
From e534a77a0e1f880d0f74514ac50de5de3dd4811a Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Mon, 5 Dec 2011 23:37:52 +0100
Subject: [PATCH 15/33] XXX move qemu binary lower in address space so we have space for guest stuff
Subject: [PATCH 14/33] XXX move qemu binary lower in address space so we have space for guest stuff
---
x86_64.ld | 2 +-

View File

@ -1,7 +1,7 @@
From a8631179ca4a90670923fd9acce05b0e109eae01 Mon Sep 17 00:00:00 2001
From edda5e8f49b7857379733d652d6b259488bd7b70 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 6 Dec 2011 00:39:50 +0100
Subject: [PATCH 16/33] linux-user: map lower in address space
Subject: [PATCH 15/33] linux-user: map lower in address space
While trying to compile Java I can into situations where there was simply
no virtual address space left for a 32-bit guest to take. For example when
@ -17,10 +17,10 @@ Signed-off-by: Alexander Graf <agraf@suse.de>
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 7d846f3..8453c0d 100644
index 994c02b..505254f 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -226,7 +226,7 @@ static int mmap_frag(abi_ulong real_start,
@@ -210,7 +210,7 @@ static int mmap_frag(abi_ulong real_start,
/* Cygwin doesn't have a whole lot of address space. */
# define TASK_UNMAPPED_BASE 0x18000000
#else

View File

@ -1,7 +1,7 @@
From f2bd85fd0ebe444677f22e28ab12b966937207e2 Mon Sep 17 00:00:00 2001
From 3580a90d40df10410b7268f89aae58ce05dd2bed Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Thu, 8 Dec 2011 23:19:32 +0100
Subject: [PATCH 17/33] XXX fake /proc/self/maps: also fclose real file
Subject: [PATCH 16/33] XXX fake /proc/self/maps: also fclose real file
---
linux-user/syscall.c | 1 +

View File

@ -1,7 +1,7 @@
From f8d469421d92e3abe854e565bdf4ee62b86846b6 Mon Sep 17 00:00:00 2001
From 91f12fe177833e0112cd7f7cf5781b26377667a5 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Sat, 10 Dec 2011 00:03:56 +0100
Subject: [PATCH 18/33] XXX map qemu higher again so we have space for brk
Subject: [PATCH 17/33] XXX map qemu higher again so we have space for brk
---
linux-user/mmap.c | 2 +-
@ -9,10 +9,10 @@ Subject: [PATCH 18/33] XXX map qemu higher again so we have space for brk
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 8453c0d..1e8cc38 100644
index 505254f..46e8bf8 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -226,7 +226,7 @@ static int mmap_frag(abi_ulong real_start,
@@ -210,7 +210,7 @@ static int mmap_frag(abi_ulong real_start,
/* Cygwin doesn't have a whole lot of address space. */
# define TASK_UNMAPPED_BASE 0x18000000
#else

View File

@ -1,7 +1,7 @@
From 4d016e72b0d6b81115100217614aba990fcb505e Mon Sep 17 00:00:00 2001
From 434801ec78b031170eb0762302b52062e6c27d0e Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:18:44 +0200
Subject: [PATCH 19/33] qemu-0.9.0.cvs-binfmt
Subject: [PATCH 18/33] qemu-0.9.0.cvs-binfmt
Fixes binfmt_misc setup script:
- x86_64 is i386-compatible

View File

@ -1,7 +1,7 @@
From 923b1531de681940198e2c1d28c735da1efe29e2 Mon Sep 17 00:00:00 2001
From b41a72d0c29f97610dfdd5573b8be383823bc88f Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 14 Apr 2009 16:20:50 +0200
Subject: [PATCH 20/33] qemu-cvs-alsa_bitfield
Subject: [PATCH 19/33] qemu-cvs-alsa_bitfield
Implements TYPE_INTBITFIELD partially. (required for ALSA support)

View File

@ -1,7 +1,7 @@
From b732ecf6a05f837368ab6c2413b206e0e2715e73 Mon Sep 17 00:00:00 2001
From 33f065c217c1921759df12467954eb4638f84a72 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 14 Apr 2009 16:23:27 +0200
Subject: [PATCH 21/33] qemu-cvs-alsa_ioctl
Subject: [PATCH 20/33] qemu-cvs-alsa_ioctl
Implements ALSA ioctls on PPC hosts.

View File

@ -1,7 +1,7 @@
From 3ea2fa480d730990c427d4a2924168f2b6f42dba Mon Sep 17 00:00:00 2001
From 8b67814c8ab4645ddd43664b1092e78ea6a743d8 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 14 Apr 2009 16:24:15 +0200
Subject: [PATCH 22/33] qemu-cvs-alsa_mmap
Subject: [PATCH 21/33] qemu-cvs-alsa_mmap
Hack to prevent ALSA from using mmap() interface to simplify emulation.
@ -12,10 +12,10 @@ Signed-off-by: Ulrich Hecht <uli@suse.de>
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 1e8cc38..1e5ba51 100644
index 46e8bf8..e4db455 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -380,6 +380,9 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
@@ -364,6 +364,9 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
}
}
@ -25,7 +25,7 @@ index 1e8cc38..1e5ba51 100644
/* 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)
@@ -415,6 +418,17 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
@@ -399,6 +402,17 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
}
#endif

View File

@ -1,7 +1,7 @@
From 2c1ea2bd2c59d70ca63c1d42230588b4bdeed6fd Mon Sep 17 00:00:00 2001
From c0ce4deb6c2ac843e337b7252fbefc190d625ca5 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:25:41 +0200
Subject: [PATCH 23/33] qemu-cvs-gettimeofday
Subject: [PATCH 22/33] qemu-cvs-gettimeofday
No clue what this is for.
---

View File

@ -1,7 +1,7 @@
From 6d6663f77131b1546e55b5b6548d63f7496d6988 Mon Sep 17 00:00:00 2001
From 6232258009a4735d7f4f53b5589e7ebd90a9885d Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 14 Apr 2009 16:26:33 +0200
Subject: [PATCH 24/33] qemu-cvs-ioctl_debug
Subject: [PATCH 23/33] qemu-cvs-ioctl_debug
Extends unsupported ioctl debug output.

View File

@ -1,7 +1,7 @@
From 07d1e1618bb9632bad8d4b6928067711781df1d9 Mon Sep 17 00:00:00 2001
From 926d75fa4b4b5d95d4b0111e3e0af4d983a9d46b Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 14 Apr 2009 16:27:36 +0200
Subject: [PATCH 25/33] qemu-cvs-ioctl_nodirection
Subject: [PATCH 24/33] 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

View File

@ -1,7 +1,7 @@
From a4eebec448c7cd69fcc589912779fc7df6fca4ea Mon Sep 17 00:00:00 2001
From 90b3180677c5615bafc9a1f8252fbc4af1dc1ae4 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:37:42 +0200
Subject: [PATCH 26/33] qemu-img-vmdk-scsi
Subject: [PATCH 25/33] qemu-img-vmdk-scsi
Support creation of SCSI VMDK images in qemu-img.

View File

@ -1,7 +1,7 @@
From 9b3ae5bebe9635991156b6e87f61ca204b204345 Mon Sep 17 00:00:00 2001
From 7e6479e0d45e45e888cb79759fd44d6c14be19f4 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:38:20 +0200
Subject: [PATCH 27/33] qemu-nonvoid_return
Subject: [PATCH 26/33] qemu-nonvoid_return
Squelches GCC warnings about undefined return values.

View File

@ -1,7 +1,7 @@
From 18b54324078105bd5d23241026bdbc92f1fe22b6 Mon Sep 17 00:00:00 2001
From 164cf539481164978d9fa6ad69eb20cda7dc0e12 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Wed, 25 Aug 2010 14:23:43 +0200
Subject: [PATCH 28/33] fix mipsn32*-linux-user builds
Subject: [PATCH 27/33] fix mipsn32*-linux-user builds
Signed-off-by: Ulrich Hecht <uli@suse.de>
---

View File

@ -1,7 +1,7 @@
From b3f9ab3168e50f1dec4835c0df01869ecf848267 Mon Sep 17 00:00:00 2001
From 15d6a32b38abc6c2f8143ebccfcdd05d204f0fcd Mon Sep 17 00:00:00 2001
From: Benjamin <mlspirat42@gmail.com>
Date: Sat, 8 Oct 2011 07:31:33 +0000
Subject: [PATCH 29/33] Integrating Dynamips and GNS3 UDP tunnels (Patches)
Subject: [PATCH 28/33] Integrating Dynamips and GNS3 UDP tunnels (Patches)
On 10/07/11 10:35, Jan Kiszka wrote:
>

View File

@ -1,7 +1,7 @@
From 42ca714385588477429c8ac77c810b310854494b Mon Sep 17 00:00:00 2001
From 47ff084e9af71b217e6f842f720d12fe9e12f2fd Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Fri, 30 Sep 2011 19:40:36 +0200
Subject: [PATCH 30/33] linux-user: add binfmt wrapper for argv[0] handling
Subject: [PATCH 29/33] linux-user: add binfmt wrapper for argv[0] handling
When using qemu's linux-user binaries through binfmt, argv[0] gets lost
along the execution because qemu only gets passed in the full file name

View File

@ -1,7 +1,7 @@
From a9d80d519385d7c659173a7b12461a2099738c02 Mon Sep 17 00:00:00 2001
From 269d801698bf7640dd325cfb4b195c4a207a07ee Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Sun, 11 Dec 2011 01:19:24 +0100
Subject: [PATCH 31/33] linux-user: Ignore timer_create syscall
Subject: [PATCH 30/33] linux-user: Ignore timer_create syscall
We don't implement the timer_create syscall, but shouting out loud
about it breaks some %check tests in OBS, so better ignore it silently.

View File

@ -1,7 +1,7 @@
From 0006edd6319648e5a5eac86b6c7c82d67c4b5cb1 Mon Sep 17 00:00:00 2001
From 36f403e159ecb5fcaeda5346c2df762cc904a91b Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Sun, 11 Dec 2011 01:21:51 +0100
Subject: [PATCH 32/33] linux-user: be silent about capget failures
Subject: [PATCH 31/33] linux-user: be silent about capget failures
Complaining about capget doesn't buy us anything, but makes %check
fail in certain builds. So better not complain about its missing

View File

@ -1,7 +1,7 @@
From 1dd66fa6bb6c616b91626a51d2dff02692e83fe5 Mon Sep 17 00:00:00 2001
From 4fddaa4befeb3ddb1c14d9b2c882474ba4166940 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Mon, 12 Dec 2011 23:16:43 +0100
Subject: [PATCH 33/33] PPC: Fix linker scripts on ppc hosts
Subject: [PATCH 32/33] PPC: Fix linker scripts on ppc hosts
When compiling qemu statically with multilib on PPC, we hit the
same issue that commit 845f2c2812d9ed24b36c02a3d06ee83aeafe8b49

View File

@ -0,0 +1,44 @@
From ac233b323ad7e498c665e8c74df7e44de4a542c0 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Wed, 14 Dec 2011 00:33:28 +0100
Subject: [PATCH 33/33] linux-user: reserve 4GB of vmem for 32-on-64
When running 32-on-64 bit guests, we should always reserve as much
virtual memory as we possibly can for the guest process, so it can
never overlap with QEMU address space.
Fortunately we already have the infrastructure for that. All that's
missing is some sane default value to also make use of it!
Signed-off-by: Alexander Graf <agraf@suse.de>
---
linux-user/main.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 788ff98..3ffee40 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -48,8 +48,19 @@ unsigned long mmap_min_addr;
#if defined(CONFIG_USE_GUEST_BASE)
unsigned long guest_base;
int have_guest_base;
+#if (TARGET_LONG_BITS == 32) && (HOST_LONG_BITS == 64)
+/*
+ * When running 32-on-64 we should make sure we can fit all of the possible
+ * guest address space into a contiguous chunk of virtual host memory.
+ *
+ * This way we will never overlap with our own libraries or binaries or stack
+ * or anything else that QEMU maps.
+ */
+unsigned long reserved_va = 0xf7000000;
+#else
unsigned long reserved_va;
#endif
+#endif
static void usage(void);
extern int use_stopflag;
--
1.6.0.2

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Dec 14 00:16:28 UTC 2011 - agraf@suse.com
- add update_git.sh to simplify maintenance of the tree
- use -R automatically in linux-user to gain more address space
- drop MAP_32BIT patch (deprecated by the one above)
-------------------------------------------------------------------
Mon Dec 12 22:05:24 CET 2011 - agraf@suse.com

149
qemu.spec
View File

@ -26,39 +26,39 @@ Summary: Universal CPU emulator
Version: 1.0
Release: 0
Source: %name-%version.tar.bz2
Patch1: 0001-Handle-CPU-interrupts-by-inline-checking-of-a-flag.patch
Patch2: 0002-linux-user-fix-QEMU_STRACE-1-segfault.patch
Patch3: 0003-linux-user-save-auxv-length.patch
Patch4: 0004-linux-user-add-open-hijack-infrastructure.patch
Patch5: 0005-linux-user-fake-proc-self-maps.patch
Patch6: 0006-linux-user-fake-proc-self-stat.patch
Patch7: 0007-linux-user-fake-proc-self-auxv.patch
Patch8: 0008-XXX-dont-dump-core-on-sigabort.patch
Patch9: 0009-linux-user-fix-wait-syscall-status-returns.patch
Patch10: 0010-Revert-linux-user-fix-wait-syscall-status-returns.patch
Patch11: 0011-linux-user-fix-wait-syscall-status-returns.patch
Patch12: 0012-linux-user-Fix-32-on-64-mmap-for-x86_64.patch
Patch13: 0013-XXX-linux-user-fake-proc-self-maps-even-more.patch
Patch14: 0014-XXX-work-around-SA_RESTART-race-with-boehm-gc-ARM-o.patch
Patch15: 0015-XXX-move-qemu-binary-lower-in-address-space-so-we-ha.patch
Patch16: 0016-linux-user-map-lower-in-address-space.patch
Patch17: 0017-XXX-fake-proc-self-maps-also-fclose-real-file.patch
Patch18: 0018-XXX-map-qemu-higher-again-so-we-have-space-for-brk.patch
Patch19: 0019-qemu-0.9.0.cvs-binfmt.patch
Patch20: 0020-qemu-cvs-alsa_bitfield.patch
Patch21: 0021-qemu-cvs-alsa_ioctl.patch
Patch22: 0022-qemu-cvs-alsa_mmap.patch
Patch23: 0023-qemu-cvs-gettimeofday.patch
Patch24: 0024-qemu-cvs-ioctl_debug.patch
Patch25: 0025-qemu-cvs-ioctl_nodirection.patch
Patch26: 0026-qemu-img-vmdk-scsi.patch
Patch27: 0027-qemu-nonvoid_return.patch
Patch28: 0028-fix-mipsn32-linux-user-builds.patch
Patch29: 0029-Integrating-Dynamips-and-GNS3-UDP-tunnels-Patches.patch
Patch30: 0030-linux-user-add-binfmt-wrapper-for-argv-0-handling.patch
Patch31: 0031-linux-user-Ignore-timer_create-syscall.patch
Patch32: 0032-linux-user-be-silent-about-capget-failures.patch
Patch33: 0033-PPC-Fix-linker-scripts-on-ppc-hosts.patch
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-PPC-Fix-linker-scripts-on-ppc-hosts.patch
Patch0033: 0033-linux-user-reserve-4GB-of-vmem-for-32-on-64.patch
# this is to make lint happy
Source300: rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -113,54 +113,50 @@ system. It currently emulates x86, ARM, PowerPC and SPARC CPUs as well
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
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%setup -q
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
%patch0005 -p1
%patch0006 -p1
%patch0007 -p1
%patch0008 -p1
%patch0009 -p1
%patch0010 -p1
%patch0011 -p1
%patch0012 -p1
%patch0013 -p1
%patch0014 -p1
%patch0015 -p1
%patch0016 -p1
%patch0017 -p1
%patch0018 -p1
%patch0019 -p1
%patch0020 -p1
%patch0021 -p1
%patch0022 -p1
%patch0023 -p1
%patch0024 -p1
%patch0025 -p1
%patch0026 -p1
%patch0027 -p1
%patch0028 -p1
%patch0029 -p1
%patch0030 -p1
%patch0031 -p1
%patch0032 -p1
%patch0033 -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
./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
# curl test fails for no reason in build system
echo "CONFIG_CURL=y" >> config-host.mak
echo "CURL_LIBS=-lcurl" >> config-host.mak
@ -170,12 +166,7 @@ make qemu-img V=1
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 \
--extra-cflags="$QEMU_OPT_FLAGS"
./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
%install

180
qemu.spec.in Normal file
View File

@ -0,0 +1,180 @@
#
# spec file for package qemu
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: qemu
Url: http://fabrice.bellard.free.fr/qemu/
License: BSD3c(or similar) ; GPLv2+ ; LGPLv2.1+ ; MIT License (or similar)
Group: System/Emulators/PC
Summary: Universal CPU emulator
Version: 1.0
Release: 0
Source: %name-%version.tar.bz2
PATCH_FILES
# this is to make lint happy
Source300: rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: SDL-devel
BuildRequires: bison
BuildRequires: bluez-devel
BuildRequires: curl-devel
BuildRequires: cyrus-sasl-devel
BuildRequires: e2fsprogs-devel
BuildRequires: libaio
BuildRequires: libaio-devel
BuildRequires: libattr-devel
BuildRequires: libgnutls-devel
BuildRequires: libpcap-devel
BuildRequires: ncurses-devel
%if 0%{?suse_version} >= 1120
BuildRequires: zlib-devel-static
%else
BuildRequires: zlib-devel
%endif
%if 0%{?suse_version} >= 1210
BuildRequires: libattr-devel-static
BuildRequires: glibc-devel-static
BuildRequires: libfdt1-devel
%endif
%if 0%{?suse_version} >= 1140
BuildRequires: glib2-devel-static
%endif
BuildRequires: libvdeplug3-devel
BuildRequires: glib2-devel
BuildRequires: python
BuildRequires: fdupes
Requires: timezone virt-utils
%description
QEMU is an extremely well-performing CPU emulator that allows you to
choose between simulating an entire system and running userspace
binaries for different architectures under your native operating
system. It currently emulates x86, ARM, PowerPC and SPARC CPUs as well
as PC and PowerMac systems.
%package linux-user
Group: System/Emulators/PC
Summary: Universal CPU emulator -- Linux User binaries
Provides: qemu:%_bindir/qemu-arm
%description linux-user
QEMU is an extremely well-performing CPU emulator that allows you to
choose between simulating an entire system and running userspace
binaries for different architectures under your native operating
system. It currently emulates x86, ARM, PowerPC and SPARC CPUs as well
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
run cross architectures builds
%prep
%setup -q
PATCH_EXEC
%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
# curl test fails for no reason in build system
echo "CONFIG_CURL=y" >> config-host.mak
echo "CURL_LIBS=-lcurl" >> config-host.mak
echo "#define CONFIG_CURL 1" >> config-host.h
make %{?jobs:-j%jobs} V=1
make qemu-img V=1
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 \
--extra-cflags="$QEMU_OPT_FLAGS"
make %{?jobs:-j%jobs} V=1
%install
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT/%_mandir/man1/qemu-img.1
rm -f $RPM_BUILD_ROOT/%_mandir/man8/qemu-nbd.8
rm -fr $RPM_BUILD_ROOT/%_datadir/doc
# otherwise we get: install: omitting directory `dynamic/qemu-palcode'
rm -fr dynamic/qemu-palcode
install -m 755 */qemu-*[^.]? $RPM_BUILD_ROOT/%_bindir
install -d -m 755 $RPM_BUILD_ROOT/%_sbindir
install -m 755 dynamic/qemu-binfmt-conf.sh $RPM_BUILD_ROOT/%_sbindir
%ifnarch %ix86 x86_64
ln -sf ../../../emul/ia32-linux $RPM_BUILD_ROOT/usr/share/qemu/qemu-i386
%endif
%ifnarch ia64
mkdir -p $RPM_BUILD_ROOT/emul/ia32-linux
%endif
%fdupes -s $RPM_BUILD_ROOT
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-, root, root)
%doc COPYING COPYING.LIB Changelog README TODO VERSION qemu-doc.html qemu-tech.html
%_bindir/qemu-io
%_bindir/qemu-system-*
%doc %_mandir/man[18]/qemu*.[18].gz
%_datadir/%name
%ifnarch %ix86 x86_64 ia64
%dir /emul/ia32-linux
%endif
%dir %_sysconfdir/%name
%config %_sysconfdir/%name/target-x86_64.conf
%files linux-user
%defattr(-, root, root)
%_bindir/qemu-alpha
%_bindir/qemu-arm
%_bindir/qemu-armeb
%_bindir/qemu-cris
%_bindir/qemu-i386
%_bindir/qemu-m68k
%_bindir/qemu-microblaze
%_bindir/qemu-microblazeel
%_bindir/qemu-mips
%_bindir/qemu-mipsel
%_bindir/qemu-mipsn32
%_bindir/qemu-mipsn32el
%_bindir/qemu-ppc64abi32
%_bindir/qemu-ppc64
%_bindir/qemu-ppc
%_bindir/qemu-s390x
%_bindir/qemu-sh4
%_bindir/qemu-sh4eb
%_bindir/qemu-sparc32plus
%_bindir/qemu-sparc64
%_bindir/qemu-sparc
%_bindir/qemu-unicore32
%_bindir/qemu-x86_64
%_bindir/qemu-*-binfmt
%_bindir/qemu-binfmt-conf.sh
%_sbindir/qemu-binfmt-conf.sh
%changelog

53
update_git.sh Normal file
View File

@ -0,0 +1,53 @@
#!/bin/bash -e
#
# While updating versions of QEMU to 1.0 I got fed up with the
# quilt workflow and just put up a git tree that contains all
# the commits on top of a stable tarball.
#
# When updating this package, just either update the git tree
# below (use rebase!) or change the tree path and use your own
#
# That way we can easily rebase against the next stable release
# when it comes.
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
# clean up
if [ -e 0001-* ]; then
osc rm --force 0*
fi
rm -f qemu.spec
# fetch all patches
if [ -d "$GIT_LOCAL_TREE" ]; then
git clone -ls $GIT_LOCAL_TREE qemu-tmp
else
git clone $GIT_TREE qemu-tmp
fi
cd qemu-tmp
git checkout $GIT_BRANCH
git format-patch -n $GIT_UPSTREAM_TAG -o ..
cd ..
rm -rf qemu-tmp
# we have all patches as files now - generate the spec file!
while read line; do
if [ "$line" = "PATCH_FILES" ]; then
for i in 0*; do
NUM=${i%%-*}
echo "Patch$NUM: $i"
done
elif [ "$line" = "PATCH_EXEC" ]; then
for i in 0*; do
NUM=${i%%-*}
echo "%patch$NUM -p1"
done
else
echo "$line"
fi
done < qemu.spec.in > qemu.spec
osc add 0*