Commit graph

11 commits

Author SHA1 Message Date
Dmitry Torokhov
bb65801679 plugin: allow retrieving and setting XCR VCPU states
Add crossvm plugin API to allow fetching and setting XCRs for VCPU.

BUG=b:79692549
TEST=cargo test -p kvm

Change-Id: I2a988279c08051a8d8865efc1e60f9692fa26272
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1062646
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-05-18 20:08:21 -07:00
Dmitry Torokhov
3e40b51a62 plugin: allow retrieving and setting VM and VCPU states
This change allows plugin to retrieve and set various VM and VCPU states:
interrupt controller, PIT, LAPIC and MP state.

BUG=b:76083711
TEST=cargo test -p kvm

Change-Id: Ie32a67b0cd4a1f0a19ccd826a6e1c9dc25670f95
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/986511
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-03-30 00:07:07 -07:00
Stephen Barber
a10b2d20a8 plugin: add crosvm_net_get_config
BUG=none
TEST=sudo cargo test --features plugin

Change-Id: Ib38fad250295d73529dff0451345b4274a261073
Reviewed-on: https://chromium-review.googlesource.com/911943
Commit-Ready: Stephen Barber <smbarber@chromium.org>
Tested-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-03-08 00:37:50 -08:00
Dmitry Torokhov
9786573e07 allow plugin to query KVM for supported/emulated CPUIDs
This plumbs calls to KVM_GET_SUPPORTED_CPUID and KVM_GET_EMULATED_CPUID
to be available to plugins.

TEST=cargo test --features plugin; cargo test -p kvm
BUG=chromium:800626

Change-Id: I98879599b5f970c6c2720772658689a505d8abe1
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/938674
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-02-28 21:30:20 -08:00
Dmitry Torokhov
0db8f41245 Ensure we are not holding per-cpu data lock when pausing VCPU
We may want to issue additional crosvm_pause_vcpu() requests while VCPUs
are waiting to be resumed, so we need to make sure we are not holding
lock while waiting.

TEST=cargo test --features plugin
BUG=chromium:800626

Change-Id: Ia74836a567fc565fbd868abdcaa6d0174a4341ad
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/917426
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-02-16 15:12:24 -08:00
Zach Reizner
dadb7625ea allow plugin to query for KVM extensions
The guest may need to check for KVM extensions before blindly using
them.

TEST=cargo test --features plugin; cargo test -p kvm; ./build_test
BUG=chromium:800626

Change-Id: If87b928753cd71adeabac4fc7732c3fce7265834
Reviewed-on: https://chromium-review.googlesource.com/906008
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2018-02-12 22:42:40 -08:00
Zach Reizner
7ca9f771e7 add plugin support for configuring CPUID
The guest expects to be able to read the CPUID, so the plugin process
needs to specify what the CPUID for each VCPU will have.

TEST=cargo test --features plugin; ./build_test
BUG=chromium:800626

Change-Id: I9258540ab2501126c3d8cadbd09b7fc01d19f7a9
Reviewed-on: https://chromium-review.googlesource.com/906006
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2018-02-12 22:42:38 -08:00
Zach Reizner
7a4d7b1f50 add plugin support for model specific registers
The MSRs are useful for booting a full operating system that requires
them.

TEST=cargo test --features plugin; cargo test -p kvm; ./build_test
BUG=chromium:800626

Change-Id: I817fbf3e6868c85b373808bd48e568b5b2b458eb
Reviewed-on: https://chromium-review.googlesource.com/897412
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-02-12 22:42:36 -08:00
Zach Reizner
53528e33ed add support for accessing debug registers in the plugin process
The debug registers are useful to access for the plugin process in some
cases.

TEST=cargo test --features plugin; cargo test -p kvm; ./build_test
BUG=chromium:800626

Change-Id: I8f3f6c31c6989061a43cef948cf5b4e64bd52d30
Reviewed-on: https://chromium-review.googlesource.com/896945
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-02-12 22:42:35 -08:00
Zach Reizner
cc30d58c18 crosvm: run plugin process in a jail by default
The plugin process is similar to a virtual device from the perspective
of crosvm. Therefore, the plugin process should be run in a jail,
similar to the other devices in crosvm.

TEST=cargo build --features plugin; ./build_test
BUG=chromium:800626

Change-Id: I881d7b0f8a11e2626f69a5fa0eee0aa59bb6b6be
Reviewed-on: https://chromium-review.googlesource.com/882131
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2018-02-12 22:42:34 -08:00
Zach Reizner
8864cb0f3a crosvm: add support for plugin process
The plugin process is good for running a VM that depends substantially
on devices that aren't implemented inside of crosvm.

TEST=cargo build --features plugin; ./build_test
BUG=chromium:800626

Change-Id: I7b4f656563742cd0bedc837205dd1240d497941d
Reviewed-on: https://chromium-review.googlesource.com/869357
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
2018-02-09 19:03:16 -08:00