From patchwork Mon May 11 10:35:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 22929 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4BAaJrd021179 for ; Mon, 11 May 2009 10:36:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752485AbZEKKgP (ORCPT ); Mon, 11 May 2009 06:36:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752120AbZEKKgN (ORCPT ); Mon, 11 May 2009 06:36:13 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53784 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751932AbZEKKf7 (ORCPT ); Mon, 11 May 2009 06:35:59 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4BAa0lD019335 for ; Mon, 11 May 2009 06:36:00 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4BAZx4h030307; Mon, 11 May 2009 06:35:59 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n4BAZvkX018194; Mon, 11 May 2009 06:35:58 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 4314B18D468; Mon, 11 May 2009 13:35:56 +0300 (IDT) From: Gleb Natapov To: avi@redhat.com Cc: kvm@vger.kernel.org, Gleb Natapov Subject: [PATCH 09/10] Disable CR8 intercept if tpr patching is active. Date: Mon, 11 May 2009 13:35:54 +0300 Message-Id: <1242038155-8759-9-git-send-email-gleb@redhat.com> In-Reply-To: <1242038155-8759-1-git-send-email-gleb@redhat.com> References: <1242038155-8759-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Gleb Natapov --- arch/x86/kvm/x86.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 2729c4b..04236b2 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3130,7 +3130,10 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu) if (!kvm_x86_ops->update_cr8_intercept) return; - max_irr = kvm_lapic_find_highest_irr(vcpu); + if (!vcpu->arch.apic->vapic_addr) + max_irr = kvm_lapic_find_highest_irr(vcpu); + else + max_irr = -1; if (max_irr != -1) max_irr >>= 4; @@ -3237,10 +3240,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) kvm_x86_ops->enable_irq_window(vcpu); if (kvm_lapic_enabled(vcpu)) { - if (!vcpu->arch.apic->vapic_addr) - update_cr8_intercept(vcpu); - else - kvm_lapic_sync_to_vapic(vcpu); + update_cr8_intercept(vcpu); + kvm_lapic_sync_to_vapic(vcpu); } up_read(&vcpu->kvm->slots_lock);