Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a30313f
docs: design two-node Legofs Type-3 coherence proof
vickiegpt Aug 14, 2026
c688771
docs: plan Legofs Type 3 coherence proof
vickiegpt Aug 14, 2026
ea68767
chore: pin Legofs and MESI v2 sources
vickiegpt Aug 14, 2026
866521d
guest: add strict Legofs Type 3 node image
vickiegpt Aug 14, 2026
5fc98ce
chore: pin Type 3 coherence evidence components
vickiegpt Aug 14, 2026
c978c5a
build: add reproducible Legofs Type 3 guest artifacts
vickiegpt Aug 14, 2026
05e0098
build: validate ext2 Legofs payload contents
vickiegpt Aug 14, 2026
ff1dc87
run: orchestrate two SiFive U Type 3 nodes
vickiegpt Aug 14, 2026
09c7f4e
test: require Legofs-triggered dirty back-invalidation
vickiegpt Aug 14, 2026
305a7dd
fix: interrupt U-Boot autoboot in two-node runner
vickiegpt Aug 14, 2026
e5ac4f3
run: expose persistent Type 3 media through devdax
vickiegpt Aug 14, 2026
0c1779c
build: enable zone-device support for CXL devdax
vickiegpt Aug 14, 2026
05d23d6
guest: wait for asynchronous CXL devdax probe
vickiegpt Aug 14, 2026
79bebfa
guest: parse getdents64 records by ABI offset
vickiegpt Aug 14, 2026
66f3ede
test: require actionable CXL dax probe diagnostics
vickiegpt Aug 14, 2026
14dfc83
guest: discover device-dax on the dax bus
vickiegpt Aug 14, 2026
a0e0d0d
build: bind CXL regions to device-dax
vickiegpt Aug 14, 2026
699455c
guest: align lifecycle maps to CXL devdax
vickiegpt Aug 14, 2026
edcd6b8
build: enable filesystem DAX for device mappings
vickiegpt Aug 14, 2026
6e3da61
guest: persist CXL dax ranges at mapping granularity
vickiegpt Aug 14, 2026
daab2cf
build: require persistent CXL devdax fsync
vickiegpt Aug 14, 2026
bfc9d15
test: prove Legofs Type 3 dirty back-invalidation
vickiegpt Aug 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
[submodule "components/meta-sifive"]
path = components/meta-sifive
url = https://github.com/SlugLab/meta-sifive.git
[submodule "components/legofs"]
path = components/legofs
url = https://github.com/Zettai-US/legofs.git
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The superproject records exact gitlinks for:
- `components/u-boot`: CXL discovery and HDM decoder programming;
- `components/linux`: matching RISC-V CXL firmware handoff support;
- `components/cxlmemsim`: PGAS SHM server;
- `components/legofs`: Badfs lifecycle-direct client, server, and benchmark;
- `components/opensbi`: OpenSBI v1.5.1;
- `components/hifive-premier-tools`: pinned board-tool reference;
- `components/meta-sifive`: pinned Yocto-layer reference.
Expand All @@ -85,6 +86,60 @@ It adds a synthetic `pxb-cxl` bridge with
U-Boot programs HPA `0x1000000000` with host decoder control `0x600` and
endpoint decoder control `0x1600`.

## Two-node Legofs Type 3 back-invalidation proof

The second workflow builds the complete stack and runs the Zettai-US Legofs
Badfs lifecycle-direct workload across two concurrent RISC-V guests:

```bash
./run-legofs-type3.sh --bytes 65536 --timeout 1200
```

Both recorded commands begin exactly with:

```text
qemu-system-riscv64 -M sifive_u
```

Each guest has one 256 MiB Type 3 endpoint attached through the synthetic
SiFive U PCIe/CXL host bridge. Each endpoint uses its own file-backed
`persistent-memdev`; CXLMemSim uses a separate file-backed `ssd-stream`
backend. U-Boot enumerates `41.00.0`, reports it as Type 3, and programs the
host and endpoint HDM decoders before Linux boots. Linux exposes the Type 3
capacity as `/dev/dax0.0`, which Legofs maps for strict lifecycle-direct
writes and reads. The external ext2 image is only the read-only delivery
disk for the static RISC-V binaries.

The node1 endpoint retains dirty modified lines. The node0 endpoint enables
the opt-in `coherence-v2-read-exclusive` QEMU policy so its server-side
checksum reads issue GETM requests. Those requests exercise QEMU's Type 3
back-invalidation handler against node1. A run passes only if the benchmark
trace contains the same operation ID and mapping range as a node1-directed
`SNP_DATA_INV`, a model ACK carrying the complete dirty 64-byte line, and a
dirty completion. Host monotonic timestamps must additionally prove:

```text
node1 direct unmap < snoop send < model ACK < dirty completion < store success
```

The result is written to:

```text
out/legofs-type3/runs/<run-id>/result.json
```

The result also records both QEMU argv arrays, overlapping process lifetimes,
artifact hashes, the two CXL SSD backing files, all address correlations,
Legofs direct-path and fallback counters, and final coherence error counters.
`status: "passed"` requires zero timeouts, protocol errors, delivery failures,
server-copy failures, fallback I/O, pending operations, quarantined extents,
and active leases.

This is functional QEMU/TCG and CXLMemSim model evidence. The CXL SSDs are
file-backed simulated persistent-memory devices; this does not claim a
physical CXL link, CPU-cache or CXL.cache coherence, media durability across a
host crash, or hardware performance.

The guest benchmark is a libc-free static `rv64imafdc` executable delivered
through a read-only external ext2 image on
`virtio-blk-pci,bus=pcie.0`. The built-in freestanding PID 1 mounts the
Expand Down
2 changes: 1 addition & 1 deletion components/cxlmemsim
Submodule cxlmemsim updated 56 files
+117 −1 CMakeLists.txt
+586 −0 docs/superpowers/plans/2026-07-16-mesi-wb-coherence-v2.md
+12 −0 docs/superpowers/plans/2026-08-09-type2-coherent-domain-litmus.md
+980 −0 docs/superpowers/specs/2026-07-16-mesi-wb-coherence-v2-design.md
+44 −0 docs/superpowers/specs/2026-08-09-type2-coherent-domain-litmus-design.md
+138 −0 include/coherence_endpoint_cache.h
+20 −0 include/coherence_memory_backend.h
+209 −0 include/coherence_protocol_v2.h
+75 −0 include/coherence_rdma_transport_v2.h
+36 −0 include/coherence_server_runtime_v2.h
+57 −0 include/coherence_server_v2.h
+66 −0 include/coherence_shm_transport_v2.h
+15 −0 include/coherence_tcp_transport_v2.h
+83 −0 include/coherence_trace_v2.h
+20 −0 include/coherence_transport.h
+26 −1 include/coherency_engine.h
+467 −0 include/endpoint_session_registry.h
+217 −0 include/mesi_directory.h
+281 −0 include/mesi_transaction_engine.h
+3 −0 microbench/CMakeLists.txt
+548 −0 microbench/type2_device_litmus.c
+412 −0 qemu_integration/run_type2_coherence_initramfs.sh
+565 −0 qemu_integration/run_type2_coherence_litmus.sh
+133 −0 qemu_integration/test_run_type2_coherence_initramfs.sh
+110 −0 qemu_integration/test_run_type2_coherence_litmus.sh
+166 −0 qemu_integration/type2_litmus_initramfs_init.sh
+815 −0 src/coherence_endpoint_cache.cpp
+629 −0 src/coherence_protocol_v2.cpp
+239 −0 src/coherence_rdma_transport_v2.cpp
+52 −0 src/coherence_server_runtime_v2.cpp
+683 −0 src/coherence_server_v2.cpp
+467 −0 src/coherence_shm_transport_v2.cpp
+198 −0 src/coherence_tcp_transport_v2.cpp
+172 −0 src/coherence_trace_v2.cpp
+64 −1 src/coherency_engine.cpp
+1,608 −0 src/endpoint_session_registry.cpp
+191 −26 src/main_server.cc
+571 −0 src/mesi_directory.cpp
+1,623 −0 src/mesi_transaction_engine.cpp
+5 −0 tests/fixtures/coherence_protocol_v2_frames.tsv
+961 −0 tests/test_coherence_protocol_v2.cpp
+487 −0 tests/test_coherence_rdma_transport_v2.cpp
+103 −0 tests/test_coherence_server_runtime_v2.cpp
+1,341 −0 tests/test_coherence_server_v2.cpp
+426 −0 tests/test_coherence_shm_transport_v2.cpp
+283 −0 tests/test_coherence_tcp_transport_v2.cpp
+90 −0 tests/test_coherence_trace_v2.cpp
+277 −0 tests/test_endpoint_completion_semantics.cpp
+167 −0 tests/test_endpoint_eviction_race.cpp
+2,099 −0 tests/test_endpoint_session_registry.cpp
+951 −0 tests/test_mesi_directory.cpp
+211 −0 tests/test_mesi_reported_state_recovery.cpp
+1,492 −0 tests/test_mesi_transaction_engine.cpp
+1,737 −0 tests/test_mesi_writeback_and_atomics.cpp
+504 −0 tests/test_type2_coherence_litmus.cpp
+30 −0 tests/test_type2_device_litmus_contract.c
1 change: 1 addition & 0 deletions components/legofs
Submodule legofs added at a2edd5
17 changes: 17 additions & 0 deletions configs/linux-cxl.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ CONFIG_HVC_RISCV_SBI=y
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_EARLYCON_RISCV_SBI=y
CONFIG_SPARSEMEM=y
CONFIG_SPARSEMEM_VMEMMAP=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_ZONE_DEVICE=y
CONFIG_CXL_BUS=y
CONFIG_CXL_PCI=y
CONFIG_CXL_ACPI=y
Expand All @@ -33,3 +37,16 @@ CONFIG_PROC_FS=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
CONFIG_BINFMT_ELF=y
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_DAX=y
CONFIG_FS_DAX=y
CONFIG_DEV_DAX=y
CONFIG_DEV_DAX_CXL=y
# CONFIG_DEV_DAX_KMEM is not set
CONFIG_NET=y
CONFIG_INET=y
CONFIG_UNIX=y
CONFIG_PACKET=y
CONFIG_VIRTIO_NET=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
Loading