Skip to content

linx: initialize SG pools in rootfs bring-up - #36

Draft
zhoubot wants to merge 1 commit into
mainfrom
codex/linx-busybox-sg-pool-init
Draft

zhoubot wants to merge 1 commit into
mainfrom
codex/linx-busybox-sg-pool-init

Conversation

@zhoubot

@zhoubot zhoubot commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • initialize the scatter-gather mempool in the reduced CONFIG_LINX_INTC storage bring-up path
  • expose sg_pool_init() through the same bounded Linx wrapper pattern used by the other manually ordered storage prerequisites
  • pace BusyBox gate commands one line per observed prompt and one byte at a time so the virtual UART does not drop a burst
  • add a regression test proving one prompt sends exactly one paced command

Root cause

The reduced Linx bring-up path deliberately bypasses do_basic_setup() and do_initcalls(). It manually calls the storage prerequisites needed for the block rootfs, but omitted the subsys_initcall(sg_pool_init) equivalent. sg_pool_alloc() therefore addressed the correct sg_pools[index].pool field and loaded a null pointer before calling mempool_alloc().

The gate runner then exposed a second independent issue. Writing all six shell commands in one PTY write could overflow the virtual UART RX path. Depending on timing, only help, a truncated command, or a subset of later commands reached the guest. The runner now waits for each new # prompt and transmits one command with bounded character pacing. Classification and required success markers are unchanged.

Validation

Unit tests pass.

python3 tools/linxisa/busybox_rootfs/test_boot.py
python3 -m py_compile \
  tools/linxisa/busybox_rootfs/boot.py \
  tools/linxisa/busybox_rootfs/test_boot.py
git diff --check

The incremental kernel build completed with the pinned pre-existing LLVM toolchain.

env PATH=/path/to/llvm/bin:/opt/homebrew/bin:/usr/bin:/bin \
  /opt/homebrew/bin/gmake -C . ARCH=linx \
  LLVM=/path/to/llvm/bin/ \
  'CC=/path/to/llvm/bin/clang --target=linx64-unknown-linux-gnu -fintegrated-as' \
  HOSTCC=/usr/bin/clang HOSTCXX=/usr/bin/clang++ \
  KALLSYMS_EXTRA_PASS=128 O=/tmp/linx-v0591-locked-runtime/build \
  -j2 vmlinux

The native block-rootfs gate passed with no waived markers.

env LINX_QEMU_SCOPED_SCALAR_RUNTIME=1 SKIP_BUILD=1 TIMEOUT=30 \
  KERNEL=/tmp/linx-v0591-locked-runtime/build/vmlinux \
  KERNEL_CONFIG=/tmp/linx-v0591-locked-runtime/build/.config \
  ROOTFS_IMG=/tmp/linx-v0591-busybox-rootfs/out/rootfs.ext2 \
  QEMU=/path/to/qemu-system-linx64 QEMU_EXTRA_ARGS='-bios none' \
  LINX_BUSYBOX_BOOT_REPORT=/tmp/linx-sgpool-pr-boot-report.json \
  python3 tools/linxisa/busybox_rootfs/boot.py

Sampled diagnostic result:

  • status=pass, ok=true, duration 8.05 seconds
  • timer IRQ advanced 293 -> 424
  • /, /sbin, two interrupt samples, and poweroff markers present
  • QEMU return code 0 and LINX_REBOOT lisc_shutdown observed
  • diagnostic kernel SHA-256 3ca91bce2cc4769931db7b9ef77b078d120dc5f25976f9dc45a1349e55c1c491
  • QEMU SHA-256 0ef08241d74fde727a5472e6bc14e0dcf9207402f20b76e54b431bea4f99cb85
  • rootfs SHA-256 ef2e929d65977e803d11e83c27ca9da0b99068ee372745874025e4deb4687fb0

Qualification boundary

This result uses an incrementally rebuilt diagnostic kernel from this branch. It is not release evidence. Do not repin or merge based on the sampled run alone. Release qualification still requires a reviewed merge, a clean fresh kernel and rootfs build with provenance at the final exact component pins, and a fresh native BusyBox report bound into the release packet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant