[PATCH 0/2] target/mips: Rearrange handling of vector compare instructions

2019-10-23 Thread Filip Bozuta
Simplify instructions by removing unnecessary argument and creating separate comparing functions for each instruction. Filip Bozuta (2): target/mips: Rearrange vector compare equal instructions target/mips: Rearrange vector compare less than (signed) instructions target/mips/msa_helper.c

[PATCH 2/2] target/mips: Rearrange vector compare less than (signed) instructions

2019-10-23 Thread Filip Bozuta
Remove unnecessary argument and provide separate function for each instruction. Signed-off-by: Filip Bozuta --- target/mips/msa_helper.c | 80 ++-- 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/target/mips/msa_helper.c b/target/mips

[PATCH 1/2] target/mips: Rearrange vector compare equal instructions

2019-10-23 Thread Filip Bozuta
Remove unnecessary argument and provide separate function for each instruction. Signed-off-by: Filip Bozuta --- target/mips/msa_helper.c | 80 ++-- 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/target/mips/msa_helper.c b/target/mips

[PATCH v2 2/2] tests/tcg/multiarch: Add tests for implemented alsa sound timer ioctls

2020-02-13 Thread Filip Bozuta
file. The file was modified a little bit by adding an output line that shows which test passed and at which test the program aborts. It was also modified so that it doesn't have styling problems detected by 'scripts/checkpatch.pl'. Signed-off-by: Filip Bozuta --- .

[PATCH v2 0/2] tests/tcg/multiarch: Add tests for implemented real

2020-02-13 Thread Filip Bozuta
Tests that were obtained remotely run multiple ioctl tests at once, while the manually written tests can be used to run both individual and multiple ioctl tests based on the command specified when running the test. Filip Bozuta (2): tests/tcg/multiarch: Add tests for implemented rtc ioctls

[PATCH v2 1/2] tests/tcg/multiarch: Add tests for implemented rtc ioctls

2020-02-13 Thread Filip Bozuta
blems identified by "scripts/checkpatch.pl". It is used to further test functionalities of some rtc ioctls by running rtc clock at different frequencies. Signed-off-by: Filip Bozuta --- .../manual-test/rtc-ioctl-manual-test.c| 352 + .../rtc-ioct

[PATCH v3 2/2] tests/tcg/multiarch: Add tests for implemented alsa sound timer ioctls

2020-02-18 Thread Filip Bozuta
file. The file was modified a little bit by adding an output line that shows which test passed and at which test the program aborts. It was also modified so that it doesn't have styling problems detected by 'scripts/checkpatch.pl'. Signed-off-by: Filip Bozuta --- .

[PATCH v3 1/2] tests/tcg/multiarch: Add tests for implemented rtc ioctls

2020-02-18 Thread Filip Bozuta
blems identified by "scripts/checkpatch.pl". It is used to further test functionalities of some rtc ioctls by running rtc clock at different frequencies. Signed-off-by: Filip Bozuta --- .../manual-test/rtc-ioctl-manual-test.c| 352 + .../rtc-ioct

[PATCH v3 0/2] tests/tcg/multiarch: Add tests for implemented real

2020-02-18 Thread Filip Bozuta
individual test files for each ioctl v3: * fixed alsa timer ioctl manual test so that it can run ioctl tests individually by specifying their name when running the test program Filip Bozuta (2): tests/tcg/multiarch: Add tests for implemented rtc ioctls tests/tcg/multiarch: Add

[PATCH 3/5] mips: mipssim: Renovate coding style

2019-12-06 Thread Filip Bozuta
the script was ran again to make sure there are no more errors and warnings. Signed-off-by: Filip Bozuta Reviewed-by: Aleksandar Markovic --- hw/net/mipsnet.c | 44 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/hw/net/mipsnet.c b/hw

[PATCH 4/5] mips: r4000: Renovate coding style

2019-12-06 Thread Filip Bozuta
sure there are no more errors and warnings. Signed-off-by: Filip Bozuta Reviewed-by: Aleksandar Markovic --- hw/mips/mips_r4k.c | 55 +- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index

[PATCH 0/5] mips: machines: Renovate coding style

2019-12-06 Thread Filip Bozuta
lines 103 and 107 in tests/acceptance/mips_malta.c so that splitting lines are aligned vertically belove the opening brackets * changed line 121 in mips_r4k.c so that INITRD_PAGE_MASK so that it is aligned vertically belove the opening bracket Filip Bozuta (5): mips: jazz

[PATCH 1/5] mips: jazz: Renovate coding style

2019-12-06 Thread Filip Bozuta
corrected and then the script was ran again to make sure there are no more errors and warnings. Signed-off-by: Filip Bozuta Reviewed-by: Aleksandar Markovic --- hw/display/jazz_led.c | 123 +- hw/dma/rc4030.c | 12 +++-- hw/mips/mips_jazz.c

[PATCH 2/5] mips: malta: Renovate coding style

2019-12-06 Thread Filip Bozuta
checkpatch.pl script were corrected and then the script was ran again to make sure there are no more errors and warnings. Signed-off-by: Filip Bozuta Reviewed-by: Aleksandar Markovic --- hw/mips/mips_malta.c | 169 --- tests/acceptance

[PATCH 5/5] mips: fulong 2e: Renovate coding style

2019-12-06 Thread Filip Bozuta
generated by the checkpatch.pl script were corrected and then the script was ran again to make sure there are no more errors and warnings. Signed-off-by: Filip Bozuta Reviewed-by: Aleksandar Markovic --- hw/isa/vt82c686.c| 23 ++-- hw/pci-host/bonito.c | 60

[PATCH v4 5/6] linux-user: Add support for getting/setting RTC PLL correction using ioctls

2019-12-18 Thread Filip Bozuta
tructure are of type 'int', except the last one that is of type 'long'. That is the reason why a separate target structure (target_rtc_pll_info) is defined in linux-user/syscall_defs. The rest of the implementation is straightforward. Signed-off-by: Filip Bozuta -

[PATCH v4 2/6] linux-user: Add support for getting/setting RTC time and alarm using ioctls

2019-12-18 Thread Filip Bozuta
inition is added in linux-user/syscall_types.h. Since all elements of this structure are of type 'int', the rest of the implementation is straightforward. Signed-off-by: Filip Bozuta --- linux-user/ioctls.h| 4 linux-user/syscall_defs.h | 4 linux-user/syscall_types

[PATCH v4 3/6] linux-user: Add support for getting/setting RTC periodic interrupt and epoch using ioctls

2019-12-18 Thread Filip Bozuta
ode in linux-user/syscall_defs.h contain special handling related to 'ulong' type: they use 'abi_ulong' type to make sure that ioctl's code is calculated correctly for both 32-bit and 64-bit targets. Also, 'MK_PTR(TYPE_ULONG)' is used for the simi

[PATCH v4 6/6] linux-user: Add support for read/clear RTC voltage low detector using ioctls

2019-12-18 Thread Filip Bozuta
ge low for RTCs that support voltage low. The third ioctl(2) argument is ignored. Implementation notes: Since one ioctl has a pointer to 'int' as its third agrument, and another ioctl has NULL as its third argument, their implementation was straightforward. Signed-

[PATCH v4 4/6] linux-user: Add support for getting/setting RTC wakeup alarm using ioctls

2019-12-18 Thread Filip Bozuta
d in linux-user/syscall_types.h. Since all elements of this structure are either of type 'unsigned char' or 'struct rtc_time' (that was covered in one of previous patches), the rest of the implementation is straightforward. Signed-off-by: Filip Bozuta --- linux-user

[PATCH v4 0/6] linux-user: Add support for real time clock ioctls

2019-12-18 Thread Filip Bozuta
s of MK_PTR(TYPE_ULONG) to TYPE_ULONG v2: * added description of each ioctl in patches * wrote a more detailed cover letter with description of testing * changed one instance of TYPE_INT to MK_PTR(TYPE_INT) Filip Bozuta (6): linux-user: Add support for enabling/disabling RTC feat

[PATCH v4 1/6] linux-user: Add support for enabling/disabling RTC features using ioctls

2019-12-18 Thread Filip Bozuta
unchanged for a long time, therefore there is no need to worry about supporting older Linux kernel version. Signed-off-by: Filip Bozuta --- linux-user/ioctls.h | 9 + linux-user/syscall.c | 1 + linux-user/syscall_defs.h | 10 ++ 3 files changed, 20 insertio

[PATCH 1/5] mips: jazz: Renovate coding style

2019-11-25 Thread Filip Bozuta
corrected and then the script was ran again to make sure there are no more errors and warnings. Signed-off-by: Filip Bozuta --- hw/display/jazz_led.c | 123 +- hw/dma/rc4030.c | 12 +++-- hw/mips/mips_jazz.c | 32 +++-- 3 files

[PATCH 4/5] mips: r4000: Renovate coding style

2019-11-25 Thread Filip Bozuta
sure there are no more errors and warnings. Signed-off-by: Filip Bozuta --- hw/mips/mips_r4k.c | 55 +- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index 7002423..d638358 100644 --- a/hw

[PATCH 2/5] mips: malta: Renovate coding style

2019-11-25 Thread Filip Bozuta
checkpatch.pl script were corrected and then the script was ran again to make sure there are no more errors and warnings. Signed-off-by: Filip Bozuta --- hw/mips/mips_malta.c | 139 --- tests/acceptance/linux_ssh_mips_malta.py | 6 +- 2 files

[PATCH 0/5] mips: machines: Renovate coding style

2019-11-25 Thread Filip Bozuta
future versions. Filip Bozuta (5): mips: jazz: Renovate coding style mips: malta: Renovate coding style mips: mipssim: Renovate coding style mips: r4000: Renovate coding style mips: fulong 2e: Renovate coding style hw/display/jazz_led.c| 123

[PATCH 3/5] mips: mipssim: Renovate coding style

2019-11-25 Thread Filip Bozuta
the script was ran again to make sure there are no more errors and warnings. Signed-off-by: Filip Bozuta --- hw/net/mipsnet.c | 44 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/hw/net/mipsnet.c b/hw/net/mipsnet.c index f7ae1ce

[PATCH 5/5] mips: fulong 2e: Renovate coding style

2019-11-25 Thread Filip Bozuta
generated by the checkpatch.pl script were corrected and then the script was ran again to make sure there are no more errors and warnings. Signed-off-by: Filip Bozuta --- hw/isa/vt82c686.c| 23 ++-- hw/pci-host/bonito.c | 60 +--- 2

[PATCH v2] linux-user: Fix 'semop()' and 'semtimedop()' implementation

2020-08-17 Thread Filip Bozuta
testcases for 'semop()'): semop02.c:126: PASS: semop failed as expected: E2BIG (7) Implementation notes: A target value ('TARGET_SEMOPM') was added for 'SEMOPM' as to be sure in case the value is not available for some targets. Signed-off-by: Filip Bozuta

[PATCH v3] linux-user: Fix 'semop()' and 'semtimedop()' implementation

2020-08-18 Thread Filip Bozuta
testcases for 'semop()'): semop02.c:126: PASS: semop failed as expected: E2BIG (7) Implementation notes: A target value ('TARGET_SEMOPM') was added for 'SEMOPM' as to be sure in case the value is not available for some targets. Signed-off-by: Filip Bozuta

[PATCH v5 2/6] linux-user: Add strace support for a group of syscalls

2020-06-19 Thread Filip Bozuta
From: Filip Bozuta 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

[PATCH v5 1/6] linux-user: Extend strace support to enable argument printing after syscall execution

2020-06-19 Thread Filip Bozuta
From: Filip Bozuta 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

[PATCH v5 3/6] linux-user: Add strace support for printing argument of syscalls used for extended attributes

2020-06-19 Thread Filip Bozuta
From: Filip Bozuta 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

[PATCH v5 4/6] linux-user: Add strace support for printing arguments of lseek()

2020-06-19 Thread Filip Bozuta
From: Filip Bozuta 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

[PATCH v5 6/6] linux-user: Add strace support for printing arguments of fallocate()

2020-06-19 Thread Filip Bozuta
From: Filip Bozuta 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

[PATCH v5 5/6] linux-user: Add strace support for printing arguments of chown()/lchown()

2020-06-19 Thread Filip Bozuta
From: Filip Bozuta 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

[PATCH v3 1/2] linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS

2020-06-19 Thread Filip Bozuta
From: Filip Bozuta 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 hav

[PATCH v3 0/2] Add strace support for printing arguments for ioctls

2020-06-19 Thread Filip Bozuta
From: Filip Bozuta This series introduces the functionality in strace to print arguments for ioctls. This is gonna be a useful adittion as it indroduces a good debugging and diagnostic mechanism for user programs cross compiled for different architectures. The first patch in the series

[PATCH v3 2/2] linux-user: Add strace support for printing arguments of ioctl()

2020-06-19 Thread Filip Bozuta
From: Filip Bozuta 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

[PATCH v5 0/6] Add strace support for printing arguments of selected syscalls

2020-06-19 Thread Filip Bozuta
From: Filip Bozuta This series covers strace support for printing arguments of following syscalls: *acct() *lgetxattr() *removexattr() *lchown() *fsync() *fgetxattr() *lremovexattr() *fallocate() *fdatasync() *listxattr

[PATCH 2/4] linux-user: Add support for a group of btrfs ioctls used for snapshots

2020-07-09 Thread Filip Bozuta
aproppriate values for the file descriptor and path of the subvolume for which the snapshot is to be deleted. Implementation notes: Since the thunk type 'struct btrfs_ioctl_vol_args' is defined in the previous patch, the implementation for these ioctls was straightforward.

[PATCH 4/4] linux-user: Add support for a group of btrfs ioctls used to get/set features

2020-07-09 Thread Filip Bozuta
can be safely set and third element represent flags that can be safely clearead. Implementation notes: All of the implemented ioctls use 'struct btrfs_ioctl_feature_flags' as third argument. That is the reason why a corresponding defintion was added in file 'linux-use

[PATCH 3/4] linux-user: Add support for a group of btrfs ioctls used to manipulate with devices

2020-07-09 Thread Filip Bozuta
t is the reason why corresponding structure definitions were added in file 'linux-user/syscall_types.h'. Since the thunk type for 'struct ioc_vol_args' was already added in a previous patch, the rest of the implementation was straightforward. Signed-off-by: Filip Boz

[PATCH 1/4] linux-user: Add support for a group of btrfs ioctls used for subvolumes

2020-07-09 Thread Filip Bozuta
enwrapped in an #ifdef statement with parameter CONFIG_BTRFS which is defined in 'configure' if the header file is present. Signed-off-by: Filip Bozuta --- configure | 9 + linux-user/ioctls.h| 15 +++ linux-user/syscall

[PATCH 0/4] Add support for a group of btrfs filesystem ioctl

2020-07-09 Thread Filip Bozuta
86_64 host. All applicable compiled programs were in turn executed through QEMU and the results obtained were the same ones gotten for native execution. Filip Bozuta (4): linux-user: Add support for a group of btrfs ioctls used for subvolumes linux-user: Add support for a grou

Re: [PATCH v2 1/2] linux-user: fix the errno value in print_syscall_err()

2020-07-10 Thread Filip Bozuta
qemu_log("-1 errno=%d", (int)-ret); errstr = target_strerror(-ret); if (errstr) { qemu_log(" (%s)", errstr); Reviewed-by: Filip Bozuta

[PATCH v2 1/4] linux-user: Make cpu_env accessible in strace.c

2020-07-13 Thread Filip Bozuta
o, all defined "print_*" and "print_syscall_ret*" functions in "strace.c" were changed to have the new "void *cpu_env". This was done to not cause build errors (even though none of these functions use this argument). Signed-off-by: Filip Bozut

[PATCH v2 2/4] linux-user: Add strace support for printing arguments of truncate()/ftruncate() and getsid()

2020-07-13 Thread Filip Bozuta
on "regpairs_aligned()" was cut & pasted from "syscall.c" to "qemu.h" as it is used by functions "print_truncate64()" and "print_ftruncate64()" to print the offset arguments of "truncate64()" and "ftruncate6

[PATCH v2 3/4] linux-user: Add strace support for printing arguments of syscalls used to lock and unlock memory

2020-07-13 Thread Filip Bozuta
ment 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 Bozu

[PATCH v2 4/4] linux-user: Add strace support for printing arguments of some clock and time functions

2020-07-13 Thread Filip Bozuta
s()" and "clocK_gettime()" have the same number and types of arguments and thus their print functions "print_clock_getres" and "print_clock_gettime" shate a common definition in file "strace.c". Signed-off-by: Filip Bozuta --- linux-user/strace.c

[PATCH v2 0/4] Add strace support for printing arguments for a group of selected syscalls

2020-07-13 Thread Filip Bozuta
t_syscall_ret_setitimer' for old value of the interval timer * added a function 'print_itimer_type' that prints the interval timer type Filip Bozuta (4): linux-user: Make cpu_env accessible in strace.c linux-user: Add strace support for printing arguments of

[PATCH] linux-user: Add strace support for printing arguments for ioctls used for terminals and serial lines

2020-07-14 Thread Filip Bozuta
Field "void print(void *arg)" was added in this structure as a special print function. Also, function "thunk_print()" was changed a little so that it uses this special print function in case it is defined. This printing function was instantiated with the

[PATCH 2/4] linux-user: Add support for two btrfs ioctls used for subvolume

2020-07-17 Thread Filip Bozuta
This patch implements functionality for following ioctl: BTRFS_IOC_DEFAULT_SUBVOL - Setting a default subvolume Set a default subvolume for a btrfs filesystem. The third ioctl's argument is a '__u64' (unsigned long long) which represents the id of a subvolume that is to be set as

[PATCH 4/4] linux-user: Add support for btrfs ioctls used to scrub a filesystem

2020-07-17 Thread Filip Bozuta
This patch implements functionality for following ioctls: BTRFS_IOC_SCRUB - Starting a btrfs filesystem scrub Start a btrfs filesystem scrub. The third ioctls argument is a pointer to a following type: struct btrfs_ioctl_scrub_args { __u64 devid;/*

[PATCH 1/4] linux-user: Add support for a group of btrfs inode ioctls

2020-07-17 Thread Filip Bozuta
This patch implements functionality of following ioctls: BTRFS_IOC_INO_LOOKUP - Reading tree root id and path Read tree root id and path for a given file or directory. The name and tree root id are returned in an ioctl's third argument that represents a pointer to a following type:

[PATCH 3/4] linux-user: Add support for btrfs ioctls used to manage quota

2020-07-17 Thread Filip Bozuta
This patch implements functionality for following ioctls: BTRFS_IOC_QUOTA_CTL - Enabling/Disabling quota support Enable or disable quota support for a btrfs filesystem. Quota support is enabled or disabled using the ioctls third argument which represents a pointer to a following type:

[PATCH 0/4] Add support for a group of btrfs ioctls - 2

2020-07-17 Thread Filip Bozuta
execution. Based-on: <20200709155203.21106-1-filip.boz...@syrmia.com> Filip Bozuta (4): linux-user: Add support for a group of btrfs inode ioctls linux-user: Add support for two btrfs ioctls used for subvolume linux-user: Add support for btrfs ioctls used to manage quota linux-user:

[PATCH v2 0/4] Add support for a group of btrfs ioctls - 2

2020-07-17 Thread Filip Bozuta
grams were in turn executed through QEMU and the results obtained were the same ones gotten for native execution v2: * added Signed-off-by tag (forgot in v1...) Based-on: <20200709155203.21106-1-filip.boz...@syrmia.com> Filip Bozuta (4): linux-user: Add support for a group of bt

[PATCH v2 2/4] linux-user: Add support for two btrfs ioctls used for subvolume

2020-07-17 Thread Filip Bozuta
resent the minimum value for the tree id. Implementation notes: Ioctl BTRFS_IOC_GET_SUBVOL_ROOTREF uses the above mentioned structure type as third argument. That is the reason why a aproppriate thunk structure definition is added in file 'syscall_types.h'. Signed-off-by:

[PATCH v2 4/4] linux-user: Add support for btrfs ioctls used to scrub a filesystem

2020-07-17 Thread Filip Bozuta
at is the reason why an aproppriate thunk type definition is added in file 'syscall_types.h'. Signed-off-by: Filip Bozuta --- linux-user/ioctls.h| 11 +++ linux-user/syscall_defs.h | 6 ++ linux-user/syscall_types.h | 26 ++ 3 files c

[PATCH v2 3/4] linux-user: Add support for btrfs ioctls used to manage quota

2020-07-17 Thread Filip Bozuta
ioctls argument is ignored. Implementation notes: Almost all of the ioctls in this patch use structure types as third arguments. That is the reason why aproppriate thunk definitions were added in file 'syscall_types.h'. Signed-off-by: Filip Bozuta --- linux-user/ioctls

[PATCH v2 1/4] linux-user: Add support for a group of btrfs inode ioctls

2020-07-17 Thread Filip Bozuta
id' and 'treeid' field should be filled with aproppriate values which represent the inode number of the directory that contains the subvolume and treeid of the subvolume. Implementation notes: All of the ioctls in this patch use structure types as third argument

[PATCH 1/2] linux-user: Modify 'target_to_host/host_to_target_itimerspec()'

2020-07-22 Thread Filip Bozuta
ification to the converting functions to be implemented using already existing functions that convert 'struct timespec': 'target_to_host_timespec()' and 'host_to_target_timespec()'. This makes the code of 'target_to_host_itimerspec()' and 'host_to_target

[PATCH 2/2] linux-user: Add support for a group of 2038 safe syscalls

2020-07-22 Thread Filip Bozuta
itimerspec' type is used in these new converting functions. These new functions were defined similarly to 'host_to_target_itimerspec()' and 'target_to_host_itimerspec()' the only difference being that 'target_to_host_timespec64()' and 'host_to_tar

[PATCH 0/2] Adding support for a group of year 2038 safe syscalls

2020-07-22 Thread Filip Bozuta
mplementation of the implemented syscalls was tested using already existing tests from LTP test suite which was built inside chroot. Filip Bozuta (2): linux-user: Modify 'target_to_host/host_to_target_itimerspec()' linux-user: Add support for a group of 2038 safe syscall

[PATCH v2 1/2] linux-user: Modify 'target_to_host/host_to_target_itimerspec()'

2020-07-22 Thread Filip Bozuta
ification to the converting functions to be implemented using already existing functions that convert 'struct timespec': 'target_to_host_timespec()' and 'host_to_target_timespec()'. This makes the code of 'target_to_host_itimerspec()' and 'host_to_target

[PATCH v2 2/2] linux-user: Add support for a group of 2038 safe syscalls

2020-07-22 Thread Filip Bozuta
itimerspec' type is used in these new converting functions. These new functions were defined similarly to 'host_to_target_itimerspec()' and 'target_to_host_itimerspec()' the only difference being that 'target_to_host_timespec64()' and 'ho

[PATCH v2 0/2] This two patch series introduces functionality for a group

2020-07-22 Thread Filip Bozuta
tests from LTP test suite which was built inside chroot. v2: *changed 'target_to_host/host_to_target_itimerspec/64()' to use 'offsetof()' to determine converting adress for 'timespec' instead of 'sizeof()' Filip Bozuta (2): linux-user: Modi

[PATCH v3 2/5] linux-user: Add strace support for printing arguments of truncate()/ftruncate() and getsid()

2020-07-22 Thread Filip Bozuta
on "regpairs_aligned()" was cut & pasted from "syscall.c" to "qemu.h" as it is used by functions "print_truncate64()" and "print_ftruncate64()" to print the offset arguments of "truncate64()" and "ftruncate64()".

[PATCH v3 0/5] Add strace support for printing arguments for a group of selected syscalls

2020-07-22 Thread Filip Bozuta
t_syscall_ret_setitimer' for old value of the interval timer * added a function 'print_itimer_type' that prints the interval timer type v3: * added patch that introduces an api that prints enumarted values with strace * used this new introduced api to p

[PATCH v3 3/5] linux-user: Add strace support for printing arguments of syscalls used to lock and unlock memory

2020-07-22 Thread Filip Bozuta
ment 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

[PATCH v3 5/5] linux-user: Add strace support for printing arguments of some clock and time functions

2020-07-22 Thread Filip Bozuta
ed a little so that it prints the field names beside the values. Syscalls "clock_getres()" and "clock_gettime()" have the same number and types of arguments and thus their print functions "print_clock_getres" and "print_clock_gettime" shar

[PATCH v3 4/5] linux-user: Add an api to print enumareted argument values with strace

2020-07-22 Thread Filip Bozuta
dify all existing print functions in 'strace.c' that print arguments of syscalls with enumerated values to use this new api. Signed-off-by: Filip Bozuta --- linux-user/strace.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/linux-user/strace.c b/lin

[PATCH v3 1/5] linux-user: Make cpu_env accessible in strace.c

2020-07-22 Thread Filip Bozuta
o, all defined "print_*" and "print_syscall_ret*" functions in "strace.c" were changed to have the new "void *cpu_env". This was done to not cause build errors (even though none of these functions use this argument). Signed-off-by: Filip Bozuta

[PATCH v2 2/3] linux-user: Add missing termbits types and values definitions

2020-07-23 Thread Filip Bozuta
dded in file 'syscall.c' in bitmask tables 'iflag_tbl[]' and 'lflag_tbl[]' which are used to convert values of 'struct termios' between target and host. Signed-off-by: Filip Bozuta --- linux-user/alpha/termbits.h | 1 + linux-user/cris/termbits.h|

[PATCH v2 1/3] linux-user: Add generic 'termbits.h' for some archs

2020-07-23 Thread Filip Bozuta
n every arch 'termbits.h' file. Also, some of the flag values that were missing were added in this generic file so that it matches the generic 'termibts.h' and 'ioctls.h' files from the kernel: 'asm-generic/termbits.h' and 'asm-generic/ioctls.h'. Sign

[PATCH v2 3/3] linux-user: Add strace support for printing arguments for ioctls used for terminals and serial lines

2020-07-23 Thread Filip Bozuta
h" contains information that is used to decode structure values. Field "void print(void *arg)" was added in this structure as a special print function. Also, function "thunk_print()" was changed a little so that it uses this special print function in c

[PATCH v2 0/3] Adding support for printing contents of 'struct termios' which is used by ioctls of group 'ioctl_tty'

2020-07-23 Thread Filip Bozuta
7; were used. These programs were cross executed with QEMU with "-strace" to check if the contents 'struct termios' are getting correctly printed. Based-on: <20200722200437.312767-1-filip.boz...@syrmia.com> Filip Bozuta (5): linux-user: Add generic 'termbits.h

[PATCH] linux-user: Fix syscall rt_sigtimedwait() implementation

2020-07-24 Thread Filip Bozuta
the expected EFAULT. After the changes from this patch, the test case is executed successfully along with the other LTP test cases for 'rt_sigtimedwait()': PASS: test_bad_address3 (349): Test passed Signed-off-by: Filip Bozuta --- linux-user/syscall.c | 4 +++- 1 file changed,

[PATCH 2/2] linux-user: Add support for 'rt_sigtimedwait_time64()' and 'sched_rr_get_interval_time64()'

2020-07-25 Thread Filip Bozuta
to_host_timespec64()' and 'host_to_target_timespec64()' were used to convert values of 'struct timespec' between host and target. Signed-off-by: Filip Bozuta --- linux-user/syscall.c | 53 1 file changed, 53 insertions(+) diff -

[PATCH 1/2] linux-user: Add support for 'clock_nanosleep_time64()' and 'clock_adjtime64()'

2020-07-25 Thread Filip Bozuta
ser_timeval64()' was used to convert the field 'time' which if of type 'struct timeval' from host to target. Function 'copy_from_user_timveal64()' was added in this patch and used to convert the 'time' field from target to host. Signed-off-by: Filip Bozuta ---

[PATCH 0/2] linux-user: Introducing functionality for a group of 4 time64 syscalls

2020-07-25 Thread Filip Bozuta
tests from LTP test suite which was built inside chroot. Filip Bozuta (2): linux-user: Add support for two 'clock_nanosleep_time64()' and 'clock_adjtime64()' linux-user: Add support for 'rt_sigtimedwait_time64()' and 'sched_rr_get_interval_time64()

[PATCH] linux-user: Add support for 'mq_timedsend_time64()' and 'mq_timedreceive_time64()'

2020-07-25 Thread Filip Bozuta
tation in this patch was tested using recently added LTP time64 test variants for "mq_timedsend()" and "mq_timedsendreceive()". Signed-off-by: Filip Bozuta --- linux-user/syscall.c | 50 +--- 1 file changed, 47 insertions(+), 3

[PATCH v2 0/2] linux-user: Introducing functionality for two time64 syscalls

2020-07-26 Thread Filip Bozuta
implementation of the implemented syscalls was tested using recently added time64 test in the LTP test suite. Filip Bozuta (2): linux-user: Fix 'mq_timedsend()' and 'mq_timedreceive()' linux-user: Add support for 'mq_timedsend_time64()' and 'mq_timedrecei

[PATCH v2 2/2] linux-user: Add support for 'mq_timedsend_time64()' and 'mq_timedreceive_time64()'

2020-07-26 Thread Filip Bozuta
'mq_timedsend()' and 'mq_timedreceive' except that functions 'target_to_host_timespec64()' and 'host_to_target_timespec64()' were used to convert values of 'struct timespec' between host and target. Signed-of

[PATCH v2 1/2] linux-user: Fix 'mq_timedsend()' and 'mq_timedreceive()'

2020-07-26 Thread Filip Bozuta
ULT as expected, which is the same test result that is received with native execution: mq_timedsend01.c:187: PASS: mq_timedsend() failed expectedly: EFAULT (14) mq_timedreceive01.c:180: PASS: mq_timedreceive() failed expectedly: EFAULT (14) (Patch with this new test case will be sent to LTP mailing list soon)

[PATCH v2 0/2] Introducing functionality for a group of 4 time64 syscalls

2020-07-27 Thread Filip Bozuta
tests from LTP test suite which was built inside chroot. *v2: -Added check for 'clock_nanosleep_time64()' which returns '-TARGET_EFAULT' if conversion of 'struct timespec64' between host and target fails -Removed unnecesary special errno handl

[PATCH v2 1/2] linux-user: Add support for two 'clock_nanosleep_time64()' and 'clock_adjtime64()'

2020-07-27 Thread Filip Bozuta
ser_timeval64()' was used to convert the field 'time' which if of type 'struct timeval' from host to target. Function 'copy_from_user_timveal64()' was added in this patch and used to convert the 'time' field from target to host. Signed-off-by: Filip Bozut

[PATCH v2 2/2] linux-user: Add support for 'rt_sigtimedwait_time64()' and 'sched_rr_get_interval_time64()'

2020-07-27 Thread Filip Bozuta
to_host_timespec64()' and 'host_to_target_timespec64()' were used to convert values of 'struct timespec' between host and target. Signed-off-by: Filip Bozuta --- linux-user/syscall.c | 53 1 file changed, 53 insertions(+) diff -

[PATCH] linux-user: Fix 'clock_nanosleep()' implementation

2020-07-27 Thread Filip Bozuta
LTP suite can be found at: https://github.com/bozutaf/ltp (Patch with this new test case will be sent to LTP mailing list soon) Signed-off-by: Filip Bozuta --- linux-user/syscall.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/sysc

Re: [PATCH 0/1] linux-user: Add support for SG_IO and SG_GET_VERSION_NUM raw SCSI ioctls

2020-07-31 Thread Filip Bozuta
Hello Leif, On 30.7.20. 04:55, Leif N Huhn wrote: Hi. This is my first time trying to contribute to qemu. This patch works correctly for architectures with the same bit-width, for example 32bit arm host and i386 user binary. Here is an example with the sg_simple2 executable from https://github.c

Re: [PATCH 1/1] linux-user: Add support for SG_IO and SG_GET_VERSION_NUM raw SCSI ioctls

2020-07-31 Thread Filip Bozuta
On 30.7.20. 04:55, Leif N Huhn wrote: This patch implements functionalities of following ioctls: SG_GET_VERSION_NUM - Returns SG driver version number The sg version numbers are of the form "x.y.z" and the single number given by the SG_GET_VERSION_NUM ioctl() is calculated by (

[PATCH 0/3] linux-user: Introducing support for 'recvmmsg_time64()'

2020-07-31 Thread Filip Bozuta
x27; itself. Testing method: The implementation was tested using a modified LTP test suite where a timeout test case was added for 'recvmmsg()'. This modified test suite can be found at: https://github.com/bozutaf/ltp (A patch with this fix will be sent to LTP mai

[PATCH 3/3] linux-user: Add support for 'recvmmsg_time64()'

2020-07-31 Thread Filip Bozuta
27;TARGET_ABI_BITS' was checked to know what value for 'time64' argument to pass (0 if 'TARGET_ABI_BITS == 32' and 1 otherwise). Signed-off-by: Filip Bozuta --- linux-user/syscall.c | 25 ++--- 1 file changed, 18 insertions(+), 7 deletions(-) diff

[PATCH 1/3] linux-user: Modify 'sendmmsg()' and 'recvmmsg()' implementation

2020-07-31 Thread Filip Bozuta
; argument. Memory allocation for the 'iovec' field is done outside of these functions as to ensure that the memory is freed after the syscall execution. Signed-off-by: Filip Bozuta --- linux-user/syscall.c | 243 --- 1 file changed, 15

[PATCH 2/3] linux-user: Fix 'recvmmsg()' implementation

2020-07-31 Thread Filip Bozuta
f a new argument which represents the timeout. This argument is only passed in case of 'TARGET_NR_recvmmsg' and for 'TARGENT_NR_sendmmsg' 0 is passed. Function 'do_sendrecvmmsg()' was also updated accordingly in 'do_socketcall()' for 'TARGET_S

[PATCH v2 2/8] linux-user: Add support for a group of btrfs ioctls used for snapshots

2020-08-03 Thread Filip Bozuta
aproppriate values for the file descriptor and path of the subvolume for which the snapshot is to be deleted. Implementation notes: Since the thunk type 'struct btrfs_ioctl_vol_args' is defined in the previous patch, the implementation for these ioctls was straightforward.

[PATCH v2 3/8] linux-user: Add support for btrfs ioctls used to manipulate with devices

2020-08-03 Thread Filip Bozuta
t is the reason why corresponding structure definitions were added in file 'linux-user/syscall_types.h'. Since the thunk type for 'struct ioc_vol_args' was already added in a previous patch, the rest of the implementation was straightforward. Signed-off-by: Filip Bozuta

[PATCH v2 1/8] linux-user: Add support for a group of btrfs ioctls used for subvolumes

2020-08-03 Thread Filip Bozuta
enwrapped in an #ifdef statement with parameter CONFIG_BTRFS which is defined in 'configure' if the header file is present. Signed-off-by: Filip Bozuta Reviewed-by: Laurent Vivier --- configure | 9 + linux-user/ioctls.h| 15

[PATCH v2 5/8] linux-user: Add support for a group of btrfs inode ioctls

2020-08-03 Thread Filip Bozuta
id' and 'treeid' field should be filled with aproppriate values which represent the inode number of the directory that contains the subvolume and treeid of the subvolume. Implementation notes: All of the ioctls in this patch use structure types as third argument

  1   2   3   >