SHA256
1
0
forked from pool/qemu

Accepting request 60601 from home:uli_suse:branches:Virtualization

OBS-URL: https://build.opensuse.org/request/show/60601
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=7
This commit is contained in:
Cristian Rodríguez 2011-02-16 19:30:51 +00:00 committed by Git OBS Bridge
parent ac5014fe23
commit eb5624499a
40 changed files with 3351 additions and 5787 deletions

View File

@ -1,7 +1,7 @@
From 827af866df5674253ef563bd244277d31a93ba32 Mon Sep 17 00:00:00 2001
From 4af9300d36f0975213b0fb967131629ad6b4c550 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:17:39 +0200
Subject: [PATCH 01/33] qemu-0.7.0-amd64
Subject: [PATCH 01/17] qemu-0.7.0-amd64
No clue why this is necessary or useful, nothing found in any changelogs.
---
@ -9,10 +9,10 @@ No clue why this is necessary or useful, nothing found in any changelogs.
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/x86_64.ld b/x86_64.ld
index 878dafb..142e641 100644
index 46d8d4d..cce0a17 100644
--- a/x86_64.ld
+++ b/x86_64.ld
@@ -59,8 +59,6 @@ SECTIONS
@@ -70,8 +70,6 @@ SECTIONS
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
.rodata1 : { *(.rodata1) }
.eh_frame_hdr : { *(.eh_frame_hdr) }
@ -21,7 +21,7 @@ index 878dafb..142e641 100644
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
. = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);
@@ -86,8 +84,8 @@ SECTIONS
@@ -97,8 +95,8 @@ SECTIONS
.data1 : { *(.data1) }
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
@ -33,5 +33,5 @@ index 878dafb..142e641 100644
.ctors :
{
--
1.6.2.1
1.7.1

View File

@ -1,7 +1,7 @@
From 496da9d6ffd6f42570cbed52adba37fea769d2ab Mon Sep 17 00:00:00 2001
From 8f16efecc00d3ee4615dcd2d5381b23df4465698 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:18:44 +0200
Subject: [PATCH 02/33] qemu-0.9.0.cvs-binfmt
Subject: [PATCH 02/17] qemu-0.9.0.cvs-binfmt
Fixes binfmt_misc setup script:
- x86_64 is i386-compatible
@ -10,28 +10,15 @@ Fixes binfmt_misc setup script:
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
qemu-binfmt-conf.sh | 33 ++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
scripts/qemu-binfmt-conf.sh | 35 +++++++++++++++++++----------------
1 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/qemu-binfmt-conf.sh b/qemu-binfmt-conf.sh
index 941f0cf..67d6728 100644
--- a/qemu-binfmt-conf.sh
+++ b/qemu-binfmt-conf.sh
@@ -12,7 +12,7 @@ fi
# probe cpu type
cpu=`uname -m`
case "$cpu" in
- i386|i486|i586|i686|i86pc|BePC)
+ i386|i486|i586|i686|i86pc|BePC|x86_64)
cpu="i386"
;;
m68k)
@@ -24,36 +24,39 @@ case "$cpu" in
"Power Macintosh"|ppc|ppc64)
cpu="ppc"
;;
- armv4l)
+ armv[4-9]*l)
diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
index c50beb7..335ab05 100644
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -27,40 +27,43 @@ case "$cpu" in
armv[4-9]*)
cpu="arm"
;;
+ sparc*)
@ -45,6 +32,10 @@ index 941f0cf..67d6728 100644
- 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
@ -80,6 +71,12 @@ index 941f0cf..67d6728 100644
+ 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
fi
--
1.6.2.1
1.7.1

View File

@ -1,7 +1,7 @@
From 4675ae349f0d4e489f1298f1cbf246dfa7124d79 Mon Sep 17 00:00:00 2001
From 8a88b86cc9a3ad0bb6da52fb0f938fe5a085c027 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:20:50 +0200
Subject: [PATCH 03/33] qemu-cvs-alsa_bitfield
Subject: [PATCH 03/17] qemu-cvs-alsa_bitfield
Implements TYPE_INTBITFIELD partially. (required for ALSA support)
@ -79,5 +79,5 @@ index 109c541..55890f3 100644
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
--
1.6.2.1
1.7.1

View File

@ -1,7 +1,7 @@
From ab27a247cbab3c5f780e14a3ad822a5e12955d8f Mon Sep 17 00:00:00 2001
From c5b614579d85877cfa39dfea8989040e43f9ba56 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:23:27 +0200
Subject: [PATCH 04/33] qemu-cvs-alsa_ioctl
Subject: [PATCH 04/17] qemu-cvs-alsa_ioctl
Implements ALSA ioctls on PPC hosts.
@ -19,10 +19,10 @@ Signed-off-by: Ulrich Hecht <uli@suse.de>
create mode 100644 linux-user/syscall_types_alsa.h
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 685cc71..aee5a88 100644
index acff781..13ff54f 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -301,6 +301,11 @@
@@ -308,6 +308,11 @@
IOCTL(VFAT_IOCTL_READDIR_BOTH, IOC_R, MK_PTR(MK_ARRAY(MK_STRUCT(STRUCT_dirent), 2)))
IOCTL(VFAT_IOCTL_READDIR_SHORT, IOC_R, MK_PTR(MK_ARRAY(MK_STRUCT(STRUCT_dirent), 2)))
@ -2254,16 +2254,16 @@ index 0000000..3de8614
+ unsigned char *code;
+};
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index ac5dbc5..78c6488 100644
index d02a9bf..be612ce 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2138,3 +2138,4 @@ struct target_mq_attr {
@@ -2205,3 +2205,4 @@ struct target_mq_attr {
#define FUTEX_CLOCK_REALTIME 256
#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
+#include "ioctls_alsa_structs.h"
diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h
index d3f3df9..1fa48d0 100644
index 0e67cd8..635fdef 100644
--- a/linux-user/syscall_types.h
+++ b/linux-user/syscall_types.h
@@ -80,6 +80,11 @@ STRUCT(count_info,
@ -3622,5 +3622,5 @@ index 0000000..6dbc964
+)
+
--
1.6.2.1
1.7.1

View File

@ -1,7 +1,7 @@
From ed5099e1cc655c77344863855abe5c20c1b6eb0b Mon Sep 17 00:00:00 2001
From 3848cba4ed22ebef70e59cbb542e71a37fe74d1d Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:24:15 +0200
Subject: [PATCH 05/33] qemu-cvs-alsa_mmap
Subject: [PATCH 05/17] qemu-cvs-alsa_mmap
Hack to prevent ALSA from using mmap() interface to simplify emulation.
@ -11,11 +11,11 @@ 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 e05caa0..c33e5fe 100644
index abf21f6..e18c228 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -321,6 +321,9 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
return addr;
@@ -360,6 +360,9 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
}
}
+#define SNDRV_PCM_MMAP_OFFSET_STATUS 0x80000000
@ -24,7 +24,7 @@ index e05caa0..c33e5fe 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)
@@ -356,6 +359,17 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
@@ -395,6 +398,17 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
}
#endif
@ -43,5 +43,5 @@ index e05caa0..c33e5fe 100644
errno = EINVAL;
goto fail;
--
1.6.2.1
1.7.1

View File

@ -1,7 +1,7 @@
From 69aca2fcdf61fbd4a5c0123a7e64cf99862076ff Mon Sep 17 00:00:00 2001
From da6cdca6cdbfccb4936f5df5e297a87fe1e4baa8 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:25:41 +0200
Subject: [PATCH 06/33] qemu-cvs-gettimeofday
Subject: [PATCH 06/17] qemu-cvs-gettimeofday
No clue what this is for.
---
@ -9,10 +9,10 @@ No clue what this is for.
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7b57323..70d3b2d 100644
index 499c4d7..92f2aa6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5063,6 +5063,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
@@ -5399,6 +5399,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_gettimeofday:
{
struct timeval tv;
@ -22,5 +22,5 @@ index 7b57323..70d3b2d 100644
if (!is_error(ret)) {
if (copy_to_user_timeval(arg1, &tv))
--
1.6.2.1
1.7.1

View File

@ -1,7 +1,7 @@
From 4ec256fd6d555ec61f0a1bd530ff66860937b232 Mon Sep 17 00:00:00 2001
From 1a883714ac7e953bab2bbdeba651d0696f49dd81 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:26:33 +0200
Subject: [PATCH 07/33] qemu-cvs-ioctl_debug
Subject: [PATCH 07/17] qemu-cvs-ioctl_debug
Extends unsupported ioctl debug output.
@ -11,10 +11,10 @@ Signed-off-by: Ulrich Hecht <uli@suse.de>
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 70d3b2d..ce5283c 100644
index 92f2aa6..04f77ef 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2890,7 +2890,12 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)
@@ -3100,7 +3100,12 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)
ie = ioctl_entries;
for(;;) {
if (ie->target_cmd == 0) {
@ -29,5 +29,5 @@ index 70d3b2d..ce5283c 100644
}
if (ie->target_cmd == cmd)
--
1.6.2.1
1.7.1

View File

@ -1,7 +1,7 @@
From 5a0ba0e95920618c8ae38f4842d9dd56943f4343 Mon Sep 17 00:00:00 2001
From d03d586aabc9000cabc56de7e327c5b5640f3179 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:27:36 +0200
Subject: [PATCH 08/33] qemu-cvs-ioctl_nodirection
Subject: [PATCH 08/17] 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
@ -14,10 +14,10 @@ Signed-off-by: Ulrich Hecht <uli@suse.de>
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ce5283c..b7230c7 100644
index 04f77ef..b51634b 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2920,6 +2920,11 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)
@@ -3134,6 +3134,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) {
@ -29,7 +29,7 @@ index ce5283c..b7230c7 100644
case IOC_R:
ret = get_errno(ioctl(fd, ie->host_cmd, buf_temp));
if (!is_error(ret)) {
@@ -2938,6 +2943,7 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)
@@ -3152,6 +3157,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;
@ -38,5 +38,5 @@ index ce5283c..b7230c7 100644
case IOC_RW:
argptr = lock_user(VERIFY_READ, arg, target_size, 1);
--
1.6.2.1
1.7.1

View File

@ -1,235 +0,0 @@
From bc376b5848fef44ed9a56ec2e0e9bfd22aa1b24d Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:28:45 +0200
Subject: [PATCH 09/33] qemu-cvs-newpath
fast path mangling patch by Kirill A. Shutemov
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
linux-user/path.c | 190 ++++++++++++++++-------------------------------------
1 files changed, 56 insertions(+), 134 deletions(-)
diff --git a/linux-user/path.c b/linux-user/path.c
index 06b1f5f..aedff50 100644
--- a/linux-user/path.c
+++ b/linux-user/path.c
@@ -1,159 +1,81 @@
/* Code to mangle pathnames into those matching a given prefix.
eg. open("/lib/foo.so") => open("/usr/gnemul/i386-linux/lib/foo.so");
-
- The assumption is that this area does not change.
*/
#include <sys/types.h>
-#include <dirent.h>
+#include <sys/stat.h>
#include <unistd.h>
-#include <stdlib.h>
#include <string.h>
-#include <errno.h>
#include <stdio.h>
#include "qemu.h"
-struct pathelem
-{
- /* Name of this, eg. lib */
- char *name;
- /* Full path name, eg. /usr/gnemul/x86-linux/lib. */
- char *pathname;
- struct pathelem *parent;
- /* Children */
- unsigned int num_entries;
- struct pathelem *entries[0];
+struct path_list_head {
+ struct path_list_head *next;
+ char* path;
};
-static struct pathelem *base;
-
-/* First N chars of S1 match S2, and S2 is N chars long. */
-static int strneq(const char *s1, unsigned int n, const char *s2)
-{
- unsigned int i;
-
- for (i = 0; i < n; i++)
- if (s1[i] != s2[i])
- return 0;
- return s2[i] == 0;
-}
-
-static struct pathelem *add_entry(struct pathelem *root, const char *name);
-
-static struct pathelem *new_entry(const char *root,
- struct pathelem *parent,
- const char *name)
-{
- struct pathelem *new = malloc(sizeof(*new));
- new->name = strdup(name);
- asprintf(&new->pathname, "%s/%s", root, name);
- new->num_entries = 0;
- return new;
-}
-
-#define streq(a,b) (strcmp((a), (b)) == 0)
-
-static struct pathelem *add_dir_maybe(struct pathelem *path)
-{
- DIR *dir;
-
- if ((dir = opendir(path->pathname)) != NULL) {
- struct dirent *dirent;
-
- while ((dirent = readdir(dir)) != NULL) {
- if (!streq(dirent->d_name,".") && !streq(dirent->d_name,"..")){
- path = add_entry(path, dirent->d_name);
- }
- }
- closedir(dir);
- }
- return path;
-}
-
-static struct pathelem *add_entry(struct pathelem *root, const char *name)
-{
- root->num_entries++;
-
- root = realloc(root, sizeof(*root)
- + sizeof(root->entries[0])*root->num_entries);
-
- root->entries[root->num_entries-1] = new_entry(root->pathname, root, name);
- root->entries[root->num_entries-1]
- = add_dir_maybe(root->entries[root->num_entries-1]);
- return root;
-}
-
-/* This needs to be done after tree is stabilized (ie. no more reallocs!). */
-static void set_parents(struct pathelem *child, struct pathelem *parent)
-{
- unsigned int i;
-
- child->parent = parent;
- for (i = 0; i < child->num_entries; i++)
- set_parents(child->entries[i], child);
-}
-
-/* FIXME: Doesn't handle DIR/.. where DIR is not in emulated dir. */
-static const char *
-follow_path(const struct pathelem *cursor, const char *name)
-{
- unsigned int i, namelen;
-
- name += strspn(name, "/");
- namelen = strcspn(name, "/");
-
- if (namelen == 0)
- return cursor->pathname;
-
- if (strneq(name, namelen, ".."))
- return follow_path(cursor->parent, name + namelen);
-
- if (strneq(name, namelen, "."))
- return follow_path(cursor, name + namelen);
-
- for (i = 0; i < cursor->num_entries; i++)
- if (strneq(name, namelen, cursor->entries[i]->name))
- return follow_path(cursor->entries[i], name + namelen);
-
- /* Not found */
- return NULL;
-}
+static struct path_list_head* list_head;
void init_paths(const char *prefix)
{
- char pref_buf[PATH_MAX];
-
- if (prefix[0] == '\0' ||
- !strcmp(prefix, "/"))
+ if (prefix[0] != '/' ||
+ prefix[0] == '\0' ||
+ !strcmp(prefix, "/"))
return;
- if (prefix[0] != '/') {
- char *cwd = get_current_dir_name();
- if (!cwd)
- abort();
- strcpy(pref_buf, cwd);
- strcat(pref_buf, "/");
- strcat(pref_buf, prefix);
- free(cwd);
- } else
- strcpy(pref_buf,prefix + 1);
+ list_head = malloc(sizeof(struct path_list_head));
- base = new_entry("", NULL, pref_buf);
- base = add_dir_maybe(base);
- if (base->num_entries == 0) {
- free (base);
- base = NULL;
- } else {
- set_parents(base, base);
- }
+ /* first element of list is prefix */
+ list_head->path = strdup(prefix);
+ list_head->next = NULL;
}
/* Look for path in emulation dir, otherwise return name. */
const char *path(const char *name)
{
+ struct path_list_head *list = list_head;
+ int path_length = strlen(list_head->path) + strlen(name) + 1;
+ char *newname = malloc(path_length);
+ struct stat buf;
+ const char * result = name;
+
/* Only do absolute paths: quick and dirty, but should mostly be OK.
Could do relative by tracking cwd. */
- if (!base || !name || name[0] != '/')
- return name;
-
- return follow_path(base, name) ?: name;
+ if (!list_head || result[0] != '/')
+ goto exit;
+
+ strncpy(newname, list_head->path, path_length);
+ strncat(newname, name, path_length);
+
+ /* look for place where path should be present */
+ while ( list->next && (strcmp(list->next->path, newname) < 0) )
+ list = list->next;
+
+ /* if there is no path in list */
+ if ( !list->next || strcmp(list->next->path, newname) ) {
+ /* add element to list if path exist in emulation dir */
+ if ( !stat(newname, &buf) )
+ {
+ struct path_list_head *new;
+
+ new = malloc(sizeof(struct path_list_head));
+ new->path = strdup(newname);
+ new->next = list->next;
+ list->next = new;
+ result = new->path;
+ }
+
+ } else if ( stat(list->next->path, &buf) ) {
+ /* remove element from list if path doesn't exist in emulation dir */
+ struct path_list_head* tmp;
+
+ tmp = list->next;
+ list->next = tmp->next;
+ free(tmp->path);
+ free(tmp);
+ } else
+ result = list->next->path;
+
+exit:
+ free(newname);
+ return result;
}
--
1.6.2.1

View File

@ -1,7 +1,7 @@
From 72e306e63740a51a1c82f39cabb65df65ce2c215 Mon Sep 17 00:00:00 2001
From 026ee1029cfeb6c802ee715372992fb3c847bd27 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:30:16 +0200
Subject: [PATCH 10/33] qemu-cvs-sched_getaffinity
Subject: [PATCH 09/17] qemu-cvs-sched_getaffinity
Implements sched_getaffinity syscall.
@ -11,10 +11,10 @@ Signed-off-by: Ulrich Hecht <uli@suse.de>
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b7230c7..faf41b1 100644
index b51634b..81bf1f0 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -152,6 +152,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \
@@ -164,6 +164,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \
}
@ -22,7 +22,7 @@ index b7230c7..faf41b1 100644
#define __NR_sys_uname __NR_uname
#define __NR_sys_faccessat __NR_faccessat
#define __NR_sys_fchmodat __NR_fchmodat
@@ -213,6 +214,9 @@ _syscall3(int,sys_tgkill,int,tgid,int,pid,int,sig)
@@ -223,6 +224,9 @@ _syscall3(int,sys_tgkill,int,tgid,int,pid,int,sig)
#if defined(TARGET_NR_tkill) && defined(__NR_tkill)
_syscall2(int,sys_tkill,int,tid,int,sig)
#endif
@ -32,10 +32,10 @@ index b7230c7..faf41b1 100644
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
#endif
@@ -6979,6 +6983,18 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
@@ -7505,6 +7509,18 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
break;
#endif
#endif /* CONFIG_SPLICE */
#endif
+
+#ifdef TARGET_NR_sched_getaffinity
+ case TARGET_NR_sched_getaffinity:
@ -52,5 +52,5 @@ index b7230c7..faf41b1 100644
unimplemented:
gemu_log("qemu: Unsupported syscall: %d\n", num);
--
1.6.2.1
1.7.1

View File

@ -1,7 +1,7 @@
From 5c8849d886cafd1626c1d36c572c3ccee5c88d5d Mon Sep 17 00:00:00 2001
From 2013ec7c2d1b5a71d73701da746363b69d4c992c Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:34:05 +0200
Subject: [PATCH 11/33] qemu-cvs-mmap-amd64
Subject: [PATCH 10/17] qemu-cvs-mmap-amd64
Map stuff to address space < 4GB on AMD64. This patch got continually smaller
as most cases were this was an issue were dealt with in other ways. May
@ -13,7 +13,7 @@ Signed-off-by: Ulrich Hecht <uli@suse.de>
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index c33e5fe..9ca8f6f 100644
index e18c228..de8abe9 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -31,6 +31,10 @@
@ -26,8 +26,8 @@ index c33e5fe..9ca8f6f 100644
+
//#define DEBUG_MMAP
#if defined(USE_NPTL)
@@ -230,7 +234,7 @@ static int mmap_frag(abi_ulong real_start,
#if defined(CONFIG_USE_NPTL)
@@ -169,7 +173,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,
@ -37,5 +37,5 @@ index c33e5fe..9ca8f6f 100644
return -1;
prot1 = prot;
--
1.6.2.1
1.7.1

View File

@ -0,0 +1,116 @@
From 09686f619707ec98e073bf671b0334a2f65934ad Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:37:42 +0200
Subject: [PATCH 11/17] qemu-img-vmdk-scsi
Support creation of SCSI VMDK images in qemu-img.
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
block.c | 5 ++++-
block/vmdk.c | 7 +++++--
block_int.h | 2 ++
qemu-img.c | 8 +++++++-
4 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index b476479..b77f09b 100644
--- a/block.c
+++ b/block.c
@@ -2792,7 +2792,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;
+ QEMUOptionParameter *backing_fmt, *backing_file, *scsi;
BlockDriverState *bs = NULL;
BlockDriver *drv, *proto_drv;
BlockDriver *backing_drv = NULL;
@@ -2901,6 +2901,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 8fc9d67..8944173 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -685,7 +685,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";
char desc[1024];
const char *real_filename, *temp_str;
int64_t total_size = 0;
@@ -701,6 +701,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
backing_file = options->value.s;
} else if (!strcmp(options->name, BLOCK_OPT_COMPAT6)) {
flags |= options->value.n ? BLOCK_FLAG_COMPAT6: 0;
+ } else if (!strcmp(options->name, BLOCK_OPT_SCSI)) {
+ flags |= options->value.n ? BLOCK_FLAG_SCSI: 0;
}
options++;
}
@@ -798,7 +800,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
snprintf(desc, sizeof(desc), desc_template, (unsigned int)time(NULL),
total_size, real_filename,
(flags & BLOCK_FLAG_COMPAT6 ? 6 : 4),
- total_size / (int64_t)(63 * 16));
+ total_size / (int64_t)(63 * 16),
+ flags & BLOCK_FLAG_SCSI ? "lsilogic" : "ide");
/* write the descriptor */
lseek(fd, le64_to_cpu(header.desc_offset) << 9, SEEK_SET);
diff --git a/block_int.h b/block_int.h
index 545ad11..771fd91 100644
--- a/block_int.h
+++ b/block_int.h
@@ -30,10 +30,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 4a37358..ed8cc08 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -572,7 +572,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;
@@ -727,6 +727,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) {
--
1.7.1

View File

@ -1,28 +0,0 @@
From 9e89bde7061d46a60dfe895450053360427a32f0 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:34:36 +0200
Subject: [PATCH 12/33] qemu-cvs-pthread
Link with libpthread. Not sure if still necessary.
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index e4f9498..be55d3d 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ VPATH=$(SRC_PATH):$(SRC_PATH)/hw
CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@
CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
CPPFLAGS += -U_FORTIFY_SOURCE
-LIBS=
+LIBS=-lpthread
ifdef CONFIG_STATIC
LDFLAGS += -static
endif
--
1.6.2.1

View File

@ -1,7 +1,7 @@
From 29b517b3811d8745eb73e95fe18552eb1f0153af Mon Sep 17 00:00:00 2001
From 75c51f45c127ebe4f549041aae98f510480429ae Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:38:20 +0200
Subject: [PATCH 14/33] qemu-nonvoid_return
Subject: [PATCH 12/17] qemu-nonvoid_return
Squelches GCC warnings about undefined return values.
@ -12,10 +12,10 @@ Signed-off-by: Ulrich Hecht <uli@suse.de>
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/hw/mpcore.c b/hw/mpcore.c
index 907bd99..a682695 100644
index fc05215..7bdb495 100644
--- a/hw/mpcore.c
+++ b/hw/mpcore.c
@@ -108,6 +108,7 @@ static uint32_t mpcore_timer_read(mpcore_timer_state *s, int offset)
@@ -104,6 +104,7 @@ static uint32_t mpcore_timer_read(mpcore_timer_state *s, int offset)
default:
return 0;
}
@ -24,7 +24,7 @@ index 907bd99..a682695 100644
static void mpcore_timer_write(mpcore_timer_state *s, int offset,
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index b37578b..feaa155 100644
index 6f72a2b..7d9492b 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -440,6 +440,7 @@ static inline int opsize_bytes(int opsize)
@ -36,5 +36,5 @@ index b37578b..feaa155 100644
/* Assign value to a register. If the width is less than the register width
--
1.6.2.1
1.7.1

View File

@ -1,7 +1,7 @@
From e770ff83915791d048ca88da6c3877cb54bf063e Mon Sep 17 00:00:00 2001
From f44ecd4fcdb8e02e6bd58201a81f047d1e109508 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Thu, 16 Apr 2009 15:14:12 +0200
Subject: [PATCH 16/33] i386-linux-user NPTL support
Subject: [PATCH 13/17] i386-linux-user NPTL support
Makes NPTL binaries run by implementing TLS.
@ -12,10 +12,10 @@ Signed-off-by: Ulrich Hecht <uli@suse.de>
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 4ce7bc1..4f79498 100755
index 598e8e1..95de763 100755
--- a/configure
+++ b/configure
@@ -1904,6 +1904,7 @@ TARGET_ABI_DIR=""
@@ -2910,6 +2910,7 @@ TARGET_ABI_DIR=""
case "$target_arch2" in
i386)
target_phys_bits=32
@ -24,10 +24,10 @@ index 4ce7bc1..4f79498 100755
x86_64)
TARGET_BASE_ARCH=i386
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index faf41b1..87ceac7 100644
index 81bf1f0..1a98433 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3575,8 +3575,14 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp,
@@ -3792,8 +3792,14 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp,
ts->child_tidptr = child_tidptr;
}
@ -43,7 +43,7 @@ index faf41b1..87ceac7 100644
/* Grab a mutex so that thread setup appears atomic. */
pthread_mutex_lock(&clone_lock);
@@ -3648,8 +3654,14 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp,
@@ -3867,8 +3873,14 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp,
if (flags & CLONE_PARENT_SETTID)
put_user_u32(gettid(), parent_tidptr);
ts = (TaskState *)env->opaque;
@ -60,5 +60,5 @@ index faf41b1..87ceac7 100644
ts->child_tidptr = child_tidptr;
#endif
--
1.6.2.1
1.7.1

View File

@ -1,142 +0,0 @@
From 75e8da1c5ca1b61a9a97fcc385eb5c6b9f83130f Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:37:42 +0200
Subject: [PATCH 13/33] qemu-img-vmdk-scsi
Support creation of SCSI VMDK images in qemu-img.
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
block/vmdk.c | 5 +++--
block_int.h | 1 +
qemu-img-cmds.hx | 8 ++++----
qemu-img.c | 15 +++++++++++++--
4 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index 4e48622..b7a15c7 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -710,7 +710,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";
char desc[1024];
const char *real_filename, *temp_str;
int64_t total_size = 0;
@@ -800,7 +800,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
snprintf(desc, sizeof(desc), desc_template, (unsigned int)time(NULL),
total_size, real_filename,
(flags & BLOCK_FLAG_COMPAT6 ? 6 : 4),
- total_size / (int64_t)(63 * 16));
+ total_size / (int64_t)(63 * 16),
+ flags & BLOCK_FLAG_SCSI ? "lsilogic" : "ide");
/* write the descriptor */
lseek(fd, le64_to_cpu(header.desc_offset) << 9, SEEK_SET);
diff --git a/block_int.h b/block_int.h
index 8898d91..d482050 100644
--- a/block_int.h
+++ b/block_int.h
@@ -30,6 +30,7 @@
#define BLOCK_FLAG_ENCRYPT 1
#define BLOCK_FLAG_COMPRESS 2
#define BLOCK_FLAG_COMPAT6 4
+#define BLOCK_FLAG_SCSI 8
#define BLOCK_OPT_SIZE "size"
#define BLOCK_OPT_ENCRYPT "encryption"
diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
index ddb86f0..be94d22 100644
--- a/qemu-img-cmds.hx
+++ b/qemu-img-cmds.hx
@@ -16,9 +16,9 @@ STEXI
ETEXI
DEF("create", img_create,
- "create [-F fmt] [-b base_image] [-f fmt] [-o options] filename [size]")
+ "create [-s] [-F fmt] [-b base_image] [-f fmt] [-o options] filename [size]")
STEXI
-@item create [-F @var{base_fmt}] [-b @var{base_image}] [-f @var{fmt}] [-o @var{options}] @var{filename} [@var{size}]
+@item create [-s] [-F @var{base_fmt}] [-b @var{base_image}] [-f @var{fmt}] [-o @var{options}] @var{filename} [@var{size}]
ETEXI
DEF("commit", img_commit,
@@ -28,9 +28,9 @@ STEXI
ETEXI
DEF("convert", img_convert,
- "convert [-c] [-f fmt] [-O output_fmt] [-o options] [-B output_base_image] filename [filename2 [...]] output_filename")
+ "convert [-c] [-s] [-f fmt] [-O output_fmt] [-o options] [-B output_base_image] filename [filename2 [...]] output_filename")
STEXI
-@item convert [-c] [-f @var{fmt}] [-O @var{output_fmt}] [-o @var{options}] [-B @var{output_base_image}] @var{filename} [@var{filename2} [...]] @var{output_filename}
+@item convert [-c] [-s] [-f @var{fmt}] [-O @var{output_fmt}] [-o @var{options}] [-B @var{output_base_image}] @var{filename} [@var{filename2} [...]] @var{output_filename}
ETEXI
DEF("info", img_info,
diff --git a/qemu-img.c b/qemu-img.c
index 070fe2e..2adeb56 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -259,7 +259,7 @@ static int img_create(int argc, char **argv)
flags = 0;
for(;;) {
- c = getopt(argc, argv, "F:b:f:he6o:");
+ c = getopt(argc, argv, "F:b:f:hes6o:");
if (c == -1)
break;
switch(c) {
@@ -278,6 +278,9 @@ static int img_create(int argc, char **argv)
case 'e':
flags |= BLOCK_FLAG_ENCRYPT;
break;
+ case 's':
+ flags |= BLOCK_FLAG_SCSI;
+ break;
case '6':
flags |= BLOCK_FLAG_COMPAT6;
break;
@@ -357,6 +360,8 @@ static int img_create(int argc, char **argv)
printf("Formatting '%s', fmt=%s ", filename, fmt);
print_option_parameters(param);
+ if (flags & BLOCK_FLAG_SCSI)
+ printf(", SCSI");
puts("");
ret = bdrv_create(drv, filename, param);
@@ -551,7 +556,7 @@ static int img_convert(int argc, char **argv)
out_baseimg = NULL;
flags = 0;
for(;;) {
- c = getopt(argc, argv, "f:O:B:hce6o:");
+ c = getopt(argc, argv, "f:O:B:hces6o:");
if (c == -1)
break;
switch(c) {
@@ -573,6 +578,9 @@ static int img_convert(int argc, char **argv)
case 'e':
flags |= BLOCK_FLAG_ENCRYPT;
break;
+ case 's':
+ flags |= BLOCK_FLAG_SCSI;
+ break;
case '6':
flags |= BLOCK_FLAG_COMPAT6;
break;
@@ -639,6 +647,9 @@ static int img_convert(int argc, char **argv)
}
}
+ if (flags & BLOCK_FLAG_SCSI && strcmp(drv->format_name, "vmdk"))
+ error("SCSI devices not supported for this file format");
+
/* Create the new image */
ret = bdrv_create(drv, out_filename, param);
free_option_parameters(param);
--
1.6.2.1

View File

@ -1,17 +1,17 @@
From df6df89350799107b3395665943c4df7eeba87e0 Mon Sep 17 00:00:00 2001
From 3f23daf11dab4206ef87839bb513c4f97609f112 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Wed, 17 Jun 2009 14:54:48 +0200
Subject: [PATCH 17/33] qemu-0.11-git-ioctl_mount
Subject: [PATCH 14/17] qemu-0.11-git-ioctl_mount
---
linux-user/ioctls.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index aee5a88..a0fb052 100644
index 13ff54f..2442040 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -310,7 +310,7 @@
@@ -317,7 +317,7 @@
IOCTL(LOOP_CLR_FD, 0, TYPE_INT)
IOCTL(LOOP_SET_STATUS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info)))
IOCTL(LOOP_GET_STATUS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info)))
@ -21,5 +21,5 @@ index aee5a88..a0fb052 100644
IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
#endif
--
1.6.2.1
1.7.1

File diff suppressed because it is too large Load Diff

View File

@ -1,205 +0,0 @@
From 99759e033ea960b86828657682f8382538c4ccb7 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Tue, 14 Apr 2009 16:52:51 +0200
Subject: [PATCH 15/33] pcap network emulation
Implements network emulation using libpcap; useful for direct Ethernet access.
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
Makefile.target | 3 ++
configure | 7 ++++
net.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
qemu-options.hx | 4 ++
4 files changed, 122 insertions(+), 0 deletions(-)
diff --git a/Makefile.target b/Makefile.target
index f9cd42a..9c9304c 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -618,6 +618,9 @@ endif
ifdef CONFIG_SLIRP
CPPFLAGS+=-I$(SRC_PATH)/slirp
endif
+ifdef CONFIG_PCAP
+LIBS+=-lpcap
+endif
# specific flags are needed for non soft mmu emulator
ifdef CONFIG_STATIC
diff --git a/configure b/configure
index cac4198..4ce7bc1 100755
--- a/configure
+++ b/configure
@@ -169,6 +169,7 @@ mingw32="no"
EXESUF=""
slirp="yes"
vde="yes"
+pcap="yes"
fmod_lib=""
fmod_inc=""
oss_lib=""
@@ -432,6 +433,8 @@ for opt do
;;
--disable-vde) vde="no"
;;
+ --disable-pcap) pcap="no"
+ ;;
--disable-kqemu) kqemu="no"
;;
--disable-xen) xen="no"
@@ -1598,6 +1601,10 @@ if test "$vde" = "yes" ; then
echo "#define CONFIG_VDE 1" >> $config_host_h
echo "VDE_LIBS=-lvdeplug" >> $config_host_mak
fi
+if test "$pcap" = "yes" ; then
+ echo "CONFIG_PCAP=yes" >> $config_host_mak
+ echo "#define CONFIG_PCAP 1" >> $config_host_h
+fi
for card in $audio_card_list; do
def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
echo "$def=y" >> $config_host_mak
diff --git a/net.c b/net.c
index 3d3829d..595f7bc 100644
--- a/net.c
+++ b/net.c
@@ -1264,6 +1264,105 @@ void do_info_usernet(Monitor *mon)
#endif /* CONFIG_SLIRP */
+#if defined(CONFIG_PCAP)
+#include <pcap.h>
+typedef struct PCAPState {
+ VLANClientState *vc;
+ pcap_t *handle;
+} PCAPState;
+
+static ssize_t pcap_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
+{
+ PCAPState *s = (PCAPState *)(vc->opaque);
+
+ pcap_sendpacket(s->handle, (u_char*)buf, size);
+ return size;
+}
+
+static void pcap_callback(u_char *user, struct pcap_pkthdr *phdr, u_char *pdata)
+{
+ VLANClientState *vc = (VLANClientState *)user;
+
+ qemu_send_packet(vc, pdata, phdr->len);
+}
+
+static void pcap_send(void *opaque)
+{
+ PCAPState *s = (PCAPState *)opaque;
+
+ pcap_dispatch(s->handle, 1, (pcap_handler)&pcap_callback, (u_char *)s->vc);
+}
+
+static int net_pcap_init(VLANState *vlan, const char *model, const char *name, char *ifname)
+{
+ PCAPState *s;
+ char errbuf[PCAP_ERRBUF_SIZE];
+ int fd;
+
+ s = qemu_mallocz(sizeof(PCAPState));
+ if (!s)
+ return -1;
+
+ if (ifname == NULL && (ifname = pcap_lookupdev(errbuf)) == NULL) {
+ fprintf(stderr, "qemu: pcap_lookupdev: %s\n", errbuf);
+ goto fail;
+ }
+
+ /* Attempt to connect device. */
+ s->handle = (void*)pcap_open_live(ifname, 65535, 1, 0, errbuf);
+ if (!s->handle) {
+ fprintf(stderr, "qemu: pcap_open_live: %s\n", errbuf);
+ goto fail;
+ }
+
+ /* Check non-blocking mode. */
+ if (pcap_setnonblock(s->handle, 1, errbuf) < 0) {
+ fprintf(stderr, "qemu: pcap_setnonblock: %s\n", errbuf);
+ goto fail;
+ }
+
+#if defined(BIOCSHDRCMPLT)
+ /*
+ * Tell the kernel that the header is fully-formed when it gets it.
+ * This is required in order to fake the src address.
+ */
+ {
+ unsigned int one = 1;
+ ioctl(pcap_fileno(s->handle), BIOCSHDRCMPLT, &one);
+ }
+#endif /* BIOCSHDRCMPLT */
+
+#if defined(BIOCIMMEDIATE)
+ /*
+ * Tell the kernel that the packet has to be processed immediately.
+ */
+ {
+ unsigned int one = 1;
+ ioctl(pcap_fileno(s->handle), BIOCIMMEDIATE, &one);
+ }
+#endif /* BIOCIMMEDIATE */
+
+ s->vc = qemu_new_vlan_client(vlan, model, name, NULL, pcap_receive, NULL, NULL, s);
+ snprintf(s->vc->info_str, sizeof(s->vc->info_str), "pcap redirector");
+ if ((fd = pcap_get_selectable_fd(s->handle)) < 0) {
+ fprintf(stderr, "qemu: pcap_get_selectable_fd failed\n");
+ goto fail;
+ }
+ qemu_set_fd_handler(fd, pcap_send, NULL, s);
+
+ return 0;
+
+fail:
+ if (s) {
+ if (s->handle)
+ pcap_close(s->handle);
+ qemu_free(s);
+ }
+
+ return -1;
+}
+#endif /* CONFIG_PCAP */
+
#if !defined(_WIN32)
typedef struct TAPState {
@@ -2631,6 +2730,15 @@ int net_client_init(Monitor *mon, const char *device, const char *p)
ret = 0;
} else
#endif
+#ifdef CONFIG_PCAP
+ if (!strcmp(device, "pcap")) {
+ char ifname[64];
+ if (get_param_value(ifname, sizeof(ifname), "ifname", p) <= 0)
+ ret = net_pcap_init(vlan, device, name, NULL);
+ else
+ ret = net_pcap_init(vlan, device, name, ifname);
+ } else
+#endif
#ifdef _WIN32
if (!strcmp(device, "tap")) {
static const char * const tap_params[] = {
diff --git a/qemu-options.hx b/qemu-options.hx
index a58287c..4d46d6c 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -801,6 +801,10 @@ DEF("net", HAS_ARG, QEMU_OPTION_net,
" default of 'sndbuf=1048576' can be disabled using 'sndbuf=0'\n"
#endif
#endif
+#ifdef CONFIG_PCAP
+ "-net pcap[,vlan=n][,ifname=name]\n"
+ " connect the host network interface using PCAP to VLAN 'n'\n"
+#endif
"-net socket[,vlan=n][,name=str][,fd=h][,listen=[host]:port][,connect=host:port]\n"
" connect the vlan 'n' to another VLAN using a socket connection\n"
"-net socket[,vlan=n][,name=str][,fd=h][,mcast=maddr:port]\n"
--
1.6.2.1

View File

@ -0,0 +1,58 @@
From 4569b209989e09bdebcb6cce809b3fed0f94142c Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Wed, 25 Aug 2010 14:23:43 +0200
Subject: [PATCH 16/17] fix mipsn32*-linux-user builds
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
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 bd1484b..6513d91 100755
--- a/configure
+++ b/configure
@@ -1010,6 +1010,8 @@ m68k-linux-user \
microblaze-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"
--
1.7.1

129
0017-S-390-build-fix.patch Normal file
View File

@ -0,0 +1,129 @@
From 024f781ab4af31ba5e14882b5661d4586ae26988 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Wed, 9 Feb 2011 18:35:21 +0100
Subject: [PATCH 17/17] S/390 build fix
---
target-s390x/op_helper.c | 22 +++++++++++-----------
target-s390x/translate.c | 2 +-
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/target-s390x/op_helper.c b/target-s390x/op_helper.c
index 20c83c5..46b71fc 100644
--- a/target-s390x/op_helper.c
+++ b/target-s390x/op_helper.c
@@ -738,7 +738,7 @@ uint32_t HELPER(tmxx)(uint64_t val, uint32_t mask)
uint32_t HELPER(abs_i32)(uint32_t reg, int32_t val)
{
uint32_t cc;
- if (val == 0x80000000UL) cc = 3;
+ if ((uint32_t)val == 0x80000000UL) cc = 3;
else if (val) cc = 1;
else cc = 0;
@@ -996,7 +996,7 @@ uint32_t HELPER(slbg)(uint32_t cc, uint32_t r1, uint64_t v1, uint64_t v2)
/* condition codes for binary FP ops */
static uint32_t set_cc_f32(float32 v1, float32 v2)
{
- if (float32_is_nan(v1) || float32_is_nan(v2)) return 3;
+ if (float32_is_any_nan(v1) || float32_is_any_nan(v2)) return 3;
else if (float32_eq(v1, v2, &env->fpu_status)) return 0;
else if (float32_lt(v1, v2, &env->fpu_status)) return 1;
else return 2;
@@ -1004,7 +1004,7 @@ static uint32_t set_cc_f32(float32 v1, float32 v2)
static uint32_t set_cc_f64(float64 v1, float64 v2)
{
- if (float64_is_nan(v1) || float64_is_nan(v2)) return 3;
+ if (float64_is_any_nan(v1) || float64_is_any_nan(v2)) return 3;
else if (float64_eq(v1, v2, &env->fpu_status)) return 0;
else if (float64_lt(v1, v2, &env->fpu_status)) return 1;
else return 2;
@@ -1013,7 +1013,7 @@ static uint32_t set_cc_f64(float64 v1, float64 v2)
/* condition codes for unary FP ops */
static uint32_t set_cc_nz_f32(float32 v)
{
- if (float32_is_nan(v)) return 3;
+ if (float32_is_any_nan(v)) return 3;
else if (float32_is_zero(v)) return 0;
else if (float32_is_neg(v)) return 1;
else return 2;
@@ -1021,7 +1021,7 @@ static uint32_t set_cc_nz_f32(float32 v)
static uint32_t set_cc_nz_f64(float64 v)
{
- if (float64_is_nan(v)) return 3;
+ if (float64_is_any_nan(v)) return 3;
else if (float64_is_zero(v)) return 0;
else if (float64_is_neg(v)) return 1;
else return 2;
@@ -1029,7 +1029,7 @@ static uint32_t set_cc_nz_f64(float64 v)
static uint32_t set_cc_nz_f128(float128 v)
{
- if (float128_is_nan(v)) return 3;
+ if (float128_is_any_nan(v)) return 3;
else if (float128_is_zero(v)) return 0;
else if (float128_is_neg(v)) return 1;
else return 2;
@@ -1350,7 +1350,7 @@ uint32_t HELPER(cxbr)(uint32_t f1, uint32_t f2)
CPU_QuadU v2;
v2.ll.upper = env->fregs[f2].ll;
v2.ll.lower = env->fregs[f2 + 2].ll;
- if (float128_is_nan(v1.q) || float128_is_nan(v2.q)) return 3;
+ if (float128_is_any_nan(v1.q) || float128_is_any_nan(v2.q)) return 3;
else if (float128_eq(v1.q, v2.q, &env->fpu_status)) return 0;
else if (float128_lt(v1.q, v2.q, &env->fpu_status)) return 1;
else return 2;
@@ -1463,7 +1463,7 @@ uint32_t HELPER(cgxbr)(uint32_t r1, uint32_t f2, uint32_t m3)
v2.ll.lower = env->fregs[f2 + 2].ll;
set_round_mode(m3);
env->regs[r1] = float128_to_int64(v2.q, &env->fpu_status);
- if (float128_is_nan(v2.q)) return 3;
+ if (float128_is_any_nan(v2.q)) return 3;
else if (float128_is_zero(v2.q)) return 0;
else if (float128_is_neg(v2.q)) return 1;
else return 2;
@@ -1611,7 +1611,7 @@ uint32_t HELPER(tceb)(uint32_t f1, uint64_t m2)
HELPER_LOG("%s: v1 0x%lx m2 0x%lx neg %d\n", __FUNCTION__, v1, m2, neg);
if (float32_is_zero(v1) && (m2 & (1 << (11-neg)))) cc = 1;
else if (float32_is_infinity(v1) && (m2 & (1 << (5-neg)))) cc = 1;
- else if (float32_is_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
+ else if (float32_is_quiet_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
else if (float32_is_signaling_nan(v1) && (m2 & (1 << (1-neg)))) cc = 1;
else /* assume normalized number */ if (m2 & (1 << (9-neg))) cc = 1;
/* FIXME: denormalized? */
@@ -1627,7 +1627,7 @@ uint32_t HELPER(tcdb)(uint32_t f1, uint64_t m2)
HELPER_LOG("%s: v1 0x%lx m2 0x%lx neg %d\n", __FUNCTION__, v1, m2, neg);
if (float64_is_zero(v1) && (m2 & (1 << (11-neg)))) cc = 1;
else if (float64_is_infinity(v1) && (m2 & (1 << (5-neg)))) cc = 1;
- else if (float64_is_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
+ else if (float64_is_quiet_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
else if (float64_is_signaling_nan(v1) && (m2 & (1 << (1-neg)))) cc = 1;
else /* assume normalized number */ if (m2 & (1 << (9-neg))) cc = 1;
/* FIXME: denormalized? */
@@ -1645,7 +1645,7 @@ uint32_t HELPER(tcxb)(uint32_t f1, uint64_t m2)
int neg = float128_is_neg(v1.q);
if (float128_is_zero(v1.q) && (m2 & (1 << (11-neg)))) cc = 1;
else if (float128_is_infinity(v1.q) && (m2 & (1 << (5-neg)))) cc = 1;
- else if (float128_is_nan(v1.q) && (m2 & (1 << (3-neg)))) cc = 1;
+ else if (float128_is_quiet_nan(v1.q) && (m2 & (1 << (3-neg)))) cc = 1;
else if (float128_is_signaling_nan(v1.q) && (m2 & (1 << (1-neg)))) cc = 1;
else /* assume normalized number */ if (m2 & (1 << (9-neg))) cc = 1;
/* FIXME: denormalized? */
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index e08dcf4..189a60b 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -67,7 +67,7 @@ void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf,
}
}
for (i = 0; i < 16; i++) {
- cpu_fprintf(f, "F%02d=%016lx", i, (long)env->fregs[i].i);
+ cpu_fprintf(f, "F%02d=%016lx", i, (long)env->fregs[i].ll);
if ((i % 4) == 3) {
cpu_fprintf(f, "\n");
} else {
--
1.7.1

View File

@ -1,116 +0,0 @@
From 015bd9be8314b3ce6d97d1bc9614874aee9b0e52 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Wed, 17 Jun 2009 15:08:38 +0200
Subject: [PATCH 18/33] qemu-0.11-git-user-linux-ppc-uid16_fix
---
linux-user/ppc/syscall_nr.h | 30 +++++++++++++++---------------
linux-user/syscall_defs.h | 2 +-
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/linux-user/ppc/syscall_nr.h b/linux-user/ppc/syscall_nr.h
index f54276b..cc84a4c 100644
--- a/linux-user/ppc/syscall_nr.h
+++ b/linux-user/ppc/syscall_nr.h
@@ -17,15 +17,15 @@
#define TARGET_NR_time 13
#define TARGET_NR_mknod 14
#define TARGET_NR_chmod 15
-#define TARGET_NR_lchown32 16
+#define TARGET_NR_lchown 16
#define TARGET_NR_break 17
#define TARGET_NR_oldstat 18
#define TARGET_NR_lseek 19
#define TARGET_NR_getpid 20
#define TARGET_NR_mount 21
#define TARGET_NR_umount 22
-#define TARGET_NR_setuid32 23
-#define TARGET_NR_getuid32 24
+#define TARGET_NR_setuid 23
+#define TARGET_NR_getuid 24
#define TARGET_NR_stime 25
#define TARGET_NR_ptrace 26
#define TARGET_NR_alarm 27
@@ -47,11 +47,11 @@
#define TARGET_NR_times 43
#define TARGET_NR_prof 44
#define TARGET_NR_brk 45
-#define TARGET_NR_setgid32 46
-#define TARGET_NR_getgid32 47
+#define TARGET_NR_setgid 46
+#define TARGET_NR_getgid 47
#define TARGET_NR_signal 48
-#define TARGET_NR_geteuid32 49
-#define TARGET_NR_getegid32 50
+#define TARGET_NR_geteuid 49
+#define TARGET_NR_getegid 50
#define TARGET_NR_acct 51
#define TARGET_NR_umount2 52
#define TARGET_NR_lock 53
@@ -71,8 +71,8 @@
#define TARGET_NR_sigaction 67
#define TARGET_NR_sgetmask 68
#define TARGET_NR_ssetmask 69
-#define TARGET_NR_setreuid32 70
-#define TARGET_NR_setregid32 71
+#define TARGET_NR_setreuid 70
+#define TARGET_NR_setregid 71
#define TARGET_NR_sigsuspend 72
#define TARGET_NR_sigpending 73
#define TARGET_NR_sethostname 74
@@ -81,8 +81,8 @@
#define TARGET_NR_getrusage 77
#define TARGET_NR_gettimeofday 78
#define TARGET_NR_settimeofday 79
-#define TARGET_NR_getgroups32 80
-#define TARGET_NR_setgroups32 81
+#define TARGET_NR_getgroups 80
+#define TARGET_NR_setgroups 81
#define TARGET_NR_select 82
#define TARGET_NR_symlink 83
#define TARGET_NR_oldlstat 84
@@ -96,7 +96,7 @@
#define TARGET_NR_truncate 92
#define TARGET_NR_ftruncate 93
#define TARGET_NR_fchmod 94
-#define TARGET_NR_fchown32 95
+#define TARGET_NR_fchown 95
#define TARGET_NR_getpriority 96
#define TARGET_NR_setpriority 97
#define TARGET_NR_profil 98
@@ -139,8 +139,8 @@
#define TARGET_NR_sysfs 135
#define TARGET_NR_personality 136
#define TARGET_NR_afs_syscall 137 /* Syscall for Andrew File System */
-#define TARGET_NR_setfsuid32 138
-#define TARGET_NR_setfsgid32 139
+#define TARGET_NR_setfsuid 138
+#define TARGET_NR_setfsgid 139
#define TARGET_NR__llseek 140
#define TARGET_NR_getdents 141
#define TARGET_NR__newselect 142
@@ -182,7 +182,7 @@
#define TARGET_NR_rt_sigsuspend 178
#define TARGET_NR_pread64 179
#define TARGET_NR_pwrite64 180
-#define TARGET_NR_chown32 181
+#define TARGET_NR_chown 181
#define TARGET_NR_getcwd 182
#define TARGET_NR_capget 183
#define TARGET_NR_capset 184
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 78c6488..0cbe396 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -49,7 +49,7 @@
#define TARGET_IOC_TYPEBITS 8
#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) \
- || defined(TARGET_M68K) || defined(TARGET_SH4) || defined(TARGET_CRIS)
+ || defined(TARGET_M68K) || defined(TARGET_SH4) || defined(TARGET_CRIS) || defined(TARGET_PPC)
/* 16 bit uid wrappers emulation */
#define USE_UID16
#endif
--
1.6.2.1

View File

@ -1,125 +0,0 @@
From d7f01e455acae19ef780e29417ffba50ca90ffde Mon Sep 17 00:00:00 2001
From: Kirill A. Shutemov <kirill@shutemov.name>
Date: Wed, 17 Jun 2009 15:14:43 +0200
Subject: [PATCH 19/33] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets
From: Kirill A. Shutemov <kirill@shutemov.name>
qemu's page table can be incomple if /proc/self/maps is unavailable or
host allocating a memory with mmap(), so we can't use it to find free
memory area.
New version mmap_find_vma() uses mmap() without MAP_FIXED to find free
memory.
From: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
linux-user/mmap.c | 79 +++++++++++++++++++++++++++++------------------------
1 files changed, 43 insertions(+), 36 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 9ca8f6f..8d94783 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -277,52 +277,59 @@ static abi_ulong mmap_next_start = 0x40000000;
unsigned long last_brk;
-/* find a free memory area of size 'size'. The search starts at
- 'start'. If 'start' == 0, then a default start address is used.
- Return -1 if error.
-*/
-/* page_init() marks pages used by the host as reserved to be sure not
- to use them. */
+/*
+ * Find and reserve a free memory area of size 'size'. The search
+ * starts at 'start'.
+ * It must be called with mmap_lock() held.
+ * Return -1 if error.
+ */
abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
{
- abi_ulong addr, addr1, addr_start;
- int prot;
- unsigned long new_brk;
-
- new_brk = (unsigned long)sbrk(0);
- if (last_brk && last_brk < new_brk && last_brk == (target_ulong)last_brk) {
- /* This is a hack to catch the host allocating memory with brk().
- If it uses mmap then we loose.
- FIXME: We really want to avoid the host allocating memory in
- the first place, and maybe leave some slack to avoid switching
- to mmap. */
- page_set_flags(last_brk & TARGET_PAGE_MASK,
- TARGET_PAGE_ALIGN(new_brk),
- PAGE_RESERVED);
- }
- last_brk = new_brk;
+ void *ptr;
+ abi_ulong addr;
size = HOST_PAGE_ALIGN(size);
- start = start & qemu_host_page_mask;
+ start &= qemu_host_page_mask;
+
+ /* If 'start' == 0, then a default start address is used. */
+ if (start == 0)
+ start = mmap_next_start;
+
addr = start;
- if (addr == 0)
- addr = mmap_next_start;
- addr_start = addr;
+
for(;;) {
- prot = 0;
- for(addr1 = addr; addr1 < (addr + size); addr1 += TARGET_PAGE_SIZE) {
- prot |= page_get_flags(addr1);
- }
- if (prot == 0)
+ /*
+ * Reserve needed memory area to avoid a race.
+ * It should be discarded using:
+ * - mmap() with MAP_FIXED flag
+ * - mremap() with MREMAP_FIXED flag
+ * - shmat() with SHM_REMAP flag
+ */
+ ptr = mmap((void *)(unsigned long)addr, size, PROT_NONE,
+ MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0);
+
+ /* ENOMEM, if host address space has no memory */
+ if (ptr == MAP_FAILED)
+ return (abi_ulong)-1;
+
+ /* If address fits target address space we've found what we need */
+ if ((unsigned long)ptr + size - 1 <= (abi_ulong)-1)
break;
+
+ /* Unmap and try again with new page */
+ munmap(ptr, size);
addr += qemu_host_page_size;
- /* we found nothing */
- if (addr == addr_start)
+
+ /* ENOMEM if we check whole of target address space */
+ if (addr == start)
return (abi_ulong)-1;
}
- if (start == 0)
- mmap_next_start = addr + size;
- return addr;
+
+ /* Update default start address */
+ if (start == mmap_next_start)
+ mmap_next_start = (unsigned long)ptr + size;
+
+ return h2g(ptr);
}
#define SNDRV_PCM_MMAP_OFFSET_STATUS 0x80000000
--
1.6.2.1

View File

@ -1,82 +0,0 @@
From ea0b70265614b950d1e2ed48a9581ecd5e63ac97 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Fri, 24 Jul 2009 17:25:37 +0200
Subject: [PATCH 20/33] TCG "sync" op (32-bit targets fixed)
sync allows concurrent accesses to locations in memory through different TCG
variables. This comes in handy when you are emulating CPU registers that can
be used as either 32 or 64 bit, as TCG doesn't know anything about aliases.
See the s390x target for an example.
Fixed to not break 32-bit target builds.
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
tcg/tcg-op.h | 12 ++++++++++++
tcg/tcg-opc.h | 2 ++
tcg/tcg.c | 6 ++++++
3 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index 7cb6934..cfd6160 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -316,6 +316,18 @@ static inline void tcg_gen_br(int label)
tcg_gen_op1i(INDEX_op_br, label);
}
+static inline void tcg_gen_sync_i32(TCGv_i32 arg)
+{
+ tcg_gen_op1_i32(INDEX_op_sync_i32, arg);
+}
+
+#if TCG_TARGET_REG_BITS == 64
+static inline void tcg_gen_sync_i64(TCGv_i64 arg)
+{
+ tcg_gen_op1_i64(INDEX_op_sync_i64, arg);
+}
+#endif
+
static inline void tcg_gen_mov_i32(TCGv_i32 ret, TCGv_i32 arg)
{
if (!TCGV_EQUAL_I32(ret, arg))
diff --git a/tcg/tcg-opc.h b/tcg/tcg-opc.h
index 3a095fc..654a45f 100644
--- a/tcg/tcg-opc.h
+++ b/tcg/tcg-opc.h
@@ -40,6 +40,7 @@ DEF2(call, 0, 1, 2, TCG_OPF_SIDE_EFFECTS) /* variable number of parameters */
DEF2(jmp, 0, 1, 0, TCG_OPF_BB_END | TCG_OPF_SIDE_EFFECTS)
DEF2(br, 0, 0, 1, TCG_OPF_BB_END | TCG_OPF_SIDE_EFFECTS)
+DEF2(sync_i32, 0, 1, 0, 0)
DEF2(mov_i32, 1, 1, 0, 0)
DEF2(movi_i32, 1, 0, 1, 0)
/* load/store */
@@ -103,6 +104,7 @@ DEF2(neg_i32, 1, 1, 0, 0)
#endif
#if TCG_TARGET_REG_BITS == 64
+DEF2(sync_i64, 0, 1, 0, 0)
DEF2(mov_i64, 1, 1, 0, 0)
DEF2(movi_i64, 1, 0, 1, 0)
/* load/store */
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 299bff6..86e16fa 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1927,6 +1927,12 @@ static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf,
// dump_regs(s);
#endif
switch(opc) {
+ case INDEX_op_sync_i32:
+#if TCG_TARGET_REG_BITS == 64
+ case INDEX_op_sync_i64:
+#endif
+ temp_save(s, args[0], s->reserved_regs);
+ break;
case INDEX_op_mov_i32:
#if TCG_TARGET_REG_BITS == 64
case INDEX_op_mov_i64:
--
1.6.2.1

View File

@ -1,127 +0,0 @@
From fba6b2002b323519c4bb03079479de5bc3819642 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Fri, 24 Jul 2009 17:03:48 +0200
Subject: [PATCH 22/33] S/390 host/target build system support
changes to configure and makefiles for S/390 host and target support,
fixed as suggested by Juan Quintela
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
Makefile.target | 9 +++++++++
configure | 19 ++++++++++++++-----
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/Makefile.target b/Makefile.target
index 9c9304c..1080bf0 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -84,6 +84,9 @@ CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
ifeq ($(ARCH),sparc64)
CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
endif
+ifeq ($(ARCH),s390x)
+CPPFLAGS+=-I$(SRC_PATH)/tcg/s390
+endif
ifdef CONFIG_SOFTFLOAT
libobj-y += fpu/softfloat.o
else
@@ -211,6 +214,9 @@ endif
ifeq ($(ARCH),s390)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
+ifeq ($(ARCH),s390x)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+endif
ifeq ($(ARCH),sparc)
# -static is used to avoid g1/g3 usage by the dynamic linker
@@ -358,6 +364,9 @@ endif
ifeq ($(ARCH),s390)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
+ifeq ($(ARCH),s390x)
+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
+endif
ifeq ($(ARCH),sparc)
# -static is used to avoid g1/g3 usage by the dynamic linker
diff --git a/configure b/configure
index 4f79498..e0874b5 100755
--- a/configure
+++ b/configure
@@ -146,9 +146,12 @@ case "$cpu" in
ppc64)
cpu="ppc64"
;;
- s390*)
+ s390)
cpu="s390"
;;
+ s390x)
+ cpu="s390x"
+ ;;
sparc|sun4[cdmuv])
cpu="sparc"
;;
@@ -745,6 +748,7 @@ sh4eb-linux-user \
sparc-linux-user \
sparc64-linux-user \
sparc32plus-linux-user \
+s390x-linux-user \
"
fi
# the following are Darwin specific
@@ -809,6 +813,7 @@ hostlongbits="32"
if test "$cpu" = "x86_64" \
-o "$cpu" = "alpha" \
-o "$cpu" = "ia64" \
+ -o "$cpu" = "s390x" \
-o "$cpu" = "sparc64" \
-o "$cpu" = "ppc64"; then
hostlongbits="64"
@@ -1499,10 +1504,10 @@ echo "EXESUF=$EXESUF" >> $config_host_mak
echo "PTHREADLIBS=$PTHREADLIBS" >> $config_host_mak
echo "CLOCKLIBS=$CLOCKLIBS" >> $config_host_mak
case "$cpu" in
- i386|x86_64|alpha|cris|hppa|ia64|m68k|microbaze|mips|mips64|ppc|ppc64|s390|sparc|sparc64)
+ i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
ARCH=$cpu
;;
- armv4b|arm4l)
+ armv4b|armv4l)
ARCH=arm
;;
*)
@@ -1837,7 +1842,7 @@ config_h=$target_dir/config.h
target_arch2=`echo $target | cut -d '-' -f 1`
target_bigendian="no"
case "$target_arch2" in
- armeb|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|sh4eb|sparc|sparc64|sparc32plus)
+ armeb|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus)
target_bigendian=yes
;;
esac
@@ -1997,6 +2002,10 @@ case "$target_arch2" in
echo "TARGET_ABI32=y" >> $config_mak
target_phys_bits=64
;;
+ s390x)
+ target_nptl="yes"
+ target_phys_bits=64
+ ;;
*)
echo "Unsupported target CPU"
exit 1
@@ -2065,7 +2074,7 @@ fi
echo "TARGET_XML_FILES=$list" >> $config_mak
case "$target_arch2" in
- arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|sparc|sparc64|sparc32plus)
+ arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|s390x|sparc|sparc64|sparc32plus)
echo "CONFIG_SOFTFLOAT=y" >> $config_mak
;;
esac
--
1.6.2.1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,96 +0,0 @@
From 603d882c9c1c61475a69f657a9550bb335bf3ca9 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Wed, 22 Jul 2009 14:03:19 +0200
Subject: [PATCH 25/33] linux-user: don't do locking in single-threaded processes
Skips setting the tb_lock if a process doesn't have more than one thread,
which is usually the case. Results in about 20% performance gain (measured
with the s390x target, but the effect should be similar with other targets).
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
cpu-defs.h | 8 ++++++++
cpu-exec.c | 14 ++++++++++++--
linux-user/syscall.c | 1 +
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/cpu-defs.h b/cpu-defs.h
index d73ec0a..27e5bb2 100644
--- a/cpu-defs.h
+++ b/cpu-defs.h
@@ -135,6 +135,13 @@ typedef struct CPUWatchpoint {
} CPUWatchpoint;
#define CPU_TEMP_BUF_NLONGS 128
+
+#ifdef CONFIG_USER_ONLY
+#define MULTITHREAD uint32_t multithreaded;
+#else
+#define MULTITHREAD
+#endif
+
#define CPU_COMMON \
struct TranslationBlock *current_tb; /* currently executing TB */ \
/* soft mmu support */ \
@@ -149,6 +156,7 @@ typedef struct CPUWatchpoint {
uint32_t stop; /* Stop request */ \
uint32_t stopped; /* Artificially stopped */ \
uint32_t interrupt_request; \
+ MULTITHREAD /* needs locking when accessing TBs */ \
volatile sig_atomic_t exit_request; \
/* The meaning of the MMU modes is defined in the target code. */ \
CPUTLBEntry tlb_table[NB_MMU_MODES][CPU_TLB_SIZE]; \
diff --git a/cpu-exec.c b/cpu-exec.c
index 855ea3e..1371ce4 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -219,6 +219,9 @@ int cpu_exec(CPUState *env1)
TranslationBlock *tb;
uint8_t *tc_ptr;
unsigned long next_tb;
+#ifdef CONFIG_USER_ONLY
+ uint32_t multithreaded;
+#endif
if (cpu_halted(env1) == EXCP_HALTED)
return EXCP_HALTED;
@@ -604,7 +607,11 @@ int cpu_exec(CPUState *env1)
#endif
}
#endif
- spin_lock(&tb_lock);
+#ifdef CONFIG_USER_ONLY
+ multithreaded = env->multithreaded;
+ if (multithreaded)
+#endif
+ spin_lock(&tb_lock);
tb = tb_find_fast();
/* Note: we do it here to avoid a gcc bug on Mac OS X when
doing it in tb_find_slow */
@@ -632,7 +639,10 @@ int cpu_exec(CPUState *env1)
tb_add_jump((TranslationBlock *)(next_tb & ~3), next_tb & 3, tb);
}
}
- spin_unlock(&tb_lock);
+#ifdef CONFIG_USER_ONLY
+ if (multithreaded)
+#endif
+ spin_unlock(&tb_lock);
env->current_tb = tb;
/* cpu_interrupt might be called while translating the
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e9b07df..f7a411d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3560,6 +3560,7 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp,
ts = qemu_mallocz(sizeof(TaskState) + NEW_STACK_SIZE);
init_task_state(ts);
new_stack = ts->stack;
+ env->multithreaded = 1;
/* we create a new CPU instance. */
new_env = cpu_copy(env);
/* Init regs that differ from the parent. */
--
1.6.2.1

View File

@ -1,80 +0,0 @@
From ad0b7fcf697651a156c0e4a2911dd9fa69fd011c Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Thu, 23 Jul 2009 14:33:36 +0200
Subject: [PATCH 26/33] linux-user: dup3, fallocate syscalls
implementations of dup3 and fallocate that are good enough to fool LTP
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
configure | 18 ++++++++++++++++++
linux-user/syscall.c | 10 ++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index e0874b5..4be25f6 100755
--- a/configure
+++ b/configure
@@ -1355,6 +1355,21 @@ if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
splice=yes
fi
+# check for fallocate
+fallocate=no
+cat > $TMPC << EOF
+#include <fcntl.h>
+
+int main(void)
+{
+ fallocate(0, 0, 0, 0);
+ return 0;
+}
+EOF
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+ fallocate=yes
+fi
+
# Check if tools are available to build documentation.
if test "$build_docs" = "yes" -a \( ! -x "`which texi2html 2>/dev/null`" -o ! -x "`which pod2man 2>/dev/null`" \) ; then
build_docs="no"
@@ -1707,6 +1722,9 @@ fi
if test "$splice" = "yes" ; then
echo "#define CONFIG_SPLICE 1" >> $config_host_h
fi
+if test "$fallocate" = "yes" ; then
+ echo "#define CONFIG_FALLOCATE 1" >> $config_host_h
+fi
if test "$inotify" = "yes" ; then
echo "#define CONFIG_INOTIFY 1" >> $config_host_h
fi
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f7a411d..4fb7998 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4750,6 +4750,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_dup2:
ret = get_errno(dup2(arg1, arg2));
break;
+#ifdef TARGET_NR_dup3
+ case TARGET_NR_dup3:
+ ret = get_errno(dup3(arg1, arg2, arg3));
+ break;
+#endif
#ifdef TARGET_NR_getppid /* not on alpha */
case TARGET_NR_getppid:
ret = get_errno(getppid());
@@ -7016,6 +7021,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
}
#endif
+#if defined(CONFIG_FALLOCATE) && defined(TARGET_NR_fallocate)
+ case TARGET_NR_fallocate:
+ ret = get_errno(fallocate(arg1, arg2, arg3, arg4));
+ break;
+#endif
default:
unimplemented:
gemu_log("qemu: Unsupported syscall: %d\n", num);
--
1.6.2.1

View File

@ -1,171 +0,0 @@
From e4f2e031fe5b5f9f11560a51ce607ffdd3090c05 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Thu, 23 Jul 2009 15:10:30 +0200
Subject: [PATCH 27/33] linux-user: fcntl fixes for LTP
Fixes swaps on l_pid which were pretty much of random size. Implements
F_SETLEASE, F_GETLEASE. Now passes all LTP fcntl tests.
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
linux-user/syscall.c | 34 ++++++++++++++++++++++------------
linux-user/syscall_defs.h | 7 +++++++
2 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4fb7998..86754f1 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3705,6 +3705,14 @@ static int target_to_host_fcntl_cmd(int cmd)
case TARGET_F_SETLKW64:
return F_SETLKW64;
#endif
+ case TARGET_F_SETLEASE:
+ return F_SETLEASE;
+ case TARGET_F_GETLEASE:
+ return F_GETLEASE;
+ case TARGET_F_DUPFD_CLOEXEC:
+ return F_DUPFD_CLOEXEC;
+ case TARGET_F_NOTIFY:
+ return F_NOTIFY;
default:
return -TARGET_EINVAL;
}
@@ -3731,7 +3739,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
fl.l_whence = tswap16(target_fl->l_whence);
fl.l_start = tswapl(target_fl->l_start);
fl.l_len = tswapl(target_fl->l_len);
- fl.l_pid = tswapl(target_fl->l_pid);
+ fl.l_pid = tswap32(target_fl->l_pid);
unlock_user_struct(target_fl, arg, 0);
ret = get_errno(fcntl(fd, host_cmd, &fl));
if (ret == 0) {
@@ -3741,7 +3749,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
target_fl->l_whence = tswap16(fl.l_whence);
target_fl->l_start = tswapl(fl.l_start);
target_fl->l_len = tswapl(fl.l_len);
- target_fl->l_pid = tswapl(fl.l_pid);
+ target_fl->l_pid = tswap32(fl.l_pid);
unlock_user_struct(target_fl, arg, 1);
}
break;
@@ -3754,7 +3762,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
fl.l_whence = tswap16(target_fl->l_whence);
fl.l_start = tswapl(target_fl->l_start);
fl.l_len = tswapl(target_fl->l_len);
- fl.l_pid = tswapl(target_fl->l_pid);
+ fl.l_pid = tswap32(target_fl->l_pid);
unlock_user_struct(target_fl, arg, 0);
ret = get_errno(fcntl(fd, host_cmd, &fl));
break;
@@ -3766,7 +3774,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
fl64.l_whence = tswap16(target_fl64->l_whence);
fl64.l_start = tswapl(target_fl64->l_start);
fl64.l_len = tswapl(target_fl64->l_len);
- fl64.l_pid = tswap16(target_fl64->l_pid);
+ fl64.l_pid = tswap32(target_fl64->l_pid);
unlock_user_struct(target_fl64, arg, 0);
ret = get_errno(fcntl(fd, host_cmd, &fl64));
if (ret == 0) {
@@ -3776,7 +3784,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
target_fl64->l_whence = tswap16(fl64.l_whence);
target_fl64->l_start = tswapl(fl64.l_start);
target_fl64->l_len = tswapl(fl64.l_len);
- target_fl64->l_pid = tswapl(fl64.l_pid);
+ target_fl64->l_pid = tswap32(fl64.l_pid);
unlock_user_struct(target_fl64, arg, 1);
}
break;
@@ -3788,7 +3796,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
fl64.l_whence = tswap16(target_fl64->l_whence);
fl64.l_start = tswapl(target_fl64->l_start);
fl64.l_len = tswapl(target_fl64->l_len);
- fl64.l_pid = tswap16(target_fl64->l_pid);
+ fl64.l_pid = tswap32(target_fl64->l_pid);
unlock_user_struct(target_fl64, arg, 0);
ret = get_errno(fcntl(fd, host_cmd, &fl64));
break;
@@ -3808,6 +3816,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
case TARGET_F_GETOWN:
case TARGET_F_SETSIG:
case TARGET_F_GETSIG:
+ case TARGET_F_SETLEASE:
+ case TARGET_F_GETLEASE:
ret = get_errno(fcntl(fd, host_cmd, arg));
break;
@@ -6630,7 +6640,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
fl.l_whence = tswap16(target_efl->l_whence);
fl.l_start = tswap64(target_efl->l_start);
fl.l_len = tswap64(target_efl->l_len);
- fl.l_pid = tswapl(target_efl->l_pid);
+ fl.l_pid = tswap32(target_efl->l_pid);
unlock_user_struct(target_efl, arg3, 0);
} else
#endif
@@ -6641,7 +6651,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
fl.l_whence = tswap16(target_fl->l_whence);
fl.l_start = tswap64(target_fl->l_start);
fl.l_len = tswap64(target_fl->l_len);
- fl.l_pid = tswapl(target_fl->l_pid);
+ fl.l_pid = tswap32(target_fl->l_pid);
unlock_user_struct(target_fl, arg3, 0);
}
ret = get_errno(fcntl(arg1, cmd, &fl));
@@ -6654,7 +6664,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
target_efl->l_whence = tswap16(fl.l_whence);
target_efl->l_start = tswap64(fl.l_start);
target_efl->l_len = tswap64(fl.l_len);
- target_efl->l_pid = tswapl(fl.l_pid);
+ target_efl->l_pid = tswap32(fl.l_pid);
unlock_user_struct(target_efl, arg3, 1);
} else
#endif
@@ -6665,7 +6675,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
target_fl->l_whence = tswap16(fl.l_whence);
target_fl->l_start = tswap64(fl.l_start);
target_fl->l_len = tswap64(fl.l_len);
- target_fl->l_pid = tswapl(fl.l_pid);
+ target_fl->l_pid = tswap32(fl.l_pid);
unlock_user_struct(target_fl, arg3, 1);
}
}
@@ -6681,7 +6691,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
fl.l_whence = tswap16(target_efl->l_whence);
fl.l_start = tswap64(target_efl->l_start);
fl.l_len = tswap64(target_efl->l_len);
- fl.l_pid = tswapl(target_efl->l_pid);
+ fl.l_pid = tswap32(target_efl->l_pid);
unlock_user_struct(target_efl, arg3, 0);
} else
#endif
@@ -6692,7 +6702,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
fl.l_whence = tswap16(target_fl->l_whence);
fl.l_start = tswap64(target_fl->l_start);
fl.l_len = tswap64(target_fl->l_len);
- fl.l_pid = tswapl(target_fl->l_pid);
+ fl.l_pid = tswap32(target_fl->l_pid);
unlock_user_struct(target_fl, arg3, 0);
}
ret = get_errno(fcntl(arg1, cmd, &fl));
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 0f4fbd7..481ce59 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -1824,6 +1824,13 @@ struct target_statfs64 {
#define TARGET_F_SETLK64 13
#define TARGET_F_SETLKW64 14
#endif
+
+#define TARGET_F_LINUX_SPECIFIC_BASE 1024
+#define TARGET_F_SETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 0)
+#define TARGET_F_GETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 1)
+#define TARGET_F_DUPFD_CLOEXEC (TARGET_F_LINUX_SPECIFIC_BASE + 6)
+#define TARGET_F_NOTIFY (TARGET_F_LINUX_SPECIFIC_BASE+2)
+
#if defined (TARGET_ARM)
#define TARGET_O_ACCMODE 0003
#define TARGET_O_RDONLY 00
--
1.6.2.1

View File

@ -1,41 +0,0 @@
From 0a1fc6cfd1798da391335a37ce7f3fd6141c7ff5 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Thu, 23 Jul 2009 17:17:32 +0200
Subject: [PATCH 28/33] linux-user: enable getdents for > 32-bit systems
works perfectly fine with the example from getdents(2) and passes the LTP
tests (tested with s390x on x86_64 emulation)
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
linux-user/syscall.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 86754f1..49dfb40 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -195,9 +195,7 @@ static int gettid(void) {
return -ENOSYS;
}
#endif
-#if TARGET_ABI_BITS == 32
_syscall3(int, sys_getdents, uint, fd, struct linux_dirent *, dirp, uint, count);
-#endif
#if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)
_syscall3(int, sys_getdents64, uint, fd, struct linux_dirent64 *, dirp, uint, count);
#endif
@@ -5820,9 +5818,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
break;
#endif
case TARGET_NR_getdents:
-#if TARGET_ABI_BITS != 32
- goto unimplemented;
-#elif TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 64
+#if TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 64
{
struct target_dirent *target_dirp;
struct linux_dirent *dirp;
--
1.6.2.1

View File

@ -1,271 +0,0 @@
From d9c50cda4f12fc4c64b8b494a298659b8ad341ed Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Thu, 23 Jul 2009 17:41:57 +0200
Subject: [PATCH 29/33] linux-user: define a couple of syscalls for non-uid16 targets
Quite a number of syscalls are only defined on systems with USE_UID16
defined; this patch defines them on other systems as well.
Fixes a large number of uid/gid-related testcases on the s390x target
(and most likely on other targets as well)
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
linux-user/syscall.c | 125 ++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 105 insertions(+), 20 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 49dfb40..b1ef3c9 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -309,7 +309,7 @@ static int sys_fchmodat(int dirfd, const char *pathname, mode_t mode)
return (fchmodat(dirfd, pathname, mode, 0));
}
#endif
-#if defined(TARGET_NR_fchownat) && defined(USE_UID16)
+#if defined(TARGET_NR_fchownat)
static int sys_fchownat(int dirfd, const char *pathname, uid_t owner,
gid_t group, int flags)
{
@@ -418,7 +418,7 @@ _syscall3(int,sys_faccessat,int,dirfd,const char *,pathname,int,mode)
#if defined(TARGET_NR_fchmodat) && defined(__NR_fchmodat)
_syscall3(int,sys_fchmodat,int,dirfd,const char *,pathname, mode_t,mode)
#endif
-#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat) && defined(USE_UID16)
+#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat)
_syscall5(int,sys_fchownat,int,dirfd,const char *,pathname,
uid_t,owner,gid_t,group,int,flags)
#endif
@@ -6382,18 +6382,35 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_setfsgid:
ret = get_errno(setfsgid(arg1));
break;
+#else /* USE_UID16 */
+#if defined(TARGET_NR_fchownat) && defined(__NR_fchownat)
+ case TARGET_NR_fchownat:
+ if (!(p = lock_user_string(arg2)))
+ goto efault;
+ ret = get_errno(sys_fchownat(arg1, p, arg3, arg4, arg5));
+ unlock_user(p, arg2, 0);
+ break;
+#endif
#endif /* USE_UID16 */
-#ifdef TARGET_NR_lchown32
+#if defined(TARGET_NR_lchown32) || !defined(USE_UID16)
+#if defined(TARGET_NR_lchown32)
case TARGET_NR_lchown32:
+#else
+ case TARGET_NR_lchown:
+#endif
if (!(p = lock_user_string(arg1)))
goto efault;
ret = get_errno(lchown(p, arg2, arg3));
unlock_user(p, arg1, 0);
break;
#endif
-#ifdef TARGET_NR_getuid32
+#if defined(TARGET_NR_getuid32) || (defined(TARGET_NR_getuid) && !defined(USE_UID16))
+#if defined(TARGET_NR_getuid32)
case TARGET_NR_getuid32:
+#else
+ case TARGET_NR_getuid:
+#endif
ret = get_errno(getuid());
break;
#endif
@@ -6421,33 +6438,57 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
break;
#endif
-#ifdef TARGET_NR_getgid32
+#if defined(TARGET_NR_getgid32) || (defined(TARGET_NR_getgid) && !defined(USE_UID16))
+#if defined(TARGET_NR_getgid32)
case TARGET_NR_getgid32:
+#else
+ case TARGET_NR_getgid:
+#endif
ret = get_errno(getgid());
break;
#endif
-#ifdef TARGET_NR_geteuid32
+#if defined(TARGET_NR_geteuid32) || (defined(TARGET_NR_geteuid) && !defined(USE_UID16))
+#if defined(TARGET_NR_geteuid32)
case TARGET_NR_geteuid32:
+#else
+ case TARGET_NR_geteuid:
+#endif
ret = get_errno(geteuid());
break;
#endif
-#ifdef TARGET_NR_getegid32
+#if defined(TARGET_NR_getegid32) || (defined(TARGET_NR_getegid) && !defined(USE_UID16))
+#if defined(TARGET_NR_getegid32)
case TARGET_NR_getegid32:
+#else
+ case TARGET_NR_getegid:
+#endif
ret = get_errno(getegid());
break;
#endif
-#ifdef TARGET_NR_setreuid32
+#if defined(TARGET_NR_setreuid32) || !defined(USE_UID16)
+#if defined(TARGET_NR_setreuid32)
case TARGET_NR_setreuid32:
+#else
+ case TARGET_NR_setreuid:
+#endif
ret = get_errno(setreuid(arg1, arg2));
break;
#endif
-#ifdef TARGET_NR_setregid32
+#if defined(TARGET_NR_setregid32) || !defined(USE_UID16)
+#if defined(TARGET_NR_setregid32)
case TARGET_NR_setregid32:
+#else
+ case TARGET_NR_setregid:
+#endif
ret = get_errno(setregid(arg1, arg2));
break;
#endif
-#ifdef TARGET_NR_getgroups32
+#if defined(TARGET_NR_getgroups32) || !defined(USE_UID16)
+#if defined(TARGET_NR_getgroups32)
case TARGET_NR_getgroups32:
+#else
+ case TARGET_NR_getgroups:
+#endif
{
int gidsetsize = arg1;
uint32_t *target_grouplist;
@@ -6471,8 +6512,12 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
}
break;
#endif
-#ifdef TARGET_NR_setgroups32
+#if defined(TARGET_NR_setgroups32) || !defined(USE_UID16)
+#if defined(TARGET_NR_setgroups32)
case TARGET_NR_setgroups32:
+#else
+ case TARGET_NR_setgroups:
+#endif
{
int gidsetsize = arg1;
uint32_t *target_grouplist;
@@ -6492,18 +6537,30 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
}
break;
#endif
-#ifdef TARGET_NR_fchown32
+#if defined(TARGET_NR_fchown32) || !defined(USE_UID16)
+#if defined(TARGET_NR_fchown32)
case TARGET_NR_fchown32:
+#else
+ case TARGET_NR_fchown:
+#endif
ret = get_errno(fchown(arg1, arg2, arg3));
break;
#endif
-#ifdef TARGET_NR_setresuid32
+#if defined(TARGET_NR_setresuid32) || !defined(USE_UID16)
+#if defined(TARGET_NR_setresuid32)
case TARGET_NR_setresuid32:
+#else
+ case TARGET_NR_setresuid:
+#endif
ret = get_errno(setresuid(arg1, arg2, arg3));
break;
#endif
-#ifdef TARGET_NR_getresuid32
+#if defined(TARGET_NR_getresuid32) || !defined(USE_UID16)
+#if defined(TARGET_NR_getresuid32)
case TARGET_NR_getresuid32:
+#else
+ case TARGET_NR_getresuid:
+#endif
{
uid_t ruid, euid, suid;
ret = get_errno(getresuid(&ruid, &euid, &suid));
@@ -6516,13 +6573,21 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
}
break;
#endif
-#ifdef TARGET_NR_setresgid32
+#if defined(TARGET_NR_setresgid32) || !defined(USE_UID16)
+#if defined(TARGET_NR_setresgid32)
case TARGET_NR_setresgid32:
+#else
+ case TARGET_NR_setresgid:
+#endif
ret = get_errno(setresgid(arg1, arg2, arg3));
break;
#endif
+#if defined(TARGET_NR_getresgid32) || !defined(USE_UID16)
#ifdef TARGET_NR_getresgid32
case TARGET_NR_getresgid32:
+#else
+ case TARGET_NR_getresgid:
+#endif
{
gid_t rgid, egid, sgid;
ret = get_errno(getresgid(&rgid, &egid, &sgid));
@@ -6535,31 +6600,51 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
}
break;
#endif
-#ifdef TARGET_NR_chown32
+#if defined(TARGET_NR_chown32) || !defined(USE_UID16)
+#if defined(TARGET_NR_chown32)
case TARGET_NR_chown32:
+#else
+ case TARGET_NR_chown:
+#endif
if (!(p = lock_user_string(arg1)))
goto efault;
ret = get_errno(chown(p, arg2, arg3));
unlock_user(p, arg1, 0);
break;
#endif
-#ifdef TARGET_NR_setuid32
+#if defined(TARGET_NR_setuid32) || !defined(USE_UID16)
+#if defined(TARGET_NR_setuid32)
case TARGET_NR_setuid32:
+#else
+ case TARGET_NR_setuid:
+#endif
ret = get_errno(setuid(arg1));
break;
#endif
-#ifdef TARGET_NR_setgid32
+#if defined(TARGET_NR_setgid32) || !defined(USE_UID16)
+#if defined(TARGET_NR_setgid32)
case TARGET_NR_setgid32:
+#else
+ case TARGET_NR_setgid:
+#endif
ret = get_errno(setgid(arg1));
break;
#endif
-#ifdef TARGET_NR_setfsuid32
+#if defined(TARGET_NR_setfsuid32) || !defined(USE_UID16)
+#if defined(TARGET_NR_setfsuid32)
case TARGET_NR_setfsuid32:
+#else
+ case TARGET_NR_setfsuid:
+#endif
ret = get_errno(setfsuid(arg1));
break;
#endif
-#ifdef TARGET_NR_setfsgid32
+#if defined(TARGET_NR_setfsgid32) || !defined(USE_UID16)
+#if defined(TARGET_NR_setfsgid32)
case TARGET_NR_setfsgid32:
+#else
+ case TARGET_NR_setfsgid:
+#endif
ret = get_errno(setfsgid(arg1));
break;
#endif
--
1.6.2.1

View File

@ -1,28 +0,0 @@
From 03004ec00de3f29699a6bb9458942ea111f528ed Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Thu, 23 Jul 2009 17:55:41 +0200
Subject: [PATCH 30/33] linux-user: getpriority errno fix
getpriority returned wrong errno; fixes LTP test getpriority02.
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
linux-user/syscall.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b1ef3c9..30fb4ab 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5327,7 +5327,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
/* libc does special remapping of the return value of
* sys_getpriority() so it's just easiest to call
* sys_getpriority() directly rather than through libc. */
- ret = sys_getpriority(arg1, arg2);
+ ret = get_errno(sys_getpriority(arg1, arg2));
break;
case TARGET_NR_setpriority:
ret = get_errno(setpriority(arg1, arg2, arg3));
--
1.6.2.1

View File

@ -1,46 +0,0 @@
From 51e609fc6a4a6ff29cd463babfe14032aea18254 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Thu, 23 Jul 2009 14:56:59 +0200
Subject: [PATCH 31/33] linux-user: fadvise64 implementation
good enough to pass all LTP fadvise64 tests
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
linux-user/syscall.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 30fb4ab..c4b7001 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6680,12 +6680,23 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
arg4 = temp;
}
#endif
-#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_arm_fadvise64_64)
+#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_arm_fadvise64_64) || defined(TARGET_NR_fadvise64)
#ifdef TARGET_NR_fadvise64_64
case TARGET_NR_fadvise64_64:
#endif
- /* This is a hint, so ignoring and returning success is ok. */
- ret = get_errno(0);
+#ifdef TARGET_NR_fadvise64
+ case TARGET_NR_fadvise64:
+#endif
+#ifdef TARGET_S390X
+ switch (arg4) {
+ case 4: arg4 = POSIX_FADV_NOREUSE + 1; break; /* make sure it's an invalid value */
+ case 5: arg4 = POSIX_FADV_NOREUSE + 2; break; /* ditto */
+ case 6: arg4 = POSIX_FADV_DONTNEED; break;
+ case 7: arg4 = POSIX_FADV_NOREUSE; break;
+ default: break;
+ }
+#endif
+ ret = -posix_fadvise(arg1, arg2, arg3, arg4);
break;
#endif
#ifdef TARGET_NR_madvise
--
1.6.2.1

View File

@ -1,31 +0,0 @@
From 50a2b3b61b897ada12c267538e9f65578c256880 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Fri, 10 Jul 2009 16:43:26 +0200
Subject: [PATCH 32/33] linux-user: zero fstat buffer to initialize nsec fields
The fstat implementation does not initialize the nanosecond fields in the
stat buffer; this caused funny values to turn up there, preventing, for
instance, cp -p from preserving timestamps because utimensat rejected
the out-of-bounds nanosecond values. Resetting the entire structure
to zero fixes that.
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
linux-user/syscall.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c4b7001..ef76537 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5552,6 +5552,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
if (!lock_user_struct(VERIFY_WRITE, target_st, arg2, 0))
goto efault;
+ memset(target_st, 0, sizeof(*target_st));
__put_user(st.st_dev, &target_st->st_dev);
__put_user(st.st_ino, &target_st->st_ino);
__put_user(st.st_mode, &target_st->st_mode);
--
1.6.2.1

View File

@ -1,76 +0,0 @@
From 1e8223836a2e09899cd946db4e4ee99b64ceb7a4 Mon Sep 17 00:00:00 2001
From: Ulrich Hecht <uli@suse.de>
Date: Thu, 30 Jul 2009 16:02:52 +0200
Subject: [PATCH 33/33] dup3 check, fallocate check fixed
Signed-off-by: Ulrich Hecht <uli@suse.de>
---
configure | 20 +++++++++++++++++++-
linux-user/syscall.c | 4 +++-
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 4be25f6..8d3967d 100755
--- a/configure
+++ b/configure
@@ -1370,6 +1370,21 @@ if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
fallocate=yes
fi
+# check for dup3
+dup3=no
+cat > $TMPC << EOF
+#include <unistd.h>
+
+int main(void)
+{
+ dup3(0, 0, 0);
+ return 0;
+}
+EOF
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+ dup3=yes
+fi
+
# Check if tools are available to build documentation.
if test "$build_docs" = "yes" -a \( ! -x "`which texi2html 2>/dev/null`" -o ! -x "`which pod2man 2>/dev/null`" \) ; then
build_docs="no"
@@ -1723,7 +1738,10 @@ if test "$splice" = "yes" ; then
echo "#define CONFIG_SPLICE 1" >> $config_host_h
fi
if test "$fallocate" = "yes" ; then
- echo "#define CONFIG_FALLOCATE 1" >> $config_host_h
+ echo "CONFIG_FALLOCATE=y" >> $config_host_mak
+fi
+if test "$dup3" = "yes" ; then
+ echo "CONFIG_DUP3=y" >> $config_host_mak
fi
if test "$inotify" = "yes" ; then
echo "#define CONFIG_INOTIFY 1" >> $config_host_h
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ef76537..6c109de 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3707,8 +3707,10 @@ static int target_to_host_fcntl_cmd(int cmd)
return F_SETLEASE;
case TARGET_F_GETLEASE:
return F_GETLEASE;
+#ifdef F_DUPFD_CLOEXEC
case TARGET_F_DUPFD_CLOEXEC:
return F_DUPFD_CLOEXEC;
+#endif
case TARGET_F_NOTIFY:
return F_NOTIFY;
default:
@@ -4758,7 +4760,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_dup2:
ret = get_errno(dup2(arg1, arg2));
break;
-#ifdef TARGET_NR_dup3
+#if defined(TARGET_NR_dup3) && defined(CONFIG_DUP3)
case TARGET_NR_dup3:
ret = get_errno(dup3(arg1, arg2, arg3));
break;
--
1.6.2.1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:58ad4225ba18ba5166977a7e0f5cd1bb94ee4e5f9fce65274d6dbb30035958ab
size 3292681

3
qemu-0.14.0-rc1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c4f5c01033e6a4a39f221cfad84e2d15e4e6c1023d263b8480d6aea4afbc0ac
size 4545302

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Thu Feb 10 14:48:36 CET 2011 - uli@suse.de
- update -> 0.14.0-rc1
See http://wiki.qemu.org/Changelog/0.14 for changes in 0.14.
(There is no such page for the 0.13 tree. The ChangeLog file ends at
0.12.0, http://wiki.qemu.org/ChangeLog at 0.12.5 and suggests to look at
the git log. High-level information of what has changed in 0.13 is
apparently not available.)
-------------------------------------------------------------------
Fri May 28 18:57:23 CEST 2010 - uli@suse.de
- update -> 0.12.4
see http://wiki.qemu.org/ChangeLog for changes
-------------------------------------------------------------------
Wed May 19 17:37:03 UTC 2010 - brogers@novell.com

View File

@ -1,5 +1,5 @@
#
# spec file for package qemu (Version 0.11.0)
# spec file for package qemu (Version 0.12.4)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -19,14 +19,14 @@
Name: qemu
BuildRequires: SDL-devel bison bluez-devel curl-devel cyrus-sasl-devel e2fsprogs-devel libaio-devel libgnutls-devel libpcap-devel ncurses-devel zlib-devel-static
BuildRequires: SDL-devel bison bluez-devel curl-devel cyrus-sasl-devel e2fsprogs-devel libaio libaio-devel libgnutls-devel libpcap-devel ncurses-devel zlib-devel-static
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: 0.11.0
Release: 6
Source: %name-0.11.0.tar.bz2
Version: 0.14.0_rc1
Release: 1
Source: %name-0.14.0-rc1.tar.bz2
Patch1: 0001-qemu-0.7.0-amd64.patch
Patch2: 0002-qemu-0.9.0.cvs-binfmt.patch
Patch3: 0003-qemu-cvs-alsa_bitfield.patch
@ -35,31 +35,15 @@ Patch5: 0005-qemu-cvs-alsa_mmap.patch
Patch6: 0006-qemu-cvs-gettimeofday.patch
Patch7: 0007-qemu-cvs-ioctl_debug.patch
Patch8: 0008-qemu-cvs-ioctl_nodirection.patch
Patch9: 0009-qemu-cvs-newpath.patch
Patch10: 0010-qemu-cvs-sched_getaffinity.patch
Patch11: 0011-qemu-cvs-mmap-amd64.patch
Patch12: 0012-qemu-cvs-pthread.patch
Patch13: 0013-qemu-img-vmdk-scsi.patch
Patch14: 0014-qemu-nonvoid_return.patch
Patch15: 0015-pcap-network-emulation.patch
Patch16: 0016-i386-linux-user-NPTL-support.patch
Patch17: 0017-qemu-0.11-git-ioctl_mount.patch
Patch18: 0018-qemu-0.11-git-user-linux-ppc-uid16_fix.patch
Patch19: 0019-Rewrite-mmap_find_vma-to-work-fine-on-64-bit-hosts.patch
Patch20: 0020-TCG-sync-op-32-bit-targets-fixed.patch
Patch21: 0021-S-390-CPU-emulation.patch
Patch22: 0022-S-390-host-target-build-system-support.patch
Patch23: 0023-S-390-host-support-for-TCG.patch
Patch24: 0024-linux-user-S-390-64-bit-s390x-support.patch
Patch25: 0025-linux-user-don-t-do-locking-in-single-threaded-proc.patch
Patch26: 0026-linux-user-dup3-fallocate-syscalls.patch
Patch27: 0027-linux-user-fcntl-fixes-for-LTP.patch
Patch28: 0028-linux-user-enable-getdents-for-32-bit-systems.patch
Patch29: 0029-linux-user-define-a-couple-of-syscalls-for-non-uid1.patch
Patch30: 0030-linux-user-getpriority-errno-fix.patch
Patch31: 0031-linux-user-fadvise64-implementation.patch
Patch32: 0032-linux-user-zero-fstat-buffer-to-initialize-nsec-fie.patch
Patch33: 0033-dup3-check-fallocate-check-fixed.patch
Patch9: 0009-qemu-cvs-sched_getaffinity.patch
Patch10: 0010-qemu-cvs-mmap-amd64.patch
Patch11: 0011-qemu-img-vmdk-scsi.patch
Patch12: 0012-qemu-nonvoid_return.patch
Patch13: 0013-i386-linux-user-NPTL-support.patch
Patch14: 0014-qemu-0.11-git-ioctl_mount.patch
Patch15: 0015-S-390-support.patch
Patch16: 0016-fix-mipsn32-linux-user-builds.patch
Patch17: 0017-S-390-build-fix.patch
# this is to make lint happy
Source300: rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -80,7 +64,7 @@ Authors:
Fabrice Bellard <fabrice.bellard@free.fr>
%prep
%setup -q -n qemu-0.11.0
%setup -q -n %name-0.14.0-rc1
%patch1 -p1
%patch2 -p1
%patch3 -p1
@ -95,34 +79,18 @@ Authors:
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%ifarch s390x ppc64 x86_64
# s390 target only builds on 64-bit machines
%patch22 -p1
%patch15 -p1
%patch17 -p1
%endif
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch16 -p1
%build
# build QEMU
mkdir -p dynamic
# build qemu-system
./configure --prefix=/usr \
./configure --prefix=/usr --sysconfdir=%_sysconfdir \
--interp-prefix=/usr/share/qemu/qemu-i386 \
--audio-card-list="ac97 es1370 sb16 cs4231a adlib gus" \
--audio-drv-list="alsa sdl" --enable-mixemu \
@ -139,11 +107,11 @@ make qemu-img V=1
mv */qemu */qemu-* qemu-io dynamic || true
make clean
# build userland emus
./configure --prefix=/usr \
./configure --prefix=/usr --sysconfdir=%_sysconfdir \
--interp-prefix=/usr/share/qemu/qemu-i386 \
--enable-linux-user \
--disable-system \
--static \
--static --disable-linux-aio \
--extra-cflags="$QEMU_OPT_FLAGS"
make %{?jobs:-j%{jobs}} V=1
@ -156,7 +124,7 @@ install -m 755 */qemu $RPM_BUILD_ROOT/usr/bin
ln -sf qemu $RPM_BUILD_ROOT/usr/bin/qemu-system-i386
install -m 755 */qemu-*[^.]? $RPM_BUILD_ROOT/usr/bin
install -d -m 755 $RPM_BUILD_ROOT/usr/sbin
install -m 755 qemu-binfmt-conf.sh $RPM_BUILD_ROOT/usr/sbin
install -m 755 dynamic/qemu-binfmt-conf.sh $RPM_BUILD_ROOT/usr/sbin
%ifnarch %ix86 x86_64
ln -sf ../../../emul/ia32-linux $RPM_BUILD_ROOT/usr/share/qemu/qemu-i386
%endif
@ -178,5 +146,7 @@ rm -rf ${RPM_BUILD_ROOT}
%ifnarch %ix86 x86_64 ia64
%dir /emul/ia32-linux
%endif
%dir %_sysconfdir/qemu
%config %_sysconfdir/qemu/target-x86_64.conf
%changelog