From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [PATCH 05/10] Don't call apic functions directly from kvm code Date: Wed, 17 Mar 2010 11:00:22 -0300 Message-ID: <20100317140022.GA9951@mothafucka.localdomain> References: <1267215141-13629-1-git-send-email-glommer@redhat.com> <1267215141-13629-2-git-send-email-glommer@redhat.com> <1267215141-13629-3-git-send-email-glommer@redhat.com> <1267215141-13629-4-git-send-email-glommer@redhat.com> <1267215141-13629-5-git-send-email-glommer@redhat.com> <1267215141-13629-6-git-send-email-glommer@redhat.com> <4B964CA6.9050909@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, mtosatti@redhat.com To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46149 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753605Ab0CQOAZ (ORCPT ); Wed, 17 Mar 2010 10:00:25 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2HE0OBe026338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 17 Mar 2010 10:00:25 -0400 Content-Disposition: inline In-Reply-To: <4B964CA6.9050909@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Mar 09, 2010 at 03:27:02PM +0200, Avi Kivity wrote: > On 02/26/2010 10:12 PM, Glauber Costa wrote: > >It is actually not necessary to call a tpr function to save and load cr8, > >as cr8 is part of the processor state, and thus, it is much easier > >to just add it to CPUState. > > > >As for apic base, wrap kvm usages, so we can call either the qemu device, > >or the in kernel version. > > > > > > } > > > >+static void kvm_set_apic_base(CPUState *env, uint64_t val) > >+{ > >+ if (!kvm_irqchip_in_kernel()) > >+ cpu_set_apic_base(env, val); > > What if it is in kernel? Just ignored? Doesn't seem right. At this point it is right, because there is no irqchip in kernel yet. In a later patch, irqchip in kernel begins to exist, and this function gets filled.