1. 28 2月, 2017 1 次提交
  2. 16 2月, 2017 1 次提交
  3. 25 1月, 2017 1 次提交
  4. 24 1月, 2017 2 次提交
  5. 23 1月, 2017 2 次提交
  6. 21 10月, 2016 4 次提交
    • P
      linux-user: Fix definition of target_sigevent for 32-bit guests · 17351c3f
      Peter Maydell 提交于
      The sigevent structure includes a union with some fields which
      are pointers. For the QEMU target_sigevent structure we must
      represent these as abi_ulongs, not host function pointers.
      
      This error was causing the compiler to believe it should 8-align
      the _sigev_un union on a 64-bit host, which meant that the
      code in target_to_host_sigevent() was looking at the wrong
      offset to find the _tid field, and timer_create() would
      spuriously fail with EINVAL.
      
      This fixes the final loose end noted in LP:1042388.
      
      While we're editing the structure, switch the 'int32_t' fields
      to 'abi_int'; this will only matter for guests with non-standard
      integer alignment like m68k.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
      17351c3f
    • 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
  7. 23 9月, 2016 3 次提交
  8. 21 9月, 2016 2 次提交
  9. 15 9月, 2016 1 次提交
    • T
      Remove remainders of HPPA backend · d41f3c3c
      Thomas Huth 提交于
      The HPPA backend has been removed by the following commit:
      
          802b5081
          tcg-hppa: Remove tcg backend
      
      But some small pieces of the HPPA backend still survived until
      today. Since we also do not have support for a HPPA target in
      QEMU, we can nowadays safely remove the remaining HPPA parts
      (like the disassembler code, or the detection of HPPA in the
      configure script).
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      d41f3c3c
  10. 19 7月, 2016 2 次提交
  11. 12 7月, 2016 1 次提交
  12. 26 6月, 2016 2 次提交
  13. 08 6月, 2016 1 次提交
    • P
      linux-user: Correct signedness of target_flock l_start and l_len fields · 8efb2ed5
      Peter Maydell 提交于
      The l_start and l_len fields in the various target_flock structures are
      supposed to be '__kernel_off_t' or '__kernel_loff_t', which means they
      should be signed, not unsigned. Correcting the structure definitions means
      that __get_user() and __put_user() will correctly sign extend them if
      the guest is using 32 bit offsets and the host is using 64 bit offsets.
      
      This fixes failures in the LTP 'fcntl14' tests where it checks that
      negative seek offsets work correctly.
      
      We reindent the structures to drop hard tabs since we're touching 40%
      of the fields anyway.
      
      RV: long long -> abi_llong as suggested by Laurent Vivier <laurent@vivier.eu>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
      8efb2ed5
  14. 07 6月, 2016 1 次提交
    • P
      linux-user: Use both si_code and si_signo when converting siginfo_t · a70dadc7
      Peter Maydell 提交于
      The siginfo_t struct includes a union. The correct way to identify
      which fields of the union are relevant is complicated, because we
      have to use a combination of the si_code and si_signo to figure out
      which of the union's members are valid.  (Within the host kernel it
      is always possible to tell, but the kernel carefully avoids giving
      userspace the high 16 bits of si_code, so we don't have the
      information to do this the easy way...) We therefore make our best
      guess, bearing in mind that a guest can spoof most of the si_codes
      via rt_sigqueueinfo() if it likes.  Once we have made our guess, we
      record it in the top 16 bits of the si_code, so that tswap_siginfo()
      later can use it.  tswap_siginfo() then strips these top bits out
      before writing si_code to the guest (sign-extending the lower bits).
      
      This fixes a bug where fields were sometimes wrong; in particular
      the LTP kill10 test went into an infinite loop because its signal
      handler got a si_pid value of 0 rather than the pid of the sending
      process.
      
      As part of this change, we switch to using __put_user() in the
      tswap_siginfo code which writes out the byteswapped values to
      the target memory, in case the target memory pointer is not
      sufficiently aligned for the host CPU's requirements.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
      a70dadc7
  15. 27 5月, 2016 1 次提交
  16. 11 1月, 2016 1 次提交
  17. 08 1月, 2016 1 次提交
    • L
      linux-user: correctly align target_epoll_event · 928bed6a
      Laurent Vivier 提交于
      According to comments in /usr/include/linux/eventpoll.h,
      poll_event is packed only on x86_64.
      
      And to be sure fields are correctly aligned in epoll_data,
      use abi_XXX types for all of them.
      
      Moreover, fd type is wrong: fd is int, not ulong.
      
      This has been tested with a ppc guest on an x86_64 host:
      without this patch, systemd crashes (core).
      
      CC: Alexander Graf <agraf@suse.de>
      CC: Peter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
      928bed6a
  18. 07 10月, 2015 1 次提交
  19. 28 9月, 2015 1 次提交
  20. 15 9月, 2015 1 次提交
  21. 11 9月, 2015 1 次提交
  22. 13 2月, 2015 1 次提交
  23. 10 2月, 2015 1 次提交
  24. 11 11月, 2014 1 次提交
  25. 15 7月, 2014 1 次提交
  26. 29 6月, 2014 4 次提交
  27. 03 5月, 2014 1 次提交