From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WK7L0-0005EX-4e for qemu-devel@nongnu.org; Sun, 02 Mar 2014 09:26:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WK7Ku-0001IF-5e for qemu-devel@nongnu.org; Sun, 02 Mar 2014 09:25:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WK7Kt-0001IA-Tj for qemu-devel@nongnu.org; Sun, 02 Mar 2014 09:25:48 -0500 Date: Sun, 2 Mar 2014 16:31:12 +0200 From: "Michael S. Tsirkin" Message-ID: <20140302143112.GD30372@redhat.com> References: <20140228185719.GJ17184@ERROL.INI.CMU.EDU> <20140228191425.GK17184@ERROL.INI.CMU.EDU> <5311F2BE.4060206@redhat.com> <20140302001707.GO17184@ERROL.INI.CMU.EDU> <5312F252.4090809@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5312F252.4090809@redhat.com> Subject: Re: [Qemu-devel] [PATCH] qemu: x86: report lapic version as 0x14 instead of 0x11 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: "Gabriel L. Somlo" , qemu-devel@nongnu.org, Andreas =?iso-8859-1?Q?F=E4rber?= , agraf@suse.de On Sun, Mar 02, 2014 at 09:56:50AM +0100, Paolo Bonzini wrote: > Il 02/03/2014 01:17, Gabriel L. Somlo ha scritto: > >Although, on KVM, it's simply hardcoded to 0x14 rather than exposing to > >the guest whatever the host CPU's apic version happens to be, or > >trying to match it to the CPU model: > > > > > >[somlo@foober kvm]$ grep -i version arch/x86/kvm/lapic.c > >... > >/* 14 is the version for Xeon and Pentium 8.4.8*/ > >#define APIC_VERSION (0x14UL | ((APIC_LVT_NUM - 1) << 16)) > >... > > > > > >I'd honestly prefer to stick to 0x14 (because it's simple :) ) > > I'd also prefer that, because I like having the same for KVM and > TCG, but I'm not sure it'd fly with others. :) > > >but if you're sure that's a bad idea, how about the struct x86_def_t > >rather than qdev ? > > > >So far, only OS X seems to even care at all about the version... > > Andreas, Michael, what do you think? > > Paolo I note that OSX is not the only one that cares, Linux does this: static int modern_apic(void) { /* AMD systems use old APIC versions, so check the CPU */ if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && boot_cpu_data.x86 >= 0xf) return 1; return lapic_get_version() >= 0x14; } So I think this commit should include some documentation analysing the reasons that this is a safe change. In any case, we really should also use old lapic version for compat machine types. -- MST