1. 21 10月, 2016 4 次提交
    • A
      linux-user: Add support for clock_adjtime() syscall · 38860a03
      Aleksandar Markovic 提交于
      This patch implements Qemu user mode clock_adjtime() syscall support.
      
      The implementation is based on invocation of host's clock_adjtime().
      Signed-off-by: NAleksandar Rikalo <aleksandar.rikalo@imgtec.com>
      Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com>
      Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
      38860a03
    • A
      linux-user: Fix syslog() syscall support · da2c8ad7
      Aleksandar Markovic 提交于
      There are currently several problems related to syslog() support.
      
      For example, if the second argument "bufp" of target syslog() syscall
      is NULL, the current implementation always returns error code EFAULT.
      However, NULL is a perfectly valid value for the second argument for
      many use cases of this syscall. This is, for example, visible from
      this excerpt of man page for syslog(2):
      
      > EINVAL Bad arguments (e.g., bad type; or for type 2, 3, or 4, buf is
      >        NULL, or len is less than zero; or for type 8, the level is
      >        outside the range 1 to 8).
      
      Moreover, the argument "bufp" is ignored for all cases of values of the
      first argument, except 2, 3 and 4. This means that for such cases
      (the first argument is not 2, 3 or 4), there is no need to pass "buf"
      between host and target, and it can be set to NULL while calling host's
      syslog(), without loss of emulation accuracy.
      
      Note also that if "bufp" is NULL and the first argument is 2, 3 or 4, the
      correct returned error code is EINVAL, not EFAULT.
      
      All these details are reflected in this patch.
      
      "#ifdef TARGET_NR_syslog" is also proprerly inserted when needed.
      
      Support for Qemu's "-strace" switch for syslog() syscall is included too.
      
      LTP tests syslog11 and syslog12 pass with this patch (while fail without
      it), on any platform.
      
      Changes to original patch by Riku Voipio:
      
       fixed error paths in TARGET_SYSLOG_ACTION_READ_ALL to match
      
      http://lxr.free-electrons.com/source/kernel/printk/printk.c?v=4.7#L1335
      
      Should fix also the build error in:
      
      https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg03721.htmlSigned-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com>
      Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
      da2c8ad7
    • A
      linux-user: Fix socketcall() syscall support · ff71a454
      Aleksandar Markovic 提交于
      Since not all Linux host platforms support socketcall() (most notably
      Intel), do_socketcall() function in Qemu's syscalls.c is implemented to
      mirror the corespondant implementation of socketcall() in Linux kernel,
      and to utilise individual socket operations that are supported on all
      Linux platforms. (see kernel source file net/socket.c, definition of
      socketcall).
      
      However, error codes produced by Qemu implementation are wrong for the
      cases of invalid values of the first argument. Also, naming of constants
      is not consistent with kernel one, and not consistant with Qemu convention
      of prefixing such constants with "TARGET_". This patch in that light
      brings do_socketcall() closer to its kernel counterpart, and in that way
      fixes the errors and yields more consisrtent Qemu code.
      
      There were also three missing cases (among 20) for strace support for
      socketcall(). The array that contains pointers for appropriate printing
      functions is updated with 3 elements, however pointers to functions are
      left NULL, and its implementation is left for future.
      
      Also, this patch fixes failure of LTP test socketcall02, if executed on some
      Qemu emulated sywstems (uer mode).
      Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com>
      Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
      ff71a454
    • A
      linux-user: Add support for adjtimex() syscall · 19f59bce
      Aleksandar Markovic 提交于
      This patch implements Qemu user mode adjtimex() syscall support.
      
      Syscall adjtimex() reads and optionally sets parameters for a clock
      adjustment algorithm used in network synchonization or similar scenarios.
      
      Its declaration is:
      
      int adjtimex(struct timex *buf);
      
      The correspondent source code in the Linux kernel is at kernel/time.c,
      line 206.
      
      The Qemu implementation is based on invocation of host's adjtimex(), and
      its key part is in the "TARGET_NR_adjtimex" case segment of the the main
      switch statement of the function do_syscall(), in linux-user/syscalls.c. All
      necessary conversions of the data structures from target to host and from
      host to target are covered. Two new functions, target_to_host_timex() and
      host_to_target_timex(), are provided for the purpose of such conversions.
      For that purpose, the support for related structure "timex" had tp be added
      to the file linux-user/syscall_defs.h, based on its definition in Linux
      kernel. Also, the relevant support for "-strace" Qemu option is included
      in files linux-user/strace.c and linux-user/strace.list.
      
      This patch also fixes failures of LTP tests adjtimex01 and adjtimex02, if
      executed in Qemu user mode.
      Signed-off-by: NAleksandar Rikalo <aleksandar.rikalo@imgtec.com>
      Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com>
      Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
      19f59bce
  2. 21 9月, 2016 1 次提交
  3. 26 6月, 2016 4 次提交
  4. 17 6月, 2016 1 次提交
  5. 08 6月, 2016 1 次提交
  6. 29 1月, 2016 1 次提交
  7. 05 4月, 2013 1 次提交
  8. 11 3月, 2013 2 次提交
  9. 30 1月, 2013 1 次提交
  10. 05 8月, 2012 1 次提交
  11. 02 2月, 2012 2 次提交
  12. 27 10月, 2011 1 次提交
  13. 02 5月, 2011 1 次提交
  14. 26 4月, 2011 1 次提交
  15. 17 2月, 2011 2 次提交
    • L
      linux-user: in linux-user/strace.c, tswap() is useless · d2ee72a5
      Laurent Vivier 提交于
      Syscall parameters are already swapped by the caller.
      
      This patch removes useless tswap() from strace.c
      
      $ QEMU_STRACE=1 chroot /m68k mknod myramdisk b 1 1
      with tswap()
      ...
      29944 mknod("myramdisk",026630200000) = 0
      ...
      
      without tswap()
      
      ...
      30042 mknod("myramdisk",S_IFBLK|0666,makedev(1,1)) = 0
      ...
      
      natively:
      
      $ strace touch mytouch
      ...
      open("mytouch", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = 3
      ...
      
      $ QEMU_STRACE=1 chroot /m68k touch mytouch
      with tswap()
      ...
      30368 open("/usr/share/locale/locale.alias",O_RDONLY) = 3
      30368 fstat64(50331648,0x4080032c) = 0
      ...
      30368 open("mytouch",O_RDONLY|O_CREAT|O_LARGEFILE|O_NOCTTY|O_NONBLOCK|0x1) = 0
      ...
      without tswap()
      ...
      30572 open("/usr/share/locale/locale.alias",O_RDONLY) = 3
      30572 fstat64(3,0x4080032c) = 0
      ...
      30572 open("mytouch",O_WRONLY|O_CREAT|O_LARGEFILE|O_NOCTTY|O_NONBLOCK,0666) = 0
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      
      Fixes by Riku Voipio: add casts
      Signed-off-by: NRiku Voipio <riku.voipio@nokia.com>
      d2ee72a5
    • L
      linux-user: add rmdir() strace · 4de596cb
      Laurent Vivier 提交于
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      Signed-off-by: NRiku Voipio <riku.voipio@nokia.com>
      4de596cb
  16. 09 2月, 2011 2 次提交
  17. 16 6月, 2010 1 次提交
  18. 20 2月, 2010 1 次提交
  19. 19 6月, 2009 1 次提交
    • R
      linux-user: strace now handles guest stringscorrectly [v2] · 03dfe9f8
      Riku Voipio 提交于
      On Tue, Jun 16, 2009 at 08:19:23PM -0500, Anthony Liguori wrote:
      > malc wrote:
      >>
      >> On my system the above line causes gcc to emit:
      >>
      >> In file included from /home/malc/x/rcs/git/qemu/linux-user/strace.c:12:
      >> /usr/include/linux/futex.h:48: error: field `__user' has incomplete type
      >> /usr/include/linux/futex.h:48: error: syntax error before '*' token
      >> /usr/include/linux/futex.h:63: error: field `list' has incomplete type
      >> /usr/include/linux/futex.h:83: error: field `__user' has incomplete type
      >> /usr/include/linux/futex.h:83: error: syntax error before '*' token
      >> make[1]: *** [strace.o] Error 1
      
      > We had the same problem with usb-linux.c.  It's broken system headers,
      > the __user stuff is supposed to get removed as part of the headers
      > installation.
      
      > It builds fine on my system (Fedora 10).
      
      Howabout something like this:
      
      commit eb8387cb0eda32a18880664eb5f0ca5c8bf05b45
      Author: Riku Voipio <riku.voipio@iki.fi>
      Date:   Thu Jun 18 22:44:31 2009 +0300
      Subject: linux-user: include futex defines directly
      
      Since some common distributions have broken linux/futex.h, stop
      including it. Instead add the defines directly.
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      03dfe9f8
  20. 16 6月, 2009 1 次提交
  21. 23 12月, 2008 1 次提交
  22. 13 12月, 2008 1 次提交
  23. 04 10月, 2008 1 次提交
  24. 01 10月, 2008 1 次提交
  25. 14 9月, 2008 1 次提交
  26. 29 5月, 2008 1 次提交
  27. 15 11月, 2007 1 次提交
  28. 12 11月, 2007 2 次提交
  29. 11 11月, 2007 1 次提交