this patch adds the crosvm_control command (and internal implementation)
to send a new WSS config command to a guest balloon driver. included is
a refactor of how wss op notifications are dispatched in the balloon
device.
BUG=b/271891148
TEST=run bzImage
TEST=socket-pinger program available at https://x20.corp.google.com/users/dr/drmasquatch/socket-pinger
Change-Id: Id9696b0e82b3ba54d87cd0928070c55da9a77d1f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4415596
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Maciek Swiech <drmasquatch@google.com>
for wss, s/intervals/config, add new field to track bytes for ANON and
PAGE memory.
BUG=b:271757427, b:273212204
TEST=crosvm run bzImage
Cq-Depend: 4404310
Change-Id: I62696135d1e3af9219ba819f112a1ed128e39600
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4405307
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Maciek Swiech <drmasquatch@google.com>
this patch implements the virtio-balloon extensions proposed in
go/roziere - namely adding the Working Set Size vqueues and listener on
the wss vqueue. in addition we add a crosvm_control command which allows
a user to request that the balloon device send a request to the driver
to produce a WSS report, similar to asking for balloon stats.
BUG=b:271757427,b:273212204
TEST=sidecar process, available at https://x20.corp.google.com/users/dr/drmasquatch/socket-pinger
TEST=deploy to DUT, restart termina and arcvm
Change-Id: I45753f523aae97d14bfc5dcbad5ddfcb70d10beb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4260158
Reviewed-by: T.J. Alumbaugh <talumbau@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Maciek Swiech <drmasquatch@google.com>
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>
As part of commit cadc84b32a the crosvm
suspend command has been extended to generating sleep button injection
in order to put VM in suspend state. Additionally the crosvm suspend
command completed after the guest entered proper power state.
Nevertheless in some circumstances above implementation caused issues.
E.g. when the guest with pass-through devices entered run-time device
suspension, triggering a subsequent system suspend request fails and
makes VM inaccessible. It is because before entering system suspension,
devices which entered device run-time suspension needs to be resumed.
Therefore in problematic scenario:
- VmRequest::Suspend was triggered and it resulted with blocking till
guest entered proper suspend state
- during VM suspension process some pci config write accesses are made,
which in some cases triggers write_msi_reg-> write_msi_capability->
add_msi_route, which underneath sends VmIrqRequest::AddMsiRoute
request
- above VmIrqRequest::AddMsiRoute request can't be satisfied since
VmRequest::Suspend made the run_control wait loop busy waiting and
preventing further requests to be processed
In order to fix the above issue, instead of busy waiting directly in the
run_control wait loop for suspend notification, spawn a new thread, which
will generate the acpi power button and start busy waiting for a
notification that the VM actually entered suspend state. This allows to
postpone sending response over the control tube indicating that the
'crosvm suspend ...' command completed and in the same time process
other Vm*Requests.
Mentioned postponement of 'crosvm suspend ..' completion is crucial
since the full system suspension needs to be blocked till VM actually
enters proper suspend state.
BUG=b:248462336
TEST=With a setup where some device is pass-through to the VM and
--force-s2idle flag is used: wait till pass-through device enters
run-time suspend state and trigger "crosvm suspend
/run/vm/vm.<hash>/crosvm.sock" followed by "crosvm resume ..". Also make
sure that full system suspension/resumption doesn't make VM inaccessible
anymore.
Change-Id: Ic23461a78a62d2116cf5674c71d89f4f86ad96c3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3944915
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
This greatly simplifies and speeds up compilation
and clippy times.
This ChromeOS-side building these crates has been
updated to copy the source out of the source tree
so that they will compile as a separate workspace.
BUG=b:256020427
TEST=presubmit
Change-Id: I2e0f1f6724924d6bdd70ea28d7777df7966cf724
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988324
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This search/replace updates all copyright notices to drop the
"All rights reserved", Use "ChromiumOS" instead of "Chromium OS"
and drops the trailing dots.
This fulfills the request from legal and unifies our notices.
./tools/health-check has been updated to only accept this style.
BUG=b:246579983
TEST=./tools/health-check
Change-Id: I87a80701dc651f1baf4820e5cc42469d7c5f5bf7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3894243
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
We originally removed it because we had frequent merge conflicts
and all downstream projects were doing their own pinning already.
We also had CI issues because ChromeOS changes could trigger
Cargo.lock changes in crosvm back then.
The new Cargo.lock format should ease the merge conflicts and we
no longer have issues with external changes triggering changes
in our Cargo.lock. So let's bring it back in.
This will allow us to judge the impact of changing third party
dependencies and gives us a chance to implement a special
review process.
BUG=b:240435583
TEST=CQ
Change-Id: Ie53e5616cc98d7e50a84f3c0a91902dd539f2520
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3795655
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
crosvm is switching the import style to use one import per line.
While more verbose, this will greatly reduce the occurence of merge
conflicts going forward.
Note: This is using a nightly feature of rustfmt. So it's a one-off
re-format only. We are considering adding a nightly toolchain to
enable the feature permanently.
BUG=b:239937122
TEST=CQ
Change-Id: Id2dd4dbdc0adfc4f8f3dd1d09da1daafa2a39992
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784345
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This reverts commit 56c0d02760.
Reason for revert: Break ARCVM after suspend/resume
BUG=b:234067421
TEST=Checked that ARCVM kept working after suspend/resume
Original change's description:
> crosvm: remove balloon stats request timeout
>
> It was done to avoid deadlock when stats are requested before guest is
> up. Implement a stub BalloonStats::NotReady replier until host is up so
> that timeout is no longer necessary.
>
> BUG=b:232289535
> TEST=few tast crostini/arc tests
>
> Change-Id: I6731b4ee9eaecdd65aebdd3f530f0932b0660c85
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3652887
> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
> Tested-by: kokoro <noreply+kokoro@google.com>
> Commit-Queue: Anton Romanov <romanton@google.com>
> Auto-Submit: Anton Romanov <romanton@google.com>
Bug: b:232289535
Change-Id: Iffafaef1e1136ebc050d69d001d384eedd0a2319
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3686789
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Hikaru Nishida <hikalium@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Hikaru Nishida <hikalium@chromium.org>
It was done to avoid deadlock when stats are requested before guest is
up. Implement a stub BalloonStats::NotReady replier until host is up so
that timeout is no longer necessary.
BUG=b:232289535
TEST=few tast crostini/arc tests
Change-Id: I6731b4ee9eaecdd65aebdd3f530f0932b0660c85
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3652887
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
Auto-Submit: Anton Romanov <romanton@google.com>
This reverts commit 716b698659.
Reason for revert: this is wrong in multithreaded mode
Original change's description:
> crosvm: remove balloon stats request timeout
>
> It was done to avoid deadlock when stats are requested before guest is
> up. Implement a stub BalloonStats::NotReady replier until host is up so
> that timeout is no longer necessary.
>
> BUG=b:232289535
> TEST=few tast crostini/arc tests
>
> Change-Id: Ieb6888487ea5b10664b76d8f94330564e7a3c726
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3647161
> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
> Auto-Submit: Anton Romanov <romanton@google.com>
> Tested-by: kokoro <noreply+kokoro@google.com>
> Commit-Queue: Anton Romanov <romanton@google.com>
Bug: b:232289535
Change-Id: I11faa967d6030ad4a0c292069b0678260757fda8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3651672
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Anton Romanov <romanton@google.com>
It was done to avoid deadlock when stats are requested before guest is
up. Implement a stub BalloonStats::NotReady replier until host is up so
that timeout is no longer necessary.
BUG=b:232289535
TEST=few tast crostini/arc tests
Change-Id: Ieb6888487ea5b10664b76d8f94330564e7a3c726
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3647161
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
Add a flag to the adjust command that allows the command to fail. When
this flag is set, a reply is sent with the balloon size at the end of
adjustment.
The flag also changes the semantics of inflation somewhat. By default,
the balloon driver will indefinitely retry if it fails to allocate pages
during inflation. When the flag is set, the device reacts to puff
failure notifications on the event queue by setting the target num_pages
to the current balloon size, to abort and fail the inflation attempt.
BUG=b:213962590
TEST=manual testing with crrev.com/c/3394436
TEST=check ARCVM balloon still works
Change-Id: Idd606b90550c544ce5bea085f62ac35979679d71
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3394442
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
Add a crate containing an API for controlling the balloon. This is done
by reusing the API between the control socket and the balloon device.
BUG=b:213962590
TEST=compiles
Change-Id: I5d89d5ebee55162d28ba45ca2c49b7083561b916
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3394440
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>