Commit Graph

28 Commits

Author SHA1 Message Date
184e94ba05 Fix a few spacing style issues
Reported by kernel's checkpatch.pl script.
2017-06-17 22:54:08 +00:00
Eugene Syromyatnikov
9d095c7860 Add copyright headers 2017-05-22 17:33:51 +00:00
50b50e78f6 Remove getarg_klu
After transition from long to kernel_ulong_t we no longer need
tcp->ext_arg, and therefore a function to access it is also no longer
needed.

* defs.h (getarg_klu): Remove prototype.
* util.c (getarg_klu): Remove.
(printargs): Access tcp->u_arg directly
* bjm.c (SYS_FUNC(init_module)): Likewise.
* clone.c (SYS_FUNC(unshare)): Likewise.
* fadvise.c (SYS_FUNC(fadvise64)): Likewise.
* kcmp.c (SYS_FUNC(kcmp)): Likewise.
* kexec.c (SYS_FUNC(kexec_file_load)): Likewise.
* keyctl.c (SYS_FUNC(keyctl)): Likewise.
* lookup_dcookie.c (SYS_FUNC(lookup_dcookie)): Likewise.
* mem.c (do_mprotect): Likewise.
* mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Likewise.
* pkeys.c (SYS_FUNC(pkey_alloc)): Likewise.
* prctl.c (print_prctl_args, SYS_FUNC(prctl), SYS_FUNC(arch_prctl)):
Likewise.
2016-12-26 10:43:35 +00:00
89636759d7 Automatically replace PRI_kr[dux] with PRI_kl[dux]
Remove temporary macros created for transition from long
to kernel_ulong_t.

Automatically replace PRI_kr[dux] with PRI_kl[dux] using
$ git grep -l 'PRI_kr[dux]' | xargs sed -ri 's/PRI_kr([dux])/PRI_kl\1/g'

* defs.h (PRI_krd, PRI_kru, PRI_krx): Remove.  All users updated.
2016-12-26 10:43:34 +00:00
7fa3d78319 Automatically replace kernel_(scno|ureg)_t with kernel_ulong_t
Remove temporary types created for transition from long
to kernel_ulong_t.

Automatically replace kernel_scno_t and kernel_ureg_t with
kernel_ulong_t using
$ git grep -El 'kernel_(scno|ureg)_t' |
  xargs sed -ri 's/kernel_(scno|ureg)_t/kernel_ulong_t/g'

* kernel_types.h (kernel_scno_t, kernel_ureg_t): Remove.
All users updated.
2016-12-26 10:43:34 +00:00
1d5bb61c49 Print kernel_ureg_t and kernel_scno_t using dedicated format strings
Prepare for the change of kernel_ureg_t and kernel_scno_t from
unsigned long to kernel_ulong_t.

* defs.h (PRI_krd, PRI_kru, PRI_krx): New temporary macros.
All users updated.
2016-12-26 10:43:04 +00:00
7372d4a900 kexec: change flags type from unsigned long to kernel_ureg_t
* kexec.c (SYS_FUNC(kexec_load)): Change n variable type
from unsigned long to kernel_ureg_t.  Use printxval64 instead
of printxval_long.  Use printflags64 instead of printflags_long.
2016-12-25 11:32:46 +00:00
bbb1fa0c5f kexec: change types of pointers and sizes to kernel_ureg_t
* kexec.c (print_seg): Change the type of *seg and seg_buf variables
from unsigned long to kernel_ureg_t.
(print_kexec_segments): Change len argument type from unsigned long
to kernel_ureg_t.  Change seg variable type from unsigned long
to kernel_ureg_t.
2016-12-25 11:32:46 +00:00
a940d1a60f printstr: rename to printstrn, add printstr as a thin wrapper
As about half of all printstr uses cases are invocations with the last
argument set to -1, create a dedicated function for this use case.

* defs.h (printstr): Rename to printstrn.  All callers updated.
(printstr): New static inline function.  All callers updated.
2016-12-25 11:32:45 +00:00
aa5e08eac5 kexec: change address argument type from unsigned long to kernel_ureg_t
* kexec.c (print_kexec_segments): Change address argument type
from unsigned long to kernel_ureg_t.
2016-12-23 19:26:58 +00:00
552888b1ac Do not use widen_to_ulong in kexec.c and process_vm.c
Automatic argument truncation makes use of this function redundant.

* kexec.c (SYS_FUNC(kexec_load)): Do not invoke widen_to_ulong.
* process_vm.c (SYS_FUNC(process_vm_readv),
SYS_FUNC(process_vm_writev)): Likewise.
2016-12-20 05:10:21 +00:00
Eugene Syromyatnikov
8e4c657a9d kexec: fix for the x32 ABI
There is no compat (and no 32-bit version, ever) for x32 ABI, so
kernel's long type should be used for arguments' values.

The only remaining thing is a pointer to cmdline string, but it is
currently broken on x32 anyway.

* kexec.c (SYS_FUNC(kexec_file_load)): Print the cmdline_len argument
as kernel long, retrieve it via getarg_klu; use printflags64 for
printing the flags argument, retrieve it via getarg_klu.
2016-12-20 00:13:27 +03:00
Eugene Syromyatnikov
108d574c54 kexec: use widen_to_ulong since kexec_load has compat on x32/n32
Curiously, kexec_load uses compat on x32/n32, so its parameters should
be 4 bytes in size on these ABIs.

* kexec.c (SYS_FUNC(kexec_load)): Use widen_to_ulong for casting
parameters to proper size on x32/n32.
2016-10-29 02:54:01 +03:00
Eugene Syromyatnikov
920b4d5114 kexec: fix zeroing of higher bits of flags parameter in kexec_load
* kexec.c (SYS_FUNC(kexec_load)): Perform type conversion before
negation in order to properly negate higher bits of KEXEC_ARCH_MASK.
2016-10-29 02:54:01 +03:00
Eugene Syromyatnikov
41c468b26c kexec: add printing of struct kexec_segment field names
* kexec.c (print_seg): Print field names of the kexec_segment structure.
2016-10-29 02:54:01 +03:00
e2c5a3c60e Fix printing of invalid flags argument of kexec_load and kexec_file_load
* kexec.c (SYS_FUNC(kexec_load), SYS_FUNC(kexec_file_load)): Print
flags argument using printflags_long.
2016-05-16 22:54:41 +00:00
ba4a4c60cf kexec.c: use print_array function
* kexec.c (print_seg): Change for use as print_array callback.
(print_kexec_segments): Use print_array.
2016-05-07 23:32:30 +00:00
38a34c9349 Add copyright headers to some files which lack them
Before this change, all files that exist since 20th century had
copyright headers, while most files that appeared later didn't.  This
change fixes the inconsistency by adding missing copyright headers.

It doesn't mean that copyright headers became maintained.  In my view,
git history provides much better information on this subject and is much
more accurate than copyright headers.
2015-12-17 17:56:48 +00:00
ea1970500e Implement kexec_file_load syscall decoding
* xlat/kexec_file_load_flags.in: New file.
* kexec.c: Include "xlat/kexec_file_load_flags.h".
(SYS_FUNC(kexec_file_load)): New function.
* linux/dummy.h (sys_kexec_file_load): Remove stub alias.
* pathtrace.c (pathtrace_match): Add SEN_kexec_file_load.
2015-11-22 23:10:12 +00:00
b172a94d02 Add a new helper function umove_ulong_array_or_printaddr
* defs.h (umove_ulong_array_or_printaddr): New prototype.
* util.c (umove_ulong_array_or_printaddr): New function.
* desc.c (sys_pselect6): Use it instead of open-coding
a proxy struct parser for different personalities.
* io.c (tprint_iov_upto): Use it instead of open-coding
a struct iovec parser for different personalities.
* kexec.c (print_kexec_segments): Use it instead of open-coding
a struct kexec_segment parser for different personalities.
(print_seg): Pass arguments using an array.
2015-09-15 11:23:27 +00:00
2f444dc871 kexec.c: use printaddr and umove_or_printaddr
* kexec.c (print_seg): New function.
(print_kexec_segments): Use it.  Use printaddr and umove_or_printaddr.
(kexec_load): Use printaddr.  Update for RVAL_DECODED.
2015-07-20 01:42:01 +00:00
a0bd3749fc Declare syscall parsers using SYS_FUNC macro
Introduce SYS_FUNC macro to declare and define all syscall parsers.

* Makefile.am (BUILT_SOURCES, CLEANFILES): Add sys_func.h.
(sys_func.h): New rule.
* defs.h (SYS_FUNC_NAME, SYS_FUNC): New macros.
* linux/syscall.h: Include "sys_func.h".
[NEED_UID16_PARSERS]: Use SYS_FUNC to declare uid16 syscall parsers.
Remove other declarations.
* linux/alpha/syscallent.h (160, 161): Add sys_ prefix to osf_statfs
and osf_fstatfs syscall parsers.
* *.c: Use SYS_FUNC to define syscall parsers.
2015-04-07 11:22:49 +00:00
Denys Vlasenko
7e69ed98cd Change last parameter of umoven() from char* to void*
Saves tons of casts.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2015-03-21 19:50:53 +01:00
ff6a55dee9 Remove linux/kexec.h
* linux/kexec.h: Remove.
* Makefile.am (EXTRA_DIST): Remove it.
* kexec.c: Do not include <linux/kexec.h>.
* xlat/kexec_arch_values.in: Add default values.
* xlat/kexec_flags.in: Rename to kexec_load_flags.in, add default
values.
2015-02-19 21:29:01 +00:00
d35bdcad13 Compress blank lines
Suppress empty lines left after automated xlat conversion.
2014-05-30 22:10:21 +00:00
0ed617bd66 Generate xlat/*.in files
Automatically convert xlat structures from *.c files to xlat/*.in files
using "./generate_xlat_in.sh *.c" command.
2014-05-30 21:40:03 +00:00
900ec1b042 kexec: fix typo
* kexec.c (print_kexec_segments) [SUPPORTED_PERSONALITIES == 1]: Fix typo.
2014-02-06 21:13:36 +00:00
90aa9f4d72 Implement kexec_load decoding
* kexec.c: New file.
* linux/kexec.h: Likewise.
* Makefile.am (strace_SOURCES): Add kexec.c.
(EXTRA_DIST): Add linux/kexec.h.
* linux/dummy.h (sys_kexec_load): Remove.
* linux/syscall.h (sys_kexec_load): New prototype.
2014-02-05 14:25:20 +00:00