FA-89689 / Instruction set emulation / Member archive
Protection fault reported as not-present · case 04
A permission violation on a present page has the present bit clear in its error code.
Case contract
Input [va, write, user, root, mem]; mem maps decimal-string physical addresses to 32-bit entries (missing = 0). VA splits 10/10/12 (directory index va>>22, table index (va>>12)&0x3FF, offset). The PDE is at root + 4*dir, the PTE at (PDE frame << 12) + 4*table. Bits: P=1, W=2, U=4, A=32, D=64; frame = entry >> 12. Not present -> ['fault', err]; write without W on both levels or user access without U on both levels -> ['fault', err | 1], where err = 2 if write plus 4 if user. On success set A on both entries and D on the PTE only for writes, returning ['ok', physical address, sorted [address, entry] of memory].
Why this case matters
MMU emulation must combine permissions across levels and update accessed/dirty bits exactly as guest operating systems expect.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| kernel write to read-only page | ["fault", 2] | ["fault", 3] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗