3 #include "config-host.h"
11 #include <sys/utsname.h>
14 extern kvm_context_t kvm_context
;
16 int kvm_arch_qemu_create_context(void)
21 void kvm_arch_load_regs(CPUState
*env
)
26 void kvm_arch_save_regs(CPUState
*env
)
30 int kvm_arch_qemu_init_env(CPUState
*cenv
)
35 int kvm_arch_halt(void *opaque
, int vcpu
)
37 CPUState
*env
= cpu_single_env
;
38 env
->hflags
|= HF_HALTED_MASK
;
39 env
->exception_index
= EXCP_HLT
;
43 void kvm_arch_pre_kvm_run(void *opaque
, int vcpu
)
47 void kvm_arch_post_kvm_run(void *opaque
, int vcpu
)
51 int kvm_arch_has_work(CPUState
*env
)
56 int kvm_arch_try_push_interrupts(void *opaque
)
61 void kvm_arch_update_regs_for_sipi(CPUState
*env
)
65 void kvm_save_mpstate(CPUState
*env
)
67 #ifdef KVM_CAP_MP_STATE
69 struct kvm_mp_state mp_state
;
71 r
= kvm_get_mpstate(kvm_context
, env
->cpu_index
, &mp_state
);
75 env
->mp_state
= mp_state
.mp_state
;
79 void kvm_load_mpstate(CPUState
*env
)
81 #ifdef KVM_CAP_MP_STATE
82 struct kvm_mp_state mp_state
= { .mp_state
= env
->mp_state
};
85 * -1 indicates that the host did not support GET_MP_STATE ioctl,
88 if (env
->mp_state
!= -1)
89 kvm_set_mpstate(kvm_context
, env
->cpu_index
, &mp_state
);
93 void kvm_arch_cpu_reset(CPUState
*env
)
95 if (kvm_irqchip_in_kernel(kvm_context
)) {
96 #ifdef KVM_CAP_MP_STATE
97 kvm_reset_mpstate(kvm_context
, env
->cpu_index
);
100 env
->interrupt_request
&= ~CPU_INTERRUPT_HARD
;
102 env
->exception_index
= EXCP_HLT
;