Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTH8V-0003DN-FB for qemu-devel@nongnu.org; Tue, 21 Jul 2009 11:20:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTH8Q-0003C5-OH for qemu-devel@nongnu.org; Tue, 21 Jul 2009 11:20:11 -0400 Received: from [199.232.76.173] (port=41080 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTH8Q-0003By-8O for qemu-devel@nongnu.org; Tue, 21 Jul 2009 11:20:06 -0400 Received: from mx2.redhat.com ([66.187.237.31]:57713) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MTH8P-00048T-QF for qemu-devel@nongnu.org; Tue, 21 Jul 2009 11:20:06 -0400 From: Glauber Costa Date: Tue, 21 Jul 2009 12:26:58 -0300 Message-Id: <1248190018-22577-1-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH] provide tests for pit in kernel and irqchip in kernel List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com 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: Glauber Costa --- kvm-all.c | 13 +++++++++++++ kvm.h | 3 +++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 2f74dcb..ed86315 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -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; @@ -153,6 +155,17 @@ static void kvm_reset_vcpu(void *opaque) } } +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; diff --git a/kvm.h b/kvm.h index 96b4d72..0d4dd53 100644 --- a/kvm.h +++ b/kvm.h @@ -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; -- 1.6.2.2