qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] linux-user updates.
@ 2009-10-16 14:02 riku.voipio
  2009-10-16 14:02 ` [Qemu-devel] [PATCH 1/5] implementations of dup3 and fallocate that are good enough to fool LTP riku.voipio
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: riku.voipio @ 2009-10-16 14:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

From: Riku Voipio <riku.voipio@iki.fi>

Long time no update... A set of relatively small patches for comment
on the list before sending a pull request.

Max Filippov (1):
  linux-user: fix ppc target_stat64 st_blocks layout

Paul Bolle (1):
  linux-user: don't zero a buffer twice

Riku Voipio (1):
  linux-user: Update ARM hwcaps

Ulrich Hecht (2):
  implementations of dup3 and fallocate that are good enough to fool LTP
  linux-user: getpriority errno fix

 configure                 |   36 ++++++++++++++++++++++++++++++++++++
 linux-user/elfload.c      |    9 ++++++++-
 linux-user/linuxload.c    |    1 -
 linux-user/syscall.c      |   12 +++++++++++-
 linux-user/syscall_defs.h |    2 +-
 5 files changed, 56 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 1/5] implementations of dup3 and fallocate that are good enough to fool LTP
  2009-10-16 14:02 [Qemu-devel] [PATCH 0/5] linux-user updates riku.voipio
@ 2009-10-16 14:02 ` riku.voipio
  2009-10-16 14:02 ` [Qemu-devel] [PATCH 2/5] linux-user: getpriority errno fix riku.voipio
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: riku.voipio @ 2009-10-16 14:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

From: Ulrich Hecht <uli@suse.de>

updated fallocate check to new configure, added dup3 check as suggested
by Jan-Simon Möller.

Riku: updated to apply to current git.

Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 configure            |   36 ++++++++++++++++++++++++++++++++++++
 linux-user/syscall.c |   10 ++++++++++
 2 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index ca6d45c..3df9d07 100755
--- a/configure
+++ b/configure
@@ -1569,6 +1569,36 @@ if compile_prog "" "" ; then
   eventfd=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 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 "$docs" != "no" ; then
   if test -x "`which texi2html 2>/dev/null`" -a \
@@ -1950,6 +1980,12 @@ fi
 if test "$eventfd" = "yes" ; then
   echo "CONFIG_EVENTFD=y" >> $config_host_mak
 fi
+if test "$fallocate" = "yes" ; then
+  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 "CONFIG_INOTIFY=y" >> $config_host_mak
 fi
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index bf06d14..d07c381 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4746,6 +4746,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_dup2:
         ret = get_errno(dup2(arg1, arg2));
         break;
+#if defined(CONFIG_DUP3) && defined(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());
@@ -7013,6 +7018,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         break;
 #endif
 #endif /* CONFIG_EVENTFD  */
+#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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 2/5] linux-user: getpriority errno fix
  2009-10-16 14:02 [Qemu-devel] [PATCH 0/5] linux-user updates riku.voipio
  2009-10-16 14:02 ` [Qemu-devel] [PATCH 1/5] implementations of dup3 and fallocate that are good enough to fool LTP riku.voipio
@ 2009-10-16 14:02 ` riku.voipio
  2009-10-16 14:02 ` [Qemu-devel] [PATCH 3/5] linux-user: fix ppc target_stat64 st_blocks layout riku.voipio
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: riku.voipio @ 2009-10-16 14:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

From: Ulrich Hecht <uli@suse.de>

getpriority returned wrong errno; fixes LTP test getpriority02.

Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 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 d07c381..baf00e0 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5311,7 +5311,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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 3/5] linux-user: fix ppc target_stat64 st_blocks layout
  2009-10-16 14:02 [Qemu-devel] [PATCH 0/5] linux-user updates riku.voipio
  2009-10-16 14:02 ` [Qemu-devel] [PATCH 1/5] implementations of dup3 and fallocate that are good enough to fool LTP riku.voipio
  2009-10-16 14:02 ` [Qemu-devel] [PATCH 2/5] linux-user: getpriority errno fix riku.voipio
@ 2009-10-16 14:02 ` riku.voipio
  2009-10-16 14:02 ` [Qemu-devel] [PATCH 4/5] linux-user: don't zero a buffer twice riku.voipio
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: riku.voipio @ 2009-10-16 14:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Max Filippov, Riku Voipio

From: Max Filippov <jcmvbkbc@gmail.com>

Swap __pad1 and st_blocks fields location to maintain proper alignment.
This fixes incorrect 'du' and 'stat' report on ppc guest.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 linux-user/syscall_defs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index c018165..dce36b2 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -1187,8 +1187,8 @@ struct __attribute__((__packed__)) target_stat64 {
 	unsigned long long __pad0;
 	long long      st_size;
 	int	       st_blksize;
-	long long      st_blocks;	/* Number 512-byte blocks allocated. */
 	unsigned int   __pad1;
+	long long      st_blocks;	/* Number 512-byte blocks allocated. */
 	int	       target_st_atime;
         unsigned int   target_st_atime_nsec;
 	int	       target_st_mtime;
-- 
1.6.2.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 4/5] linux-user: don't zero a buffer twice
  2009-10-16 14:02 [Qemu-devel] [PATCH 0/5] linux-user updates riku.voipio
                   ` (2 preceding siblings ...)
  2009-10-16 14:02 ` [Qemu-devel] [PATCH 3/5] linux-user: fix ppc target_stat64 st_blocks layout riku.voipio
@ 2009-10-16 14:02 ` riku.voipio
  2009-10-16 14:02 ` [Qemu-devel] [PATCH 5/5] linux-user: Update ARM hwcaps riku.voipio
  2009-10-17  9:18 ` [Qemu-devel] [PATCH 0/5] linux-user updates Edgar E. Iglesias
  5 siblings, 0 replies; 7+ messages in thread
From: riku.voipio @ 2009-10-16 14:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paul Bolle, Riku Voipio

From: Paul Bolle <pebolle@tiscali.nl>

prepare_binprm() zeroes bprm->buf. That buffer is already zeroed in
main() and hasn't been touched since so that is not necessary.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 linux-user/linuxload.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c
index 4091bdc..2d778a2 100644
--- a/linux-user/linuxload.c
+++ b/linux-user/linuxload.c
@@ -96,7 +96,6 @@ static int prepare_binprm(struct linux_binprm *bprm)
 	}
     }
 
-    memset(bprm->buf, 0, sizeof(bprm->buf));
     retval = lseek(bprm->fd, 0L, SEEK_SET);
     if(retval >= 0) {
         retval = read(bprm->fd, bprm->buf, 128);
-- 
1.6.2.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 5/5] linux-user: Update ARM hwcaps
  2009-10-16 14:02 [Qemu-devel] [PATCH 0/5] linux-user updates riku.voipio
                   ` (3 preceding siblings ...)
  2009-10-16 14:02 ` [Qemu-devel] [PATCH 4/5] linux-user: don't zero a buffer twice riku.voipio
@ 2009-10-16 14:02 ` riku.voipio
  2009-10-17  9:18 ` [Qemu-devel] [PATCH 0/5] linux-user updates Edgar E. Iglesias
  5 siblings, 0 replies; 7+ messages in thread
From: riku.voipio @ 2009-10-16 14:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

From: Riku Voipio <riku.voipio@iki.fi>

Update ARM hwcaps to match Linux kernel 2.6.31 state

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 linux-user/elfload.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 62a3f2a..682a813 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -330,11 +330,18 @@ enum
   ARM_HWCAP_ARM_FPA       = 1 << 5,
   ARM_HWCAP_ARM_VFP       = 1 << 6,
   ARM_HWCAP_ARM_EDSP      = 1 << 7,
+  ARM_HWCAP_ARM_JAVA      = 1 << 8,
+  ARM_HWCAP_ARM_IWMMXT    = 1 << 9,
+  ARM_HWCAP_ARM_THUMBEE   = 1 << 10,
+  ARM_HWCAP_ARM_NEON      = 1 << 11,
+  ARM_HWCAP_ARM_VFPv3     = 1 << 12,
+  ARM_HWCAP_ARM_VFPv3D16  = 1 << 13,
 };
 
 #define ELF_HWCAP (ARM_HWCAP_ARM_SWP | ARM_HWCAP_ARM_HALF              \
                     | ARM_HWCAP_ARM_THUMB | ARM_HWCAP_ARM_FAST_MULT     \
-                    | ARM_HWCAP_ARM_FPA | ARM_HWCAP_ARM_VFP)
+                    | ARM_HWCAP_ARM_FPA | ARM_HWCAP_ARM_VFP \
+                    | ARM_HWCAP_ARM_NEON | ARM_HWCAP_ARM_VFPv3 )
 
 #endif
 
-- 
1.6.2.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 0/5] linux-user updates.
  2009-10-16 14:02 [Qemu-devel] [PATCH 0/5] linux-user updates riku.voipio
                   ` (4 preceding siblings ...)
  2009-10-16 14:02 ` [Qemu-devel] [PATCH 5/5] linux-user: Update ARM hwcaps riku.voipio
@ 2009-10-17  9:18 ` Edgar E. Iglesias
  5 siblings, 0 replies; 7+ messages in thread
From: Edgar E. Iglesias @ 2009-10-17  9:18 UTC (permalink / raw)
  To: riku.voipio; +Cc: qemu-devel

On Fri, Oct 16, 2009 at 05:02:26PM +0300, riku.voipio@iki.fi wrote:
> From: Riku Voipio <riku.voipio@iki.fi>
> 
> Long time no update... A set of relatively small patches for comment
> on the list before sending a pull request.
> 
> Max Filippov (1):
>   linux-user: fix ppc target_stat64 st_blocks layout
> 
> Paul Bolle (1):
>   linux-user: don't zero a buffer twice
> 
> Riku Voipio (1):
>   linux-user: Update ARM hwcaps
> 
> Ulrich Hecht (2):
>   implementations of dup3 and fallocate that are good enough to fool LTP
>   linux-user: getpriority errno fix
> 
>  configure                 |   36 ++++++++++++++++++++++++++++++++++++
>  linux-user/elfload.c      |    9 ++++++++-
>  linux-user/linuxload.c    |    1 -
>  linux-user/syscall.c      |   12 +++++++++++-
>  linux-user/syscall_defs.h |    2 +-
>  5 files changed, 56 insertions(+), 4 deletions(-)

Looks good!

Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-17  9:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-16 14:02 [Qemu-devel] [PATCH 0/5] linux-user updates riku.voipio
2009-10-16 14:02 ` [Qemu-devel] [PATCH 1/5] implementations of dup3 and fallocate that are good enough to fool LTP riku.voipio
2009-10-16 14:02 ` [Qemu-devel] [PATCH 2/5] linux-user: getpriority errno fix riku.voipio
2009-10-16 14:02 ` [Qemu-devel] [PATCH 3/5] linux-user: fix ppc target_stat64 st_blocks layout riku.voipio
2009-10-16 14:02 ` [Qemu-devel] [PATCH 4/5] linux-user: don't zero a buffer twice riku.voipio
2009-10-16 14:02 ` [Qemu-devel] [PATCH 5/5] linux-user: Update ARM hwcaps riku.voipio
2009-10-17  9:18 ` [Qemu-devel] [PATCH 0/5] linux-user updates Edgar E. Iglesias

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).