Skip to content

feat:较大的更新合并,主要是让原本实现好的loongarch可以顺利接入,并且让riscv也能顺利运行大多数测试 - #267

Merged
a6d9a6m merged 31 commits into
mainfrom
ccy-dev02
Jun 25, 2026
Merged

feat:较大的更新合并,主要是让原本实现好的loongarch可以顺利接入,并且让riscv也能顺利运行大多数测试#267
a6d9a6m merged 31 commits into
mainfrom
ccy-dev02

Conversation

@a6d9a6m

@a6d9a6m a6d9a6m commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

PR: ccy-dev02 -> main

Summary

This PR brings the current development branch back into main, focusing on LoongArch runtime stability, libc/LTP compatibility, filesystem robustness, and several syscall/runtime fixes needed by the test environment.

The branch is large, so this description only calls out the major areas instead of enumerating every small bug fix.

Major Changes

LoongArch Runtime Stability

  • Fixes multiple LoongArch trap, TLB refill, MMIO, timer, RTC, and FPU context handling issues.
  • Improves user-mode trap/restore correctness, including signal return context restore.
  • Fixes rt_sigreturn so the saved user PC is restored instead of falling through the signal trampoline.
  • Adds safer diagnostic behavior for unexpected signal trampoline return paths.

Syscall and Libc Compatibility

  • Adds or fixes scheduler-related syscalls, including scheduler policy/priority handling and CPU affinity behavior.
  • Wires clock_nanosleep and improves time-related syscall behavior.
  • Refines clone, futex, terminal ioctl, select timeout/fdset, and process exit semantics.
  • Improves signal handling for pthread cancellation, default signal termination, and thread-group exit behavior.

IPC and Shared Memory

  • Implements and refines SysV shared memory behavior.
  • Adds /dev/shm support for POSIX shared memory expectations.
  • Adjusts shared memory removal semantics and related syscall wiring.

Filesystem and VFS Robustness

  • Hardens ext4 reads/writes, extent handling, bitmap bounds, direntry parsing, and allocation behavior.
  • Adds ext4 directory/file read caching and extended write tests.
  • Fixes mount path preservation, mkdir-root behavior, and dentry/path handling edge cases.
  • Vendors the ext4 implementation snapshot used by this branch.

Test and Runtime Environment

  • Updates RISC-V and LoongArch init scripts to stage musl tests on tmpfs and support external OS competition test images.
  • Adds LoongArch musl loader symlinks needed by LTP/libc tests.
  • Adjusts QEMU run scripts and rootfs setup for the current test workflow.

Validation

  • cargo fmt --check
  • CARGO_TARGET_DIR=/tmp/ccyos-cargo-check cargo check --target loongarch64-unknown-none
  • CARGO_TARGET_DIR=/tmp/ccyos-cargo-run cargo build --target loongarch64-unknown-none
  • LoongArch QEMU boot was run long enough to pass /proc, /sys, /tmp, /dev mounting and enter test staging without the previous user-mode signal trampoline panic.

Notes

  • The branch contains broad compatibility work across kernel, userspace test scripts, and vendored ext4 code.
  • The latest LoongArch signal-return fix addresses a user-mode illegal-instruction trap at USER_SIGRETURN_TRAMPOLINE + 8 by restoring era through MContextT.

a6d9a6m added 30 commits June 24, 2026 10:44

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for System V shared memory, implements Linux-style scheduling syscalls (such as affinity and priority settings), improves ext4 filesystem performance via read and lookup caching, and expands signal handling to support real-time signals. The review feedback highlights several critical issues, including a lack of user-space address validation in shmat, potential memory leaks during shared memory remapping, thread leaks in signal termination, unremoved timers in select, unbounded growth in the directory lookup cache, an edge-case bug in priority task selection when priority is i32::MIN, and uninitialized memory exposure in sched_getaffinity.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread os/src/kernel/syscall/ipc.rs
Comment thread os/src/kernel/syscall/ipc.rs Outdated
Comment thread os/src/ipc/signal.rs
Comment thread os/src/kernel/syscall/io.rs
Comment thread os/src/fs/ext4/inode.rs
Comment thread os/src/kernel/scheduler/task_queue.rs
Comment thread os/src/kernel/syscall/task/sched_ops.rs
@a6d9a6m
a6d9a6m merged commit 3476885 into main Jun 25, 2026
1 check passed
@a6d9a6m
a6d9a6m deleted the ccy-dev02 branch June 25, 2026 08:02
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