Skip to content

Conversation

@ryanbreen
Copy link
Owner

Summary

This PR completes the remaining ARM64 parity tasks from the feature gap analysis:

Test plan

  • ARM64 kernel builds without errors
  • x86_64 kernel builds without errors
  • Added rigorous ARM64 parity tests (4 new tests in registry.rs)
  • All tests fail if fixes are reverted (verified with instrumentation)

Changes

File Change
timer_interrupt.rs Added RESET_QUANTUM_CALL_COUNT for test instrumentation
net/mod.rs Enabled softirq for ARM64
ioctl.rs Removed x86_64 gating from PTY ioctls
socket.rs Added test hook for timer quantum verification
fs.rs Added cfg gates for x86_64-specific devfs/devpts/fifo code
registry.rs Added 4 rigorous ARM64 parity tests

🤖 Generated with Claude Code

ryanbreen and others added 5 commits January 28, 2026 18:25
This commit enables several critical ARM64 features that were previously
x86_64-only:

**PTY Support (#34):**
- Removed x86_64 gating from PTY ioctl handlers in ioctl.rs
- PTY ioctls (TIOCGPTN, TIOCSPTLCK, etc.) now functional on ARM64

**Softirq/Deferred Work (#35):**
- Enabled softirq mechanism for ARM64 in net/mod.rs
- Network RX softirq handler now registers on ARM64

**Timer Quantum Reset (#37):**
- Already implemented correctly in socket.rs
- Added RESET_QUANTUM_CALL_COUNT instrumentation in timer_interrupt.rs
- Allows tests to verify reset_quantum() is actually called

**Filesystem Syscalls (#33):**
- Added cfg gates to x86_64-specific helper functions in fs.rs
- sys_open now properly gates devfs/devpts/fifo code for x86_64
- ARM64 falls through to ext2 filesystem handling

**CoW Fork (#36):**
- Already implemented in process_memory.rs (verified by Codex)
- Added test in registry.rs

**Rigorous ARM64 Tests:**
- test_filesystem_syscalls_aarch64: Verifies FS syscalls compile/run
- test_pty_support_aarch64: Verifies PTY ioctls with sentinel values
- test_softirq_aarch64: Verifies softirq bitmap operations
- test_timer_quantum_reset_aarch64: Verifies reset_quantum() called
- All tests fail if fixes are reverted (rigorous A/A validation)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
TCP Networking for ARM64:
- Remove x86_64 cfg gates from socket.rs, poll.rs, fd.rs
- Enable SOCK_STREAM socket creation on ARM64
- Add TCP FdKind handling to close_all_fds, read/write syscalls
- TCP protocol stack was already arch-independent

exec() Page Table Cleanup:
- Implement cleanup_for_exec() for both x86_64 and ARM64
- Walk page table hierarchy and free user frames via CoW refcount
- Deallocate page table structure frames (L1/L2/L3)
- Replace 4 TODO markers in manager.rs with actual cleanup

Test Improvements:
- Strengthen CoW fork test with actual frame allocation/verification
- Strengthen filesystem test with real file content verification
- Add ARM64-specific bit 55 CoW flag verification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add test_tcp_socket_creation for TCP FdKind verification
- Add test_telnetd_dependencies_aarch64 for TCP+PTY+fork/exec integration
- Both tests verify ARM64 parity with x86_64

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove x86_64-only cfg gates from sys_open to enable devfs directory
handling, devfs device access, and FIFO (named pipe) support on ARM64.

This fixes 3 compiler warnings about unused functions/types:
- handle_devfs_directory_open was only called under x86_64 cfg
- handle_fifo_open was only called under x86_64 cfg
- type Cpu was defined for ARM64 but only used inside handle_fifo_open

The FIFO subsystem already has ARM64 support (Cpu type alias defined
for both architectures in ipc/fifo.rs), so the call sites just needed
their cfg gates removed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove x86_64-only cfg gates from handle_devfs_open, handle_devpts_open,
  and handle_devpts_directory_open - these use architecture-independent code
- Fix unused import warning: move String import into cfg(feature="testing") block
- Fix unused variable warning: prefix initial_pending with underscore
- Fix ARM64 syscall_entry.rs: handle missing userspace_test module gracefully

Both x86_64 and ARM64 builds now pass with zero warnings and errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit da14c4d into main Jan 29, 2026
1 of 2 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