diff options
author | Dmitry Torokhov <dtor@chromium.org> | 2018-03-26 17:14:19 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-03-30 00:07:07 -0700 |
commit | 3e40b51a62b08dc27dcaa7fbec630e047713aba1 (patch) | |
tree | c83a1e4bf648c424b57c7e221f0a291256b3cb37 /crosvm_plugin/crosvm.h | |
parent | eda8b215369802296e86bd3cceee5f54bf659eda (diff) | |
download | crosvm-3e40b51a62b08dc27dcaa7fbec630e047713aba1.tar crosvm-3e40b51a62b08dc27dcaa7fbec630e047713aba1.tar.gz crosvm-3e40b51a62b08dc27dcaa7fbec630e047713aba1.tar.bz2 crosvm-3e40b51a62b08dc27dcaa7fbec630e047713aba1.tar.lz crosvm-3e40b51a62b08dc27dcaa7fbec630e047713aba1.tar.xz crosvm-3e40b51a62b08dc27dcaa7fbec630e047713aba1.tar.zst crosvm-3e40b51a62b08dc27dcaa7fbec630e047713aba1.zip |
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>
Diffstat (limited to 'crosvm_plugin/crosvm.h')
-rw-r--r-- | crosvm_plugin/crosvm.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/crosvm_plugin/crosvm.h b/crosvm_plugin/crosvm.h index 30b32c1..c7589e2 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 12 +#define CROSVM_API_MINOR 13 #define CROSVM_API_PATCH 0 enum crosvm_address_space { @@ -222,6 +222,29 @@ static_assert(sizeof(struct crosvm_irq_route) == 24, int crosvm_set_irq_routing(struct crosvm*, uint32_t __route_count, const struct crosvm_irq_route* __routes); +/* Gets the state of interrupt controller in a VM. */ +int crosvm_get_pic_state(struct crosvm *, bool __primary, + struct kvm_pic_state *__pic_state); + +/* Sets the state of interrupt controller in a VM. */ +int crosvm_set_pic_state(struct crosvm *, bool __primary, + struct kvm_pic_state *__pic_state); + +/* Gets the state of IOAPIC in a VM. */ +int crosvm_get_ioapic_state(struct crosvm *, + struct kvm_ioapic_state *__ioapic_state); + +/* Sets the state of IOAPIC in a VM. */ +int crosvm_set_ioapic_state(struct crosvm *, + struct kvm_ioapic_state *__ioapic_state); + +/* Gets the state of interrupt controller in a VM. */ +int crosvm_get_pit_state(struct crosvm *, struct kvm_pit_state2 *__pit_state); + +/* Sets the state of interrupt controller in a VM. */ +int crosvm_set_pit_state(struct crosvm *, + const struct kvm_pit_state2 *__pit_state); + /* Sets the identity map address as in the KVM_SET_IDENTITY_MAP_ADDR ioctl. */ int crosvm_set_identity_map_addr(struct crosvm*, uint32_t __addr); @@ -483,6 +506,20 @@ 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); +/* Gets state of LAPIC of the VCPU. */ +int crosvm_vcpu_get_lapic_state(struct crosvm_vcpu *, + struct kvm_lapic_state *__lapic_state); +/* Sets state of LAPIC of the VCPU. */ +int crosvm_vcpu_set_lapic_state(struct crosvm_vcpu *, + const struct kvm_lapic_state *__lapic_state); + +/* Gets the "multiprocessor state" of given VCPU. */ +int crosvm_vcpu_get_mp_state(struct crosvm_vcpu *, + struct kvm_mp_state *__mp_state); +/* Sets the "multiprocessor state" of given VCPU. */ +int crosvm_vcpu_set_mp_state(struct crosvm_vcpu *, + const struct kvm_mp_state *__mp_state); + #ifdef __cplusplus } #endif |