提交 6f725c13 编写于 作者: G Glauber Costa 提交者: Anthony Liguori

provide tests for pit in kernel and irqchip in kernel

KVM can have an in-kernel pit or irqchip. While we don't implement it
yet, having a way for test for it (that always returns zero) will allow us
to reuse code in qemu-kvm that tests for it.
Signed-off-by: NGlauber Costa <glommer@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 609f2fab
......@@ -63,6 +63,8 @@ struct KVMState
#ifdef KVM_CAP_SET_GUEST_DEBUG
struct kvm_sw_breakpoint_head kvm_sw_breakpoints;
#endif
int irqchip_in_kernel;
int pit_in_kernel;
};
static KVMState *kvm_state;
......@@ -162,6 +164,17 @@ static void on_vcpu(CPUState *env, void (*func)(void *data), void *data)
abort();
}
int kvm_irqchip_in_kernel(void)
{
return kvm_state->irqchip_in_kernel;
}
int kvm_pit_in_kernel(void)
{
return kvm_state->pit_in_kernel;
}
int kvm_init_vcpu(CPUState *env)
{
KVMState *s = kvm_state;
......
......@@ -60,6 +60,9 @@ int kvm_remove_breakpoint(CPUState *current_env, target_ulong addr,
void kvm_remove_all_breakpoints(CPUState *current_env);
int kvm_update_guest_debug(CPUState *env, unsigned long reinject_trap);
int kvm_pit_in_kernel(void);
int kvm_irqchip_in_kernel(void);
/* internal API */
struct KVMState;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册