summary refs log tree commit diff
path: root/protos
diff options
context:
space:
mode:
authorMatt Delco <delco@chromium.org>2019-09-19 10:30:41 -0700
committerCommit Bot <commit-bot@chromium.org>2019-10-31 06:18:09 +0000
commitac0b9b71d142f381d39162a1ac52c7d143700a1b (patch)
treee9a6cabc3feae921b0514354fc3e86dbb778c853 /protos
parent5bff67d485f22fcbd391231dad1666cc849deb36 (diff)
downloadcrosvm-ac0b9b71d142f381d39162a1ac52c7d143700a1b.tar
crosvm-ac0b9b71d142f381d39162a1ac52c7d143700a1b.tar.gz
crosvm-ac0b9b71d142f381d39162a1ac52c7d143700a1b.tar.bz2
crosvm-ac0b9b71d142f381d39162a1ac52c7d143700a1b.tar.lz
crosvm-ac0b9b71d142f381d39162a1ac52c7d143700a1b.tar.xz
crosvm-ac0b9b71d142f381d39162a1ac52c7d143700a1b.tar.zst
crosvm-ac0b9b71d142f381d39162a1ac52c7d143700a1b.zip
crosvm: pre-cache answers to plugin get calls
This change tries to improve the performance of a plugin-based VM
by adding a hint API that allows crosvm to proactively push cpu
state to the plugin when certain ports for hypercalls are accessed
by the VM.

BUG=None
TEST=build and run. See performance increase significantly.

Change-Id: I71af24ebc034095ffea42eedb9ffda0afc719cd6
Signed-off-by: Matt Delco <delco@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1873005
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'protos')
-rw-r--r--protos/src/plugin.proto29
1 files changed, 29 insertions, 0 deletions
diff --git a/protos/src/plugin.proto b/protos/src/plugin.proto
index b000bf4..7b0600d 100644
--- a/protos/src/plugin.proto
+++ b/protos/src/plugin.proto
@@ -151,6 +151,27 @@ message MainRequest {
     message GetVcpus {}
     message Start {}
 
+    message SetCallHint {
+        message RegHint {
+	    bool match_rax = 1;
+	    bool match_rbx = 2;
+	    bool match_rcx = 3;
+	    bool match_rdx = 4;
+	    uint64 rax = 5;
+	    uint64 rbx = 6;
+	    uint64 rcx = 7;
+	    uint64 rdx = 8;
+	    bool send_sregs = 9;
+	    bool send_debugregs = 10;
+	}
+
+        AddressSpace space = 1;
+        uint64 address = 2;
+        bool on_write = 3;
+
+        repeated RegHint hints = 4;
+    }
+
     message MemoryDirtyLog {
         uint32 id = 1;
     }
@@ -178,6 +199,7 @@ message MainRequest {
         PauseVcpus pause_vcpus = 16;
         GetVcpus get_vcpus = 17;
         Start start = 18;
+        SetCallHint set_call_hint = 19;
         // Method for a Memory type object for retrieving the dirty bitmap. Only valid if the memory
         // object was created with dirty_log set.
         MemoryDirtyLog dirty_log = 101;
@@ -225,6 +247,7 @@ message MainResponse {
     // socket. The VcpuRequest/VcpuResponse protocol is run over each of the returned fds.
     message GetVcpus {}
     message Start {}
+    message SetCallHint {}
     message MemoryDirtyLog {
         bytes bitmap = 1;
     }
@@ -252,6 +275,7 @@ message MainResponse {
         PauseVcpus pause_vcpus = 17;
         GetVcpus get_vcpus = 18;
         Start start = 19;
+        SetCallHint set_call_hint = 20;
         MemoryDirtyLog dirty_log = 101;
     }
 }
@@ -361,6 +385,11 @@ message VcpuResponse  {
             uint64 address = 2;
             bool is_write = 3;
             bytes data = 4;
+
+            // The following can be eagerly provided.
+            bytes regs = 5;
+            bytes sregs = 6;
+            bytes debugregs = 7;
         }
 
         // This type of wait reason is only generated after a PuaseVcpus request on this VCPU.