- fix debug mode (by including nyx/debug.h)
- call qemu_trace() only if host_config has already been requested once
- change nyx_abort message back to previous one (otherwise some tests will break)
- Replace instances of error/printf + exit(1) with nyx_abort(), except
for one instance where we don't give any useful error and a plain
assert() seems more appropriate
- Remove [Qemu-Nyx] and Error: in arguments to nyx_error()
- printf that looks like debug/status info or disabled by macro/comments
mostly turned to corresponding nyx_debug()
- printf followed by exit/abort/assert turned to nyx_error(),
or nyx_abort() if the error is unlikely to need backtrace/gdb
- non-fatal error/warning messages turned to nyx_warn()
- few hardcoded printf remain, e.g. hexdump and debug helpers
Hypercall failed to handle the default case where 0 < ret_value < 4096.
The handler keeps looping over num_addresses, returning a too large
overall file size to the guest.
For a 4 byte test file, hget_bulk() would fetch + write 960 bytes.
Also moved struct definition to header + set __attribute__((packed)).
Tried to minimize actual code modifcations but we got
- several comments/printf messages edited to meet line limits
- occasionally switch some lines to put declarations or printfs in blocks
- couple more places marked TODO or FIXME to avoid non-trivial changes
- fixed PAGE_SIZE define in helpers.h to avoid redeclaration warning
- remove several chunks of dead or commented code
Co-authored-by: Steffen Schulz <steffen.schulz@intel.com>
This introduces generic printf wrappers to replace the various
instances of debug_printf, fprintf, QEMU_PR_PRINTF etc.
Several more hardcoded printf() are still present and should probably be
replaced with nyx_debug_p().
reset_timeout_detection() is already called at end of NEXT_PAYLOAD
handler to properly re-init the timer on every new execution.
Remove the additional call in synchronization_lock() which prevents
proper timeout on targets that do a lot of hprintf().
Also remove extra call in synchronization_lock_timeout_found() which
really just seems to be a duplicate with no observable effect.
To reproduce, run a harness that uses hprintf() in infinite loop. It
will take longer due to execute due to userland overhead but should
eventually return with aux_buffer/runtime similar to configured timeout.