From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH] always report x2apic as supported feature Date: Thu, 16 Jul 2009 09:46:21 +0800 Message-ID: <200907160946.22327.sheng@linux.intel.com> References: <20090712131055.GB28046@redhat.com> <20090715230130.GB11794@amt.cnet> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Gleb Natapov , avi@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mga10.intel.com ([192.55.52.92]:19530 "EHLO fmsmga102.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756909AbZGPBqg (ORCPT ); Wed, 15 Jul 2009 21:46:36 -0400 In-Reply-To: <20090715230130.GB11794@amt.cnet> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Thursday 16 July 2009 07:01:30 Marcelo Tosatti wrote: > On Sun, Jul 12, 2009 at 04:10:55PM +0300, Gleb Natapov wrote: > > We emulate x2apic in software, so host support is not required. > > > > Signed-off-by: Gleb Natapov > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > index 00844eb..c256da7 100644 > > --- a/arch/x86/kvm/x86.c > > +++ b/arch/x86/kvm/x86.c > > @@ -1497,6 +1497,9 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 > > *entry, u32 function, case 1: > > entry->edx &= kvm_supported_word0_x86_features; > > entry->ecx &= kvm_supported_word4_x86_features; > > + /* we support x2apic emulation even if host does not support > > + it since we emulate x2apic in software */ > > + entry->ecx |= F(X2APIC); > > break; > > /* function 2 entries are STATEFUL. That is, repeated cpuid commands > > * may return different values. This forces us to get_cpu() before > > -- > > Gleb. > > What if you have an older host that does not support emulate x2apic? Due to interrupt remapping can't be enabled with KVM now, I think older host would just ignore this info... (The new one can work without interrupt remapping with KVM). By the way, I saw X2APIC in host supported CPUID feature list(1.ecx), which I don't think it's very properly. Host x2apic feature have nothing to do with KVM, we do the emulation all the way. I suggest to remove the mask for host, and give a comment that we would emulate all x2apic behaviour here, rather than "even if", which I think it's a little misleading. -- regards Yang, Sheng