From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56541 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4Zz7-0003aj-6b for qemu-devel@nongnu.org; Sat, 09 Oct 2010 10:01:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4ZyS-0005n7-Nh for qemu-devel@nongnu.org; Sat, 09 Oct 2010 10:00:34 -0400 Received: from adelie.canonical.com ([91.189.90.139]:49972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4ZyS-0005n1-Br for qemu-devel@nongnu.org; Sat, 09 Oct 2010 10:00:32 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1P4ZyR-0001bW-H6 for ; Sat, 09 Oct 2010 15:00:31 +0100 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 6996B2E805D for ; Sat, 9 Oct 2010 14:00:31 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Sat, 09 Oct 2010 13:51:48 -0000 From: Geoffrey Lee <657329@bugs.launchpad.net> Sender: bounces@canonical.com References: <20101009135148.4804.78327.malonedeb@palladium.canonical.com> Message-Id: <20101009135148.4804.78327.malonedeb@palladium.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 657329] [NEW] APIC unusable on QEMU Reply-To: Bug 657329 <657329@bugs.launchpad.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Public bug reported: The APIC is unusable with QEMU using x86-64 system emulation. Problem exists in the latest stable QEMU 0.12.5 as well as the latest git head. I am using Mac OS X 10.6, 64-bit version of QEMU. The QEMU binary was configured with: ./configure --target-list=3Di386-softmmu,x86_64-softmmubck-i-search: conf_ Problem is that the hw/apic.c file (as well as a few other naughty files) rely on the cpu_single_env global - which is set to NULL in cpu- exec.c. Below is a test reading the local APIC version register: Before taking it out: (qemu) xp 0xfee00030 00000000fee00030: 0x00000000 (qemu) After: (qemu) xp 0xfee00030 00000000fee00030: 0x00050011 (qemu) Quick fix below. I don't know if there are any side effects with this, if this is OK maybe we can fix it like this for the stable versions and fix the HEAD to not rely on the cpu_single_env global. diff --git a/cpu-exec.c b/cpu-exec.c index dbdfdcc..3e966d7 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -674,7 +674,17 @@ int cpu_exec(CPUState *env1) env =3D (void *) saved_env_reg; = /* fail safe : never use cpu_single_env outside cpu_exec() */ +#warning fixup devices which rely on this +#if 0 + /* + * Hello. This is wrapped around an #if 0 ... #endif because that's + * what should happen. However, certain naughty devices (like the APIC + * for instance, and a few others), access this global variable. + * + * So this is here for now ... until we fix up those devices. + */ cpu_single_env =3D NULL; +#endif return ret; } ** Affects: qemu Importance: Undecided Status: New -- = APIC unusable on QEMU https://bugs.launchpad.net/bugs/657329 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. Status in QEMU: New Bug description: The APIC is unusable with QEMU using x86-64 system emulation. Problem exis= ts in the latest stable QEMU 0.12.5 as well as the latest git head. I am u= sing Mac OS X 10.6, 64-bit version of QEMU. The QEMU binary was configured with: ./configure --target-list=3Di386-softmmu,x86_64-softmmubck-i-search: conf_= = Problem is that the hw/apic.c file (as well as a few other naughty files) r= ely on the cpu_single_env global - which is set to NULL in cpu-exec.c. Below is a test reading the local APIC version register: Before taking it out: (qemu) xp 0xfee00030 00000000fee00030: 0x00000000 (qemu) After: (qemu) xp 0xfee00030 00000000fee00030: 0x00050011 (qemu) Quick fix below. I don't know if there are any side effects with this, if = this is OK maybe we can fix it like this for the stable versions and fix th= e HEAD to not rely on the cpu_single_env global. diff --git a/cpu-exec.c b/cpu-exec.c index dbdfdcc..3e966d7 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -674,7 +674,17 @@ int cpu_exec(CPUState *env1) env =3D (void *) saved_env_reg; = /* fail safe : never use cpu_single_env outside cpu_exec() */ +#warning fixup devices which rely on this +#if 0 + /* + * Hello. This is wrapped around an #if 0 ... #endif because that's + * what should happen. However, certain naughty devices (like the APIC + * for instance, and a few others), access this global variable. + * + * So this is here for now ... until we fix up those devices. + */ cpu_single_env =3D NULL; +#endif return ret; }