2026-06-20 21:21:20 +03:00
|
|
|
#ifndef VMSIG_MEMCTX_CFG_H
|
|
|
|
|
#define VMSIG_MEMCTX_CFG_H
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
/* Private config of the memctx adapter (vmie). Passed as opaque to open(); NOT
|
|
|
|
|
* public (layout per reference: src/<module>/include/). cfg==NULL => stub. */
|
|
|
|
|
typedef struct {
|
|
|
|
|
int stub; /* 1 => synthetic kcr3/RO-fd (spine without a VM) */
|
|
|
|
|
const char* ram_path; /* armed: path to guest RAM backing (NOT published outward) */
|
|
|
|
|
uint64_t low; /* below-4G split (vmie_win32_open / locator.low) */
|
2026-06-22 17:25:06 +03:00
|
|
|
int ro_fd; /* >=0 => infra hands a pre-sealed RO-fd (policy); OWNERSHIP */
|
|
|
|
|
/* TRANSFERS to the adapter (closed in close()) — the */
|
|
|
|
|
/* caller dups first if it must keep its own copy. */
|
|
|
|
|
/* <0 => default: open(ram_path, O_RDONLY) / stub-memfd */
|
2026-06-24 11:20:32 +03:00
|
|
|
uint32_t fail_boots; /* test-only: fail the first N stub bootstraps before */
|
|
|
|
|
/* succeeding (drives the retry/backoff path deterministically */
|
|
|
|
|
/* without timing dependence); 0 in production. stub path only. */
|
2026-06-20 21:21:20 +03:00
|
|
|
} vmsig_memctx_cfg;
|
|
|
|
|
|
|
|
|
|
/* Max SRC bytes per atomic gva_write (bounds the worker POD slot; mc_req header + src
|
|
|
|
|
* must stay <= VMSIG_WORK_SLOT). Private to the adapter (an executor bound), NOT part of
|
|
|
|
|
* the neutral control contract — control only needs VMSIG_MEMWRITE_INLINE for inline SRC. */
|
|
|
|
|
#define VMSIG_MEMWRITE_MAX 192u
|
|
|
|
|
|
|
|
|
|
#endif /* VMSIG_MEMCTX_CFG_H */
|