summary refs log tree commit diff
path: root/crosvm_plugin/crosvm.h
diff options
context:
space:
mode:
authorMatt Delco <delco@chromium.org>2020-02-13 14:08:04 -0800
committerCommit Bot <commit-bot@chromium.org>2020-02-20 02:12:03 +0000
commite73414db487afd4bebd2fb60ca80693ee6349cf5 (patch)
treeadf53724c2db3f7c21e7d85ba9df6b6354ca327a /crosvm_plugin/crosvm.h
parentc469580e6c9b83172ba58e8305c6e5c11acfe186 (diff)
downloadcrosvm-e73414db487afd4bebd2fb60ca80693ee6349cf5.tar
crosvm-e73414db487afd4bebd2fb60ca80693ee6349cf5.tar.gz
crosvm-e73414db487afd4bebd2fb60ca80693ee6349cf5.tar.bz2
crosvm-e73414db487afd4bebd2fb60ca80693ee6349cf5.tar.lz
crosvm-e73414db487afd4bebd2fb60ca80693ee6349cf5.tar.xz
crosvm-e73414db487afd4bebd2fb60ca80693ee6349cf5.tar.zst
crosvm-e73414db487afd4bebd2fb60ca80693ee6349cf5.zip
crosvm: add ability to enable caps on vcpu
This change primarily adds functionality to allow kvm features to be
enabled on a vcpu (most of the current infra only supporst the ioctl for
the vm fd).

BUG=b:144746965
TEST=ran 'build_test' and verified that the added tests passed.

Change-Id: I30c00b6f462377c21d477602ceba5853df953b37
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2055883
Tested-by: Matt Delco <delco@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Matt Delco <delco@chromium.org>
Diffstat (limited to 'crosvm_plugin/crosvm.h')
-rw-r--r--crosvm_plugin/crosvm.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/crosvm_plugin/crosvm.h b/crosvm_plugin/crosvm.h
index ef7759d..db824b9 100644
--- a/crosvm_plugin/crosvm.h
+++ b/crosvm_plugin/crosvm.h
@@ -47,7 +47,7 @@ extern "C" {
  * do not indicate anything about what version of crosvm is running.
  */
 #define CROSVM_API_MAJOR 0
-#define CROSVM_API_MINOR 20
+#define CROSVM_API_MINOR 21
 #define CROSVM_API_PATCH 0
 
 enum crosvm_address_space {
@@ -115,6 +115,14 @@ int crosvm_check_extension(struct crosvm*, uint32_t __extension,
                            bool *has_extension);
 
 /*
+ * Enable an extended capability for the VM.  Currently |__flags| and
+ * |__args| must be zero.  No values for |__capability| are supported,
+ * so all calls will fail.
+ */
+int crosvm_enable_capability(struct crosvm*, uint32_t __capability,
+                             uint32_t __flags, uint64_t __args[4]);
+
+/*
  * Queries x86 cpuid features which are supported by the hardware and
  * kvm.
  */
@@ -633,6 +641,15 @@ int crosvm_vcpu_set_msrs(struct crosvm_vcpu*, uint32_t __msr_count,
 int crosvm_vcpu_set_cpuid(struct crosvm_vcpu*, uint32_t __cpuid_count,
                           const struct kvm_cpuid_entry2 *__cpuid_entries);
 
+/*
+ * Enable an extended capability for a vcpu.  Currently |__flags| and
+ * |__args| must be zero.  The only permitted values for |__capability|
+ * are KVM_CAP_HYPERV_SYNIC or KVM_CAP_HYPERV_SYNIC2, though the latter
+ * also depends on kernel support.
+ */
+int crosvm_vcpu_enable_capability(struct crosvm_vcpu*, uint32_t __capability,
+                                  uint32_t __flags, uint64_t __args[4]);
+
 /* Gets state of LAPIC of the VCPU. */
 int crosvm_vcpu_get_lapic_state(struct crosvm_vcpu *,
                                 struct kvm_lapic_state *__lapic_state);