From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJlBR-0003v5-NG for qemu-devel@nongnu.org; Sat, 01 Mar 2014 09:46:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJlBM-0008Lo-5e for qemu-devel@nongnu.org; Sat, 01 Mar 2014 09:46:33 -0500 Received: from mail-qa0-x22f.google.com ([2607:f8b0:400d:c00::22f]:43117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJlBM-0008Lj-0w for qemu-devel@nongnu.org; Sat, 01 Mar 2014 09:46:28 -0500 Received: by mail-qa0-f47.google.com with SMTP id w5so1876141qac.34 for ; Sat, 01 Mar 2014 06:46:27 -0800 (PST) Sender: Paolo Bonzini Message-ID: <5311F2BE.4060206@redhat.com> Date: Sat, 01 Mar 2014 15:46:22 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20140228185719.GJ17184@ERROL.INI.CMU.EDU> <20140228191425.GK17184@ERROL.INI.CMU.EDU> In-Reply-To: <20140228191425.GK17184@ERROL.INI.CMU.EDU> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: "Gabriel L. Somlo" , qemu-devel@nongnu.org Cc: agraf@suse.de, mst@redhat.com Il 28/02/2014 20:14, Gabriel L. Somlo ha scritto: > Some guests (e.g. 0S X) insist on a minimum lapic version of 0x14. > This patch bumps the emulated lapic version to 0x14 to accomodate that. > > Signed-off-by: Gabriel L. Somlo > --- > > Along with the TCG ioapic polarity fix, this allows me to boot OS X > without KVM acceleration. > > I dug around the Intel docs and searched the Web, and there was nothing > there to indicate any difference in functionality between lapic versions > 0x11 and 0x14. It appears to me that lapic version is loosely correlated > with the "generation" of the CPU it's attached to, and Apple simply decided > to include an extra check that basically says "we don't support CPUs older > than ", where the oldest they support ships with lapics that > were versioned to 0x14 :) For example: > > http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/osfmk/i386/lapic.c > > Let me know what you think. > > Thanks, > Gabriel > > hw/intc/apic.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/intc/apic.c b/hw/intc/apic.c > index 361ae90..67365b7 100644 > --- a/hw/intc/apic.c > +++ b/hw/intc/apic.c > @@ -675,7 +675,7 @@ static uint32_t apic_mem_readl(void *opaque, hwaddr addr) > val = s->id << 24; > break; > case 0x03: /* version */ > - val = 0x11 | ((APIC_LVT_NB - 1) << 16); /* version 0x11 */ > + val = 0x14 | ((APIC_LVT_NB - 1) << 16); /* version 0x14 */ > break; > case 0x08: > apic_sync_vapic(s, SYNC_FROM_VAPIC); > Looks good, but you have to make this a qdev property so that older versions keep using version 0x11. Paolo