New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 800626 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

crosvm: add external process plugins

Project Member Reported by za...@chromium.org, Jan 10 2018

Issue description

External process plugins can run in an isolated fashion, yet still retain capabilities of a full virtual machine monitor. They run as a subprocess of crosvm, setting up the initial VM state and servicing VM exits as the VM runs.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/20bb5976367883b43d5d07c2bcc33d68dab25cd7

commit 20bb5976367883b43d5d07c2bcc33d68dab25cd7
Author: Zach Reizner <zachr@google.com>
Date: Wed Jan 10 23:44:31 2018

sys_util: implement FromRawFd for EventFd

This is used to make EventFd passed over unix domain socket, such as by
the plugin API.

TEST=./build_test
BUG= chromium:800626 

Change-Id: Ifd6c81c51b31a376d57a007bf413a836f3af870a
Reviewed-on: https://chromium-review.googlesource.com/857906
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/20bb5976367883b43d5d07c2bcc33d68dab25cd7/sys_util/src/eventfd.rs

Project Member

Comment 2 by bugdroid1@chromium.org, Jan 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/ee2f1fe7708e1ec164c5da2483c26830e9c69373

commit ee2f1fe7708e1ec164c5da2483c26830e9c69373
Author: Zach Reizner <zachr@google.com>
Date: Wed Jan 10 23:44:31 2018

sys_util: replace sysconf(_SC_PAGESIZE) with a safe wrapper

There were a few places that used this to get the page size inside of an
unsafe block, For convenience, this adds a safe wrapper in sys_util and
replaces all extant usage of sysconf with the wrapper version.

BUG= chromium:800626 
TEST=./build_test

Change-Id: Ic65bf72aea90eabd4158fbdcdbe25c3f13ca93ac
Reviewed-on: https://chromium-review.googlesource.com/857907
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/ee2f1fe7708e1ec164c5da2483c26830e9c69373/kvm/src/lib.rs
[modify] https://crrev.com/ee2f1fe7708e1ec164c5da2483c26830e9c69373/sys_util/src/lib.rs

Project Member

Comment 3 by bugdroid1@chromium.org, Jan 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/0335dad57e6ccf06f132a890df36f3d3ef7f3e14

commit 0335dad57e6ccf06f132a890df36f3d3ef7f3e14
Author: Zach Reizner <zachr@google.com>
Date: Fri Jan 19 01:40:14 2018

kvm: add ioeventfd and irqfd unregister support

This is needed to support the plugin API, which might unregister such
eventfds.

BUG= chromium:800626 
TEST=./build_test

Change-Id: Ic4e74ffd4b2374868644d1f6598509aba741ce00
Reviewed-on: https://chromium-review.googlesource.com/857908
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>

[modify] https://crrev.com/0335dad57e6ccf06f132a890df36f3d3ef7f3e14/kvm/src/lib.rs

Project Member

Comment 4 by bugdroid1@chromium.org, Jan 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/d48d7f10b56e74296eb065de995a23f1c6173547

commit d48d7f10b56e74296eb065de995a23f1c6173547
Author: Zach Reizner <zachr@google.com>
Date: Fri Jan 19 01:40:15 2018

kvm: add dirty_log_bitmap_size helper

For the callers of get_dirty_log, they must pass in bitmap large enough
to hold the log. Instead of duplicating that calculation inside the
method and the caller, this change provides a public helper usable by
both to calculate the bitmap's minimum size.

TEST=./build_test
BUG= chromium:800626 

Change-Id: I349aa0dd7e78e7f9ea3d35ba0acba8088fd77a4e
Reviewed-on: https://chromium-review.googlesource.com/857909
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>

[modify] https://crrev.com/d48d7f10b56e74296eb065de995a23f1c6173547/kvm/src/lib.rs

Project Member

Comment 5 by bugdroid1@chromium.org, Jan 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/086922c222a856252e46b35c912b435635ea0682

commit 086922c222a856252e46b35c912b435635ea0682
Author: Zach Reizner <zachr@google.com>
Date: Fri Jan 26 03:23:42 2018

kvm: add set_irq_routing method

This is used by the plugin process API, which may register an IRQ
routing table.

TEST=./build_test
BUG= chromium:800626 

Change-Id: If40965e8abfb0c9074c90b5fc77f9042f06499e0
Reviewed-on: https://chromium-review.googlesource.com/857910
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/086922c222a856252e46b35c912b435635ea0682/kvm/src/lib.rs
[modify] https://crrev.com/086922c222a856252e46b35c912b435635ea0682/kvm_sys/src/lib.rs

Project Member

Comment 6 by bugdroid1@chromium.org, Jan 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/ea7fa562dbca413f339cf4a759152aa27b7bb3e0

commit ea7fa562dbca413f339cf4a759152aa27b7bb3e0
Author: Zach Reizner <zachr@google.com>
Date: Fri Jan 26 03:23:43 2018

sys_util: add timeout support to Poller

When servicing requests from a soon to be killed plugin process, a
timeout for poll is needed so that the main process can force kill the
plugin if the plugin takes too long to exit gracefully.

TEST=./build_test
BUG= chromium:800626 

Change-Id: Ief0e0b4f01146f85adaee0663bd8e5775c26c588
Reviewed-on: https://chromium-review.googlesource.com/865775
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/ea7fa562dbca413f339cf4a759152aa27b7bb3e0/sys_util/src/poll.rs

Project Member

Comment 7 by bugdroid1@chromium.org, Jan 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/7cc4ac3a17fd9a0132efe7eab949cc6eb39719b4

commit 7cc4ac3a17fd9a0132efe7eab949cc6eb39719b4
Author: Zach Reizner <zachr@google.com>
Date: Fri Jan 26 09:19:56 2018

add crosvm plugin C header file

This header file defines the C API used to interface with crosvm as a
plugin process.

TEST=None
BUG= chromium:800626 

Change-Id: Ie06b833e25dab8f31f64d8bc8b4b521b61d1ca04
Reviewed-on: https://chromium-review.googlesource.com/764267
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[add] https://crrev.com/7cc4ac3a17fd9a0132efe7eab949cc6eb39719b4/crosvm_plugin/crosvm.h

Project Member

Comment 8 by bugdroid1@chromium.org, Jan 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/9f89fc0251897815b849d8ae458d0be298fc232d

commit 9f89fc0251897815b849d8ae458d0be298fc232d
Author: Zach Reizner <zachr@google.com>
Date: Wed Jan 31 01:47:17 2018

crosvm: add protobuf dependencies

BUG= chromium:800626 
TEST=emerge-eve-kvm crosvm

Change-Id: Icbb402b54b56ee2657b098202e1b2b24765eabcd
Reviewed-on: https://chromium-review.googlesource.com/892048
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/9f89fc0251897815b849d8ae458d0be298fc232d/chromeos-base/crosvm/Manifest
[modify] https://crrev.com/9f89fc0251897815b849d8ae458d0be298fc232d/chromeos-base/crosvm/crosvm-9999.ebuild

Project Member

Comment 9 by bugdroid1@chromium.org, Jan 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/e0983c762535a6c82b1206d4857b17eb9803d38c

commit e0983c762535a6c82b1206d4857b17eb9803d38c
Author: Zach Reizner <zachr@google.com>
Date: Wed Jan 31 01:47:17 2018

add plugin_proto crate

This module defines the protocol shared between the crosvm plugin
process and main crosvm process.

TEST=cargo build --features plugin
BUG= chromium:800626 
CQ-DEPEND=CL:892048

Change-Id: I5dfbe845644b7489f1918cecfcc07f28a223aa42
Reviewed-on: https://chromium-review.googlesource.com/869355
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>

[add] https://crrev.com/e0983c762535a6c82b1206d4857b17eb9803d38c/plugin_proto/Cargo.toml
[modify] https://crrev.com/e0983c762535a6c82b1206d4857b17eb9803d38c/Cargo.lock
[modify] https://crrev.com/e0983c762535a6c82b1206d4857b17eb9803d38c/Cargo.toml
[add] https://crrev.com/e0983c762535a6c82b1206d4857b17eb9803d38c/plugin_proto/protos/plugin.proto
[add] https://crrev.com/e0983c762535a6c82b1206d4857b17eb9803d38c/plugin_proto/src/lib.rs
[add] https://crrev.com/e0983c762535a6c82b1206d4857b17eb9803d38c/plugin_proto/build.rs

Project Member

Comment 10 by bugdroid1@chromium.org, Jan 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/e07bd96ea90edd8a12dcf163f3211cc1ddbe9691

commit e07bd96ea90edd8a12dcf163f3211cc1ddbe9691
Author: Zach Reizner <zachr@google.com>
Date: Wed Jan 31 01:47:18 2018

kvm: fix and test set_identity_map_addr

The kernel expects a pointer to a physical address, not a physical
address directly in the ioctl argument.

TEST=cargo test -p kvm
BUG= chromium:800626 

Change-Id: I4a7298149373c00b5b9c634cd1dead7053d053c3
Reviewed-on: https://chromium-review.googlesource.com/893215
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>

[modify] https://crrev.com/e07bd96ea90edd8a12dcf163f3211cc1ddbe9691/kvm/src/lib.rs

Project Member

Comment 11 by bugdroid1@chromium.org, Feb 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/b3faa5107c033d8e65b60b2430be080c1ca5c5c2

commit b3faa5107c033d8e65b60b2430be080c1ca5c5c2
Author: Zach Reizner <zachr@google.com>
Date: Thu Feb 01 06:39:03 2018

io_jail: add exec support via  Minijail::run

The exec version of Minijail::fork is useful for running the heavily
sandboxed plugin process which is always passed in as a separate
executable by path.

TEST=./build_test
BUG= chromium:800626 

Change-Id: Id31b7998f49d56a5bfbc978c1e1811dd54c5a323
Reviewed-on: https://chromium-review.googlesource.com/882130
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/b3faa5107c033d8e65b60b2430be080c1ca5c5c2/io_jail/src/lib.rs

Project Member

Comment 12 by bugdroid1@chromium.org, Feb 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/a912b2cf76a78d3331e32679d474e621622e5060

commit a912b2cf76a78d3331e32679d474e621622e5060
Author: Zach Reizner <zachr@google.com>
Date: Wed Feb 07 02:18:39 2018

sys_util: implement IntoRawFd for EventFd

This is used in the plugin process implementation, and it makes sense
that EventFd should have all the RawFd related traits.

TEST=./build_test
BUG= chromium:800626 

Change-Id: Ic96623e169e4d9584a082628c1540ca6de709a16
Reviewed-on: https://chromium-review.googlesource.com/900488
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/a912b2cf76a78d3331e32679d474e621622e5060/sys_util/src/eventfd.rs

Project Member

Comment 13 by bugdroid1@chromium.org, Feb 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/3994c3964e117da41bfe263d6e0be0babc861572

commit 3994c3964e117da41bfe263d6e0be0babc861572
Author: Zach Reizner <zachr@google.com>
Date: Wed Feb 07 05:32:40 2018

kvm: support irqfds with resample eventfds

The plugin process may require resample events to implement a device
properly.

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

Change-Id: I47a3336195f212c9f6c49adfaec24757803c3b7f
Reviewed-on: https://chromium-review.googlesource.com/900489
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/3994c3964e117da41bfe263d6e0be0babc861572/kvm/src/lib.rs

Project Member

Comment 14 by bugdroid1@chromium.org, Feb 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/e0e8e56732801c63f5c836827e473665e1e12c29

commit e0e8e56732801c63f5c836827e473665e1e12c29
Author: Zach Reizner <zachr@google.com>
Date: Wed Feb 07 05:32:39 2018

kvm: support adding read only memory to VMs

Read only memory is useful for triggering VM exits when the VM writes to
memory while allowing reads transparently and quickly. For example, a
virtual device implementation might not care if the VM reads a memory
mapped device register, but a exit would be required if the VM wrote to
the same register.

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

Change-Id: Ic605b2cfc2a1e44941d91945f9390b9abb820040
Reviewed-on: https://chromium-review.googlesource.com/903075
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/e0e8e56732801c63f5c836827e473665e1e12c29/kvm/src/lib.rs
[modify] https://crrev.com/e0e8e56732801c63f5c836827e473665e1e12c29/kvm/tests/dirty_log.rs
[add] https://crrev.com/e0e8e56732801c63f5c836827e473665e1e12c29/kvm/tests/read_only_memory.rs
[modify] https://crrev.com/e0e8e56732801c63f5c836827e473665e1e12c29/vm_control/src/lib.rs

Project Member

Comment 15 by bugdroid1@chromium.org, Feb 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/de01b8b32f1391acfd298c977bcd20a85d020ebb

commit de01b8b32f1391acfd298c977bcd20a85d020ebb
Author: Zach Reizner <zachr@google.com>
Date: Thu Feb 08 05:27:35 2018

add crosvm_plugin dynamic library crate

This is the shared library used by the plugin process to speak to a
crosvm main process that spawned it.

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

Change-Id: I100e7ddfc1099fbdf1462c171785a861e075d5d7
Reviewed-on: https://chromium-review.googlesource.com/869356
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/de01b8b32f1391acfd298c977bcd20a85d020ebb/Cargo.lock
[modify] https://crrev.com/de01b8b32f1391acfd298c977bcd20a85d020ebb/Cargo.toml
[add] https://crrev.com/de01b8b32f1391acfd298c977bcd20a85d020ebb/crosvm_plugin/Cargo.toml
[add] https://crrev.com/de01b8b32f1391acfd298c977bcd20a85d020ebb/crosvm_plugin/src/lib.rs

Project Member

Comment 16 by bugdroid1@chromium.org, Feb 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/8864cb0f3a9184e2420bbad64c43fcddf161e427

commit 8864cb0f3a9184e2420bbad64c43fcddf161e427
Author: Zach Reizner <zachr@google.com>
Date: Sat Feb 10 03:03:16 2018

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>

[modify] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/src/main.rs
[modify] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/plugin_proto/Cargo.toml
[add] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/src/plugin/mod.rs
[add] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/src/plugin/vcpu.rs
[add] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/tests/plugin_irqfd.c
[add] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/tests/plugin_ioevent.c
[modify] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/Cargo.lock
[add] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/tests/plugin_adder.c
[modify] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/Cargo.toml
[add] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/tests/plugins.rs
[add] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/tests/plugin_dirty_log.c
[add] https://crrev.com/8864cb0f3a9184e2420bbad64c43fcddf161e427/src/plugin/process.rs

Project Member

Comment 17 by bugdroid1@chromium.org, Feb 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/cc30d58c18353905154173bab850d3610c7d01bc

commit cc30d58c18353905154173bab850d3610c7d01bc
Author: Zach Reizner <zachr@google.com>
Date: Tue Feb 13 06:42:34 2018

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>

[modify] https://crrev.com/cc30d58c18353905154173bab850d3610c7d01bc/src/main.rs
[modify] https://crrev.com/cc30d58c18353905154173bab850d3610c7d01bc/src/plugin/process.rs
[modify] https://crrev.com/cc30d58c18353905154173bab850d3610c7d01bc/src/plugin/mod.rs
[add] https://crrev.com/cc30d58c18353905154173bab850d3610c7d01bc/tests/plugin.policy
[modify] https://crrev.com/cc30d58c18353905154173bab850d3610c7d01bc/tests/plugins.rs

Project Member

Comment 18 by bugdroid1@chromium.org, Feb 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/bb678718926888701eb17f1ba1c5721592d7f881

commit bb678718926888701eb17f1ba1c5721592d7f881
Author: Zach Reizner <zachr@google.com>
Date: Tue Feb 13 06:42:34 2018

crosvm: support passing command line arguments to plugin process

This uses the same command line mechanism as the kernel command line
option. As a consequence, the Config field for the params is now a
vector of strings to accommodate potential whitespace in the individual
params.

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

Change-Id: Ief20a55bf7ced23f64e5112e184dd714f050120a
Reviewed-on: https://chromium-review.googlesource.com/895415
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/bb678718926888701eb17f1ba1c5721592d7f881/src/linux.rs
[modify] https://crrev.com/bb678718926888701eb17f1ba1c5721592d7f881/src/main.rs
[modify] https://crrev.com/bb678718926888701eb17f1ba1c5721592d7f881/src/plugin/process.rs
[modify] https://crrev.com/bb678718926888701eb17f1ba1c5721592d7f881/src/plugin/mod.rs

Project Member

Comment 19 by bugdroid1@chromium.org, Feb 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/53528e33eda615ef309915447b227d2dcacb2090

commit 53528e33eda615ef309915447b227d2dcacb2090
Author: Zach Reizner <zachr@google.com>
Date: Tue Feb 13 06:42:35 2018

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>

[modify] https://crrev.com/53528e33eda615ef309915447b227d2dcacb2090/kvm/src/lib.rs
[modify] https://crrev.com/53528e33eda615ef309915447b227d2dcacb2090/crosvm_plugin/crosvm.h
[modify] https://crrev.com/53528e33eda615ef309915447b227d2dcacb2090/plugin_proto/Cargo.toml
[modify] https://crrev.com/53528e33eda615ef309915447b227d2dcacb2090/crosvm_plugin/Cargo.toml
[modify] https://crrev.com/53528e33eda615ef309915447b227d2dcacb2090/src/plugin/vcpu.rs
[modify] https://crrev.com/53528e33eda615ef309915447b227d2dcacb2090/Cargo.lock
[modify] https://crrev.com/53528e33eda615ef309915447b227d2dcacb2090/Cargo.toml
[modify] https://crrev.com/53528e33eda615ef309915447b227d2dcacb2090/plugin_proto/protos/plugin.proto
[modify] https://crrev.com/53528e33eda615ef309915447b227d2dcacb2090/crosvm_plugin/src/lib.rs
[add] https://crrev.com/53528e33eda615ef309915447b227d2dcacb2090/tests/mini_plugin_template.c
[modify] https://crrev.com/53528e33eda615ef309915447b227d2dcacb2090/tests/plugins.rs

Project Member

Comment 20 by bugdroid1@chromium.org, Feb 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/7a4d7b1f50d07e7f0ae350c27659c6e852da62c7

commit 7a4d7b1f50d07e7f0ae350c27659c6e852da62c7
Author: Zach Reizner <zachr@google.com>
Date: Tue Feb 13 06:42:36 2018

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>

[modify] https://crrev.com/7a4d7b1f50d07e7f0ae350c27659c6e852da62c7/kvm/src/lib.rs
[modify] https://crrev.com/7a4d7b1f50d07e7f0ae350c27659c6e852da62c7/crosvm_plugin/crosvm.h
[modify] https://crrev.com/7a4d7b1f50d07e7f0ae350c27659c6e852da62c7/plugin_proto/Cargo.toml
[modify] https://crrev.com/7a4d7b1f50d07e7f0ae350c27659c6e852da62c7/crosvm_plugin/Cargo.toml
[modify] https://crrev.com/7a4d7b1f50d07e7f0ae350c27659c6e852da62c7/src/plugin/vcpu.rs
[modify] https://crrev.com/7a4d7b1f50d07e7f0ae350c27659c6e852da62c7/Cargo.lock
[modify] https://crrev.com/7a4d7b1f50d07e7f0ae350c27659c6e852da62c7/plugin_proto/protos/plugin.proto
[modify] https://crrev.com/7a4d7b1f50d07e7f0ae350c27659c6e852da62c7/tests/plugins.rs
[modify] https://crrev.com/7a4d7b1f50d07e7f0ae350c27659c6e852da62c7/crosvm_plugin/src/lib.rs

Project Member

Comment 21 by bugdroid1@chromium.org, Feb 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/ce8961d1fcba5724553ba21288fbec752b0c00bf

commit ce8961d1fcba5724553ba21288fbec752b0c00bf
Author: Zach Reizner <zachr@google.com>
Date: Tue Feb 13 06:42:37 2018

allow non-dirty log memory regions from the plugin process

Dirty logging is not necessary for every memory region, so the plugin
process should be able to specific exactly which regions it would like
dirty logging enabled for.

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

Change-Id: I28b8285357e7de1c8c3a1392bdfdb4853ec5a654
Reviewed-on: https://chromium-review.googlesource.com/900294
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/ce8961d1fcba5724553ba21288fbec752b0c00bf/crosvm_plugin/crosvm.h
[modify] https://crrev.com/ce8961d1fcba5724553ba21288fbec752b0c00bf/plugin_proto/Cargo.toml
[modify] https://crrev.com/ce8961d1fcba5724553ba21288fbec752b0c00bf/crosvm_plugin/Cargo.toml
[modify] https://crrev.com/ce8961d1fcba5724553ba21288fbec752b0c00bf/tests/plugin_irqfd.c
[modify] https://crrev.com/ce8961d1fcba5724553ba21288fbec752b0c00bf/tests/plugin_ioevent.c
[modify] https://crrev.com/ce8961d1fcba5724553ba21288fbec752b0c00bf/Cargo.lock
[modify] https://crrev.com/ce8961d1fcba5724553ba21288fbec752b0c00bf/tests/plugin_adder.c
[modify] https://crrev.com/ce8961d1fcba5724553ba21288fbec752b0c00bf/plugin_proto/protos/plugin.proto
[modify] https://crrev.com/ce8961d1fcba5724553ba21288fbec752b0c00bf/tests/plugin_dirty_log.c
[modify] https://crrev.com/ce8961d1fcba5724553ba21288fbec752b0c00bf/src/plugin/process.rs
[modify] https://crrev.com/ce8961d1fcba5724553ba21288fbec752b0c00bf/crosvm_plugin/src/lib.rs

Project Member

Comment 22 by bugdroid1@chromium.org, Feb 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63

commit 7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63
Author: Zach Reizner <zachr@google.com>
Date: Tue Feb 13 06:42:38 2018

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>

[modify] https://crrev.com/7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63/crosvm_plugin/crosvm.h
[modify] https://crrev.com/7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63/plugin_proto/Cargo.toml
[modify] https://crrev.com/7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63/crosvm_plugin/Cargo.toml
[modify] https://crrev.com/7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63/src/plugin/vcpu.rs
[modify] https://crrev.com/7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63/kvm_sys/src/x86/bindings.rs
[modify] https://crrev.com/7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63/Cargo.lock
[modify] https://crrev.com/7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63/plugin_proto/protos/plugin.proto
[modify] https://crrev.com/7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63/tests/plugins.rs
[modify] https://crrev.com/7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63/crosvm_plugin/src/lib.rs

Project Member

Comment 23 by bugdroid1@chromium.org, Feb 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/1d4a70029c849b7aff178dd1e4a00feb7a5c483b

commit 1d4a70029c849b7aff178dd1e4a00feb7a5c483b
Author: Zach Reizner <zachr@google.com>
Date: Tue Feb 13 06:42:39 2018

crosvm/plugin: allow plugins to exit early succesfully

A plugin that exits without sending the start message would cause the
main process to exit with a failure code, which made some forms of
unit testing have false negatives.

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

Change-Id: I14803ed3d2c933b8591c5370756a5caaa93b97e6
Reviewed-on: https://chromium-review.googlesource.com/906007
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/1d4a70029c849b7aff178dd1e4a00feb7a5c483b/src/plugin/process.rs
[modify] https://crrev.com/1d4a70029c849b7aff178dd1e4a00feb7a5c483b/src/plugin/mod.rs

Project Member

Comment 24 by bugdroid1@chromium.org, Feb 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd

commit dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd
Author: Zach Reizner <zachr@google.com>
Date: Tue Feb 13 06:42:40 2018

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>

[modify] https://crrev.com/dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd/kvm/src/lib.rs
[modify] https://crrev.com/dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd/crosvm_plugin/crosvm.h
[modify] https://crrev.com/dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd/plugin_proto/Cargo.toml
[modify] https://crrev.com/dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd/crosvm_plugin/Cargo.toml
[add] https://crrev.com/dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd/tests/plugin_extensions.c
[modify] https://crrev.com/dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd/Cargo.lock
[modify] https://crrev.com/dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd/plugin_proto/protos/plugin.proto
[modify] https://crrev.com/dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd/tests/plugins.rs
[modify] https://crrev.com/dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd/crosvm_plugin/src/lib.rs
[modify] https://crrev.com/dadb7625ea382b0372ec8be9fcae8f0aa3f0b6fd/src/plugin/process.rs

Components: OS>Systems>Containers
Project Member

Comment 26 by bugdroid1@chromium.org, Feb 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/80173859267b7404bcf7f5e49258602af0c1f2d6

commit 80173859267b7404bcf7f5e49258602af0c1f2d6
Author: Zach Reizner <zachr@google.com>
Date: Fri Feb 16 05:43:46 2018

crosvm: build plugin unit tests

None of the test will actually run on the CQ because they require
/dev/kvm, but building them will catch simple compile errors that may be
introduced to the CQ.

TEST=ebuild crosvm-9999.ebuild test
BUG= chromium:800626 
CQ-DEPEND=CL:922281

Change-Id: Iaba291a94e5ac46a3a9c825e3138fcb95f4e9977
Reviewed-on: https://chromium-review.googlesource.com/922484
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/80173859267b7404bcf7f5e49258602af0c1f2d6/chromeos-base/crosvm/crosvm-9999.ebuild

Project Member

Comment 27 by bugdroid1@chromium.org, Feb 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/0db8f412452ac12353d4a81a71968f84ae58c1c1

commit 0db8f412452ac12353d4a81a71968f84ae58c1c1
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Fri Feb 16 23:12:24 2018

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>

[modify] https://crrev.com/0db8f412452ac12353d4a81a71968f84ae58c1c1/src/plugin/vcpu.rs
[add] https://crrev.com/0db8f412452ac12353d4a81a71968f84ae58c1c1/tests/plugin_vcpu_pause.c
[modify] https://crrev.com/0db8f412452ac12353d4a81a71968f84ae58c1c1/tests/plugins.rs

Project Member

Comment 28 by bugdroid1@chromium.org, Feb 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/cd4053364d26029e4de560407803df842e96b7c0

commit cd4053364d26029e4de560407803df842e96b7c0
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Tue Feb 27 06:07:08 2018

sys_util: factor out signal manipulation from signalfd into signal

Move creating sigsets and blocking/unblocking signals form signalfd
module to signal module so they are usable by other parties as well.

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

Change-Id: I281ce784ed6cb341cc1e7cf2784f6fb1e8cc894d
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/930461
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/cd4053364d26029e4de560407803df842e96b7c0/src/linux.rs
[modify] https://crrev.com/cd4053364d26029e4de560407803df842e96b7c0/sys_util/src/signal.rs
[modify] https://crrev.com/cd4053364d26029e4de560407803df842e96b7c0/src/plugin/process.rs
[modify] https://crrev.com/cd4053364d26029e4de560407803df842e96b7c0/src/plugin/mod.rs
[modify] https://crrev.com/cd4053364d26029e4de560407803df842e96b7c0/sys_util/src/signalfd.rs

Project Member

Comment 29 by bugdroid1@chromium.org, Feb 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/2cd14a1e4675e4917ab464df9ad8007f8bf28c0e

commit 2cd14a1e4675e4917ab464df9ad8007f8bf28c0e
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Tue Feb 27 06:07:09 2018

sys_util: allow clearing given pending signal

We are planning on using KVM_SET_SIGNAL_MASK and have the signal that we
use to kick VCPU permanently masked to close the race around handling
pause requests, so we need a way to clear pending interrupts, otherwise
VM will never run again.

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

Change-Id: I2dfe6fcb129e4b8156f6a7ff842e171661c56440
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/930462
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/2cd14a1e4675e4917ab464df9ad8007f8bf28c0e/sys_util/src/signal.rs

Project Member

Comment 30 by bugdroid1@chromium.org, Feb 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/b7bb00297ca394edc7255b78552cfbe326c5f991

commit b7bb00297ca394edc7255b78552cfbe326c5f991
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Tue Feb 27 06:07:10 2018

sys_util: use sigaction() instead of signal() when installing handler

Use of signal(2) is only portable with SIG_DFL or SIG_IGN, it should not
be used to set real signal handler. sigaction(2) should be used for this
purpose.

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

Change-Id: I5a8d1f68c7f285b489e08f74f63b573f263e09d1
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/930463
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/b7bb00297ca394edc7255b78552cfbe326c5f991/sys_util/src/signal.rs

Project Member

Comment 31 by bugdroid1@chromium.org, Feb 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/42d194de3f8211746c9d37f3ee4e35a4fffaac48

commit 42d194de3f8211746c9d37f3ee4e35a4fffaac48
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Tue Feb 27 06:07:11 2018

kvm: plumb in KVM_SET_SIGNAL_MASK ioctl

We need this ioctl to implement race-free support for kicking/pausing VCPUs.

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

Change-Id: I5dcff54f7eb34568a8d8503e0dde86b6a36ac693
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/932443
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/42d194de3f8211746c9d37f3ee4e35a4fffaac48/kvm/src/lib.rs
[modify] https://crrev.com/42d194de3f8211746c9d37f3ee4e35a4fffaac48/sys_util/src/lib.rs

Project Member

Comment 32 by bugdroid1@chromium.org, Feb 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/cda18d757b0f9bb67af649bca9c9f13b73e56afc

commit cda18d757b0f9bb67af649bca9c9f13b73e56afc
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Wed Feb 28 01:33:20 2018

kvm: do not pass max number of cpuid entries in get_supported_cpuid()

It does not make sense to have users of the API limit number of cpuid
entries retrieved. Just have KVM select reasonable upper limit and
return the true number.

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

Change-Id: I8ab7e8d901bc408d17c23bfe798d89f921488673
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/933242
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/cda18d757b0f9bb67af649bca9c9f13b73e56afc/kvm/src/lib.rs
[modify] https://crrev.com/cda18d757b0f9bb67af649bca9c9f13b73e56afc/x86_64/src/cpuid.rs

Project Member

Comment 33 by bugdroid1@chromium.org, Feb 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/c73d39052258a7c40417424ecadabccba6233041

commit c73d39052258a7c40417424ecadabccba6233041
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Wed Feb 28 04:17:42 2018

kvm: plumb in KVM_GET_EMULATED_CPUID

This plumbs in KVM_GET_EMULATED_CPUID to allow userspace to figure out
whether a certain feature(s) can be used or whether they are too
expensive.

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

Change-Id: I914415a311f40d079b1703efb5129fd91b0d24ad
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/933243
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/c73d39052258a7c40417424ecadabccba6233041/kvm/src/lib.rs

Project Member

Comment 34 by bugdroid1@chromium.org, Feb 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/cd6a187de66ff56948312ae983ca12a12782e774

commit cd6a187de66ff56948312ae983ca12a12782e774
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Wed Feb 28 06:26:14 2018

plugin_proto: add helpers to convert CPUID data between KVM and protobuf

We need to convert between protobuf and KVM format of cpuid data in
several places, so let's add helpers to plugin_proto crate.

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

Change-Id: Ida7b59825d2146b0d02711e441f477d90dd4263a
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/939660
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/cd6a187de66ff56948312ae983ca12a12782e774/Cargo.lock
[modify] https://crrev.com/cd6a187de66ff56948312ae983ca12a12782e774/plugin_proto/src/lib.rs
[modify] https://crrev.com/cd6a187de66ff56948312ae983ca12a12782e774/plugin_proto/Cargo.toml
[modify] https://crrev.com/cd6a187de66ff56948312ae983ca12a12782e774/crosvm_plugin/src/lib.rs

Project Member

Comment 35 by bugdroid1@chromium.org, Mar 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/9786573e07992d43bfd5304ca7490a35aca2c61f

commit 9786573e07992d43bfd5304ca7490a35aca2c61f
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Thu Mar 01 05:30:20 2018

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>

[modify] https://crrev.com/9786573e07992d43bfd5304ca7490a35aca2c61f/crosvm_plugin/crosvm.h
[add] https://crrev.com/9786573e07992d43bfd5304ca7490a35aca2c61f/tests/plugin_supported_cpuid.c
[modify] https://crrev.com/9786573e07992d43bfd5304ca7490a35aca2c61f/plugin_proto/Cargo.toml
[modify] https://crrev.com/9786573e07992d43bfd5304ca7490a35aca2c61f/crosvm_plugin/Cargo.toml
[modify] https://crrev.com/9786573e07992d43bfd5304ca7490a35aca2c61f/Cargo.lock
[modify] https://crrev.com/9786573e07992d43bfd5304ca7490a35aca2c61f/tests/plugins.rs
[modify] https://crrev.com/9786573e07992d43bfd5304ca7490a35aca2c61f/plugin_proto/protos/plugin.proto
[modify] https://crrev.com/9786573e07992d43bfd5304ca7490a35aca2c61f/src/plugin/process.rs
[modify] https://crrev.com/9786573e07992d43bfd5304ca7490a35aca2c61f/crosvm_plugin/src/lib.rs
[modify] https://crrev.com/9786573e07992d43bfd5304ca7490a35aca2c61f/src/plugin/mod.rs

Project Member

Comment 36 by bugdroid1@chromium.org, Mar 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/aa83c173593e6e72c8ec5121550418efb533dadd

commit aa83c173593e6e72c8ec5121550418efb533dadd
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Sat Mar 03 06:22:43 2018

sys_util: register_signal_handler should use SA_RESTART

On Linux, signal handlers installed with signal() will restart
interrupted system calls. When we moved to using sigaction() we forgot
to specify SA_RESTART and so we started experiencing returns from read
write system calls with EINTR, which throws off some of the code.
Instead of sprinkling "handle_eintr" everywhere, let's restore the old
behavior.

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

Change-Id: I24c23069ad4c9e7be8c484ee4c57f67451a2944d
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/944848
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/aa83c173593e6e72c8ec5121550418efb533dadd/sys_util/src/signal.rs

Project Member

Comment 37 by bugdroid1@chromium.org, Mar 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/e423460238fe1cfb8853faef3b855f1ce53b756c

commit e423460238fe1cfb8853faef3b855f1ce53b756c
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Thu Mar 08 08:37:32 2018

kvm: fix invocation of KVM_SET_SIGNAL_MASK ioctl

Linux kernel expects size of sigset passed in through KVM_SET_SIGNAL_MASK
ioctl to be exactly 8, but Rust's sigset size is 128 bytes, so we can
not use sizeof to set up the size.

Also let's add test set_signal_mask().

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

Change-Id: Ica757ad63d6754d5c8008ba1735982c7ca026f33
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/944849
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/e423460238fe1cfb8853faef3b855f1ce53b756c/kvm/src/lib.rs

Project Member

Comment 38 by bugdroid1@chromium.org, Mar 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/crosvm/+/532a94c1c83c1f829a03e5c95ae584a57c0e86d5

commit 532a94c1c83c1f829a03e5c95ae584a57c0e86d5
Author: Dmitry Torokhov <dtor@chromium.org>
Date: Thu Mar 08 08:37:33 2018

Fix race between un-pausing vcpu and requesting vcpu pause

To ensure that we do not miss pause request sent while we were in paused
state, or were exiting paused state, let's start using
KVM_SET_SIGNAL_MASK. SIGRTMIN() + 0 signal will be blocked and thus is
not delivered, and it will only be checked when KVM_RUN is being
executed, reliably interrupting KVM_RUN.

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

Change-Id: Iae67a411c23c2b14fbfcbc7d53d0bc86ec4b67d9
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/944850
Reviewed-by: Zach Reizner <zachr@chromium.org>

[modify] https://crrev.com/532a94c1c83c1f829a03e5c95ae584a57c0e86d5/src/plugin/mod.rs
[modify] https://crrev.com/532a94c1c83c1f829a03e5c95ae584a57c0e86d5/tests/plugin_vcpu_pause.c

Can this be marked as fixed?

Comment 40 by za...@chromium.org, Mar 31 2018

Status: Verified (was: Started)

Sign in to add a comment