Commit Graph

1305 Commits

Author SHA1 Message Date
Wang Siyuan 48fa40bbf2 Support the system call `memfd_create` 2025-07-31 09:29:12 +08:00
Wang Siyuan 59ceb6d27c Add a method `inode` for `FileLike` 2025-07-31 09:29:12 +08:00
Tate, Hongliang Tian 659f079c2d Revise the doc of OSTD's scheduling module 2025-07-29 21:58:23 +08:00
Ruihan Li d73f1016a1 Set softfloat targets for ARM/LoongArch/RISC-V 2025-07-29 11:13:59 +08:00
Wei Zhang 8a801676ab Disallow masking SIGKILL and SIGSTOP in user space
According to the Linux man pages[1], "It is not possible to block SIGKILL
or SIGSTOP. Attempts to do so are silently ignored." This patch ensures
compliance by explicitly removing SIGKILL and SIGSTOP from the signal
mask in the `MaskOp::SetMask` operation of the `rt_sigprocmask` syscall.

[1]: https://www.man7.org/linux/man-pages/man2/sigprocmask.2.html
2025-07-28 17:08:10 +08:00
Yuke Peng 2154124dc4 Format the user exception log 2025-07-28 15:01:49 +08:00
Ruihan Li e52634cb78 Add some references for signal-related types 2025-07-28 10:50:38 +08:00
Ruihan Li 83b0564c99 Remove TLS-related stuffs from `LinuxABI` 2025-07-28 10:50:38 +08:00
jiangjianfeng 28d5d94c8c Support setting reuseaddr for UDP socket 2025-07-28 10:20:50 +08:00
jiangjianfeng ff39f6df75 Correct the reuseaddr behavior 2025-07-28 10:20:50 +08:00
王英泰 345cc9d055 Save FPU context on signal stack for LoongArch 2025-07-25 17:37:24 +08:00
王英泰 434d75c0f0 Cancel the use of floating-point instructions in kernel log 2025-07-25 17:37:24 +08:00
王英泰 fc72398fbc Change the method to identify the legacy virtio device 2025-07-25 17:37:24 +08:00
王英泰 cc280272cc Add the RTC time comps for LoongArch 2025-07-25 17:37:24 +08:00
王英泰 5c4b3fdd19 Finish the arch section for LoongArch in kernel 2025-07-25 17:37:24 +08:00
王英泰 4562361ef0 Add the random support for LoongArch in kernel 2025-07-25 17:37:24 +08:00
王英泰 5ca18b31ad Add the syscall support for LoongArch in kernel 2025-07-25 17:37:24 +08:00
王英泰 5c590f0c6b Add the process support for LoongArch in kernel 2025-07-25 17:37:24 +08:00
王英泰 3824af8c89 Add the trap section for LoongArch in OSTD 2025-07-25 17:37:24 +08:00
王英泰 91e7785915 Add the cpu section of LoongArch in OSTD and kernel 2025-07-25 17:37:24 +08:00
jiangjianfeng 9219207b97 Add CLONE_PIDFD & pidfd_open support 2025-07-24 21:11:24 +08:00
jiangjianfeng dbc6e7c71a Add support for `/proc/sys/kernel/pid_max` 2025-07-24 21:11:24 +08:00
Ruihan Li 5ccadb6253 Support SOCK_SEQPACKET 2025-07-23 20:02:15 +08:00
Ruihan Li c3572e9548 Support SCM_CREDENTIALS 2025-07-23 20:02:15 +08:00
Ruihan Li ab897ccd2f Support SO_PASSCRED
Co-authored-by: Jianfeng Jiang <jiangjianfeng.jjf@antgroup.com>
2025-07-23 20:02:15 +08:00
Qingsong Chen e86f7584a3 Fix atomic mode issue when VMO commit needs IO 2025-07-23 11:23:03 +08:00
Qingsong Chen eb64ca1cea Fix VMO commit address when needs IO 2025-07-23 11:23:03 +08:00
Cautreoxit 6ecccad3ee Add sys_ioprio_set and sys_ioprio_get 2025-07-22 17:22:52 +08:00
Cautreoxit 2e3d8ea867 Add extension support for keyboard 2025-07-22 15:16:12 +08:00
Cautreoxit b8b9d8bff6 Add release support for keyboard 2025-07-22 15:16:12 +08:00
YanWQ-monad 79335b272f Add coverage support
Co-authored-by: Marsman1996 <lqliuyuwei@outlook.com>
2025-07-22 10:31:56 +08:00
Chen Chengjun ef0382b164 Enhance waitid syscall support 2025-07-21 21:31:32 +08:00
Chen Chengjun 4d52241c6c Fix some definition errors of siginfo_t 2025-07-21 21:31:32 +08:00
Cautreoxit c6011b9650 Add fadvise64 syscall 2025-07-21 21:29:17 +08:00
Yang Zhichao 9570f14d80 Add AMD support for cache_size and tlb_size 2025-07-21 20:08:42 +08:00
Yang Zhichao d09c6c7584 Add a fallback to RDTSC estimation when TSC info is unavailable 2025-07-21 20:08:42 +08:00
Yang Zhichao 496c50f296 Fix get_cpuid_level function to directly return the CPUID 0x0 EAX value instead of TSC denominator 2025-07-21 20:08:42 +08:00
Yang Zhichao 85e605250b Fix cache line size calculation in get_clflush_size function 2025-07-21 20:08:42 +08:00
Marsman1996 62d426d9b7 Add check for empty directory and more forms of root directory in `rmdir` 2025-07-21 11:33:14 +08:00
Ruihan Li 4d8078166e Send and receive UNIX control messages 2025-07-21 10:46:08 +08:00
Qingsong Chen f1299d4b8d Save FPU context on signal stack 2025-07-18 11:40:16 +08:00
Qingsong Chen 6cd53fbb8a Refactor FPU context using pre_schedule_handler 2025-07-18 11:40:16 +08:00
Chen Chengjun 749fe77591 Add an initial script to mount several file systems 2025-07-17 13:51:45 +08:00
Chen Chengjun df69af324e Forbid creating a directory in sysfs 2025-07-17 13:51:45 +08:00
Chen Chengjun 16292742d2 Leverage FsRegistry to remove the hardcode in mount syscall 2025-07-17 13:51:45 +08:00
Chen Chengjun 9783bbddda Implement FsType for exsiting file systems 2025-07-17 13:51:45 +08:00
Chen Chengjun cb1732706a Introduce FsType and FsRegistry 2025-07-17 13:51:45 +08:00
Ruihan Li cdd7950d2e Remove some variants in `ostd::Error` 2025-07-15 23:05:30 +08:00
Chen Chengjun d02202dc73 Support the basic cgroupfs 2025-07-14 20:35:05 +08:00
Chen Chengjun 19a3f5576d Introduce the FsManager 2025-07-14 20:35:05 +08:00
Chen Chengjun b90b79810c Provide more powerful macros to assist in implementing the SysTree-related traits 2025-07-14 20:35:05 +08:00
Chen Chengjun a8b4c23319 Add SysTreeInodeTy trait to abstract the view part of MVC arch 2025-07-14 20:35:05 +08:00
Chen Chengjun 774291611c Add two error types in aster_systree::Error 2025-07-14 20:35:05 +08:00
Chen Chengjun 9c68d96fa2 Attach SysPerms to systree nodes and attributes 2025-07-14 20:35:05 +08:00
Chen Chengjun e229eb379b Enable getting path through SysObj 2025-07-14 20:35:05 +08:00
Ruihan Li a5e927b675 Make the framebuffer backspace work 2025-07-14 20:24:29 +08:00
Ruihan Li b1079c2bc5 Add support for font setting 2025-07-14 20:24:29 +08:00
Ruihan Li 9f82a0c89f Clean up the console crate 2025-07-14 20:24:29 +08:00
jiangjianfeng d317ce3246 Adjust `max_len` to avoid EFAULT when reading CString 2025-07-14 15:43:34 +08:00
jiangjianfeng 010da31b3e Align execve argument limits with Linux 2025-07-14 15:43:34 +08:00
yuankunzhang a4c918efd7 fs: validate workdir when creating overlayfs instance
The workdir needs to be an empty directory on the same filesystem
as upperdir.
2025-07-11 09:26:31 +08:00
jiangjianfeng 665de6bd35 Make RISC-V code compile under new exception APIs 2025-07-09 10:49:43 +08:00
jiangjianfeng 7f3ca86467 Refactor x86 exception related code 2025-07-09 10:49:43 +08:00
Chen Chengjun 2a34a041c4 Fix the mask set in the signalfd 2025-07-08 15:50:41 +08:00
js2xxx 1a12080c58 Fix integer overflow when updating vruntime after pending weight update 2025-07-05 18:23:17 +08:00
Ruihan Li 801ab865b7 Make paths of `TrapFrame` unique 2025-07-05 18:19:26 +08:00
Ruihan Li 0fce977b40 Clean up `trapframe` items 2025-07-05 18:19:26 +08:00
Wang Siyuan 37cc54f2aa Store `offset` in `MappedVmo` instead of `range` 2025-07-03 18:54:53 +08:00
Ruihan Li 706f62e299 Support ANSI escape sequences 2025-07-03 17:47:56 +08:00
Ruihan Li abbf152d74 Re-enable framebuffer 2025-07-03 17:47:56 +08:00
Ruihan Li d73cbb5008 Clarify the `DeviceId` encoding 2025-07-03 14:30:14 +08:00
Wang Siyuan a13297ae4c Add fields in `/proc/*/stat` and `/proc/*/status` 2025-07-02 20:13:47 +08:00
Wei Zhang 513532fe95 Correctly handle partial writes and reads in writev and readv
When using writev or readv, if data is partially written or read, the
written or read bytes number should be returned instead of error.
2025-07-02 17:14:10 +08:00
Chen Chengjun fe24c2d8ae Ensure proper handling of out-of-bounds VMO access during page fault processing 2025-07-02 16:08:00 +08:00
js2xxx 4571fabc7a Fix integer overflow due to fair weight change 2025-07-02 11:00:34 +08:00
Ruihan Li 6146434f15 Unify the styles of the `arch` modules 2025-06-30 15:43:41 +08:00
Qingsong Chen 5e3e23bf7c Add basic i8042 keyboard support 2025-06-27 12:56:55 +08:00
Ruihan Li 3f1bf99b2a Make `mremap` behavior consistent with Linux 2025-06-26 11:41:56 +08:00
Ruihan Li 079be2f30f Enable syscall tests for UNIX sockets 2025-06-26 11:11:03 +08:00
Ruihan Li bef9304c85 Fix minor problems of UNIX sockets 2025-06-26 11:11:03 +08:00
Wang Siyuan 810580bda5 Fix underflow when merging VMAs 2025-06-26 11:10:38 +08:00
jiangjianfeng e4c5c36be9 Support SO_PEERCRED & SO_PEERGROUPS 2025-06-24 17:25:44 +08:00
jiangjianfeng d7e88f93bd Support SO_ACCEPTCONN 2025-06-24 17:25:44 +08:00
jiangjianfeng ec8beab540 Support SO_PRIORITY 2025-06-24 17:25:44 +08:00
jiangjianfeng 8f6bc07b23 Support SO_SNDBUFFORCE & SO_RCVBUFFORCE 2025-06-24 17:25:44 +08:00
Ruihan Li b891d7d215 Introduce `Endpoint` and `EndpointState` 2025-06-24 15:41:53 +08:00
Wang Siyuan a0cbe7551a Fix some user space address check 2025-06-24 12:15:24 +08:00
Wang Siyuan f442cc6d81 Automatically merge adjacent and compatible `VmMapping`s 2025-06-24 12:15:24 +08:00
js2xxx c5d57d5216 Fix mapping between `sched_attr` and `SchedPolicy` 2025-06-24 10:31:32 +08:00
Zhang Junyang 93015a6090 Make user program relocation code readable 2025-06-24 10:15:09 +08:00
Ruihan Li 35e0918bce Don't race between enabling IRQs and halting CPU 2025-06-23 22:53:35 +08:00
Ruihan Li b96c8f9ed2 Make `ostd::trap::irq` public 2025-06-23 22:53:35 +08:00
Ruihan Li 751e0b2ebf Don't jump to the end of the cursor range 2025-06-23 10:54:30 +08:00
Ruihan Li 1c423d6b6d Unwrap some unreachable errors 2025-06-23 10:54:30 +08:00
Hsy-Intel 65fd1aac81 Sync CVM guest feature dependencies between kernel and virtio components 2025-06-23 10:32:09 +08:00
Marsman1996 826f56aeed Check file_table in PID directory before access 2025-06-22 17:58:33 +08:00
Marsman1996 1c56fbc871 Fix unwrap panic of dropped VMAR in PID status 2025-06-22 17:58:33 +08:00
Wang Siyuan 11f9675f37 Support the system call `mremap` 2025-06-21 16:18:09 +08:00
Wang Siyuan 33345f184a Count RSS when dropping `RssDelta` 2025-06-21 16:18:09 +08:00
Marsman1996 bb3f21b41e Fix integer overflow in futex wake 2025-06-20 15:58:19 +08:00
jiangjianfeng 95faea0fb0 Support WSTOPPED and WCONTINUED 2025-06-20 11:51:44 +08:00
Ruihan Li bcf1e69878 Expose `head`/`tail` of `RingBuffer` 2025-06-19 16:30:02 +08:00
Ruihan Li a3c5ab8cb4 Move virtio-mmio bus outside OSTD 2025-06-19 15:10:42 +08:00
Marsman1996 2f097ab8f8 Check file_table before use 2025-06-18 17:28:28 +08:00
Ruihan Li 4a9977d9a7 Make zero reads/writes' behavior right 2025-06-17 16:09:33 +08:00
Ruihan Li 837f908690 Fix some pollee mistakes 2025-06-17 16:06:48 +08:00
Marsman1996 5a514f6163 Check `VSOCK_GLOBAL` when creating `VsockStreamSocket` 2025-06-16 14:43:17 +08:00
Qingsong Chen ef7fdc6647 Fix improper handling of O_TRUNC for non-regular files 2025-06-16 12:10:58 +08:00
Wang Siyuan d5b12532a8 Require `T: Send` for `CpuLocal<T, S>` 2025-06-16 12:09:13 +08:00
Chen Chengjun 627dd0386b Enable FUTEX_WAKE_OP 2025-06-16 11:02:17 +08:00
Chen Chengjun 860bb6c07f Adjust and correct parts of the futex implementation code 2025-06-16 11:02:17 +08:00
Zhang Junyang 45059bad21 Create a new PT rather than clearing it upon `exec*` 2025-06-16 10:18:19 +08:00
Zhang Junyang 525085ab86 Implement system call `msync` 2025-06-15 16:25:37 +08:00
Ruihan Li 796635486c Handle broken netlink attributes 2025-06-13 11:27:22 +08:00
Ruihan Li deab9b6f72 Truncate netlink messages 2025-06-13 11:27:22 +08:00
Ruihan Li 0e8106abfa Restrict visibility for TCP internals 2025-06-13 11:07:11 +08:00
Ruihan Li 639bc91e31 Clean up public re-exports under `net/` 2025-06-13 11:07:11 +08:00
Zhang Junyang 86a7aa09eb Improve exception handling panic message 2025-06-13 10:35:47 +08:00
Wang Siyuan b605bed576 Fix some typos 2025-06-12 22:35:54 +08:00
Zhang Junyang e78927b449 Manage frame tracking outside the page table 2025-06-12 22:34:46 +08:00
Zhang Junyang 22ccfb1f2b Move COW out of OSTD 2025-06-12 22:34:46 +08:00
Ruihan Li 0661a0656b Never queue an ignored signal 2025-06-12 16:15:53 +08:00
Cautreoxit 3e32a38316 Add sys_close_range 2025-06-11 19:56:12 +08:00
Ruihan Li 71e08b3942 Clean up TTY termios definitions 2025-06-10 14:30:02 +08:00
Marsman1996 8583eea62b Fix unreachable error in sys_timer_settime 2025-06-10 11:22:50 +08:00
Marsman1996 9109741e8b Add TFDSetTimeFlags and fix reachable panic 2025-06-10 11:22:50 +08:00
Cautreoxit 0b471ef370 Add sys_epoll_pwait2 2025-06-09 20:20:40 +08:00
jiangjianfeng 597139a7f7 Fix a clippy error 2025-06-09 17:22:14 +08:00
Cautreoxit e9f35f6ab8 Debug for try_from impl for Duration 2025-06-09 14:51:05 +08:00
Ruihan Li fe6b78058c Correct the blocking behavior 2025-06-09 13:10:34 +08:00
Ruihan Li 67065835ef Redefine the TTY driver interface 2025-06-09 13:10:34 +08:00
Ruihan Li 5a9a63e1a7 Use one lock for `LineDiscipline` 2025-06-09 13:10:34 +08:00
Ruihan Li 45258d0475 Unpack `LineDiscipline` from `Arc` 2025-06-09 13:10:34 +08:00
Ruihan Li 9e2dde5ebb Add `enqueue_signal_async` 2025-06-09 13:10:34 +08:00
Chen Chengjun c56aee92f4 Re-organize some systree-related code 2025-06-09 11:13:48 +08:00
Chen Chengjun a67bd8cdc9 Add macros to help implementing SysObj trait 2025-06-09 11:13:48 +08:00
Chen Chengjun 1dd1c8c775 Enable read and write operations of the attribute to handle offset 2025-06-09 11:13:48 +08:00
Chen Chengjun 3b1248ba7c Fix some potential bugs of sysfs 2025-06-09 11:13:48 +08:00
Marsman1996 01328ee404 Fix panic when mount with invalid file system type 2025-06-06 18:26:24 +08:00
jiangjianfeng f0957d2f54 Fix clippy warnings in kernel crate 2025-06-06 18:22:09 +08:00
Cautreoxit 2e3de6218f Add more features for statx syscall 2025-06-06 15:07:20 +08:00
jiangjianfeng f946f09ee4 Implement netlink uevent socket 2025-06-06 11:33:09 +08:00
Wang Siyuan 58e4f45bb1 Add per-CPU counters and track RSS for each `Vmar` 2025-06-03 23:24:32 +08:00
Wang Siyuan dfd3042276 Add dynamically-allocated CPU-local objects 2025-06-03 23:24:32 +08:00
Zejun Zhao 3790f616fd Rename `PageProperty::new` to `PageProperty::new_user` 2025-06-03 18:42:53 +08:00
Ruihan Li c73892c704 Mark `pub(super)` for internal methods 2025-06-01 15:06:53 +08:00
Ruihan Li 14388da548 Remove guard generics from `xarray::Cursor` 2025-06-01 15:06:53 +08:00
Zejun Zhao ffb4097436 Add RISC-V timer support 2025-05-29 19:51:02 +08:00
Ruihan Li 63daf69e17 Fix incorrect types in `sys_getcpu` 2025-05-29 10:33:02 +08:00
Ruihan Li 56e9824dd1 Make `current_cpu_racy` a method of `CpuId` 2025-05-29 10:33:02 +08:00
Zhang Junyang 79b3f68892 Make the RCU lifetime of page tables explicit 2025-05-24 17:42:17 +08:00
Zhang Junyang 54fbdcf059 Implement the stray marking in PT to ensure serializability 2025-05-24 17:42:17 +08:00
Zhang Junyang 5b7637eac3 Remove the activation lock and use RCU to protect PT removal 2025-05-24 17:42:17 +08:00
Qingsong Chen 189daa2e09 Fix the return value of `read_link` for ext2 2025-05-23 10:17:08 +08:00
stuuupidcat 95744692a5 Remove unnecessary #[inline] attributes 2025-05-22 12:19:21 +08:00
Zhang Junyang 02463ff161 Bump xmas-elf 2025-05-12 22:00:13 +08:00
Ruihan Li d5c7a8bae3 Allow non-leaders to operate jobs 2025-05-12 16:09:43 +08:00
Zhang Junyang 773b965767 Allow specifying orderings when loading/storing `AtomicCpuSet`s 2025-05-11 15:29:17 +08:00
Ruihan Li ff907d1131 Implement race-free job control 2025-05-09 17:12:31 +08:00
Ruihan Li 6f20cfbe69 Move fields from PTY master to slave 2025-05-09 17:12:31 +08:00
jiangjianfeng 89e8cd5936 Move functions related to spawning the init process to a seperate module 2025-05-09 13:19:57 +08:00
Ruihan Li 50ba735e96 Handle negative P(G)IDs via `cast_(un)signed` 2025-05-09 11:38:01 +08:00
Ruihan Li d0719efcb4 Clarify some API usages 2025-05-06 18:47:10 +08:00
Ruihan Li a993264265 Refactor and test `get{pgid,sid}` 2025-05-06 18:47:10 +08:00
Ruihan Li 7e4509df9c Refactor and test `set{pgid,sid}` 2025-05-06 18:47:10 +08:00
Ruihan Li 5e13e0c325 Resolve lints in the TTY module 2025-05-06 11:55:06 +08:00
Ruihan Li 7de9666e65 Retire incomplete features 2025-05-06 11:17:20 +08:00
Ruihan Li 54bd64269b Rename `systree` to `aster-systree` 2025-05-03 18:22:11 +08:00
Ruihan Li f720c05706 Fail the CI if workspace lints are not enabled 2025-05-03 18:22:11 +08:00
Chen Chengjun 725a46fe72 Modify VMO usages and fix the atomic-mode issue during handling page fault 2025-04-30 20:59:15 +08:00
Chen Chengjun af2a7f7497 Refactor the APIs of VMO based on the new XArray 2025-04-30 20:59:15 +08:00
Chen Chengjun ac1de89d31 Add the default mark type for LockedXArray 2025-04-30 20:59:15 +08:00
Qingsong Chen 88f08de3af Refactor framebuffer 2025-04-29 19:48:45 +08:00
Chen Chengjun 1775bb0861 Support for timerfd-related syscalls 2025-04-25 16:33:46 +08:00
Shaowei Song f38f476c3b Add support for mounting OverlayFS 2025-04-24 20:07:06 +08:00
Shaowei Song 914237e9ca Add basic OverlayFS implementation 2025-04-24 20:07:06 +08:00
Fabing Li 63831dc2df Add ktest cases 2025-04-24 20:03:54 +08:00
Fabing Li 79b0866259 Add sysfs implementation 2025-04-24 20:03:54 +08:00
Zhenchen Wang 3a5f270ee9 Made some minor improvements to syscall statx
Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
2025-04-23 20:39:54 +08:00
Zhenchen Wang 9e729593e8 Add syscall faccessat2
Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
2025-04-23 20:39:54 +08:00
Ruihan Li 26253829bb Use `datagram_common` in netlink 2025-04-23 20:37:40 +08:00
Ruihan Li c9f939bcc4 Create `datagram_common` and use it in UDP 2025-04-23 20:37:40 +08:00
Ruihan Li 96e62b8fa5 Reorder socket locks 2025-04-23 20:37:40 +08:00
jiangjianfeng 961ad73847 Poll the correct iface in irq handler 2025-04-23 00:32:37 +08:00
jiangjianfeng 8815ca384f Add syscall ppoll 2025-04-21 11:19:48 +08:00
Chen Chengjun 1fe0fef410 Add ktests for the XArray 2025-04-19 16:48:15 +08:00
Chen Chengjun c3dd607777 Introduce RCU-based XArray 2025-04-19 16:48:15 +08:00
Ruihan Li 81b79dacc6 Remove `read*_to_end` methods 2025-04-18 14:17:37 +08:00
Zejun Zhao 1c881d30f6 Add RISC-V build CI 2025-04-18 13:26:16 +08:00
Zejun Zhao 3aa1079ca6 Clarify the usage of ostd::arch 2025-04-18 13:26:16 +08:00
Zejun Zhao 14b8c48859 Adjust RISC-V's implementation for recent changes 2025-04-18 13:26:16 +08:00
Zejun Zhao e4aa261c48 Make if_tdx_enabled macro x86-specific 2025-04-18 13:26:16 +08:00
Zhenchen Wang 7ac4fa9519 Add syscall statx
Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
2025-04-18 09:36:50 +08:00
Ruihan Li d6e40933b8 Move the log lock to a better location 2025-04-16 21:59:24 +08:00
Zhang Junyang 85d4cdbbb0 Avoid excessive heap allocations in `sys_futex` 2025-04-15 21:56:15 +08:00
jiangjianfeng 5d84ac7775 Generate kernel response to user request 2025-04-15 17:20:12 +08:00
jiangjianfeng 3e66732889 Parse netlink message 2025-04-15 17:20:12 +08:00
jiangjianfeng ac42e83387 Add basic structure for netlink route socket 2025-04-15 17:20:12 +08:00
jiangjianfeng 2c41055470 Expose more methods on bigtcp iface 2025-04-15 17:20:12 +08:00
jiangjianfeng 7d24e63216 Move network polling code to bottom half 2025-04-15 14:54:51 +08:00
jiangjianfeng 9804f053f2 Add guard which disables bottom half 2025-04-15 14:54:51 +08:00
Ruihan Li a1f81df263 Remove `ostd/src/mm/offset.rs` 2025-04-15 09:15:22 +08:00
Ruihan Li 8600278a5f Drop files at the correct time 2025-04-14 21:13:11 +08:00
Ruihan Li 7e1abc1fbb Rename `ProcessVmarGuard::get` to `unwrap` 2025-04-14 21:13:11 +08:00
Ruihan Li 293f1ff4c9 Do `release_range_locks` in `Drop` 2025-04-14 21:13:11 +08:00
Chen Chengjun a21e895102 Enable RCU to read reference to stored pointers 2025-04-10 14:42:51 +08:00
jiangjianfeng b833ec6ede Implement ReadCString for MultiRead 2025-04-09 16:47:11 +08:00
Ruihan Li ceb79ea27a Always move zombie children to init 2025-04-07 13:01:22 +08:00
Chen Chengjun e4f07b76a0 Add real vfork logics 2025-04-03 14:44:39 +08:00
le-monde-bleu 43e43ca133 Add vfork syscall and related clone flags 2025-04-03 14:44:39 +08:00
Ruihan Li 0bbd56ecf3 Don't panic for missing virtio-net 2025-04-02 11:33:51 +08:00
jiangjianfeng 1846c680fc Clone the reader to prevent cursor misplacement in `ReadCString` 2025-03-31 14:00:04 +08:00
Shaowei Song 2af71ff72a Add xattr support for ext2 2025-03-28 15:08:59 +08:00
Shaowei Song 97c27e8d2a Add xattr support for ramfs 2025-03-28 15:08:59 +08:00
Shaowei Song a47eda413c Add extended attribute (xattr) syscalls: setxattr, getxattr, listxattr and removexattr 2025-03-28 15:08:59 +08:00
Cautreoxit b4a1dc03f3 Delete useless visibility for BARs 2025-03-27 18:44:15 +08:00
Cautreoxit 4fff7cdc22 Add an API for BioRequest to return the number of sectors 2025-03-26 10:38:24 +08:00
Cautreoxit 7a8afd8c48 Add a empty line after the license 2025-03-25 19:47:55 +08:00
jiangjianfeng 0e1c660225 Make VmReader's several methods accept `&mut self` 2025-03-25 14:25:08 +08:00
Yuke Peng 1f03955f51 Change IoMem directory 2025-03-22 17:38:30 +08:00
Zhang Junyang 4f0acddfd4 Strict TLB coherence 2025-03-21 21:19:50 +08:00
Zhang Junyang 30ec0be210 Halt the idle CPUs 2025-03-21 21:19:50 +08:00
Zhang Junyang f1c7564184 Move CPU context implementations to a specific module 2025-03-21 21:19:50 +08:00
Zhang Junyang 298a205da2 Avoid an `Arc::clone` in `mmap` to make it scale 2025-03-21 20:09:42 +08:00
Zhang Junyang f9284d3803 Workaround the missing process of a thread 2025-03-21 18:05:10 +08:00
Fabing Li bce23a63bd Add sys_signalfd/sys_signalfd implementation 2025-03-21 16:10:55 +08:00
Ruihan Li bb1b41b413 Fix dead code lints 2025-03-21 16:00:35 +08:00
Hsy-Intel 49e6cd2712 Use macro to handle TDX-related code 2025-03-20 17:25:22 +08:00
Chen Chengjun 135100a472 Modify the getting-VMAR usages in other syscalls 2025-03-20 14:20:47 +08:00
Chen Chengjun 048fd1077c Inject post_schedule/user_page_fault handler to OSTD 2025-03-20 14:20:47 +08:00
Chen Chengjun 2a20f6b59a Add mutable functionality to the process VMAR 2025-03-20 14:20:47 +08:00
Chen Chengjun 248b24fb4e Remove UserSpace abstraction from OSTD 2025-03-20 14:20:47 +08:00
Ruihan Li d9f3a7761a Notify socket events directly 2025-03-20 11:44:47 +08:00
Ruihan Li 2f66f5d234 Revert "Set hash buckets as 2 to work around performance bottleneck"
This reverts commit 631ab21838.
2025-03-20 11:44:47 +08:00
Ruihan Li 7f323ac501 Don't remove TIME-WAIT sockets 2025-03-20 11:44:47 +08:00
Ruihan Li 240192f735 Make connection addition and deletion in order 2025-03-20 11:44:47 +08:00
Ruihan Li a7e718e812 Avoid `O(n)` iteration when sending TCP packets 2025-03-20 11:44:47 +08:00
Zejun Zhao 73e0b30785 Eliminate redundant check in hot path 2025-03-20 10:45:16 +08:00
Zejun Zhao c1e6f9a552 Eliminate redundant Clone in hot path 2025-03-20 10:45:16 +08:00
Zhang Junyang 288942b970 Revise the docs of the slab and remove an unused type 2025-03-14 21:17:47 +08:00
Zhang Junyang a708a0c046 Inject a scalable slab allocator 2025-03-14 19:55:00 +08:00
jiangjianfeng d366043876 Enable sig_action test from gVisor test 2025-03-14 16:09:11 +08:00
jiangjianfeng 7e96810e1a Remove trampoline code in handling user kernel 2025-03-14 16:09:11 +08:00
Zhang Junyang 5f05963ee5 Inject a scalable buddy system allocator to OSTD
Co-authored-by: Zhe Tang <tangzh@stu.pku.edu.cn>
2025-03-14 08:37:37 +08:00
Zejun Zhao 455b8abba0 Adopt a round-robin strategy to select among equally idle CPUs 2025-03-13 16:28:02 +08:00
Hsy-Intel 7b5f2c414a Use the latest tdx-guest crate version to fix the TDX init issue 2025-03-13 12:56:46 +08:00
Ruihan Li d40d452e9d Receive RST packets as `ECONNRESET` errors 2025-03-10 18:08:08 +08:00
Ruihan Li aa29640ed7 Send RST packets when appropriate 2025-03-10 18:08:08 +08:00
Ruihan Li eef56c770b Simplify the TCP state check 2025-03-10 18:08:08 +08:00
Hsy-Intel 9edee83ef1 Use the latest tdx-guest crate version to fix the MMIO emulation issue 2025-03-10 17:58:35 +08:00
jiangjianfeng 388eec449a Add ip level socket option 2025-03-07 13:38:02 +08:00
js2xxx ffc7e3612d Fix `RLimit` lock update 2025-03-06 21:29:40 +08:00
js2xxx c1dde01fc3 Add `sched_attr` system call series 2025-03-06 21:29:40 +08:00
Ruihan Li 9e1c939a3f Remove `static_assertions` 2025-03-06 16:35:21 +08:00
Ruihan Li 0d36375dfa Avoid `generic_const_exprs` feature 2025-03-06 16:35:21 +08:00
Shaowei Song d19578ac78 Pooling some cached block writes in ext2 2025-03-06 11:43:07 +08:00
Wang Siyuan 5bfdcfc619 Add memory resource limit mechanism 2025-03-06 11:22:05 +08:00
Wang Siyuan eca3c8fb59 Refactor RLimit64 to atomic 2025-03-06 11:22:05 +08:00
Yuke Peng 96d83e43b4 Make VirtioConsolesPrinter heapless 2025-03-05 20:24:59 +08:00
Ruihan Li d37e60d082 Report socket errors in `send`/`recv` 2025-03-05 19:48:28 +08:00
Ruihan Li 68cf99993e Remove socket errors from `SocketOptionSet` 2025-03-05 19:48:28 +08:00
Chen Chengjun 801eac9386 Support PR_SET/GET_CHILD_SUBREAPER for sys_prctl 2025-03-03 19:31:50 +08:00
Zhang Junyang 55ee4bda2c Use RCU for console device callbacks 2025-03-03 09:24:49 +08:00
Zhang Junyang 78a695f21b Use `RcuOption` for lazy-initialized soft-IRQ callbacks 2025-03-03 09:24:49 +08:00
wheatfox 6d42a07e95 Implement `getcpu` syscall and add corresponding test application 2025-02-27 11:41:26 +08:00
Fabing Li cbb4b4e631 Fix lint errors 2025-02-27 11:36:41 +08:00
Ruihan Li 18e0eae331 Never expose `ERESTARTSYS` to the userspace 2025-02-23 23:11:05 +08:00
Ruihan Li 8187fa2f1b Fix timeout mechanism in `wait_events` 2025-02-23 23:11:05 +08:00
Ruihan Li 2411ba671c Reapply "Make `pause_timeout` return `EINTR`"
This reverts commit 7a017faa44.
2025-02-23 23:11:05 +08:00
Zejun Zhao 29791ba77e Distribute tasks among all the CPUs 2025-02-21 10:02:46 +08:00
Ruihan Li 0398ea3d17 Split `bound.rs` into small files 2025-02-18 19:20:05 +08:00
Qingsong Chen 04be02efb7 Add init_component for mlsdisk 2025-02-11 11:38:43 +08:00
Qingsong Chen f6e040ec94 Add a basic ktest for mlsdisk 2025-02-11 11:38:43 +08:00
Qingsong Chen d8dc153be9 Fix deadlock of `CurrentTx` in mlsdisk 2025-02-11 11:38:43 +08:00
Qingsong Chen c040df72b3 Rename `SwornDisk` to `MlsDisk` 2025-02-11 11:38:43 +08:00
Shaowei Song 328ba47ccd Fix and revise the directory entry handling in ext2 2025-02-11 11:33:31 +08:00
Zejun Zhao d71771e49a Re-enable CFS 2025-02-11 10:51:12 +08:00
Zejun Zhao c2f48a41db Clean up the implementation of scheduling class 2025-02-11 10:51:12 +08:00
jiangjianfeng 3f951e0c0c Enable gVisor tcp_socket_test 2025-02-11 10:50:20 +08:00
Zhang Junyang e1ced5f385 Conditionally compile dead code in `interval_set.rs` 2025-02-11 10:48:34 +08:00
Shaowei Song fecf766771 Revise the cache page allocation for `PageCacheManager` 2025-02-11 10:48:12 +08:00
jiangjianfeng 55713b88c4 Remove unused dependencies 2025-02-10 10:36:56 +08:00
Ruihan Li 418f58ec89 Avoid locking twice in UDP `send` 2025-02-08 15:44:44 +08:00
Ruihan Li 6a13787c49 Implementing `FileLike` for all `Socket`s 2025-02-08 15:44:44 +08:00
Ruihan Li 3c6737a4ca Revise doc comments for `Socket` 2025-02-08 15:44:44 +08:00
Ruihan Li a6b3a65fe5 Don't allocate when possible in `do_poll` 2025-02-08 15:43:20 +08:00
Ruihan Li 95bbc7f367 Enforce `#[expect(lint)]` 2025-02-08 15:10:04 +08:00
Ruihan Li 0dca168717 Use `#[expect(lint)]`, not `#[allow(lint)]` 2025-02-08 15:10:04 +08:00
Ruihan Li 1899646391 Fix `#[allow(dead_code)]` in cpio-decoder 2025-02-08 15:10:04 +08:00
Ruihan Li 09ef817b4e Fix `#[allow(dead_code)]` in typeflags 2025-02-08 15:10:04 +08:00
Ruihan Li 1c4e88e648 Fix `#[allow(dead_code)]` in virtio 2025-02-08 15:10:04 +08:00
Ruihan Li b415538097 Remove useless `#[allow(lint)]` 2025-02-08 15:10:04 +08:00
Shaowei Song 56b85cb132 Cache negative dentries for faster negative lookups 2025-01-24 11:48:15 +08:00
jiangjianfeng 14f0f5a7b5 Avoid iterating over all sockets to remove dead sockets 2025-01-24 11:46:18 +08:00
Ruize Tang c4229e3c2f Add INITRAMFS_SKIP_GZIP option to make initramfs encoding/decoding faster 2025-01-23 10:50:43 +08:00
Ruihan Li b472737771 Resolve FIXME in pipe tests 2025-01-23 09:57:10 +08:00
Ruihan Li 2cf4aebe7a Use `FnOnce() + Send` as task `func` 2025-01-23 09:57:10 +08:00
Shaowei Song 6a865062e6 Unify and optimize the comparison of special file names 2025-01-21 11:34:56 +08:00
Fabing Li aa5bc6ff73 Fix the unit of meminfo 2025-01-21 11:29:08 +08:00
Shaowei Song 6de5be1ecc Make the generic inode permisson check faster 2025-01-10 10:21:52 +08:00
Ruihan Li b9ce3e64ad Make the file lookup faster 2025-01-09 10:58:16 +08:00
Ruihan Li 16db96e496 Adjust `as_socket` signature 2025-01-09 10:58:16 +08:00
Ruihan Li a7741a8a75 Remove `as_device` from `FileLike` 2025-01-09 10:58:16 +08:00
Zhang Junyang 5ea366bced Move kcmdline parsing out of OSTD 2025-01-02 10:41:51 +08:00
Zhang Junyang 397ce9652f Refactor boot modules to make heap allocation explicit 2025-01-02 10:41:51 +08:00
Zhang Junyang 51349a3da1 Heapless memory region initialization 2025-01-02 10:41:51 +08:00
jiangjianfeng 0c8200dc7b Add nginx benchmark and workaround 2025-01-01 10:43:14 +08:00
Qingsong Chen 56a137dc56 Add mlsdisk as a component
Co-authored-by: Shaowei Song <songshaowei.ssw@antgroup.com>
2025-01-01 09:19:32 +08:00
jiangjianfeng 631ab21838 Set hash buckets as 2 to work around performance bottleneck 2024-12-31 13:19:30 +08:00
Ruihan Li 7334c93ff5 Make bigtcp error wrappers consistent 2024-12-30 21:41:51 +08:00
jiangjianfeng 39cc0dca26 Add socket hash table 2024-12-30 09:46:14 +08:00
jiangjianfeng 783345b90b Add Bob Jenkins's hash algorithm 2024-12-30 09:46:14 +08:00
js2xxx 0d30ce0b2c Improve readability on `SchedPolicy` storage & reduce memory foot print on sched entities 2024-12-30 09:38:48 +08:00
js2xxx 364d6af7c8 Reduce the held time of scheduling policy lock 2024-12-30 09:38:48 +08:00
Zejun Zhao ea953209ff Add a fast path while picking next thread from RT scheduling class 2024-12-28 14:30:33 +08:00
Shaowei Song f739c67ed3 Issue device sync request at the end of ext2's sync 2024-12-27 12:23:19 +08:00
Shaowei Song 4d5d0942ad Minor improvements to ext2 inode 2024-12-27 12:23:19 +08:00
Shaowei Song 0799976018 Improve directory entry handling efficiency in ext2 2024-12-27 12:23:19 +08:00
Zhang Junyang ff453f5933 Use `CachePage` in all related block functions 2024-12-27 12:12:51 +08:00
Zhang Junyang 983a6af3cc Polish the doc and rename variables in `ostd::mm` 2024-12-27 12:12:51 +08:00
Zhang Junyang f332797084 Use frame metadada for page cache 2024-12-27 12:12:51 +08:00
Zhang Junyang cdac59beda Implement a new set of physical page APIs 2024-12-27 12:12:51 +08:00
Zhang Junyang c9a37ccab1 Renaming concepts around pages and frames
This commit renames `Frame` -> `UntypedFrame` and `Page` -> `Frame`.
So do other concepts in the following list:
 - `Segment` -> `UntypedSegment`,
 - `ContPages` -> `Segment`,
 - `DynPage` -> `AnyFrame`,
 - `PageMeta` -> `FrameMeta`,
 - `FrameMeta` -> `UntypedMeta`.

This commit also re-organized the source in the `mm/page` and `mm/frame`
module to accommodate the changes.
2024-12-27 12:12:51 +08:00
Zhang Junyang 10f1856306 Remove the vectorized page allocation 2024-12-27 12:12:51 +08:00
Marsman1996 5df8d59563 Exit when handle_user_signal fail 2024-12-26 18:33:32 +08:00
anbo225 e75b6320ad Add support for group-based permission checking in ext2 2024-12-26 17:07:55 +08:00
Zejun Zhao 6cea8d2a8c Make stop runqueue per-CPU 2024-12-26 14:54:22 +08:00
Ruihan Li 0bfe7aceb8 Utilize `ThreadLocal` 2024-12-26 14:51:20 +08:00
Marsman1996 3e47ed10fd Check name when `lookup_child` in `TaskDirOps` 2024-12-26 09:06:18 +08:00
Marsman1996 9753d796c5 Add overflow check for futex_addr 2024-12-26 09:05:24 +08:00
Marsman1996 1a5bf7b0ad Add overflow check for given sigaltstack addr and size 2024-12-25 15:46:17 +08:00
Ruihan Li 7c249cf0ca Fix the memory order in `Subject` 2024-12-25 15:28:35 +08:00
Wang Siyuan 6e46641a09 Fix a mmap `MAP_FIXED` issue 2024-12-24 09:10:10 +08:00
Wang Siyuan 1e3403e756 Support ELF files with zero `p_filesz`. 2024-12-22 15:16:22 +08:00
Shaowei Song 104c8dfdde Optimize the `DirEntry` lookup in ext2 2024-12-20 09:36:16 +08:00
Shaowei Song 21da6d2b93 Optimize lock usage in ext2 inodes 2024-12-20 09:36:16 +08:00
Marsman1996 3d12ccdbea Warn unsupported clone flags instead of panic 2024-12-20 09:21:25 +08:00
jiangjianfeng 9a540d0fb6 Notify virtqueue in a batch manner 2024-12-19 14:49:56 +08:00
jiangjianfeng 72cb160539 Add keepidle tcp option 2024-12-18 13:19:34 +08:00
Shaowei Song 00b194812d Prepare "/dev/shm" for POSIX shared memory 2024-12-18 12:26:33 +08:00
lab-pc-wtj 6e4a4c58d0 Improve /proc/{PID}/stat 2024-12-18 10:00:15 +08:00
Ruihan Li 776fd6a892 Create backlog sockets on demand 2024-12-17 20:14:53 +08:00
Fabing Li 24f1e02b26 Support prctl(PR_SET_KEEPCAPS/PR_GET_KEEPCAPS) 2024-12-17 20:14:13 +08:00
Fabing Li d72ce0351a Add permission checks for sys_capset 2024-12-17 20:14:13 +08:00
Fabing Li 636efe68fd Give root process a full capability set 2024-12-17 20:14:13 +08:00
Ruihan Li 35c20620bc Rewrite `exit()` and `exit_group()` 2024-12-17 19:36:38 +08:00
Zejun Zhao bc5a058fc5 Add TODO for a potential vulnerability in futex implementation 2024-12-16 21:12:08 +08:00
Zejun Zhao 1b56a8b600 Enable syscall restart 2024-12-16 21:12:08 +08:00
Zejun Zhao ced0023d6b Introduce a syscall restart mechanism 2024-12-16 21:12:08 +08:00
Zhang Junyang 285dde5546 Set affinity for BSP idle thread 2024-12-16 19:15:59 +08:00