trace: support time slicing options in `trace summary`

The summary will only include samples within the specified range.
Timed samples will be trimmed to the given time range.

Requested-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
fpu: early save/restore in interrupt/exception context

Since we cannot guarantee that the fpu will not be used in interrupts and
exceptions, we must save it earlier rather than later.

This was discovered with an fpu-based memcpy, but can be triggered in other
ways.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
elf: allow elf_resolve_pltgot() to use the fpu

elf_resolve_pltgot() can be called from anywhere, including with dirty fpu
state.  Ensure the fpu is not clobbered during its execution.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
rwlock: helpers for WITH_LOCK and friends

Implement facades for rwlock so it can be used with WITH_LOCK, specifying
whether we want a read lock or a write lock:

  rwlock my_rwlock;

  WITH_LOCK(my_rwlock.for_read()) {
    read stuff
  }

  WITH_LOCK(my_rwlock.for_write()) {
    write stuff
  }

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
vitio::net: Fix the description of try_xmit_one_locked(net_req*)

try_xmit_one_locked(net_req*) doesn't return EINVAL anymore. The appropriate
code has moved to xmit_prep().

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>