已开启
consistency: add dc_cmo_consistency cross-decoder CMO drain tests (cc + nc_reader) #19
consistency: add dc_cmo_consistency cross-decoder CMO drain tests (cc + nc_reader) #19
已开启
yuhao_zhang创建于 9月22日
yuhao_zhang成员
9月22日

What

Adds two cc_consistency cases (2 actors / 2 hosts each) validating that user-space DC cache-maintenance instructions drain the UB-memory cache, so a reader importing the same region through a second decoder of the same UB controller observes freshly written data:

  • dc_cmo_consistency: both windows cacheable; reader drains its cached copies with DC CIVAC (full contract).
  • dc_cmo_consistency_nc_reader: reader window non-cacheable (NC space + O_SYNC). NC reads bypass CPU-side caching and prefetching entirely, so no reader-side copies exist and the CIVAC step is dropped — any stale observation is attributable solely to the writer-side write + DC CVAP flush. (DC maintenance is deliberately not issued on the NC window: DC ops on non-cacheable UB memory are unsupported on KP950 and hang the core.)

Model

  • actor 0 (host 0): provider, exports one 4M region once, hands the UBMD to actor 1, then only handshake;
  • actor 1 (host 1): imports the same region twice through decoder 0 (writer window) and decoder 1 (reader window), read-write without obmm_set_ownership (kernel-side CMO would drain the UB cache and make the test pass vacuously).

Per round, single-threaded inside actor 1 (cc variant, rounds 1..15): reader DC CIVAC + DSB ISH over the probe lines -> writer writes deterministic pattern -> DC CVAP + DSB ISH -> immediate read, assert the current round's pattern. Round 0 is a baseline without CIVAC (cold reader validates the writer path and primes reader-side caches). Mismatch logs name which round's pattern the probe holds (reader-side vs writer-side attribution). The nc_reader variant is uniform per round (no reader cache to prime).

Topology

Both cases declare two DECODER_TO_UMMU datapaths (decoder 0/1 on the import-side die -> ummu 0 on the export-side die): the orchestrator skips them when the dies are not connected; the importer additionally skips via a pre-handshake verdict when the local die exposes fewer than two decoders.

Also includes

  • dc_cvap_range() in utils/mem_ops_aarch64.h (DC CVAP loop + DSB ISH, mirroring flush_dcache_range) plus a fence-only stdatomic fallback;
  • a "UB Memory Cache Maintenance" spec section in doc/test-writers/references/ubmem.md.

Verified: scripts/build.sh clean build, zero warnings; two review rounds over handshake protocol, resource teardown, and fidelity of the manual export/import path; the cc variant passed on a 2-host rig (NDIE_V7, ~2s).

Developed with AI assistance (GLM via ZCode); see the Co-authored-by trailer.

likedislike
合并受阻
Yyuhao_zhang成员
9月22日 强制推送  1 个提交:792a5a16-consistency: add dc_cmo_consistency cross-decoder CMO drain test
Yyuhao_zhang成员
9月22日 强制推送  1 个提交:88a3c114-consistency: add dc_cmo_consistency cross-decoder CMO drain test
Yyuhao_zhang成员
9月22日 强制推送  1 个提交:507558bb-consistency: add dc_cmo_consistency cross-decoder CMO drain test
Yyuhao_zhang成员
9月23日 强制推送  1 个提交:d65276e8-consistency: add dc_cmo_consistency cross-decoder CMO drain tests (cc + nc_reader)
Yyuhao_zhang成员
9月23日 修改了pull request 的描述
Yyuhao_zhang成员
9月23日 修改标题为 “consistency: add dc_cmo_consistency cross-decoder CMO drain tests (cc + nc_reader)”,原标题为“consistency: add dc_cmo_consistency cross-decoder CMO drain test”
Yyuhao_zhang成员
9月23日 强制推送  1 个提交:3fcaecdf-consistency: add dc_cmo_consistency cross-decoder CMO drain tests (cc + nc_reader)
Yyuhao_zhang成员
9月24日 强制推送  1 个提交:e82a64e3-consistency: add dc_cmo_consistency cross-decoder CMO drain test