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

Add Vmmap to RawPOSIX #46

Open
4 of 9 tasks
Yaxuan-w opened this issue Nov 19, 2024 · 1 comment
Open
4 of 9 tasks

Add Vmmap to RawPOSIX #46

Yaxuan-w opened this issue Nov 19, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request RawPOSIX RawPOSIX related issue

Comments

@Yaxuan-w
Copy link
Member

Yaxuan-w commented Nov 19, 2024

Implementing VMMAP in RawPOSIX

Add current code into RawPOSIX

  • Add current VMMAP implementation into RawPOSIX (each cage structure has vmmap) - @Yaxuan-w
  • Add comments - @ruchjoshi-nyu

Integration

Address picked by host calling vmmap, then use this addr to call kernel mmap, a function before mmap in dispatcher to check and pick addr for vmmap

All translation about address should be done in dispatcher stage. Including all functions related to pointers — handle situations depends on flags

Test

Here's the syscall with pointer list generated by @ChinmayShringi

// Uses pointers
getcwd_syscall       // getcwd_syscall(&self, buf: *mut u8, bufsize: u32) -> i32
read_syscall         // read_syscall(&self, virtual_fd: i32, readbuf: *mut u8, count: usize) -> i32
write_syscall        // write_syscall(&self, virtual_fd: i32, buf: *const u8, count: usize) -> i32
ioctl_syscall        // ioctl_syscall(&self, virtual_fd: i32, request: u64, ptrunion: *mut u8) -> i32
mmap_syscall         // mmap_syscall(&self, addr: *mut u8, len: usize, prot: i32, flags: i32, virtual_fd: i32, off: i64) -> i32
munmap_syscall       // munmap_syscall(&self, addr: *mut u8, len: usize) -> i32
getdents_syscall     // getdents_syscall(&self, virtual_fd: i32, buf: *mut u8, nbytes: u32) -> i32
send_syscall         // send_syscall(&self, virtual_fd: i32, buf: *const u8, buflen: usize, flags: i32) -> i32
sendto_syscall       // sendto_syscall(&self, virtual_fd: i32, buf: *const u8, buflen: usize, flags: i32, dest_addr: &GenSockaddr) -> i32
shmat_syscall        // shmat_syscall(&self, shmid: i32, shmaddr: *mut u8, shmflg: i32) -> i32
shmdt_syscall        // shmdt_syscall(&self, shmaddr: *mut u8) -> i32
pread_syscall        // pread_syscall(&self, virtual_fd: i32, buf: *mut u8, count: usize, offset: i64) -> i32
pwrite_syscall       // pwrite_syscall(&self, virtual_fd: i32, buf: *const u8, count: usize, offset: i64) -> i32
getifaddrs_syscall   // getifaddrs_syscall(&self, buf: *mut u8, count: usize) -> i32
writev_syscall       // writev_syscall(&self,virtual_fd: i32,iovec: *const interface::IovecStruct,iovcnt: i32,) -> i32
recv_syscall         // recv_syscall(&self, virtual_fd: i32, buf: *mut u8, buflen: usize, flags: i32) -> i32
recvfrom_syscall     // recvfrom_syscall(&self, virtual_fd: i32, buf: *mut u8, buflen: usize, flags: i32, addr: &mut Option<&mut GenSockaddr>) -> i32
getsockopt_syscall   // getsockopt_syscall(&self, virtual_fd: i32, level: i32, optname: i32, optval: *mut u8, optlen: *mut u32) -> i32
setsockopt_syscall   // setsockopt_syscall(&self, virtual_fd: i32, level: i32, optname: i32, optval: *const u8, optlen: u32) -> i32
gethostname_syscall  // gethostname_syscall(&self, name: *mut u8, len: isize) -> i32
select_syscall  
epoll_wait
poll_ctl
@Yaxuan-w Yaxuan-w added enhancement New feature or request RawPOSIX RawPOSIX related issue labels Nov 19, 2024
@rennergade
Copy link
Contributor

We should double check the above list, I think things like poll pipe and socketpair all also use addresses, may be more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request RawPOSIX RawPOSIX related issue
Projects
None yet
Development

No branches or pull requests

3 participants