linux-user updates.
cover linux-user updates.
From: Riku Voipio <[email protected]>
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(-)
PATCH 1/5 implementations of dup3 and fallocate that are good enough to fool LTP
From: Ulrich Hecht <[email protected]>
updated fallocate check to new configure, added dup3 check as suggested by Jan-Simon Möller.
Riku: updated to apply to current git.
--- configure | 36 ++++++++++++++++++++++++++++++++++++ linux-user/syscall.c | 10 ++++++++++ 2 files changed, 46 insertions(+), 0 deletions(-)
configure +36 -0
@@ -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
linux-user/syscall.c +10 -0
@@ -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);
Signature · 1 line
1.6.2.1
PATCH 2/5 linux-user: getpriority errno fix
In reply to [email protected]From: Ulrich Hecht <[email protected]>
getpriority returned wrong errno; fixes LTP test getpriority02.
--- linux-user/syscall.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
linux-user/syscall.c +1 -1
@@ -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));
Signature · 1 line
1.6.2.1
PATCH 3/5 linux-user: fix ppc target_stat64 st_blocks layout
In reply to [email protected]From: Max Filippov <[email protected]>
Swap __pad1 and st_blocks fields location to maintain proper alignment. This fixes incorrect 'du' and 'stat' report on ppc guest.
--- linux-user/syscall_defs.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
linux-user/syscall_defs.h +1 -1
@@ -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;
Signature · 1 line
1.6.2.1
PATCH 4/5 linux-user: don't zero a buffer twice
In reply to [email protected]From: Paul Bolle <[email protected]>
prepare_binprm() zeroes bprm->buf. That buffer is already zeroed in main() and hasn't been touched since so that is not necessary.
--- linux-user/linuxload.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
linux-user/linuxload.c +0 -1
@@ -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 );
Signature · 1 line
1.6.2.1
PATCH 5/5 linux-user: Update ARM hwcaps
In reply to [email protected]From: Riku Voipio <[email protected]>
Update ARM hwcaps to match Linux kernel 2.6.31 state
--- linux-user/elfload.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
linux-user/elfload.c +8 -1
@@ -330,11 +330,18 @@ enumARM_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
Signature · 1 line
1.6.2.1
Quoted 18 lines · On Fri, Oct 16, 2009 at 05:02:26PM +0300, [email protected] wrote:
From: Riku Voipio <[email protected]>
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 ppctarget_stat64st_blockslayoutPaul Bolle (1):
linux-user: don't zero a buffer twiceRiku Voipio (1):
linux-user: Update ARM hwcapsUlrich Hecht (2):
implementations of dup3 and fallocate that are good enough to fool LTP
linux-user: getpriority errno fix
Quoted 6 lines
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!