Skip to content

mkvh: split large elf segments so the octane prom loads linux from disk - #793

Merged
techomancer merged 1 commit into
techomancer:mainfrom
steigr:feature/linux-boot-prom-issue-ae48b8
Nov 20, 2026
Merged

techomancer merged 1 commit into
techomancer:mainfrom
steigr:feature/linux-boot-prom-issue-ae48b8

Conversation

@steigr

@steigr steigr commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

The Octane's PROM 4.17 could not load an 11.5 MB Linux vmlinux from the disk's volume header (boot -f dksc(0,1,8)vmlinux): it panicked with driver_acquire: io_state.active deadlock. Booting over TFTP worked.

The limit is in the PROM's own code, so a real Octane fails the same way. The PROM reads each ELF segment from the volume header in one SCSI command. Its ISP1040 driver then hits two fixed limits:

  • Request ring. It has 8 entries, enough for about 720 KB. A larger read never gets queued and times out.
  • DMA page list. It holds one entry per 16 KB page in a fixed per-adapter array with room for about 73 entries (about 1.1 MB). The 11 MB kernel ran past it into the second controller's state, which caused the panic.

IRIX's own volume-header files stay under both limits (sash is 267 KB).

Change

  • mkvh build splits any ET_EXEC ELF segment with more than 512 KB of file data into consecutive pieces at the same offsets and addresses. The PROM loads them one after another, and Linux doesn't notice. The program header table is rewritten in place when there is room after it, as in a vmlinux, so the file keeps its size. Otherwise it is appended at the end of the file.
  • --no-split keeps a file exactly as it is. Small files and relocatable files such as sash are never changed.
  • Docs: docs/octane-ip30.md (Disks) and docs/cpu-test-support.md; CHANGELOG.
  • The clanker note added as "open" in isp2200, virtio: what mainline linux needs on the octane #789 is now a rule note with the PROM addresses. The Linux 7.3 guest note says the kernel can now boot from the volume header.

Testing

  • cargo test --release --lib sgi_vh: 17 pass, 4 of them new. They cover ELF32 and ELF64, both places the new table can go, files that are left alone, and build_image with and without splitting.
  • Octane with PROM 4.17: from a copy of the bench disk, the PROM loaded the split kernel from dksc(0,1,8) as 23 pieces. Linux 7.3.4 mounted its root on sda1 and reached a shell.

🤖 Generated with Claude Code

The Octane's PROM reads each ELF segment of a volume-header file with one
SCSI command. Its ISP1040 driver lists the transfer one entry per 16 KB
page in a fixed array of its per-adapter state (about 73 entries) and
queues it on an 8-entry request ring, so a segment over about 720 KB never
fits the ring and times out, and one over about 1.1 MB also writes its
page list over the next adapter's state and panics the PROM. An 11 MB
Linux vmlinux did the latter. IRIX's own volume-header files stay small.

mkvh build now splits every PT_LOAD of an ELF executable that carries
more than 512 KB of file data into consecutive 512 KB segments at the
same offsets and addresses, rewriting the program header table in place
when the bytes after it are free. --no-split keeps files unchanged.
Linux 7.3.4 on the Octane now boots from dksc(0,1,8)vmlinux to a shell.

Tests: sgi_vh split_load_segments_* (ELF32 and ELF64, in place and
appended table), build_image_splits_an_oversized_kernel_only_when_asked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@techomancer
techomancer merged commit f16b946 into techomancer:main Nov 20, 2026
9 checks passed
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.

2 participants