diff --git a/scripts/qemu_nvme_rw_test.sh b/scripts/qemu_nvme_rw_test.sh index 47e1ba39..f7192ce8 100755 --- a/scripts/qemu_nvme_rw_test.sh +++ b/scripts/qemu_nvme_rw_test.sh @@ -19,8 +19,7 @@ # # Needs qemu-system-aarch64 and AAVMF (Ubuntu: qemu-system-arm qemu-efi-aarch64). # -# NOTE: scripts/verify_all.sh is intentionally NOT edited here. Wiring this -# harness into verify_all.sh is a follow-up owned by the integration lane. +# scripts/verify_all.sh step 6e runs this harness in both DMA modes. set -euo pipefail repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" diff --git a/scripts/qemu_nvme_test.sh b/scripts/qemu_nvme_test.sh index 41232e6b..ec086ba3 100755 --- a/scripts/qemu_nvme_test.sh +++ b/scripts/qemu_nvme_test.sh @@ -27,10 +27,8 @@ # # Needs qemu-system-aarch64 and AAVMF (Ubuntu: qemu-system-arm qemu-efi-aarch64). # -# NOTE: scripts/verify_all.sh is intentionally NOT edited here. Wiring this -# harness into verify_all.sh (a dedicated QEMU step plus the aarch64 clippy -# feature loop in step 3b) is a follow-up change owned by the integration -# lane. +# scripts/verify_all.sh step 6e runs this harness in both DMA modes, and +# step 3b lints the nvme-read feature set. set -euo pipefail repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" diff --git a/scripts/qemu_store_crash_test.sh b/scripts/qemu_store_crash_test.sh index 302fc0ee..e7dae445 100755 --- a/scripts/qemu_store_crash_test.sh +++ b/scripts/qemu_store_crash_test.sh @@ -33,6 +33,8 @@ commit="$(git rev-parse HEAD 2>/dev/null || echo unknown)" AIENOS_COMMIT="${commit}" AIENOS_RESTART_SECS=1 cargo build --quiet --release \ -p aienos-boot --target aarch64-unknown-uefi --features store-qual --bin aienos-handoff \ --target-dir "${target_dir}" || { echo "build failed"; exit 2; } +cargo build --quiet --release -p aienos-store-tool || { echo "store tool build failed"; exit 2; } +tool="target/release/aienos-store-tool" work="$(mktemp -d)" qemu_pid="" @@ -44,13 +46,11 @@ cp "${target_dir}/aarch64-unknown-uefi/release/aienos-handoff.efi" "${work}/esp/ image="${work}/nvme.img" serial="${work}/serial.log" -cfgfile="${work}/cfg.bin" fresh_image() { rm -f "${image}"; truncate -s "${img_bytes}" "${image}"; } write_cfg() { # mode settle - python3 -c "open('${cfgfile}','wb').write(bytes([$1,$2]) + bytes(4094))" - dd if="${cfgfile}" of="${image}" bs="${lba_bytes}" seek="${cfg_lba}" conv=notrunc status=none + "${tool}" cfg "${image}" "$(( cfg_lba * lba_bytes ))" "$1" "$2" >/dev/null || { echo "cfg write failed"; exit 2; } } # run_qemu [kill] diff --git a/scripts/verify_all.sh b/scripts/verify_all.sh index 173bd3a8..1333889f 100755 --- a/scripts/verify_all.sh +++ b/scripts/verify_all.sh @@ -67,7 +67,7 @@ echo "" echo "--- [Clippy Verification: AArch64 targets, -D warnings] ---" cargo clippy -p aienos-kernel --target aarch64-unknown-none --no-default-features -- -D warnings cargo clippy -p aienos-kernel --target aarch64-unknown-none --no-default-features --features seed0b-test-anchor -- -D warnings -for features in firmware handoff seed0b-qualification usb-keyboard; do +for features in firmware handoff seed0b-qualification usb-keyboard nvme-read nvme-write store-qual; do cargo clippy -p aienos-boot --target aarch64-unknown-uefi --features "${features}" --bins -- -D warnings done echo "PASS clippy: aarch64-unknown-none kernel and aarch64-unknown-uefi images, zero warnings" @@ -154,6 +154,25 @@ else skipped "qemu-system-aarch64 or AAVMF firmware not present on host." fi +# Step 6e: P3 native NVMe driver and System Store v1 over NVMe (QEMU only). +# Read and write/flush in both DMA modes (SMMU-confined, and fail-closed with +# no SMMU), 4K root-write atomicity, the 4K Store crash/reboot campaign and the +# 512-byte Store campaign. Never an unsafe DMA bypass build here. +echo "" +echo "--- [P3 NVMe + System Store v1 in QEMU] ---" +if command -v qemu-system-aarch64 >/dev/null && [[ -r "${AAVMF_CODE:-/usr/share/AAVMF/AAVMF_CODE.no-secboot.fd}" ]]; then + unset AIENOS_UNSAFE_DMA_BYPASS AIENOS_BUILD_FEATURES + AIENOS_QEMU_SMMU=1 ./scripts/qemu_nvme_test.sh + AIENOS_QEMU_SMMU=0 ./scripts/qemu_nvme_test.sh + AIENOS_QEMU_SMMU=1 ./scripts/qemu_nvme_rw_test.sh + AIENOS_QEMU_SMMU=0 ./scripts/qemu_nvme_rw_test.sh + ./scripts/qemu_nvme_atomicity_test.sh + ./scripts/qemu_store_crash_test.sh + ./scripts/qemu_store_512b_crash_test.sh +else + skipped "qemu-system-aarch64 or AAVMF firmware not present on host." +fi + echo "" echo "============================================================" echo "HOST VERIFICATIONS PASSED."