From d38a34c038679385e5a06f60875fa0d8b2405d49 Mon Sep 17 00:00:00 2001 From: Keiichi Watanabe Date: Wed, 22 Sep 2021 00:25:32 +0900 Subject: [PATCH] docs: Move code map to ARCHITECTURE BUG=b:195003973 TEST=none Change-Id: Idfe9565354d661361010df91c83a9313d94462b2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3188674 Commit-Queue: Dennis Kempin Tested-by: kokoro Reviewed-by: Dennis Kempin --- ARCHITECTURE.md | 28 ++++++++++++++++++++++++++++ CONTRIBUTING.md | 31 ------------------------------- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 4462fcc488..7ce1ea2bf8 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -221,3 +221,31 @@ HANDLEs on Windows), a module is provided for sending and receiving descriptors alongside the plain old bytes that serde consumes. [minijail]: https://android.googlesource.com/platform/external/minijail + + +## Code Map + +Source code is organized into crates, each with their own unit tests. + +- `crosvm` - The top-level binary front-end for using crosvm. +- `devices` - Virtual devices exposed to the guest OS. +- `kernel_loader` - Loads elf64 kernel files to a slice of memory. +- `kvm_sys` - Low-level (mostly) auto-generated structures and constants for + using KVM. +- `kvm` - Unsafe, low-level wrapper code for using `kvm_sys`. +- `net_sys` - Low-level (mostly) auto-generated structures and constants for + creating TUN/TAP devices. +- `net_util` - Wrapper for creating TUN/TAP devices. +- `sys_util` - Mostly safe wrappers for small system facilities such as + `eventfd` or `syslog`. +- `syscall_defines` - Lists of syscall numbers in each architecture used to + make syscalls not supported in `libc`. +- `vhost` - Wrappers for creating vhost based devices. +- `virtio_sys` - Low-level (mostly) auto-generated structures and constants + for interfacing with kernel vhost support. +- `vm_control` - IPC for the VM. +- `x86_64` - Support code specific to 64 bit intel machines. + +The `seccomp` folder contains minijail seccomp policy files for each sandboxed +device. Because some syscalls vary by architecture, the seccomp policies are +split by architecture. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 625ea46ab7..52d2de11e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,34 +81,3 @@ The `use` statements for each module should be grouped in this order crosvm uses the [remain](https://github.com/dtolnay/remain) crate to keep error enums sorted, along with the `#[sorted]` attribute to keep their corresponding match statements in the same order. - -### Code Overview - -The crosvm source code is written in Rust and C. To build, crosvm generally -requires the most recent stable version of rustc. - -Source code is organized into crates, each with their own unit tests. These -crates are: - -- `crosvm` - The top-level binary front-end for using crosvm. -- `devices` - Virtual devices exposed to the guest OS. -- `kernel_loader` - Loads elf64 kernel files to a slice of memory. -- `kvm_sys` - Low-level (mostly) auto-generated structures and constants for - using KVM. -- `kvm` - Unsafe, low-level wrapper code for using `kvm_sys`. -- `net_sys` - Low-level (mostly) auto-generated structures and constants for - creating TUN/TAP devices. -- `net_util` - Wrapper for creating TUN/TAP devices. -- `sys_util` - Mostly safe wrappers for small system facilities such as - `eventfd` or `syslog`. -- `syscall_defines` - Lists of syscall numbers in each architecture used to - make syscalls not supported in `libc`. -- `vhost` - Wrappers for creating vhost based devices. -- `virtio_sys` - Low-level (mostly) auto-generated structures and constants - for interfacing with kernel vhost support. -- `vm_control` - IPC for the VM. -- `x86_64` - Support code specific to 64 bit intel machines. - -The `seccomp` folder contains minijail seccomp policy files for each sandboxed -device. Because some syscalls vary by architecture, the seccomp policies are -split by architecture.