From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Peter Huang(Peng)" Subject: Re: [Question] why x2apic's set by default without host support(on Nehalem CPU). Date: Tue, 23 Jul 2013 10:38:06 +0800 Message-ID: <51EDEC8E.4050802@huawei.com> References: <51ED1668.7030205@huawei.com> <51ED2735.3050107@huawei.com> <20130722235540.GA20029@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Cc: , To: Marcelo Tosatti Return-path: Received: from szxga01-in.huawei.com ([119.145.14.64]:62346 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753205Ab3GWCiS (ORCPT ); Mon, 22 Jul 2013 22:38:18 -0400 In-Reply-To: <20130722235540.GA20029@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Hi, Marcelo Thanks for replying. I noticed that, kvm has emulated x2apic, but I can't find where the code exits. Could you give me some hint? Thanks again. On 2013-07-23 7:55, Marcelo Tosatti wrote: > Peter, > > Because x2apic support is emulated in software. > > On Mon, Jul 22, 2013 at 08:36:05PM +0800, Peter Huang(Peng) wrote: >> I traced the qemu process, and find out that host cpuid doesn't support x2apic, >> but VM interception seems enabled x2apic. >> >> with function=1(bit 21 indicates x2apic) >> host_cpuid:ecx=0x009ce3bd >> guest_cpuid:ecx=0x00b82201 >> >> On 2013-07-22 19:24, Peter Huang(Peng) wrote: >>> Hi, Everyone >>> >>> I have been encountered a problem recently. >>> My box uses Nehalem E5520 CPU, and this model doesn't support x2apic feature. >>> I created a VM on KVM, and uses cpu mode=pass-through, I can get the right cpu >>> model from the VM, but I can also see that the CPU in the vm supports x2apic. >>> >>> This seems werid. >>> From QEMU's CPU model definition, Nehalem also doesn't support x2apic. >>> >>> Can anyone explain it? >>> >>> Thanks to you all! >>> >>> Below is the cpuinfo from host and guest: >>> host: >>> fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush >>> dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc >>> arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 >>> monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 >>> popcnt lahf_lm dtherm tpr_shadow vnmi flexpriority ept vpid >>> >>> vm: >>> fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush >>> mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon rep_good >>> nopl pni ssse3 cx16 sse4_1 sse4_2 *x2apic *popcnt hypervisor lahf_lm