From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: KVM: Another fix for tsc deadline timer without irqchip_in_kernel() Date: Mon, 3 Oct 2011 16:11:31 -0300 Message-ID: <20111003191131.GA20671@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: kvm Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50150 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751853Ab1JCTMP (ORCPT ); Mon, 3 Oct 2011 15:12:15 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p93JCFrc019885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 3 Oct 2011 15:12:15 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p93JCEgZ011258 for ; Mon, 3 Oct 2011 15:12:14 -0400 Received: from amt.cnet (vpn-9-85.rdu.redhat.com [10.11.9.85]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p93JCD2V015676 for ; Mon, 3 Oct 2011 15:12:14 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 3D857656104 for ; Mon, 3 Oct 2011 16:11:33 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.5/8.14.5/Submit) id p93JBVcU020737 for kvm@vger.kernel.org; Mon, 3 Oct 2011 16:11:31 -0300 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: get/set MSR functions not prepared to deal with non existance of in kernel irqchip. Signed-off-by: Marcelo Tosatti diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 92390dc..54abb40 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -963,6 +963,8 @@ void kvm_free_lapic(struct kvm_vcpu *vcpu) u64 kvm_get_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu) { struct kvm_lapic *apic = vcpu->arch.apic; + if (!apic) + return 0; if (apic_lvtt_oneshot(apic) || apic_lvtt_period(apic)) return 0; @@ -973,6 +975,8 @@ u64 kvm_get_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu) void kvm_set_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu, u64 data) { struct kvm_lapic *apic = vcpu->arch.apic; + if (!apic) + return; if (apic_lvtt_oneshot(apic) || apic_lvtt_period(apic)) return;