Span and substring scans over checked guest memory with the shared 1 MiB
budget, registered as standard services.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
Checked guest-memory implementations for the remaining core byte-string
mutators, registered as standard services alongside the existing scans.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
Implement isalnum/isalpha/isdigit and related predicates plus
tolower/toupper with MSVC EOF rules, registered as standard services.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
Extend the system runtime with setlocale/localeconv (C only), a bounded
sprintf/snprintf converter, and XAsyncRun/GetStatus/Cancel/GetResultSize
on the calling thread. Register the new symbols as standard services.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
CPUID returns a fixed table that never reads the host: a synthetic
vendor, and a feature bit only when every instruction of that feature
is implemented. Today that is CMOV, POPCNT, LZCNT and long mode. SSE
and SSE2 stay unreported while parts of them are rejected. Unlisted
leaves return zeros.
tests/cpu_features.rs pins every leaf in both engines, requires each
reported feature's instruction set among the executed fixtures, and
holds a refused witness instruction for each unreported feature, so a
bit cannot be set early or forgotten later.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
Harden host-backed guest drives after agent security and implementation
review: O_NOFOLLOW mount roots, identity re-check before unlink with
Linux AT_EMPTY_PATH when available, CREATE_ALWAYS truncate coverage,
and honest docs about residual trusted-host limits.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
Declare XADD and CMPXCHG in the instruction registry for 8- to 64-bit
register and memory destinations. The LOCK prefix is accepted on the
forms the registry marks lockable and only with a memory destination;
every other use stays an illegal instruction.
Both engines run the new forms on the shared semantics. A failed
CMPXCHG still writes its destination, so it faults on memory that
cannot be written, and a fault changes nothing. The registry document
states the ordering, alignment, compare-failure and fault rules a guest
scheduler has to preserve. Nothing is lowered to ARM64 atomics.
Fourteen SDM-derived cases already in cpu_known_answers.rs move from
refused to verified. Adds 62 LLVM-assembled fixtures with reference
arms, generator checks for the lock key and tests/x86_atomic.rs.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
Author-side review findings: sharing and delete checks now treat an
unreadable identity as the same file, writable mounts limit file size
(1 GiB by default), and errno handling is portable.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
scripts/test-gpu.sh now runs the oracle on native Metal: 752 cases in
613 programs pass under API and shader validation. Also states which half
of the oracle checks values and which checks rejection offsets (review nit).
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
The B3 oracle (#309) checks v_not_b32, v_bfrev_b32, v_ffbh_u32,
v_ffbl_b32, v_ffbh_i32 and v_swap_b32 against the guide on both CPU
interpreters, but its native Metal half was skipped because the
translator did not accept the forms. This adds the VOP1 registry file and
operand rule, decoder dispatch, IR and MSL lowering (v_swap_b32 writes
both VGPRs, each merged under EXEC), fixture and goldens, and removes
the oracle's skip from scripts/test-gpu.sh.
A new CPU test checks that the compiler accepts every case of the
oracle and rejects each of its rejections at the same word.
v_mov_b32 stays hand-written.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
s_mov_b32 was the last hand-written SOP1 decode path. It becomes
ScalarUnaryOp::MovB32 under a new sop1_move operand rule that matches the
old hand-written domain exactly (it accepts more SDST and SSRC0 classes
than sop1_sgpr, which other unary forms keep).
A decode sweep of 33,664 s_mov_b32 words shows no behaviour change: the
21,010 accepted words differ only in the instruction's name and the 12,654
rejections are identical. IR and MSL goldens are unchanged.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
Accept only D: to Z:. Hide multiply linked files. Verify each opened
descriptor's type and identity against the listing. Compare live
device and inode for sharing and deletion, and check sharing before a
truncating open. Report directory listing errors and limits
explicitly. Add regression tests for hard links, host swaps between
listing and open, renames, read-only enforcement and limits, and
describe the policy and its remaining limits without unconditional
confinement claims.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
Address review on the delay-import probe change:
- Read only descriptors inside the delay import directory's declared
size, and require that size to hold the terminating empty descriptor.
- Require each descriptor's DLL name, import address table and import
name table to be present and to start in section data, with a
diagnostic naming the missing field.
- Leave delayed rows out of the xenora imports sync backlog, so its
totals stay ordinary-only.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
Read the PE32+ delay-load directory (data directory 13) with a bounded
parser and list each delay-loaded import in imports.csv, marked by a new
import_table column. Ordinary totals and missing_imports.csv are
unchanged; the JSON report counts delayed slots and DLLs separately and
carries a diagnostic for truncated, out-of-range or unsupported tables.
Adds an original fixture with ordinary and delayed imports, generated by
fixtures/pe/delay-imports.py and cross-checked with llvm-readobj.
Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>
Add a clean-room decoder for the common decoration grammar, show its
output in generator manifests, and test it against names clang mangles
for x86_64-pc-windows-msvc.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
Add correctness-gated guest loops that time services through the
import table. Scan string lengths 256 units at a time, falling back to
single units at mapping boundaries to keep exact faults.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
Drive random service call sequences with adversarial arguments and
check memory and register invariants after every call. The libFuzzer
target and a stable replay test share one driver.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>
main keeps the last error per TEB since #310. This adds the missing
retirement step, so a reused TEB address starts at zero, and two
conformance tests: a successful call keeps a nonzero error, and one
thread's failure does not reach another.
Signed-off-by: LanaCodes-Boop <139008131+LanaCodes-Boop@users.noreply.github.com>
main gained per-TEB last-error handling in #310. The conflicts in
CHANGELOG.md, services.rs and runtime_services.rs are resolved to main's
version, which drops this branch's separate thread-context mechanism.
Signed-off-by: LanaCodes-Boop <139008131+LanaCodes-Boop@users.noreply.github.com>
The merge of #309 kept only the wide-compare skip, so scripts/test-gpu.sh
runs vop1_integer_forms_match_the_guide_on_native_metal, which fails until
the translator implements the VOP1 integer forms.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
A form declared operation = "cmov" without carry_in = "scc" passed
validation and would have generated a move that never writes D. The new
generator test fails without the fix.
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
Resolve each path component from the mount's root descriptor with
openat and O_NOFOLLOW, matching names case-insensitively and hiding
symbolic links, so guest paths cannot leave the mounted root. Mounts
are read-only unless configured writable.
Signed-off-by: Adeeb Rahman <therealabeeb@icloud.com>