119 Commits

Author SHA1 Message Date
c417e20ce0 Add flag that toggles tracing 2025-09-10 15:27:00 +02:00
7883ec274c Log when trace file gets truncated 2025-08-19 13:45:42 +02:00
fd01132cad Don't run libxdc 2025-08-19 13:41:52 +02:00
rh0
0533f3f67e OOB fix in set_abort_reason_auxiliary_buffer
passing a message size larger than the size of the msg buffer to
set_abort_reason_auxiliary_buffer() may lead to an out-of-bounds read.
2024-09-30 22:08:46 +02:00
Sergej Schumilo
1def26f83e fix non-ipt mode 2024-01-20 21:26:18 +01:00
Sergej Schumilo
af13f3e73a fix unaligned load in auxilliary_buffer.c 2024-01-20 21:23:54 +01:00
Sergej Schumilo
02a6f2aed3 remove NYX_FDL check in check_available_ipt_ranges 2023-10-30 01:31:19 +01:00
Sergej Schumilo
d5f0efe9de check libxdc_init return value 2023-10-30 01:29:49 +01:00
Sergej Schumilo
874fa033d1 avoid unnecessary bitmap SHM resize 2023-08-04 11:41:32 +02:00
Sergej Schumilo
a09d3ae2e6 add support to configure aux buffer size via args 2023-08-03 09:19:31 +02:00
Sergej Schumilo
347559a923 export yaml state file even if snapshot serialization is disabled 2023-08-03 09:19:14 +02:00
Sergej Schumilo
dfe8584567 fix typo in mem_mode enum 2023-08-03 09:19:14 +02:00
Sergej Schumilo
e461639e96 extend yaml writer and add version and mem_mode 2023-08-03 09:19:14 +02:00
Sergej Schumilo
7f146b6a8c add yaml serializer for snapshot meta data 2023-08-03 09:19:14 +02:00
Sergej Schumilo
60c216bc9e add sanitiy check to verify that the aux buffer is not corrupted 2023-04-13 06:03:43 +02:00
Sergej Schumilo
5dae6ab764 split FDL and PT mode
- PT mode now works with both FDL and dirty ring backend
as in-kernel dirty page trackers.
2023-03-06 07:32:21 +01:00
Sergej Schumilo
ede09f502b some code cleanup and fix for another edge case 2023-01-19 17:01:38 +01:00
Sergej Schumilo
0a2ccef4d3 fix helper function to determine actual RAM size 2023-01-19 17:01:38 +01:00
Sergej Schumilo
37717f5ebf fix ram offset translation for pc_piix and q35 2023-01-19 17:01:38 +01:00
Sergej Schumilo
96f98e0b8d add debug hypercall (ram offset)
- to test translation from virtual to ram offset addresses
2023-01-19 17:01:38 +01:00
Sergej Schumilo
f35362b987 add debug hypercall for testing kcore-dumps 2023-01-19 17:01:38 +01:00
Sergej Schumilo
1a134e93d8 add nyx_warn_once() macro 2023-01-19 17:01:38 +01:00
Steffen Schulz
0fb4268b3e fix setting starved bit
Must be set before interface_send_char().

Currently only works for 'regular' executions, so we set it in
synchronization_lock_disable_pt()..
2022-12-22 04:53:31 +01:00
Steffen Schulz
397dba5ee2 reset aux_buffer pt_overflow bit 2022-12-22 04:53:31 +01:00
Steffen Schulz
b1fd5f1039 check ToPA allocation success
Check size returned for ToA allocation instead of blind mmap + assert.
Requires KVM-Nyx change to return error on allocation fail.
2022-12-22 04:47:28 +01:00
Steffen Schulz
5701e26966 remove duplicate warn/error strings 2022-12-22 02:41:00 +01:00
Steffen Schulz
21368bc0d9 minor
- use more symmetric message for GET_HOST_CONFIG
- the char* cast won't be needed once we have 'better errors' merged
2022-12-15 11:25:52 +01:00
Sergej Schumilo
ab9a1be9fe Fix previous patch (GET_HOST / SET_AGENT config)
- 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)
2022-12-15 11:25:52 +01:00
Steffen Schulz
2889f88a00 Allow multiple GET_HOST_CONFIG, but abort on SET_AGENT_CONFIG
GET_HOST_CONFIG may be queried multiple times to verify host
magic/version info by different tools. Only inform in debug mode.
2022-12-15 11:25:52 +01:00
Sergej Schumilo
eb1b6e6da6 change pre_image error message to debug msg 2022-12-15 11:23:53 +01:00
Steffen Schulz
2f869ed3e1 replace printf + exit() with nyx_abort()
- 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()
2022-12-15 11:23:53 +01:00
Steffen Schulz
31c509b171 replace most fprintf with nyx_error/warn/debug/abort
- 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
2022-12-15 11:23:53 +01:00
Steffen Schulz
b40f7c60e9 more missing newlines, fix use of warn/error
- replace several hardcoded fprintf()
- use of warn vs error or nyx_abort()
- several more missing newlines
- fixed up messages
2022-12-15 11:23:53 +01:00
Steffen Schulz
0675844956 Add nyx_warn() and prefix tags
Use qemu_log() everywhere so we have a single log on stderr or -D <logfile>.
2022-12-15 11:23:53 +01:00
Steffen Schulz
ab4fbeadef better nyx_abort()
Let nyx_abort() take a format string and replace instances of
fprintf/nyx_debug with subsequent nyx_abort / abort / assert.
2022-12-15 11:23:53 +01:00
Steffen Schulz
e6159806aa use nyx_error/printf/abort() also in sig handlers 2022-11-22 09:58:32 +01:00
Steffen Schulz
1609eee66a wait for gdb attach only when compiled for debug
Waiting for gdb attach is not useful/expected for normal use and has
a tendendency to create hanging qemu instances.
2022-11-22 09:58:32 +01:00
Steffen Schulz
3be0ec292e fix req_stream_data_bulk() return size
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)).
2022-11-21 07:05:27 +01:00
Steffen Schulz
f1bb7b29c4 check for successful chdir() 2022-11-21 06:50:29 +01:00
Sergej Schumilo
8a88edc2a1 auto-apply clang-format
- including vl.c & kvm-all.c
2022-10-16 23:51:13 +02:00
Sergej Schumilo
976d8e8329 minor fix (file_helper.c) 2022-10-16 23:51:13 +02:00
Sergej Schumilo
e4269fc973 manual code cleanups (reviewed)
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>
2022-10-16 23:51:13 +02:00
Sergej Schumilo
80f22f77d6 fix usage of nyx_debug_p() (add missing prefix) 2022-09-22 05:19:45 +02:00
Steffen Schulz
e83025a145 replace custom printf with nyx_<level>() wrappers
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().
2022-09-22 05:07:37 +02:00
Steffen Schulz
f91ff284ee switch debug logging to use qemu_log_mask()
Default qemu_log is written to stderr, or logged to file with -D
Additional qemu_log_masked(LOG_NYX) can be enabled with -d nyx
2022-09-22 05:07:37 +02:00
Steffen Schulz
bd34c46b85 fix printf format string errors 2022-09-22 05:07:37 +02:00
Steffen Schulz
ab668227f9 add NYX_DEBUG option in debug mode 2022-09-22 05:07:37 +02:00
Steffen Schulz
d407bab254 No vm_start() on snapshot restore (fixes #29)
Actual vm_start() performed by caller in vl.c. This extra vm_start()
breaks "qemu -S" function in combination with snapshot loads.
2022-09-07 20:11:21 +02:00
Steffen Schulz
6a336d0d3a Revert "page_cache: auto-create workdir files or resume based on existing files"
This reverts commit b8995723775c5ee75355ef4e87922cec359245e5.
2022-05-25 01:06:50 +02:00
Steffen Schulz
c93998e817 Revert "page_cache: use file lock also for read access"
This reverts commit 5c24050a645b0db69a806cb100f4e263ca191838.
2022-05-25 01:06:38 +02:00