mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
kvm: x86: Add support for VCPU event states
This patch extends the qemu-kvm state sync logic with support for KVM_GET/SET_VCPU_EVENTS, giving access to yet missing exception, interrupt and NMI states. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
5a2e3c2e11
commit
a0fb002c64
5 changed files with 100 additions and 0 deletions
11
kvm-all.c
11
kvm-all.c
|
|
@ -61,6 +61,7 @@ struct KVMState
|
|||
int coalesced_mmio;
|
||||
int broken_set_mem_region;
|
||||
int migration_log;
|
||||
int vcpu_events;
|
||||
#ifdef KVM_CAP_SET_GUEST_DEBUG
|
||||
struct kvm_sw_breakpoint_head kvm_sw_breakpoints;
|
||||
#endif
|
||||
|
|
@ -479,6 +480,11 @@ int kvm_init(int smp_cpus)
|
|||
}
|
||||
#endif
|
||||
|
||||
s->vcpu_events = 0;
|
||||
#ifdef KVM_CAP_VCPU_EVENTS
|
||||
s->vcpu_events = kvm_check_extension(s, KVM_CAP_VCPU_EVENTS);
|
||||
#endif
|
||||
|
||||
ret = kvm_arch_init(s, smp_cpus);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
|
@ -868,6 +874,11 @@ int kvm_has_sync_mmu(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
int kvm_has_vcpu_events(void)
|
||||
{
|
||||
return kvm_state->vcpu_events;
|
||||
}
|
||||
|
||||
void kvm_setup_guest_memory(void *start, size_t size)
|
||||
{
|
||||
if (!kvm_has_sync_mmu()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue