Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop Main Merge 2 #212

Merged
merged 43 commits into from
Mar 28, 2024
Merged

Develop Main Merge 2 #212

merged 43 commits into from
Mar 28, 2024

Conversation

rennergade
Copy link
Contributor

No description provided.

yashaswi2000 and others added 30 commits March 28, 2024 13:20
* epoll fixes in safeposix

* removing commented lines

* new changes

* using interface::rust_min

Co-authored-by: lind <lind@nyu.edu>
* adding fchmod to safeposix

* fixes in dispatcher

* cleaning up comments

* fixing indentation

* fixing indentation

* refactor fchmod and chmod to use helper function

Co-authored-by: lind <lind@nyu.edu>
* fix verbiage

* fix verbiage
* Changed rev_shm table to cage-local linear vec

* Factored out search rev_shm

* Added foreign interface for copying lind shmat mappings

* Removed unnecessary ffi

* Fix for posix shm for nacl

* Dispatch for shmctl fixed

* Update shm count on exit

* Did the same thing for exec

* fixed pr comments

* Reverted excess newline

* Fixed shmdtret

Co-authored-by: lind <lind@nyu.edu>
* added check_select_read & check_select_write

* pipes support

* fixed syntax

* fixed errors

* fixed reading only if pipe full

* fixed warnings

* made requested changes

* cleaned up check_select_write()

Co-authored-by: lind <lind@nyu.edu>
* Cleaned up a bunch of refcount code

(cherry picked from commit b45857b)

* Linkcount cleanup on failure

(cherry picked from commit 210af85)

* added comment

* Removed extra whitespace
…150)

* Moved mutexes into rustposix to make them behave correctly

* Spaced out interface raw functions
* Fixed truncate, added ftruncate, put in dispatcher

* Explanatory comment, underscores

* Removed joke
* remove pipetable, add to fds

* make pipe insertion multi line
* remove cagetable, move to unsafe vector

* move unsafe to interface

* move unsafe to interface

* move unsafe to interface

* fix exec

* collect cages on exit

* collect cages on exit
* initial table commit

* compilation fixes

* pass fs and pipe tests

* merge

* fix deadlocks and remove warnings

* merge

* drop inode earlier to prevent deadlock pt2

* PR fixes for jonathan

* PR fixes for jonathan 2
* impl libc shutdown

* add new connection states

* add new connection states

* add new connection states

* Sockobj implemented for all except innersocket changes

* Debugging fs_tests and net_tests

* Fixed creation of inner socket before connect

* net_tests runs successfully

* Several fixes to net calls, socket structure

* Got all tests to work

* Added requested PR comments

* Further comment

Co-authored-by: Nicholas Renner <nicholassrenner@gmail.com>
* impl libc shutdown

* add new connection states

* add new connection states

* add new connection states

* Sockobj implemented for all except innersocket changes

* Debugging fs_tests and net_tests

* Fixed creation of inner socket before connect

* net_tests runs successfully

* Several fixes to net calls, socket structure

* Got all tests to work

* Added requested PR comments

* Further comment

* REUSEADDR on socketpair

* Add comment

Co-authored-by: Nicholas Renner <nicholassrenner@gmail.com>
* implement epipe

* fix blocking read
* add cancel point interface

* add cancel point interface

* add cancel point interface

* add cancel point interface

* implement cancel points

* implement cancel points

* implement cancel points

* refactor cancellation

* refactor cancellation

* refactor cancellation

* merge develp and add recv cancel point

* merge develp and add recv cancel point

* add cv cancellation

* add cv cancellation

* add cv cancellation

* refactor cancel funcs

* more comments
* quick io

* quick io

* quick io

* comments
* add sched yield

* add sched yield

* add sched yield

* yield on full

* add to interface
* fix recv loop for blocking sockets

* fix recv loop for blocking sockets

* drop sockhandle for recv loop

* drop sockhandle for recv loop
* remove cancel point from inside pipe, move to fs_calls

* remove cancel point from inside pipe, move to fs_calls
* Adding Fchdir and Mknod

* Fixed Error Descriptions

* Necessary changes have been made

* Update fs_calls.rs

* Editor Problem Fixed, Comment lines added

* Created a new function 'pathnamefrominodenum'

* Update filesystem.rs

* Correct comment lines added

---------

Co-authored-by: lind <lind@nyu.edu>
* Fixed AdvisoryLock::unlock.

* Fixed formatting.

* Removed redundant if check; added comments.
* Adding Fchdir and Mknod

* Fixed Error Descriptions

* Necessary changes have been made

* Update fs_calls.rs

* Editor Problem Fixed, Comment lines added

* Created a new function 'pathnamefrominodenum'

* Update filesystem.rs

* Correct comment lines added

* Update dispatcher.rs

* Update dispatcher.rs

---------

Co-authored-by: lind <lind@nyu.edu>
* add getpid getppid test

* call the getpid test
…#182)

* Add fstatfs test

* Add fstatfs test

* Add fstatfs test

* Update fstatfs test

* Only remain fs tests

* Only remain fs tests

* Add pipe2 test

* Add epoll tests

* Update epoll test

* Only net tests

* Update epoll test

* Update epollin type

* Update epoll test

* Change EPOLLevent type

* Variable name change

* Only remain net test

* update pipe_test

* Comment epoll

* Comment epoll

* uncomment

* comment epoll

* comment ut_lind_fs_chmod

* test only simple test

* only fstatfs

* add networking test and only bind

* only net

* Modify cage creation

* Try to make creation work

* Add epoll for test

* epoll_create

* delete mut at 1516

* Uncomment all other tests

* modify open in epoll test

* try make other fs work

* make all fs test work

* try all fs test work

* make pipe test work

* Delete unrelated comment

* remove whitespace

* remove whitespace
* first try add check

* apply check to all

* apply check to all

* change tmp to checkedfd
* add semaphore

* add semaphore

* add semaphore

* add semaphore

* add semaphore

* add semaphore

* change to loop

* copy from atomicU32

* copy from atomicU32

* copy from atomicU32

* copy from atomicU32

* copy from atomicU32

* copy from atomicU32

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* test sem

* comment sem

* comment sem

* comment sem

* comment sem

* test 2 process sem

* test 2 process sem

* test 2 process sem

* test 2 process sem

* test 2 process sem

* test 2 process sem

* test 2 process sem

* test 2 process sem

* test 2 process sem

* modify sem

* modify sem

* modify sem

* modify sem

* modify sem

* modify sem

* modify sem

* modify sem

* modify sem

* modify sem

* modify sem

* modify sem

* modify sem

* modify sem

* modify sem

* shared implementation, need to debug

* fix borrowing and semantic errors

Signed-off-by: RusherRG <rushang101@gmail.com>

* shared implementation, need to debug

* fix lock

* fix lock

* fix params

* add sem_trywait/sem_timedwait

* add sem_trywait/sem_timedwait

* test sem_trywait/timedwait

* fix references

* fix references

* test sem_trywait/timedwait

* fix address option

* test sem_trywait/timedwait

* test sem_trywait

* test para

* test para

* test para

* test para

* test para

* test para

* test para

* test para

* test para

* fix errno test

* fix errno test

* test add value check

* test add value check

* test add value check

* test sem_post

* test sem_post

* test sem_post

* test sem_post

* test sem_post

* test sem

* test sem

* test sem

* test sem

* test sem

* fix: copy semaphore table to child cage even when pshared is zero

Signed-off-by: RusherRG <rushang101@gmail.com>

* refactor: remove use of enumerate

Signed-off-by: RusherRG <rushang101@gmail.com>

---------

Signed-off-by: RusherRG <rushang101@gmail.com>
Co-authored-by: Yaxuan-w <wenyaxuan0925@outlook.com>
Co-authored-by: RusherRG <rushang101@gmail.com>
* fix: refactor the implementation of RustSemaphore to use Mutex<u32> instead of Atomicu32

Signed-off-by: RusherRG <rushang101@gmail.com>

* refactor: use if/else instead of return/break

Signed-off-by: RusherRG <rushang101@gmail.com>

* chore: add comments to struct RustSemaphore

Signed-off-by: RusherRG <rushang101@gmail.com>

---------

Signed-off-by: RusherRG <rushang101@gmail.com>
RusherRG and others added 13 commits March 28, 2024 14:56
Signed-off-by: RusherRG <rushang101@gmail.com>
* clone semaphores for threaded access

* clone semaphores for threaded access
* change the argument of dup2_helper

* fix: remove drop filedesc_enum

Signed-off-by: RusherRG <rushang101@gmail.com>

* update

* changes for the comments

* fix typo

---------

Signed-off-by: RusherRG <rushang101@gmail.com>
Co-authored-by: RusherRG <rushang101@gmail.com>
* adding tmp dir

* fix cagetable ref

* fix cagetable ref

* fix cagetable ref

* fix cagetable ref

* fix cagetable ref

* moving clear cage table after cleartmp in lindrustfinalize

* adding tmp test

* cleaning

* removing space

* changes

* changes

* removing space

* cleaning imports

---------

Co-authored-by: lind <lind@nyu.edu>
Co-authored-by: Nicholas Renner <nicholassrenner@gmail.com>
* Fsync implementation

* Deleting Useless Files

* Little Changes about Comment Lines

* Adding fdatasync

* Delete unnecessary files

* Delete gen_netdevs

---------

Co-authored-by: lind <lind@nyu.edu>
* Fsync implementation

* Deleting Useless Files

* Little Changes about Comment Lines

* Adding fdatasync

* Delete unnecessary files

* Delete gen_netdevs

* Adding sync_file_range

* Change as an off_t

* Necessary changes for sync_file_range

* Last Changes

* Update file.rs

* Update file.rs

* Fixing Error Handling

* Changes for Error Handling

* Remove Unnecessary Variables in Error Handling

* Implementing from_discriminant

* Update fs_calls.rs

---------

Co-authored-by: lind <lind@nyu.edu>
* refactor open

* refactor open

* fix fd type

* fix fd type

* fix fd type

* fix fd type

* fix fd type

* fix: init FS_METADATA.nextinode value to the max inode number

Signed-off-by: lind <lind@nyu.edu>

* fix: init max_inodenum and rust_max import

Signed-off-by: lind <lind@nyu.edu>

---------

Signed-off-by: lind <lind@nyu.edu>
Co-authored-by: RusherRG <rushang101@gmail.com>
* saving

* before switch to develop

* Remove redundant code for alarm

* Make interval timer work for exec syscall

* some changes for ipc debugging

* Add and remove comments

* update close

* lines in ipc_test

* accept change

* accept

* changes

* fixes for ipc_tests to pass

* getting rid of print lines

* changes that let nbuds and unixgetsockname tests work

* Add Sigprocmask Syscall (#168)

* Add sigprocmask syscall

* Fix 'how' numbers and return type

* Make new processes inherit the sigset

* Make SigactionStruct.sa_mask u64

* Add sigsetops and create SigsetType type alias for u64

* Remove and fix stale code

* Add comments

* Implement SIGCHLD and SIGPIPE (#169)

* Add SIGCHLD and SIGPIPE implementation

* Minor refactor

* Rename kill_inner to lind_kill

* Define signal numbers as constants

* add pending signal functions

* add pending signal functions

---------

Co-authored-by: Nicholas Renner <nicholassrenner@gmail.com>

* update id mechanism

* some changes

* changes

* more changes

* fixing error

* cleaning

* cleaning

* cleaning

* cleaning

* fix fork hanging

* weird

* update pending signal for threads

* changes

* test bool

* test bool

* fixed warnings and scud2

* Added fixes for signal dispatch

* check in hash set

* fixes

* cleaning

* cleaning

* cleaning

* cleaning

* cleaning

* adding socketpair test

* manually merging coulson's changes

* push

* fix recv loop

* recv loop for udp

* drop sockhandle for recv loop

* fixing net_calls for networking tests

* getting rid of commented stuff

* recv common read locks

* recv common read locks

* before merge

* refactor recv

* pulling out of loop

* if lets to unwraps

* fix shutdown

* removing warnings

* spacing fixes

* comments

* PIPE_CAPACITY TO UDSOCK_CAPACITY

* cleaning and comments

* if statement to match

* removing weird spaces and uncommenting things

* fixing weird indenting

* weird commented line and extra spaces removed

* more cleaning

* add pending signals for sigprocmask

* add pending signals for sigprocmask

* add pending signals for sigprocmask

* add pending signals for sigprocmask

* add pending signals for sigprocmask

* return to program if signal blocked

* add signal flag

* remove signal flag

* fix sigaction

* fix sigaction

* fix sigaction

* update refactor

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* add back in signal flag

* add test flag

* add back in signal flag

* add back in signal flag

* fixing PR issues

* fixing typo

* update

* fixing "the bug"

* fix

* swap error order

* sigkill fixes

* sigkill fixes

* sigkill fixes

* fix fork deadlock

* merge develop

* merge develop

* change the oldfd of dup2_helper into filedesc_enum

* remove extra TEST variable initialization

Signed-off-by: lind <lind@nyu.edu>

* add listen case for domain socket select, fix blocking error in connect

* fix merge conflicts

Signed-off-by: RusherRG <rushang101@gmail.com>

* update select listen uds

* update select listen uds

* update

* update

* update

* update

* update

* update

* update

* update

* update

* rm closed fds from epoll

* rm closed fds from epoll

* change test name

* change test name, comments

* fix warning

* add comments, fix TEST variable

* fix ipc tests

* fix ipc tests

* fix ipc tests

* update

* update

* fix constants

* more comments

* add cage checks

* add cage checks

* add cage checks

* add cage checks

* add cage checks

* optimized select by removing hashmaps

* using bitmaps in poll

* fix type

* small fix

* comment out select test

* update

* update

* not done need to see better

* checking

* checking

* almost

* changes

* changes

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* fix PR comments

* update

* Hashset to bitmap (#201)

* optimized select by removing hashmaps

* using bitmaps in poll

* fix type

* small fix

* comment out select test

* update

* update

* not done need to see better

* checking

* checking

* almost

* changes

* changes

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* fix PR comments

* update

---------

Co-authored-by: lind <lind@nyu.edu>

* merge

* merge

* update

* update

* Hashset to bitmap (#202)

* update

* select read from old fds, edit on new fds

* update fd_set_new_copy

* ptr::copy specify types

* add assertion for debug

* still debugging

* debuging

* debugging

* debugging

* select work on empty fdsets

* refactor fd_set_copy and cleanup

* more cleanup for select

---------

Co-authored-by: Yizhuo Liang <yizhuo.liang.hello@gmail.com>

* tls pending skeleton

* tls pending skeleton

* tls pending skeleton

* tls pending skeleton

* fix merge conflict

* make select use read locks

* poll/select performance improvements

* poll/select performance improvements

* fix warnings

* pending connection try 2

* pending connection try 2

* pending connection try 2

* pending connection try 2

* pending connection try 2

* pending connection try 2

* pending connection try 2

* pending connection try 2

* pending connection try 2

* fix listen

* fix listen

* fix listen

* fix listen

* change back to tuple

* change back to tuple

* change back to tuple

* fix test

* unix address type fix

* unix address type fix

---------

Signed-off-by: lind <lind@nyu.edu>
Signed-off-by: RusherRG <rushang101@gmail.com>
Co-authored-by: lind <lind@nyu.edu>
Co-authored-by: Tian(Maxwell) Yang <maxwell_yang@outlook.com>
Co-authored-by: Tian Yang <31149339+AlpacaMax@users.noreply.github.com>
Co-authored-by: jesings <34111484+jesings@users.noreply.github.com>
Co-authored-by: Yizhuo Liang <yizhuo.liang.hello@gmail.com>
Co-authored-by: RusherRG <rushang101@gmail.com>
Co-authored-by: Yizhuo Liang <70337586+yizhuoliang@users.noreply.github.com>
* rewrite FdSet and it's uses

* FdSet init from raw fd_set

* attempt to fix borrowing, kernel_select nonblocking

* attempt continued

* fix is_set

* attempt to fix borrow checking within select

* fix in-select borrow, fix warnings

* cleanup

* fix a warning

* fix serious typo

* fix typo

* debugging

* debugging

* prints

* prints!!

* debugging

* debugging

* debugging

* debugging

* debug

* debuging

* update

* debug

* debug

* debug

* debug

* debug

* cleanup and refactor

* fixing the nfds parameter for kernel select

* rawfd in socketdesc

* rawfd in socketdesc

* rawfd in socketdesc

* rawfd in socketdesc

* rawfd in socketdesc

* rawfd in socketdesc

* rawfd in socketdesc

* rawfd in socketdesc

* rawfd in socketdesc

* rawfd in socketdesc

* rawfd in socketdesc

* rawfd in socketdesc

* increase timeout

* change gettimeofday log level

* migrate FdSet, nodelay getsockopt, accept rawfd

* small fix

* store rawfd in acpt/lst/cnct, fix INPROGRESS

* fix ownership

* of course domain sockets don't have raw_sys_fd

* fix warnings

* fix warnings

* small coding style fixes

* add blank line

* add TCP level options

* getsockopt tcp without kernel

* add FdSet::clear back for tests

* fix warnings

* fix warning

* revert select sleep

* fix PR suggestions

* refactor kernel select logic

* reorganize

* update

---------

Co-authored-by: Nicholas Renner <nicholassrenner@gmail.com>
@rennergade rennergade requested a review from yashaswi2000 March 28, 2024 19:55
@rennergade rennergade merged commit ceb40f2 into main Mar 28, 2024
1 check failed
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.

7 participants