qemu/linux-user/ppc
Filip Bozuta 02e5d7d78e linux-user: Add strace support for printing arguments of syscalls used to lock and unlock memory
This patch implements strace argument printing functionality for following syscalls:

    * mlock, munlock, mlockall, munlockall - lock and unlock memory

       int mlock(const void *addr, size_t len)
       int munlock(const void *addr, size_t len)
       int mlockall(int flags)
       int munlockall(void)
       man page: https://man7.org/linux/man-pages/man2/mlock.2.html

Implementation notes:

    Syscall mlockall() takes an argument that is composed of predefined values
    which represent flags that determine the type of locking operation that is
    to be performed. For that reason, a printing function "print_mlockall" was
    stated in file "strace.list". This printing function uses an already existing
    function "print_flags()" to print the "flags" argument.  These flags are stated
    inside an array "mlockall_flags" that contains values of type "struct flags".
    These values are instantiated using an existing macro "FLAG_TARGET()" that
    crates aproppriate target flag values based on those defined in files
    '/target_syscall.h'. These target flag values were changed from
    "TARGET_MLOCKALL_MCL*" to "TARGET_MCL_*" so that they can be aproppriately set
    and recognised in "strace.c" with "FLAG_TARGET()". Value for "MCL_ONFAULT"
    was added in this patch. This value was also added in "syscall.c" in function
    "target_to_host_mlockall_arg()". Because this flag value was added in kernel
    version 4.4, it is enwrapped in an #ifdef directive (both in "syscall.c" and
    in "strace.c") as to support older kernel versions.
    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". Syscall mlock2() is not implemented in
    "syscall.c" and thus it's argument printing is not implemented in this patch.

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200811164553.27713-4-Filip.Bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-08-27 12:29:50 +02:00
..
cpu_loop.c target/ppc: Add support for scv and rfscv instructions 2020-05-27 15:29:24 +10:00
meson.build meson: linux-user 2020-08-21 06:30:38 -04:00
signal.c linux-user/ppc: Fix padding in mcontext_t for ppc64 2020-04-17 10:38:29 +10:00
sockbits.h linux-user: move ppc socket.h definitions to ppc/sockbits.h 2018-05-25 10:10:55 +02:00
syscall.tbl linux-user: update syscall.tbl from linux 0bf999f9c5e7 2020-03-20 16:02:00 +01:00
syscallhdr.sh linux-user, ppc: add syscall table generation support 2020-03-20 16:02:00 +01:00
target_cpu.h linux-user: Introduce cpu_clone_regs_parent 2019-11-06 13:43:25 +01:00
target_elf.h linux-user: set default PPC64 CPU 2019-06-24 23:10:36 +02:00
target_fcntl.h linux-user: move ppc fcntl definitions to ppc/target_fcntl.h 2018-06-04 01:30:44 +02:00
target_signal.h linux-user: move generic signal definitions to generic/signal.h 2018-06-04 01:30:44 +02:00
target_structs.h linux-user: Clean up target_structs.h header guards 2016-07-12 16:19:16 +02:00
target_syscall.h linux-user: Add strace support for printing arguments of syscalls used to lock and unlock memory 2020-08-27 12:29:50 +02:00
termbits.h Supply missing header guards 2019-06-12 13:20:21 +02:00