Commit graph

18 commits

Author SHA1 Message Date
Daniel Verkamp
c7813cb229 docs: book: update architecture docs
This cleans up some of the more egregiously outdated information, but
it could probably use a more thorough rewrite at some point.

Change-Id: I6a1f440f9e9500ae85d0c93cb6b1123e3f1ba3c1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4578297
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Zihan Chen <zihanchen@google.com>
2023-06-01 22:37:17 +00:00
Shintaro Kawamura
8cdbfb3f02 jail: create jail crate from jail_helpers.rs
Creates the jail create and move all policy files and helper methods to
the crate to make jail helpers available to outside of the main crate
(i.e. swap crate).

This also move devices::Minijail and JailConfig to jail crate.

BUG=b:258351526
TEST=cargo build

Change-Id: If9a148bdb3b18f8b746875d47d1077fb17707c18
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4230456
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2023-02-14 00:24:55 +00:00
Daniel Verkamp
ac0fc378a3 Fix remaining Chrome/Chromium OS instances
These should be written as ChromeOS and ChromiumOS (without the space)
to match the updated branding. The copyright headers were already
migrated to the new style (https://crrev.com/c/3894243), but there were
some more instances left over.

BUG=None
TEST=tools/cargo-doc

Change-Id: I8c76aea2eb33b2e370ab71ee9b5cc0a4cfd00585
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4129934
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-01-03 22:14:30 +00:00
Dennis Kempin
009cb53c76 Rename integration_tests to e2e_tests
Cargo already uses the term 'integration test' for tests living
in the tests/ directory of a crate.

To prevent confusion, rename our 'integration_tests' crate to
'e2e_tests'.

BUG=None
TEST=presubmit

Change-Id: Icfa819eaed08be54ab0f36092f1ba367f3f1ce88
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004977
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
2022-11-03 22:49:39 +00:00
Daniel Verkamp
0076579e95 arch: allocate reserved PCI addresses first
Add a new PciDevice::preferred_address() function, which allows devices
to report a PCI address where they would prefer to be allocated.

This lets the arch layer pick out the devices that need to have their
addresses reserved before allocating the remaining addresses to device
that don't care about their assigned PCI address.

For now, the returned preferred_address value is not actually used aside
from checking is_some(), but it will be used in upcoming cleanups.

BUG=b:237415650
TEST=Run x86-64 bzImage

Change-Id: Ia323274dcf801a8fe1959287bcc791ca32ce4e18
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3781441
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-08-01 18:57:44 +00:00
Daniel Verkamp
8930ba079f crosvm: update book and doc links to crosvm.dev
Replaced using this script:

git grep -l 'https://google.github.io/crosvm' \
 | xargs -n1 sed -i \
 -e 's^https://google.github.io/crosvm/doc/^https://crosvm.dev/doc/^g' \
 -e 's^https://google.github.io/crosvm/^https://crosvm.dev/book/^g'

BUG=None
TEST=mdbook build doc/book

Change-Id: I8df4e0bcc1ca1e9044df29998572393c934e29cc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3795005
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-07-29 22:54:01 +00:00
Daniel Verkamp
d4505a7f1c base: replace PollToken with EventToken tree-wide
Pull the declaration of the `EventToken` enum up to the top level of the
base crate, replacing the identical implementations inside sys/windows
and sys/unix.

Use the `EventToken` name consistently throughout the tree to remove the
unix-flavored "poll" nomenclature.

BUG=b:213153157
TEST=tools/dev_container tools/presubmit --all

Change-Id: I0ba42037b533b796797a7a3f6d8d7e71a5592aba
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3642673
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
2022-06-02 22:30:38 +00:00
Andrew Walbran
d4bfea4bb9 Document memory layout.
Change-Id: I3ddd6b355a77527063886065ab2c576364709fc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3627453
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Andrew Walbran <qwandor@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Andrew Walbran <qwandor@google.com>
2022-05-06 12:09:40 +00:00
Daniel Verkamp
91c757e648 docs: rewrite PollContext architecture section to WaitContext
Describe the cross-platform abstraction from base rather than the
Linux-specific PollContext/EpollContext.

BUG=None
TEST=read mdbook output

Change-Id: I5733913d389b222fdbdcee39c3554435524c46ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3625928
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-05-05 18:18:40 +00:00
Daniel Verkamp
55a5b54bf2 base: clean up vestigal sys_util references
The sys_util crate has been merged into base, but a few places still
refer to the old name. Fix or remove them as appropriate.

BUG=b:227226222
TEST=tools/presubmit --all

Change-Id: Icf9b57aff672b7c1afec768c9694e059f0f9a43d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3621205
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-05-02 20:16:18 +00:00
Alexandre Courbot
c7cd0e0114 Move libvda to media/libvda
As we are going to introduce more media-related crates, reserve the
"media" folder as a placeholder for them, starting with the existing
libvda.

BUG=b:169295147
BUG=b:214478588
TEST=cargo build --features "video-decoder,video-encoder,libvda"

Change-Id: I1b2ec65cbba8b735db3d19845c504546fa1c64ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3565623
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2022-04-06 01:19:07 +00:00
Steven Moreland
a7415e04bd ARCHITECTURE.md: fix repeated word typo
Bug: N/A
Test: N/A
Change-Id: Ibd4b4077eb0e9c83e0907fbb63d05642f6684f9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3488163
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Steven Moreland <smoreland@google.com>
2022-02-25 22:41:16 +00:00
Anton Romanov
5acc0f52f5 linux: split out linux mod into multiple
At nearly 4k loc its harder to maintain. This change only moves some
things around without changing any code. Input on symbol visibility is
welcome - in reality it doesn't really matter if symb is
pub/pub(super)/pub(crate) as mods themselves are private to linux mod.
I plan to invest more into splitting things apart if possible
(especially the main loop) but its a start

TEST=./tools/presubmit
BUG=n/a

Change-Id: I2792dd0acdb5627f1c9b5d0fb998c976c6fe5e15
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3422266
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Anton Romanov <romanton@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
Auto-Submit: Anton Romanov <romanton@google.com>
2022-01-28 23:07:01 +00:00
Dennis Kempin
6b06f405ff docs: Use mdformat to format markdown files
The tool is added to ./tools/fmt which will be called during
./tools/presubmit as well as by Kokoro during testing.

This requires a new dev container version to bundle the mdformat
tool in the container.

Note: mdformat does not have any IDE integrations, but the prettier
plugin with prose-wrap enabled and a line length of 100 provides
almost identical results.

BUG=None
TEST=./tools/fmt --check

Change-Id: I0ae5659eff8555df7c85c70e62095a1e116b98da
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3416098
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-01-27 21:29:11 +00:00
Junichi Uekawa
c14da943eb crosvm: Add a note that MemoryMapping does RAII.
BUG=None
TEST=None

Change-Id: Ie2bf320fd08ab8d52fc3071e825fec91dcb12551
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3267908
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2021-11-30 09:24:16 +00:00
Keiichi Watanabe
48903bc8ee ARCHITECTURE: Update code map
Add explanation on several components I'm a bit familiar with.

BUG=b:195003973
TEST=none

Change-Id: I7c4c6ebc266ae40dadfb984e9dff8016efe6ab73
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3188676
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2021-09-30 11:44:32 +00:00
Keiichi Watanabe
d38a34c038 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 <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2021-09-29 16:19:51 +00:00
Keiichi Watanabe
909d7f3c05 docs: Add ARCHITECTURE.md
It's a common idea to have ARCHITECTURE.md next to README.md and
CONTRIBUTING.md [1].
So, let's do so instead of having the doc only under mdbook.

[1] https://matklad.github.io//2021/02/06/ARCHITECTURE.md.html

BUG=b:195003973
TEST=mdbook build

Change-Id: I8d3f479ba65c7f85865c51b5c22fb5b37d6e8f78
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3188675
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2021-09-29 16:19:50 +00:00
Renamed from docs/book/src/appendix/architectural_overview.md (Browse further)