DEEP DIVE / X86-64 / OWL0 · OCT 2026
x86-64, from bits to VM exits.
An offensive researcher's x86-64 field guide: start with bits, addresses, arithmetic and data structures; reach disassembly, memory lifetimes, paging, VM exits, and OWL0. The goal is not to memorize mnemonics. It is to explain exactly which machine-level assumption failed.
Primary target: Intel/AMD x86-64 on Linux. AMD64 and Intel 64 largely share the programmer model; VMX is Intel's virtualization architecture and SVM is AMD's. The examples are for a local, authorized research lab. OWL0 is a developing experiment, not a claim of invisibility.
0. The map of the machine
A program is not a stream of C statements to the CPU. It is a set of encoded instructions, mapped virtual pages, register transitions, exceptions, and interactions with privileged software. A useful researcher’s model has six layers: bits → instruction set → ABI → virtual memory → kernel contracts → virtualization. An exploit or detector crosses assumptions between layers, and an investigator must know what each boundary guarantees.
Read the page in order, or use these chapter links: binary & math · data structures · registers · assembly · ABI · stack · paging · CPU internals · privilege · lifetimes · concurrency · mitigations · VMX / SVM · OWL0 · labs.
1. Binary arithmetic is the hardware's language
A bit has two values, 0 or 1. An n-bit unsigned integer represents the interval [0, 2ⁿ − 1]. Eight bits yield 256 combinations, from 0 to 255; a 64-bit register has 2⁶⁴ possible bit patterns. An address is a pattern of bits, not inherently an object, integer, or pointer; its interpretation comes from the architecture and the code using it.
Hexadecimal compresses binary: one hex digit represents four bits. 0xB6 is 1011 0110 in binary, or 11×16 + 6 = 182 in decimal. A byte is eight bits; a kibibyte is 2¹⁰ = 1,024 bytes; a 4 KiB page is 2¹² = 4,096 bytes. Keep KiB and KB distinct.
0x2f = 0010 1111₂ = 47₁₀
0x1000 = 4096 = 2^12
0xffff & 0x00ff = 0x00ff
0xA0 | 0x0F = 0xAF
0x5A ^ 0xFF = 0xA5
Unsigned addition wraps modulo 2ⁿ: UINT64_MAX + 1 = 0 for a 64-bit unsigned result. Two's-complement signed values use the top bit as their sign; 0xffffffffffffffff interpreted as a signed 64-bit integer is −1. The hardware may produce the same bit pattern for signed and unsigned addition, while the language's overflow rules differ. In C, signed overflow is undefined behavior; unsigned overflow is defined modulo 2ⁿ.
Left shifting by k usually multiplies an unsigned value by 2ᵏ when the result fits; right shifting an unsigned value divides by 2ᵏ, discarding remainder. Masking extracts fields. (value >> 12) & 0x1ff selects nine bits starting at bit 12. The expression is everywhere in page-table walking. Do not shift by an amount equal to or larger than the width of the integer in C: that is undefined behavior.
Alignment, division and boundary mistakes
Objects are often aligned to powers of two. A 16-byte-aligned pointer has four low zero bits. For positive powers of two, align_down(x, a) = x & ~(a−1) and align_up(x, a) = (x+a−1)&~(a−1), assuming enough width to avoid overflow. The addition in align_up is itself a security-sensitive operation: a wraparound can turn a large requested allocation into a small one.
size_t round_up(size_t n, size_t alignment) {
if (!alignment || (alignment & (alignment - 1))) abort();
if (n > SIZE_MAX - (alignment - 1)) abort();
return (n + alignment - 1) & ~(alignment - 1);
}
When investigating integer-overflow-to-buffer-overflow chains, write down the type and range of every intermediate expression, not just the final allocated size. A cast before multiplication can change the width; a cast after multiplication cannot undo overflow.
2. Data layouts, algorithms and invariants
Memory is a byte-addressed array, but real programs impose object layouts. A C struct can contain padding between fields and at the end. The compiler chooses offsets consistent with ABI alignment rules; layout is not simply “sum of field sizes.” Endianness defines byte order: on mainstream x86-64, 0x12345678 occupies adjacent bytes 78 56 34 12 from low to high address.
struct message {
uint8_t kind; // offset 0
uint32_t length; // typically offset 4
void *payload; // typically offset 8 (LP64)
}; // typically 16 bytes total
// Verify assumptions, don't guess:
// printf("%zu %zu\n", sizeof(struct message),
// offsetof(struct message, payload));
Arrays use contiguous elements: &a[i] = base + i×sizeof(element). Lists use pointers; trees use child references; hash maps translate a key into a bucket and resolve collisions. Their algorithmic costs matter to security: hash collision storms can cause unanticipated CPU use, and quadratic scanning can turn user-controlled input into denial-of-service. Typical average hash-table lookup is O(1) under assumptions; worst-case may be O(n). A balanced tree is O(log n); linear scanning is O(n).
For a ring buffer with capacity N, indices can advance modulo N; power-of-two capacities permit index & (N−1) instead of modulo. But correctness also requires deciding when the buffer is full, who owns each slot, and when data becomes visible to another CPU. That final question is about memory ordering, not arithmetic.
3. The architectural state: registers and flags
The general-purpose register set includes RAX RBX RCX RDX RSI RDI RBP RSP R8–R15. RIP tracks the next instruction. RFLAGS holds status and control flags. The low 32 bits of RAX are called EAX, the low 16 AX, and the low 8 AL. Writing EAX zero-extends into RAX in 64-bit mode; writing AX or AL does not clear the untouched upper bits.
mov rax, -1 ; RAX = ffffffffffffffff
mov eax, 7 ; RAX = 0000000000000007
mov al, 0x42 ; RAX = 0000000000000042
lea rdx, [rip+msg] ; RIP-relative address, useful for PIE
ZF means an arithmetic/compare result was zero; CF reports carry/borrow in unsigned arithmetic; SF reflects the sign bit; OF indicates signed overflow. cmp a,b sets flags as though computing a−b, without storing the difference. Signed and unsigned branches differ: jl uses sign/overflow logic, while jb uses carry.
SIMD/vector state is separate: XMM/YMM/ZMM registers process packed values with SSE/AVX extensions, subject to CPU feature detection and OS state support. A disassembler or crash report that only shows general registers may omit a relevant data path.
4. Read the instruction, then the effect
The two common assembly notations are Intel and AT&T. These examples use Intel syntax: mov destination, source. An instruction can operate on immediate constants, registers or memory; the brackets in [rax+8] mean “dereference effective address RAX+8.” By contrast, lea rax,[rbx+8] calculates the address without dereferencing it.
mov rax, [rdi+8] ; load an 8-byte value from memory
mov [rdi+8], rax ; store 8 bytes into memory
lea rax, [rdi+8] ; compute address, no load
test rax, rax ; set flags according to bitwise AND
jz .null ; branch if zero
call do_work ; push return address and transfer RIP
ret ; pop return address into RIP
The instruction decoder sees variable-length x86 instructions. Not all byte offsets are instruction boundaries. Instructions have prefixes, opcodes, ModR/M, optional SIB, displacements and immediates. Source-level lines need not match one instruction each, and optimizers may inline, vectorize, remove or reorder work. This is why the actual binary is often the final authority in a security investigation.
A complete tiny control-flow example
// C (for a local Linux lab)
long absdiff(long a, long b) {
return a > b ? a - b : b - a;
}
// Representative Intel-style logic (not a guaranteed compiler output):
; a in RDI, b in RSI
mov rax, rdi
sub rax, rsi
cmp rdi, rsi
jg .done
mov rax, rsi
sub rax, rdi
.done:
ret
Observe the difference between jmp (unconditional), call (saves return address), and ret (restores it). Reconstruct a control-flow graph from branch targets. Questions for a researcher: which condition can attacker-controlled input influence, and does the value used for the check match the one used for the operation?
5. ABI: calling conventions are executable contracts
For ordinary Linux userspace C functions under the System V AMD64 ABI, the first six integer or pointer arguments are normally passed in RDI, RSI, RDX, RCX, R8, R9; an integer return value usually arrives in RAX. Floating-point/vector arguments use XMM registers under separate classification rules. Remaining parameters and particular aggregate values can use the stack. The Windows x64 calling convention differs; do not apply it blindly to Linux.
Syscalls have a different calling convention: the syscall number goes in RAX; arguments use RDI, RSI, RDX, R10, R8, R9. The syscall instruction overwrites RCX and R11 as part of its transition semantics. Userland also has a 128-byte red zone below RSP under the System V ABI; kernel and interrupt contexts cannot casually rely on that userspace rule.
// Linux x86-64 direct write(1, message, length) example.
// This is illustrative assembly, not a replacement for libc.
mov eax, 1 ; __NR_write
mov edi, 1 ; stdout
lea rsi, [rip+msg]
mov edx, msg_len
syscall ; RCX and R11 clobbered
Which registers must be preserved by a callee? Which are caller-saved? The ABI answers. For common SysV calls, RBX, RBP and R12–R15 are callee-saved; RSP must be restored. A broken hand-written assembly routine can corrupt registers that another function was entitled to trust. Stack alignment at call sites matters, especially for SIMD instructions and compiler-generated code.
6. Stack frames, return addresses and control flow
On x86-64 the stack normally grows toward lower virtual addresses. A push of a 64-bit register subtracts 8 from RSP and stores eight bytes. A call stores the return RIP; a ret loads a return address from the current stack. RBP may serve as a frame pointer, but optimized functions often omit it.
push rbp
mov rbp, rsp
sub rsp, 0x30 ; reserve local stack space
...
leave ; equivalent to mov rsp, rbp; pop rbp
ret
Classic stack corruption becomes dangerous when an unchecked write crosses from a buffer into control data, but real layouts vary with compiler, optimization, canaries and ABI choices. A buffer overflow is a bounds violation; exploitability additionally depends on reachability, corruption target, attacker control and mitigations. Never equate a debugger crash with reliable control-flow hijack.
7. Addresses are translations, not direct locations
An x86-64 virtual address is translated through page tables before physical memory is accessed. With standard four-level paging, a 48-bit canonical virtual address splits into 9 + 9 + 9 + 9 + 12 bits: PML4 index, PDPT index, PD index, PT index, and byte offset. Each table has 512 entries because each 4 KiB page fits 4096/8 = 512 eight-byte entries.
pml4 = (va >> 39) & 0x1ff;
pdpt = (va >> 30) & 0x1ff;
pd = (va >> 21) & 0x1ff;
pt = (va >> 12) & 0x1ff;
off = va & 0xfff;
In four-level mode, canonical addresses sign-extend bit 47 into bits 48–63; noncanonical values fault. If enabled, LA57 five-level paging extends the scheme to 57-bit canonical virtual addresses with one more nine-bit level; do not assume every x86-64 machine uses exactly four levels. Large mappings may terminate earlier: 2 MiB pages at the PD level, 1 GiB pages at the PDPT level.
CR3 identifies the active translation root (with details depending on enabled PCID mode). Page-table entries carry present, access, writable, user, accessed/dirty and execute-disable semantics subject to mode and feature support. A missing translation can raise a page fault (#PF), whose error code and faulting address in CR2 are critical forensic evidence. A virtual address alone never proves what bytes were physically read.
TLB and stale assumptions
The translation lookaside buffer caches translations and permissions. Editing a page-table entry does not magically make every CPU forget the previous translation; appropriate invalidation and synchronization are required. For kernel exploitation and hypervisors alike, ask: was the page-table content changed, was the cached translation invalidated, and which CPU might still carry stale state?
8. The CPU is more than its ISA
The architecture promises a programmer-visible result; microarchitecture determines how it is reached. Modern x86 CPUs decode instructions to internal operations, execute many out of order, predict branches, use reorder buffers, retire results in architectural order, and rely heavily on cache and TLB hierarchies. Architectural correctness is not the same as absence of timing information: speculation and caching can influence measurable latency.
Keep three ideas separate: a data dependency means an operation needs another's result; a control dependency depends on which branch executes; a memory-ordering constraint governs when observers can see loads/stores. x86 typically has a stronger memory ordering model than many weakly ordered architectures, but it is not “everything is always sequential.” Compiler reorderings and atomic protocol design still matter.
9. CPL, rings, traps and kernel entry
Common Linux uses CPL3 for userspace and CPL0 for kernel code; x86 also defines rings 1 and 2, but mainstream Linux does not generally use them for normal processes. Exceptions, interrupts and syscalls move control to handlers through defined mechanisms. Privilege is not just a number attached to a pointer: it includes page permissions, descriptor tables, control registers, CPU modes and kernel authorization checks.
An exception is generally associated with instruction execution, while external interrupts are delivered asynchronously. Distinguish a page fault (#PF), general protection fault (#GP), invalid opcode (#UD) and debug exception (#DB); each tells a different story. During a real kernel investigation, preserve the register frame, fault code, stack trace and the exact binary build before speculating about causality.
10. Pointer lifetime: the exploitability question
A pointer is a bit pattern representing an address. It does not prove that the originally referenced object still exists. A use-after-free happens when code dereferences a reference after the relevant object's lifetime ended. The allocator may reuse the address for an unrelated object, so “the memory still contains plausible bytes” does not mean the use is valid.
// Deliberately wrong: demonstrative userland UAF.
struct record *p = malloc(sizeof(*p));
p->count = 4;
free(p);
// p->count++; // BUG: lifetime ended.
// Narrower safe single-threaded pattern:
free(p);
p = NULL;
// Never dereference it after release.
Setting one pointer to NULL is not sufficient if other aliases remain or another thread can race the release. Kernel lifetimes often involve reference counting, RCU grace periods, object caches and cancellation of asynchronous work. For each suspected UAF, build a timeline: allocation → reference acquisition → sharing → last release → possible reuse → stale dereference. Then prove reachability and the object's new role.
The difference between a vulnerable-but-not-exploitable instance and an exploitable one often depends on reuse predictability, object layout, what fields are later interpreted, the attacker's control over replacement data, and defenses. There is no universal “UAF exploit”; there are concrete allocator and object-lifetime failures.
11. Atomic operations, ABA and lock-free traps
A race exists when the outcome depends on unsynchronized ordering of operations. Ordinary reads and writes shared between threads without a proper synchronization protocol can be a C data race. Atomics express ordering and visibility, but choosing the right memory order requires understanding the algorithm's invariant.
For a counter increment, a read-modify-write atomic can prevent lost updates. For a linked structure, compare-and-swap (CAS) can swap a pointer only if its current value matches an expected value. Yet CAS alone does not solve object reclamation. In the ABA problem, a location contains A, changes to B, then returns to A; a comparer notices “still A” while missing an intervening lifetime change. Generation counters, careful reference ownership, hazard pointers, epochs or RCU-style reclamation may be needed depending on the system.
// C11 illustration: atomicity of a counter, not a generic object lifetime fix.
atomic_uint count = 0;
atomic_fetch_add_explicit(&count, 1, memory_order_relaxed);
// Relaxed is enough for count uniqueness, not for publishing other data.
In kernel code, a lock may protect an object only until the lock is released; a reference might outlive the critical section. Treat refcount_inc_not_zero(), kref_get(), kfree() and asynchronous completions as points where an explicit lifetime argument is required. Draw happens-before edges, not merely “thread A happened first on my machine.”
12. Defenses: what each one does and does not promise
ASLR randomizes relevant virtual mappings; PIE lets executables load at randomized bases; NX/XD marks pages non-executable; stack canaries attempt to detect certain stack overwrites; CFI/CET constrain some classes of control-flow abuse; SMEP restricts supervisor execution from user pages; SMAP restricts certain supervisor accesses to user pages unless deliberately enabled. KASLR randomizes kernel layout; KPTI separates selected user/kernel mappings to reduce exposure around Meltdown-class risks.
Each defense has scope, prerequisite CPU and OS support, and a class of threats it addresses. Nothing here makes memory-safe code automatic. For vulnerability triage record the build configuration, mitigations and actual attack surface; do not claim bypasses from theory alone.
13. Virtualization: the boundary below the kernel
Modern hardware virtualization lets a virtual-machine monitor (VMM) run a guest operating system while controlling selected transitions and hardware resources. It does not simply make everything “ring −1”: the host controls VM entry/exit state, interception policies and guest execution. On Intel, VMX distinguishes VMX root and VMX non-root operation; privilege rings still exist inside the guest.
The VMCS (virtual-machine control structure) describes guest/host state, execution controls and exit information. A VM entry transfers control into the guest; a VM exit transfers control to the VMM for a configured reason. Examples include certain control-register operations, privileged instructions, exceptions subject to intercept settings, and EPT violations. Not every instruction exits. Intercepting everything would be painfully slow; designing an experiment means choosing observations deliberately.
HOST / VMM GUEST
+------------------+ +------------------+
| VMX root | --entry->| VMX non-root |
| VMCS controls | | kernel + user |
| exit handler |<--exit--| intercepted event|
+------------------+ +------------------+
| |
+-- EPT maps guest-physical --+
EPT (Extended Page Tables) adds another address translation layer: guest virtual → guest physical → host physical. The guest maintains its own page tables, and the VMM maintains EPT mappings. EPT permissions and faults/violations can create powerful visibility into selected guest-physical activity, but the observation has caveats: caching, timing, coverage, concurrent state changes and what the guest chooses to perform.
VPID helps tag guest translations. VMX features, including EPT and related invalidation instructions such as INVEPT/INVVPID, are conditional on CPU capabilities. A correct hypervisor must handle CPU feature probing, VMCS restrictions, exception delivery and multicore synchronization, not just obtain one successful VM entry.
AMD SVM is similar in purpose, different in machinery
On AMD, SVM uses a VMCB (virtual-machine control block), VMRUN and related instructions; nested paging is usually called NPT. AMD's control structures and exit fields differ from Intel's. OWL0 can conceptually discuss both but executable implementation details must target a specific vendor and revision. Avoid blending VMCS and VMCB as though they were interchangeable.
14. OWL0: define the experiment, not a mythology
OWL0 explores an x86-64 hypervisor/isolated-service execution model and a specific question: What can a guest OS, its instrumentation, and a lower-layer observer legitimately know about activity across their boundary? A useful architecture model separates the Linux guest, a VMM or isolated runtime, a minimal service interface, and an external verifier.
The experiment needs a threat model before code: Which adversary controls the guest? Is the VMM trusted? What telemetry sources are in scope (guest process list, syscalls, memory maps, host events, performance counters)? What observable effects remain (CPU time, memory traffic, device effects, timing)? “Not represented as a guest process” is a narrowly testable property; “invisible” is not a valid absolute conclusion.
A minimal local-only key/value service can demonstrate a distinct execution boundary without pretending to escape physics. Begin with a deterministic request protocol, bounded input lengths, explicitly documented guest/VMM entry points, isolated memory ownership, logging on both sides and latency measurement. Compare a guest-side process monitor's observations against a hypervisor-side trace. Report what was and was not visible, and why.
A safe design sketch
struct request {
uint32_t op; // GET / PUT
uint32_t key_len;
uint32_t value_len;
uint32_t sequence;
};
// Validate sizes BEFORE copying or allocating.
// Authenticate/authorize callers at the trust boundary.
// Keep host-side measurements independent from guest logs.
// Invariants: no cross-boundary pointer dereference;
// bounded payload; explicit lifetime; no stale mappings.
Performance is part of correctness: VM exits are much more expensive than simple register operations; interception policy shapes your measurement. A request protocol that traps excessively may change the thing being observed. Distinguish architectural invisibility, reduced observability, and detector blind spots. Document limitations and avoid claims of “undetectable execution.”
15. The offensive research lab: observe, falsify, repeat
Build a disposable Linux x86-64 VM (QEMU/KVM or an equivalent local setup), snapshot it, install compiler and debugging tools, and keep kernel/source versions pinned. Check uname -a, lscpu, cat /proc/cpuinfo, readelf -h, objdump -d -Mintel, gdb, strace and perf where appropriate. Be explicit about whether you're looking at the host or guest.
# Compile a tiny userland program for inspection:
cc -O0 -g -fno-omit-frame-pointer -o demo demo.c
objdump -d -Mintel ./demo | less
readelf -lW ./demo
gdb -q ./demo
# In gdb: break main; run; info registers; x/16gx $rsp; disassemble
Then repeat at -O2 and compare frame layout, instruction selection and register allocation. Compile with sanitizers in a controlled lab to identify lifetimes and bounds mistakes. Use pahole to inspect DWARF/BTF type layouts where available. For the kernel, use appropriate symbols and a crash dump or debugger: a screenshot of a trace without build provenance is not evidence.
Six exercises worth keeping in your notebook
- Arithmetic: Calculate the 4 KiB page number and offset for several addresses by hand. Verify with shifts and masks.
- Assembly: Compare
mov eax,mov ax, andmov aleffects on RAX using GDB. - ABI: Trace six and then eight arguments across an optimized Linux function call, including stack alignment.
- Ownership: Draw every reference acquisition and release for a deliberately small queue. Insert cancellation mid-flight.
- Translation: Walk a four-level page-table decomposition; explain a missing page and a protection fault separately.
- Virtualization: Record guest observations and VMM-side event counts for a harmless synthetic service request; report gaps, overhead and uncertainty rather than promising stealth.
16. ELF, relocation, and why the binary is not the source
Linux executables and shared libraries commonly use ELF. An ELF file has headers, program headers describing loadable segments, and optional sections used by linkers or debugging tools. For understanding execution, program headers matter more than section names: the loader creates mappings, applies relocations as appropriate, and transfers control through the runtime entry sequence. readelf -lW shows LOAD segments and their permissions; readelf -rW shows relocations; objdump -drwC -Mintel is useful for code and symbols.
Position-independent executables (PIE) use relocatable code and are commonly loaded at a randomized base under ASLR. RIP-relative addressing makes references to nearby data practical without a fixed load address. Dynamic linking adds symbol resolution through structures such as the Global Offset Table (GOT) and Procedure Linkage Table (PLT), subject to architecture, linker options, and relocation strategy. RELRO constrains writable relocation state; full and partial RELRO differ. None of these facts license assumptions about a particular binary: inspect its flags.
# See actual ELF loading facts for a local test binary.
readelf -hW ./demo
readelf -lW ./demo
readelf -rW ./demo
objdump -drwC -Mintel ./demo | less
# In gdb: info files; info proc mappings
Symbols and debug info provide names and source correspondence but do not change what the CPU executes. With optimization, one source variable may live in several registers, be merged into an expression, or disappear. A symbolic address without a matching build ID, compiler flags, and linked libraries is an uncertain attribution.
17. Boolean algebra, entropy and a precise integer-overflow chain
At the bit level, AND selects intersection, OR combines set bits, XOR toggles differences, and NOT complements a word. Each operation is vectorized across bits. For a mask with ones in positions 3–6, (x >> 3) & 0xF yields a four-bit field; for a boolean flag set, x | (1u << k) sets bit k, while x & ~(1u << k) clears it. Keep signedness and width explicit so the shift is not accidentally done in a too-small type.
In security work, entropy often quantifies uncertainty. A perfectly uniform k-bit random choice has k bits of entropy; guessing probability for one independent attempt is 1/2ᵏ. Real address-space randomization is not necessarily uniform across all 64 bits; alignment, virtual address layouts, process behavior and platform policy limit the actual choices. You cannot read “64-bit CPU” as “64 bits of ASLR entropy.”
/* Deliberately vulnerable logic: product may wrap before allocation. */
size_t bytes = count * sizeof(struct item);
struct item *items = malloc(bytes);
/* Writing count elements may exceed the allocation after wrap. */
/* Correct check: validate BEFORE multiplication. */
if (count > SIZE_MAX / sizeof(struct item)) return -1;
size_t bytes_ok = count * sizeof(struct item);
struct item *safe = malloc(bytes_ok);
if (!safe && bytes_ok != 0) return -1;
The root cause is not the mere existence of multiplication. The invariant is that allocated capacity must be at least the total bytes later written; an overflowing calculation breaks that invariant. A exploitability analysis then separates input control, allocation behavior, subsequent write, memory layout and available mitigations.
18. Work a page-table split with real numbers
Take a canonical 48-bit virtual address. The low 12 bits are the offset within its 4 KiB page. The next four groups of nine bits choose indices in the PT, PD, PDPT and PML4 structures. For 0x00007fff12345678, the page offset is 0x678; masking and shifting produce indices you can calculate independently. The point of doing this by hand is to make a page walk an arithmetic claim you can challenge, not a mystical lookup.
uint64_t va = 0x00007fff12345678ULL;
unsigned offset = va & 0xfff;
unsigned pt = (va >> 12) & 0x1ff;
unsigned pd = (va >> 21) & 0x1ff;
unsigned pdpt = (va >> 30) & 0x1ff;
unsigned pml4 = (va >> 39) & 0x1ff;
// Check the indices with a calculator and a page-table visualizer.
// Then ask: are we in four-level mode or LA57?
For a 2 MiB huge page, translation can terminate at the directory level. The low 21 bits then give the within-page offset, rather than following an ordinary 4 KiB PT entry. For a 1 GiB page, the low 30 bits identify the offset. These differences matter when a debugger, page-table walker or a VMM assumes every mapping descends to a PT.
For nested translation, write the path explicitly: GVA --guest tables--> GPA --EPT/NPT--> HPA. A failure in the guest page walk and a denial in the nested page walk are not interchangeable events. If your tracing tooling reports only one fault category, the missing distinction may distort the investigation.
19. Control registers, exceptions and system structures
CR0 contains fundamental execution-mode controls; CR4 contains controls for features such as PAE, VMX enabling, SMEP and SMAP when available; EFER includes long-mode and execute-disable related state, subject to architecture/vendor specifics. CR2 holds a linear address associated with a page fault. CR3 points to address-translation state. These values explain far more than a random dump of general-purpose registers in many kernel faults.
The Global Descriptor Table (GDT) provides segment-descriptor machinery with reduced segmentation roles in 64-bit mode, while FS and GS bases remain important for thread-local/per-CPU contexts. The Interrupt Descriptor Table (IDT) identifies exception and interrupt entry points. Privilege level changes must use architecturally defined transitions rather than arbitrary jumps into kernel addresses. System calls, exceptions and interrupts have distinct state-transfer rules.
MSRs (model-specific registers) extend the control/measurement surface. Intel and AMD have vendor-specific MSR maps, while some architecturally named ones control syscall entry, features and performance monitoring. Reading or writing privileged state requires appropriate execution context; invalid or unsupported accesses can fault. A VMM must not assume that every control bit it wants is supported merely because the instruction-set family is x86-64.
20. VMX engineering questions for a serious OWL0 prototype
On Intel VMX, a working prototype needs more than VMXON and a triumphant screenshot. There are feature/control checks, a suitable VMXON region, a valid VMCS with guest/host state, exception/exit configuration, permitted control fields, and correct entry/exit handling. VM entry has validation rules; failure modes are important evidence. Host stack and state restoration after VM exits must be correct before any meaningful study begins.
The VMCS stores controls, guest state, host state, and exit information. Exit reason and qualification must be interpreted according to the architectural manuals, not a random constant found in a blog. The VMM should maintain a small, well-defined event record containing a sequence ID, timebase, exit reason, relevant guest RIP and known uncertainty. If the experiment is multi-core, per-CPU state and coordination belong in the design from day one.
Event instrumentation is a selection problem. Intercepting frequent operations may perturb guest execution significantly. Capturing too little misses causal context. A measurement table should include guest workload, enabled controls, exit counts, time cost and whether the detector runs inside or outside the guest. Compare equivalent runs before and after instrumentation; avoid drawing global conclusions from a single surprising trace.
On AMD SVM the corresponding details require AMD's VMCB, VMRUN interception and nested translation rules, not a textual search-and-replace from VMCS terminology. A portable research description can unify goals; the implementation cannot ignore hardware differences.
21. A researcher’s method for an x86-64 kernel crash
Start with a pinned test kernel, debug symbols and a reproducible input in an isolated VM. Record the exact faulting instruction, register values, stack pointer, page-fault/error context when relevant, and the owning object type. Use KASAN/KFENCE or other available diagnostics to strengthen lifetime/bounds evidence in a lab; treat reports as evidence, not as an automatic exploit verdict.
Next build two graphs: a control-flow graph for the path to the fault and an ownership graph for the object. Find every allocation, handoff, refcount transition, asynchronous callback and release, including failure paths. The interesting edge is often not where the crash occurred but where a previously valid reference ceased to be valid.
Then test a narrowly falsifiable hypothesis: “Request cancellation frees object X while callback Y can still dereference its field Z without owning a reference.” Look for a minimal local reproduction and an independently verifiable state transition. A failed reproduction is not proof of safety; a successful crash is not proof of exploitation.
For a security report, distinguish root cause, triggerability, security impact and mitigation state. Each step demands evidence. Low-level research becomes credible when the timeline survives skeptical inspection.
22. The checklist I want beside a crash report
What is the exact instruction? What registers and memory values feed it? Who owns the referenced object, and is that ownership current? Are bounds computed in the same type/width as the allocation? Which concurrency edge establishes ordering? Which virtual-to-physical translation and permissions apply? Which policy boundary is supposed to check the operation? Which layer made the observation and what could that layer not see?
That is the common thread from a one-byte overflow to an EPT experiment: the machine is deterministic about its contracts, and researchers get into trouble when they silently invent extra guarantees.
References for deeper study
- Intel® 64 and IA-32 Architectures Software Developer's Manuals — instruction behavior, memory model, VMX and system programming.
- AMD processor programming manuals — AMD64 programmer's model and SVM/NPT.
- System V AMD64 ABI (x86-64 supplement) — Linux userspace calling conventions and data layout.
- Linux kernel documentation — memory, locking, RCU, paging, LSM and architecture internals.
- OWL0 research notebook and the writing archive.
Last updated October 2026. Learning material and research methodology, not an assertion that OWL0 has implemented every capability discussed.