trace: infer storage/runtime args from assign() signature

storage/runtime arguments for tracepoint can be inferred from
assign() function signature instead of specified explicitly
by storage_args/runtime_args. This makes boilerplate code smaller.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
mmap: Improve mmap validation

Rename mmap_validate_flags to mmap_validate as it's not only related to
flags now.  Add new tests to check bad paramater values.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
[ penberg: cleanups ]
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
mmap: Check file-backed mmap arguments

(flags & MAP_ANONYMOUS) must be instead of (fd == -1) to determine
the mapping type as the latter one is a valid argument to file mappings.
Tests related to files were added into mmap_validate_file.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
[ penberg: cleanups ]
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: Add new tests into tst-mmap-file.so

The main purpose is to exercise the new parameter checks added to
mmap to handle wrong combination of parameters.
Let's intentionally force errors and catch them with the respective errno codes.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
x64: Use inline assembly for setcsr function

We had at least one report for a system in which the __mm_setcsr function
we were using is not found. Since this is heavily arch specific anyway,
we should just use inline assembly to do so.

Generated code verified to be the same:

  33c6e7:       c7 45 e0 80 1f 00 00    movl   $0x1f80,-0x20(%rbp)
  33c6ee:       0f ae 55 e0             ldmxcsr -0x20(%rbp)

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>