qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] aa04c9: target/sparc: Translate flushw opcode


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] aa04c9: target/sparc: Translate flushw opcode
Date: Tue, 07 Jul 2020 03:30:27 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: aa04c9d9ef962d516af5ca89667de4282d1c22ef
      
https://github.com/qemu/qemu/commit/aa04c9d9ef962d516af5ca89667de4282d1c22ef
  Author: Giuseppe Musacchio <thatlemon@gmail.com>
  Date:   2020-06-29 (Mon, 29 Jun 2020)

  Changed paths:
    M target/sparc/translate.c

  Log Message:
  -----------
  target/sparc: Translate flushw opcode

The ifdef logic should unconditionally compile in the `xop == 0x2b` case
when targeting sparc64.

Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200625091204.3186186-2-laurent@vivier.eu>


  Commit: d43624c400597aec18dff917c1424b807bbb473d
      
https://github.com/qemu/qemu/commit/d43624c400597aec18dff917c1424b807bbb473d
  Author: Giuseppe Musacchio <thatlemon@gmail.com>
  Date:   2020-06-29 (Mon, 29 Jun 2020)

  Changed paths:
    M bsd-user/main.c
    M linux-user/sparc/cpu_loop.c

  Log Message:
  -----------
  linux-user/sparc64: Fix the handling of window spill trap

Fix the handling of window spill traps by keeping cansave into account
when calculating the new CWP.

Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200625091204.3186186-3-laurent@vivier.eu>


  Commit: e865b97ff4d924a81c28b9d9f3d6fe3e198bcdb9
      
https://github.com/qemu/qemu/commit/e865b97ff4d924a81c28b9d9f3d6fe3e198bcdb9
  Author: Chen Gang <chengang@emindsoft.com.cn>
  Date:   2020-06-29 (Mon, 29 Jun 2020)

  Changed paths:
    M configure
    M linux-user/ioctls.h
    M linux-user/syscall.c
    M linux-user/syscall_defs.h
    M linux-user/syscall_types.h

  Log Message:
  -----------
  linux-user: syscall: ioctls: support DRM_IOCTL_VERSION

Another DRM_IOCTL_* commands will be done later.

Signed-off-by: Chen Gang <chengang@emindsoft.com.cn>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200605013221.22828-1-chengang@emindsoft.com.cn>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: c84be71f685436fd7216a159528421c3d7af8d05
      
https://github.com/qemu/qemu/commit/c84be71f685436fd7216a159528421c3d7af8d05
  Author: Filip Bozuta <Filip.Bozuta@syrmia.com>
  Date:   2020-06-29 (Mon, 29 Jun 2020)

  Changed paths:
    M linux-user/qemu.h
    M linux-user/strace.c
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Extend strace support to enable argument printing after syscall 
execution

    Structure "struct syscallname" in file "strace.c" is used for "-strace"
    to print arguments and return values of syscalls. The last field of
    this structure "result" represents the calling function that prints the
    return values. This field was extended in this patch so that this function
    takes all syscalls arguments beside the return value. In this way, it 
enables
    "-strace" to print arguments of syscalls that have changed after the syscall
    execution. This extension will be useful as there are many syscalls that
    return values inside their arguments (i.e. listxattr() that returns the list
    of extended attributes inside the "list" argument).

Implementation notes:

    Since there are already three existing "print_syscall_ret*" functions inside
    "strace.c" ("print_syscall_ret_addr()", "print_syscall_ret_adjtimex()",
    "print_syscall_ret_newselect()"), they were changed to have all syscall 
arguments
    beside the return value. This was done so that these functions don't cause 
build
    errors (even though syscall arguments are not used in these functions).
    There is code repetition in these functions for checking the return value
    and printing the approppriate error message (this code is also located in
    print_syscall_ret() at the end of "strace.c"). That is the reason why a
    function "syscall_print_err()" was added for this code and put inside these
    functions. Functions "print_newselect()" and "print_syscall_ret_newselect()"
    were changed to use this new implemented functionality and not store the 
syscall
    argument values in separate static variables.

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200619123331.17387-2-filip.bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: c42569f65c1c5302fb110488ad27423a948e5a7f
      
https://github.com/qemu/qemu/commit/c42569f65c1c5302fb110488ad27423a948e5a7f
  Author: Filip Bozuta <Filip.Bozuta@syrmia.com>
  Date:   2020-06-29 (Mon, 29 Jun 2020)

  Changed paths:
    M linux-user/strace.c
    M linux-user/strace.list

  Log Message:
  -----------
  linux-user: Add strace support for a group of syscalls

This patch implements strace argument printing functionality for following 
syscalls:

    *acct - switch process accounting on or off

        int acct(const char *filename)
        man page: https://www.man7.org/linux/man-pages/man2/acct.2.html

    *fsync, fdatasync - synchronize a file's in-core state with storage device

        int fsync(int fd)
        int fdatasync(int fd)
        man page: https://www.man7.org/linux/man-pages/man2/fsync.2.html

    *listen - listen for connections on a socket

        int listen(int sockfd, int backlog)
        man page: https://www.man7.org/linux/man-pages/man2/listen.2.html

Implementation notes:

    Syscall acct() takes string as its only argument and thus a separate
    print function "print_acct" is stated in file "strace.list". This
    function is defined and implemented in "strace.c" by using an
    existing function used to print string arguments: "print_string()".
    All the other syscalls have only primitive argument types, so the
    rest of the implementation was handled by stating an appropriate
    printing format in file "strace.list".

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200619123331.17387-3-filip.bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 4fc3cdde40f977ee8deecf988eea7acfa373117a
      
https://github.com/qemu/qemu/commit/4fc3cdde40f977ee8deecf988eea7acfa373117a
  Author: Filip Bozuta <Filip.Bozuta@syrmia.com>
  Date:   2020-06-29 (Mon, 29 Jun 2020)

  Changed paths:
    M linux-user/strace.c
    M linux-user/strace.list

  Log Message:
  -----------
  linux-user: Add strace support for printing argument of syscalls used for 
extended attributes

This patch implements strace argument printing functionality for following 
syscalls:

    *getxattr, lgetxattr, fgetxattr - retrieve an extended attribute value

        ssize_t getxattr(const char *path, const char *name, void *value, 
size_t size)
        ssize_t lgetxattr(const char *path, const char *name, void *value, 
size_t size)
        ssize_t fgetxattr(int fd, const char *name, void *value, size_t size)
        man page: https://www.man7.org/linux/man-pages/man2/getxattr.2.html

    *listxattr, llistxattr, flistxattr - list extended attribute names

        ssize_t listxattr(const char *path, char *list, size_t size)
        ssize_t llistxattr(const char *path, char *list, size_t size)
        ssize_t flistxattr(int fd, char *list, size_t size)
        man page: https://www.man7.org/linux/man-pages/man2/listxattr.2.html

    *removexattr, lremovexattr, fremovexattr - remove an extended attribute

         int removexattr(const char *path, const char *name)
         int lremovexattr(const char *path, const char *name)
         int fremovexattr(int fd, const char *name)
         man page: https://www.man7.org/linux/man-pages/man2/removexattr.2.html

Implementation notes:

    All of the syscalls have strings as argument types and thus a separate
    printing function was stated in file "strace.list" for every one of them.
    All of these printing functions were defined in "strace.c" using existing
    printing functions for appropriate argument types:
       "print_string()" - for (const char*) type
       "print_pointer()" - for (char*) and (void *) type
       "print_raw_param()" for (int) and (size_t) type
    Syscalls "getxattr()" and "lgetxattr()" have the same number and type of
    arguments and thus their print functions ("print_getxattr", 
"print_lgetxattr")
    share a same definition. The same statement applies to syscalls 
"listxattr()"
    and "llistxattr()".
    Function "print_syscall_ret_listxattr()" was added to print the returned 
list
    of extended attributes for syscalls "print_listxattr(), print_llistxattr() 
and
    print_flistxattr()".

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200619123331.17387-4-filip.bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: af861deaed5aa979522ec72425913295dc050f10
      
https://github.com/qemu/qemu/commit/af861deaed5aa979522ec72425913295dc050f10
  Author: Filip Bozuta <Filip.Bozuta@syrmia.com>
  Date:   2020-06-29 (Mon, 29 Jun 2020)

  Changed paths:
    M linux-user/strace.c
    M linux-user/strace.list

  Log Message:
  -----------
  linux-user: Add strace support for printing arguments of lseek()

This patch implements strace argument printing functionality for syscall:

    *lseek - reposition read/write file offset

         off_t lseek(int fd, off_t offset, int whence)
         man page: https://www.man7.org/linux/man-pages/man2/lseek.2.html

Implementation notes:

    The syscall's third argument "whence" has predefined values:
    "SEEK_SET","SEEK_CUR","SEEK_END","SEEK_DATA","SEEK_HOLE"
    and thus a separate printing function "print_lseek" was stated
    in file "strace.list". This function is defined in "strace.c"
    by using an existing function "print_raw_param()" to print
    the first and second argument and a switch(case) statement
    for the predefined values of the third argument.
    Values "SEEK_DATA" and "SEEK_HOLE" are defined in kernel version 3.1.
    That is the reason why case statements for these values are
    enwrapped in #ifdef directive.

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200619123331.17387-5-filip.bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 5844f4bc4111248b9de0c2efa422cafcdaa69cf1
      
https://github.com/qemu/qemu/commit/5844f4bc4111248b9de0c2efa422cafcdaa69cf1
  Author: Filip Bozuta <Filip.Bozuta@syrmia.com>
  Date:   2020-06-29 (Mon, 29 Jun 2020)

  Changed paths:
    M linux-user/strace.c
    M linux-user/strace.list

  Log Message:
  -----------
  linux-user: Add strace support for printing arguments of chown()/lchown()

This patch implements strace argument printing functionality for syscalls:

    *chown, lchown - change ownership of a file

        int chown(const char *pathname, uid_t owner, gid_t group)
        int lchown(const char *pathname, uid_t owner, gid_t group)
        man page: https://www.man7.org/linux/man-pages/man2/lchown.2.html

Implementation notes:

    Both syscalls use strings as arguments and thus a separate
    printing function was stated in "strace.list" for them.
    Both syscalls share the same number and types of arguments
    and thus share a same definition in file "syscall.c".
    This defintion uses existing functions "print_string()" to
    print the string argument and "print_raw_param()" to print
    other two arguments that are of basic types.

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200619123331.17387-6-filip.bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: f4d92c5e9f24efdc83f24a2fd99c37a8609787ee
      
https://github.com/qemu/qemu/commit/f4d92c5e9f24efdc83f24a2fd99c37a8609787ee
  Author: Filip Bozuta <Filip.Bozuta@syrmia.com>
  Date:   2020-06-29 (Mon, 29 Jun 2020)

  Changed paths:
    M linux-user/qemu.h
    M linux-user/strace.c
    M linux-user/strace.list
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Add strace support for printing arguments of fallocate()

This patch implements strace argument printing functionality for following 
syscall:

    *fallocate - manipulate file space

        int fallocate(int fd, int mode, off_t offset, off_t len)
        man page: https://www.man7.org/linux/man-pages/man2/fallocate.2.html

Implementation notes:

    This syscall's second argument "mode" is composed of predefined values
    which represent flags that determine the type of operation that is
    to be performed on the file space. For that reason, a printing
    function "print_fallocate" was stated in file "strace.list". This printing
    function uses an already existing function "print_flags()" to print flags of
    the "mode" argument. These flags are stated inside an array "falloc_flags"
    that contains values of type "struct flags". These values are instantiated
    using an existing macro "FLAG_GENERIC()". Most of these flags are defined
    after kernel version 3.0 which is why they are enwrapped in an #ifdef
    directive.
    The syscall's third ant fourth argument are of type "off_t" which can
    cause variations between 32/64-bit architectures. To handle this variation,
    function "target_offset64()" was copied from file "strace.c" and used in
    "print_fallocate" to print "off_t" arguments for 32-bit architectures.

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200619123331.17387-7-filip.bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: a20a7c26406b14aed56815e2bb9f150facca2cc0
      
https://github.com/qemu/qemu/commit/a20a7c26406b14aed56815e2bb9f150facca2cc0
  Author: Filip Bozuta <Filip.Bozuta@syrmia.com>
  Date:   2020-06-29 (Mon, 29 Jun 2020)

  Changed paths:
    M linux-user/ioctls.h
    M linux-user/syscall_types.h

  Log Message:
  -----------
  linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS

Socket ioctls SIOCGSTAMP and SIOCGSTAMPNS, used for timestamping the socket
connection, are defined in file "ioctls.h" differently from other ioctls.
The reason for this difference is explained in the comments above their 
definition.
These ioctls didn't have defined thunk argument types before changes from this
patch. They have special handling functions ("do_ioctl_SIOCGSTAMP" and
"do_ioctl_SIOCGSTAMPNS") that take care of setting values for approppriate 
argument
types (struct timeval and struct timespec) and thus no thunk argument types were
needed for their implementation. But this patch adds those argument type 
definitions
in file "syscall_types.h" and "ioctls.h" as it is needed for printing arguments
of these ioctls with strace.

Implementation notes:

    There are two variants of these ioctls: SIOCGSTAMP_OLD/SIOCGSTAM_NEW and
    SIOCGSTAMPNS_OLD/SIOCGSTAMPNS_NEW. One is the old existing definition and 
the
    other is the 2038 safe variant used for 32-bit architectures. Corresponding
    structure definitions STRUCT_timespec/STRUCT__kernel_timespec and
    STRUCT_timeval/STRUCT__kernel_sock_timeval were added for these variants.
    STRUCT_timeval definition was already inside the file as it is used by
    another implemented ioctl. Two cases were added for definitions
    STRUCT_timeval/STRUCT__kernel_sock_timeval to manage the case when the
    "u_sec" field of the timeval structure is of type int.

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200619124727.18080-2-filip.bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 79482e5987c824086d8824ebcf95a0c8c9c16cd7
      
https://github.com/qemu/qemu/commit/79482e5987c824086d8824ebcf95a0c8c9c16cd7
  Author: Filip Bozuta <Filip.Bozuta@syrmia.com>
  Date:   2020-07-04 (Sat, 04 Jul 2020)

  Changed paths:
    M include/exec/user/thunk.h
    M linux-user/qemu.h
    M linux-user/strace.c
    M linux-user/strace.list
    M linux-user/syscall.c
    M thunk.c

  Log Message:
  -----------
  linux-user: Add strace support for printing arguments of ioctl()

This patch implements functionality for strace argument printing for ioctls.
When running ioctls through qemu with "-strace", they get printed in format:

    "ioctl(fd_num,0x*,0x*) = ret_value"

where the request code an the ioctl's third argument get printed in a 
hexadicemal
format. This patch changes that by enabling strace to print both the request 
code
name and the contents of the third argument. For example, when running ioctl
RTC_SET_TIME with "-strace", with changes from this patch, it gets printed in
this way:

    "ioctl(3,RTC_SET_TIME,{12,13,15,20,10,119,0,0,0}) = 0"

In case of IOC_R type ioctls, the contents of the third argument get printed
after the return value, and the argument inside the ioctl call gets printed
as pointer in hexadecimal format. For example, when running RTC_RD_TIME with
"-strace", with changes from this patch, it gets printed in this way:

    "ioctl(3,RTC_RD_TIME,0x40800374) = 0 ({22,9,13,11,5,120,0,0,0})"

In case of IOC_RW type ioctls, the contents of the third argument get printed
both inside the ioctl call and after the return value.

Implementation notes:

    Functions "print_ioctl()" and "print_syscall_ret_ioctl()", that are defined
    in "strace.c", are listed in file "strace.list" as "call" and "result"
    value for ioctl. Structure definition "IOCTLEntry" as well as predefined
    values for IOC_R, IOC_W and IOC_RW were cut and pasted from file "syscall.c"
    to file "qemu.h" so that they can be used by these functions to print the
    contents of the third ioctl argument. Also, the "static" identifier for 
array
    "ioctl_entries[]" was removed and this array was declared as "extern" in 
"qemu.h"
    so that it can also be used by these functions. To decode the structure type
    of the ioctl third argument, function "thunk_print()" was defined in file
    "thunk.c" and its definition is somewhat simillar to that of function
    "thunk_convert()".

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200619124727.18080-3-filip.bozuta@syrmia.com>
[lv: fix close-bracket]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 8f902c540eccd72086e8f67d977e30e05659783f
      
https://github.com/qemu/qemu/commit/8f902c540eccd72086e8f67d977e30e05659783f
  Author: Riku Voipio <riku.voipio@linaro.org>
  Date:   2020-07-04 (Sat, 04 Jul 2020)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: update linux-user maintainer

I haven't been active for a while. Pass the maintainer hat
forward to Laurent, who has done a stellar job filling in.

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200702111636.25792-1-riku.voipio@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 7623b5ba017f61de5d7c2bba12c6feb3d55091b1
      
https://github.com/qemu/qemu/commit/7623b5ba017f61de5d7c2bba12c6feb3d55091b1
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-07-06 (Mon, 06 Jul 2020)

  Changed paths:
    M MAINTAINERS
    M bsd-user/main.c
    M configure
    M include/exec/user/thunk.h
    M linux-user/ioctls.h
    M linux-user/qemu.h
    M linux-user/sparc/cpu_loop.c
    M linux-user/strace.c
    M linux-user/strace.list
    M linux-user/syscall.c
    M linux-user/syscall_defs.h
    M linux-user/syscall_types.h
    M target/sparc/translate.c
    M thunk.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/vivier2/tags/linux-user-for-5.1-pull-request' into staging

linux-user pull request 2020-07-02

Update linux-user maintainer
Improve strace output for some syscalls
Display contents of ioctl() parameters
Fix sparc64 flushw operation

# gpg: Signature made Sat 04 Jul 2020 17:25:21 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" 
[full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-5.1-pull-request:
  MAINTAINERS: update linux-user maintainer
  linux-user: Add strace support for printing arguments of ioctl()
  linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS
  linux-user: Add strace support for printing arguments of fallocate()
  linux-user: Add strace support for printing arguments of chown()/lchown()
  linux-user: Add strace support for printing arguments of lseek()
  linux-user: Add strace support for printing argument of syscalls used for 
extended attributes
  linux-user: Add strace support for a group of syscalls
  linux-user: Extend strace support to enable argument printing after syscall 
execution
  linux-user: syscall: ioctls: support DRM_IOCTL_VERSION
  linux-user/sparc64: Fix the handling of window spill trap
  target/sparc: Translate flushw opcode

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/eb6490f54438...7623b5ba017f



reply via email to

[Prev in Thread] Current Thread [Next in Thread]