We switch from the chromeos-5.10 kernel with crostini configs
to a stripped down config building the mainline 6.1 branch.
This allows us more control over the guest kernel for testing
and significantly speeds up e2e tests (~4s -> 1.2s for all
tests run with nextest).
The rootfs is switched to Debian as that's what we use elsewhere
which makes this easier to maintain.
BUG=b:256652981
TEST=presubmit
Change-Id: Ib3897b8dbf3391eefdb1eedb69ec7555f4c77344
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4326888
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Most users are not the owner of /dev/kvm, but have access to it
via group permissions.
To ensure that we get the same group permissions on the mounted
/dev/kvm device inside the container, we need to preserve groups
in the container namespace.
BUG=b:273335986
TEST=tools/dev_container --podman x86vm run
Change-Id: Ifb61e6e1ab9af9d237b3e17b9bda7535d16082b2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4341239
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This will allow devcontainer.json files to always use the latest
container without manually upreving the version.
BUG=b:273529589
TEST=open dev container in vscode
Change-Id: I71d58eb2936097bd81dfcc0872d362b2c6b9e388
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4341238
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Add get/set VCPU_EVENTS as required to snapshot the full state of the
VCPUs for suspend/resume.
BUG=b:266515147
TEST=build and run VM
Change-Id: Iabca21b67a0eb9906d2e639a616e3f0826dfa659
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4327459
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Elie Kheirallah <khei@google.com>
The virtio specification for the network device allows the driver to
negotiate two features related to queue counts:
- VIRTIO_NET_F_MQ enables use of more than one rx/tx pair
- VIRTIO_NET_F_CTRL_VQ enables an additional control queue
The crosvm implementation of virtio-net assumed that the driver would
support both of these features and neglected to check the result of the
feature negotiation process; this would result in the net device failing
to start if a driver did not enable the CTRL_VQ feature and did not
provide the extra queue required when that feature is enabled.
Additionally, if the driver did not negotiate the MQ feature, the device
would fail to start up if the maximum supported number of queue pairs
was greater than one.
Fix both of these issues by checking the features acknowledged by the
driver at activate() time and adjusting the expected number of queues
accordingly. As part of this change, the control queue becomes optional,
and the previous code used the presence of the control queue on a worker
thread to indicate whether to perform interrupt resampling work; this
change splits that into a separate handle_interrupt_resample flag passed
to the worker run() function so that the interrupt is resampled even
when the CTRL_VQ flag is not negotiated.
BUG=b:272536271
BUG=b:164505993
TEST=tools/dev_container tools/presubmit
Change-Id: I3dd65c7b134c75f5fc6881ed33c7b8df83c48c36
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4326887
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Dmitrii Merkurev <dimorinny@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Adds command line options to move the vGPU threads housed within crosvm
and the vGPUserver threads housed externally into separate cgroups.
This will give us the ability to perform some tweaks/experiments
with the affinity masks of these threads as a group.
BUG=b:269139377
TEST=Launch Borealis VM, ensure command line options work as expected.
Change-Id: I558673e616e0344bae2407db1ff693902816daac
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4304743
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Isaac Bosompem <mrisaacb@google.com>
The dev_container no longer has a --reset flag and instead uses --clean.
Updates docs to reflect this.
BUG=b:273389824
TEST=cq
Change-Id: Ic8bdf1900a19e525d1150ebc623ab9d6bd2eec09
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4337296
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Kameron Lutes <kalutes@chromium.org>
if a sidecar process does not gracefully unregister their listening
socket we should not keep it around forever.
BUG=b:269609274
TEST=crosvm run example-ubuntu-image
TEST=deploy to dut and launch crostini/arcvm
Change-Id: I2e620d97da8f63dc73c2432146273b112770ca84
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4308039
Commit-Queue: Maciek Swiech <drmasquatch@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
we currently store UnixSeqpacket sockets for registered event listeners
- this causes us to clone (and dup) each time we want to send info on
said packets. instead, store the tubes.
BUG=b:269609274
TEST=crosvm run example-ubuntu-image
TEST=deploy to dut and launch crostini/arcvm
Change-Id: Ifeab6d6beeebc8f9171f233e5e8d21aae6d6b9ab
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4308038
Commit-Queue: Maciek Swiech <drmasquatch@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This creates a makefile for rutabaga_gfx. Most package managers
seem to still use Cargo to compile, but not packagement. We need
to install headers and the library.
I looked into to cargo-c, but it was just easier to open code it.
BUG=b:173630595
TEST=sudo make install
export LD_LIBRARY_PATH=/usr/local/lib
make and run rutabaga_test
Change-Id: Ibd68ecd0c6215cc36bc104d843847ee47d02123e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4335238
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Nothing calls this code, so it should be okay to remove it.
BUG=None
TEST=tools/dev_container tools/presubmit
Change-Id: I5f079dc9e6e15178506b801b7266d8bd0351ddbb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4321329
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
The list of extensions was moved in the latest specs of devcontainer.json
BUG=b:273332464
TEST=This CL is submitted from a codespace
Change-Id: Icae494f8dc4e588f7b642de39f42e8923e245d46
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4338039
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
The overlapped wrappers on PipeConnection are unsafe, but they were
marked as safe. There are no actual unsafe production uses of them
because the conventions for overlapped IO generally make that hard to
do. That being said, these wrappers MUST be marked unsafe. This CL does
so and updates the callers with safety statements.
BUG=b:272812234
TEST=presubmit
Change-Id: I0def7056431d5b3b70eb4ce7c6ac8b44aef0a4cc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4330490
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
Following the addition of an overlapped capable executor, here is the
experimental overlapped IO source. This is how we'll request overlapped
IO that runs on the overlapped executor. This isn't ready for production use
quite yet, but it's something we'll want in the future.
BUG=b:272614458
TEST=presubmit
Change-Id: Iaa97cf70924334dbe82d4562f43c0daf8888cb35
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4328234
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
This is a first step towards using overlapped IO (truly async IO) on
Windows. Dead code allows are removed in the next CL, which adds the
OverlappedSource.
BUG=b:272614458
TEST=presubmit
Change-Id: I19e20e957462357cecdabc08757ed44ea662767e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4326943
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
In the future we'll be using read/write wrappers in multiple places,
but the wrapping code currently lives in the named pipe implementation.
This CL pulls it out to its own module. It also brings in some other
code in win_util that wasn't upstreamed.
BUG=b:272614458
TEST=presubmit
Change-Id: I6871f3db6991336f42706652b69935755bf2fbc3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4326942
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
--pstore is another flag that creates a shared mapping in the IPA space,
so forbid using it with MTE.
Bug: b:234779841
Change-Id: I2d440e7747eabeeb75a51ec6a2098d9ba6c22765
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4337396
Auto-Submit: Peter Collingbourne <pcc@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
As you can see in the doc comment of `Lazy::force()`, `Lazy::force()`
"is equivalent to the `Deref` impl, but is explicit".
BUG=none
TEST=manual test
Change-Id: I77b5e6ab1985e7efe1bdb86eefb5271438c451fa
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4333208
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
This CL renames some functions and variables introduced for PCI BAR
reprogramming to avoid confusion.
Test: presubmit tests.
Bug: b:271204121
Change-Id: I77aaca123a677b56da0b45ce78a54e84bec64a59
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4332623
Commit-Queue: Ningyuan Wang <ningyuan@google.com>
Reviewed-by: Hugo Benichi <hugobenichi@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
The seccomp policies are located in the `jail` crate now. Fix the
include path.
BUG=None
TEST=mdbook build
Change-Id: I40049248c83c060c98925b61991d6a83c379b9c3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4335147
Reviewed-by: Shin Kawamura <kawasin@google.com>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
This will be necessary for the next CL, which introduces a closure that
cannot be make generic. Additionally the handler is used at a low
frequency and this limits the amount of generated code (2 generic
parameter leads to a potential explosion of monomorphized methods).
BUG=b:217480043
TEST=send data between the host and a VM connected to a vhost-user vsock device using socat.
TEST=send data between a VVU vsock device inside a device VM and another guest using socat.
Change-Id: Ie5946772a5f21f2c0dd289875a562abbccff6db4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4222843
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The worker thread handle was part of the State object, and when the
worker thread was exiting, it would change the state from State::Running
(which contained the WorkerThread) to another state, causing that
WorkerThread instance to be dropped. The Drop handler of WorkerThread
joins the thread, which is illegal when called from within the thread
itself, so this caused an EDEADLK error and a panic.
Move the WorkerThread to the top-level VirtioVhostUser structure, which
is only accessible from the main thread, to avoid this problem.
BUG=b:267980534
TEST=Shut down Crostini on brya-manatee
Change-Id: I7dfca3e0a92c97bbd5aad2c48da191b0b1b30461
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4330489
Reviewed-by: Tomasz Nowicki <tnowicki@google.com>
Commit-Queue: Tomasz Nowicki <tnowicki@google.com>
Instead of wiring up a channel ahead of time, set one up on demand. This
significantly reduces the amount of plumbing required. We'll need more
VcpuControl cases in the near future that require responses like this
(e.g. vcpu snapshotting and restoring) and the extra plumbing for each
in unpalatable.
It isn't obvious what the performance difference is and we don't have a
relevant benchmark. None of the use cases are particularly performance
sensitive yet.
BUG=b:232437513
Change-Id: I96e720065275894ac0eb2965d5f707ec57b19c64
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4326945
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Elie Kheirallah <khei@google.com>
Upstreams blocking overlapped read/write commmands to base.
These funtions will be used by the broker to forward messages exchanged
between main and service.
Bug: 269191436
Test: none
Change-Id: I029e8c440bb6b8234fe2d1ca3b1dd5ddb408d814
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4329913
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
The logic is the same as the existing reset() implementation, but it
also returns the queues with the spec-defined queue indexes.
BUG=b:232437513
TEST=tools/dev_container tools/presubmit
Change-Id: I242ec24fe0fb2207ab097888495e5a92697571e5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4262518
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
crrev.com/v/4237140 was reverted in crrev.com/c/4310064 due to the
generated header file not defining the RegisteredEvent type. along with
re-reverting the original cl (and corresponding bugfix cl) this patch
introduces a RegisteredEventFfi type which mirrors the original
RegisteredEvent type but should be exposed in the generated header file.
BUG=b:269609274
TEST=sidecar process (patch: crrev.com/c/4276642)
TEST=cargo build, header file inspection
Change-Id: I4a17163e36eb466a540a72d2bb4356419739c974
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4311831
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Maciek Swiech <drmasquatch@google.com>
This reverts commit 42a437de5e.
Reason for revert: This is crashing if no_rtc is set (http://go/bbid/8787052669966742145/test-results)
Original change's description:
> devices: cmos: implement rtc alarm
>
> Implement CMOS alarm functionality. This allows guests to set rtc
> alarms, which is useful when putting a Linux guest into s2idle.
>
> This change allocates a dedicated interrupt for the goldfish battery,
> instead of reusing the sci irq. Sharing an irq line between a wakeup
> interrupt and a non-wakeup interrupt doesn't work well because the
> non-wakeup interrupt won't be delivered to its driver while the driver
> is suspended, which results in the irq being permanently asserted.
> Simply using a dedicated interrupt for the goldfish battery is much
> easier than adding suspend/resume support to the Linux driver.
>
> BUG=None
> TEST=cargo test -p devices cmos, manual tests w/rtcwake
>
> Change-Id: I757acc64b61e414d5d9df5a1fb4770943ef985bf
> Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4314184
> Reviewed-by: Elie Kheirallah <khei@google.com>
> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
> Commit-Queue: David Stevens <stevensd@chromium.org>
Bug: None
Change-Id: I25737095f84ca0b56d94924a9d8ccb5fd42ff51c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4329909
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This CL adds trait implementation for PciDevice to handle BAR
reprogramming. When BAR reprogramming is detected, the PciDevice checks
all ioevents needed, and requests ioevent registeration for events that
are in the changed domain. The requests are handled by instances of
PciDevice via the trait function ioevent_register_request.
Before the CL, ioevent re-registering is unhandled, and PciDevice is
broken without notification. After CL, an error message will appear, but
device still would not function as the added trait is not implemented.
Test: Presubmit Tests. Hotplugged virtio device triggers error
IoEventNotSupported as expected.
Bug: 271204121
Change-Id: Ibf4bc00cfdce24e508cd50b5009f148c5a49db30
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4310071
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Ningyuan Wang <ningyuan@google.com>
Make StreamSourceGenerator as an attribute of VirtioSnd struct. It can
be used to hide backend related field from VirtioSnd. For example when
we have File Backend, we can put the file descriptor in
StreamSourceGenerator, instead of VirtioSnd.
This commit also removes params field from VirtioSnd as it is no longer
used. Test code that still uses params field, like test_virtio_snd_new
is refactored.
BUG=b:233542268
TEST=emerge and call aplay from the vm
Change-Id: I0720c8430f5fbe26830ef141db6dd06b047494eb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4306258
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Commit-Queue: Norman Bintang <normanbt@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Sometimes the blocking pool worker thread wouldn't start the blocking
task in time before the shutdown sequence. Now it uses a channel to wait
for it to start.
Also, the test took 10 seconds (BlockingPool::shutdown timeout) and
leaked a thread. Now it uses a channel to cleanly shutdown the thread.
Takes 20 ms on my machine. I've verified that the test still fails for
the old, leaky detach implementation.
BUG=b:272587712,b:270986145
Change-Id: Ibcc39a7129deaabbfed8023276da8c6dc48605bc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4327466
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This CL adds an initial implementation of trace points for
passthroughfs and also adds an initial stub for tracing our fuse server
implementation too.
BUG=b:261641906
TEST=ran crosvm with virtiofs and saw trace points being hit
Change-Id: I88502f33997db0030c53405b5f9fbed84aabc773
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4110129
Reviewed-by: Christian Blichmann <cblichmann@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Morg <morg@chromium.org>
Currently crosvm's boot time on x86 is heavily impacted by TSC
calibration, especially on nested-virtualization environment.
TEST=pending
Change-Id: Iadb0b35185172a3e10d5435ff0c8030cf18004d2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4326893
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Zihan Chen <zihanchen@google.com>
We occasionally see CI jobs fail due to network flakiness when
downloading prebuilts or the test vm image.
Retry both. This covers:
- Test VM images (i.e. the aarch64 vm image for testing)
- e2e_test guest images
- prebuilt libraries for win64 builds
BUG=b:248568518
TEST=dev_container tools/presubmit
TEST=dev_container --clean tools/presubmit
Change-Id: I8e5e185b17738182738bfcc4420890b925871fde
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4322030
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
use of `unaligned_references` will be blocked soon and spits out a
warning during compiling. fix it in haxm.
Test: Compiled and ran with haxm enabled.
Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Change-Id: Ia887cff1ce01e6c14a9cf4978bf49835e996dd5a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4324279
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>