summary refs log tree commit diff
path: root/plugin_proto
diff options
context:
space:
mode:
authorZach Reizner <zachr@google.com>2018-02-06 20:50:07 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-02-12 22:42:38 -0800
commit7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63 (patch)
treeb0cd9cf9353234b3d0bc2529e445b52ce28a8768 /plugin_proto
parentce8961d1fcba5724553ba21288fbec752b0c00bf (diff)
downloadcrosvm-7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63.tar
crosvm-7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63.tar.gz
crosvm-7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63.tar.bz2
crosvm-7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63.tar.lz
crosvm-7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63.tar.xz
crosvm-7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63.tar.zst
crosvm-7ca9f771e7f406ff95b5b554bbefacbc8f8d6e63.zip
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>
Diffstat (limited to 'plugin_proto')
-rw-r--r--plugin_proto/Cargo.toml2
-rw-r--r--plugin_proto/protos/plugin.proto18
2 files changed, 19 insertions, 1 deletions
diff --git a/plugin_proto/Cargo.toml b/plugin_proto/Cargo.toml
index d8f1509..0e5ead4 100644
--- a/plugin_proto/Cargo.toml
+++ b/plugin_proto/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "plugin_proto"
-version = "0.8.0"
+version = "0.9.0"
 authors = ["The Chromium OS Authors"]
 build = "build.rs"
 
diff --git a/plugin_proto/protos/plugin.proto b/plugin_proto/protos/plugin.proto
index 8bcdcc9..22f7be6 100644
--- a/plugin_proto/protos/plugin.proto
+++ b/plugin_proto/protos/plugin.proto
@@ -14,6 +14,16 @@ enum AddressSpace {
     MMIO = 1;
  }
 
+message CpuidEntry  {
+    uint32 function = 1;
+    bool has_index = 3;
+    uint32 index = 4;
+    uint32 eax = 5;
+    uint32 ebx = 6;
+    uint32 ecx = 7;
+    uint32 edx = 8;
+}
+
 // A request made to the crosvm main process that affects the global aspects of the VM.
 message MainRequest {
     // Every message under the Create namespace will instantiate an object with the given ID. The
@@ -224,6 +234,10 @@ message VcpuRequest {
         repeated MsrEntry entries = 1;
     }
 
+    message SetCpuid {
+        repeated CpuidEntry entries = 1;
+    }
+
     // The type of the message is determined by which of these oneof fields is present in the
     // protobuf.
     oneof message {
@@ -233,6 +247,7 @@ message VcpuRequest {
         SetState set_state = 4;
         GetMsrs get_msrs = 5;
         SetMsrs set_msrs = 6;
+        SetCpuid set_cpuid = 7;
     }
 }
 
@@ -285,6 +300,8 @@ message VcpuResponse  {
 
     message SetMsrs {}
 
+    message SetCpuid {}
+
     // This is zero on success, and a negative integer on failure.
     sint32 errno = 1;
     // The field present here is always the same as the one present in the corresponding
@@ -296,5 +313,6 @@ message VcpuResponse  {
         SetState set_state = 5;
         GetMsrs get_msrs = 6;
         SetMsrs set_msrs = 7;
+        SetCpuid set_cpuid = 8;
     }
 }