From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJSvd-0004sD-IC for qemu-devel@nongnu.org; Fri, 28 Feb 2014 14:17:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJSvY-0002jW-0J for qemu-devel@nongnu.org; Fri, 28 Feb 2014 14:17:01 -0500 Received: from mail-qa0-x233.google.com ([2607:f8b0:400d:c00::233]:49079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJSvX-0002jJ-Rc for qemu-devel@nongnu.org; Fri, 28 Feb 2014 14:16:55 -0500 Received: by mail-qa0-f51.google.com with SMTP id j7so1077645qaq.38 for ; Fri, 28 Feb 2014 11:16:55 -0800 (PST) Date: Fri, 28 Feb 2014 14:14:25 -0500 From: "Gabriel L. Somlo" Message-ID: <20140228191425.GK17184@ERROL.INI.CMU.EDU> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140228185719.GJ17184@ERROL.INI.CMU.EDU> Subject: [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: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, agraf@suse.de, mst@redhat.com 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); -- 1.8.1.4