All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 657329] [NEW] APIC unusable on QEMU
@ 2010-10-09 13:51 Geoffrey Lee
  2010-10-09 14:44 ` [Qemu-devel] " Jan Kiszka
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Geoffrey Lee @ 2010-10-09 13:51 UTC (permalink / raw)
  To: qemu-devel

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=i386-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 = (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 = 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 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=i386-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 = (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 = NULL;
+#endif
     return ret;
 }

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] Re: [Bug 657329] [NEW] APIC unusable on QEMU
  2010-10-09 13:51 [Qemu-devel] [Bug 657329] [NEW] APIC unusable on QEMU Geoffrey Lee
@ 2010-10-09 14:44 ` Jan Kiszka
  2018-04-10  8:50 ` [Qemu-devel] [Bug 657329] " Thomas Huth
  2018-06-10  4:17 ` Launchpad Bug Tracker
  2 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2010-10-09 14:44 UTC (permalink / raw)
  To: Bug 657329; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

Am 09.10.2010 15:51, Geoffrey Lee wrote:
> 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=i386-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)

Well, the APIC is very well usable for the VCPUs (which run with proper
cpu_single_env set. It is just out of reach for your debugging attempt.
We are working (granted: not actively ATM) on a proper device dump
interface that will allow to inspect the current APIC state as well.

BTW, your "fix" won't work if you enable io-thread support.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [Bug 657329] Re: APIC unusable on QEMU
  2010-10-09 13:51 [Qemu-devel] [Bug 657329] [NEW] APIC unusable on QEMU Geoffrey Lee
  2010-10-09 14:44 ` [Qemu-devel] " Jan Kiszka
@ 2018-04-10  8:50 ` Thomas Huth
  2018-06-10  4:17 ` Launchpad Bug Tracker
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2018-04-10  8:50 UTC (permalink / raw)
  To: qemu-devel

Looking through old bug tickets... can you still reproduce this issue
with the latest version of QEMU? Or could we close this ticket nowadays?


** Changed in: qemu
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/657329

Title:
  APIC unusable on QEMU

Status in QEMU:
  Incomplete

Bug description:
  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=i386-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 = (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 = NULL;
  +#endif
       return ret;
   }

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/657329/+subscriptions

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [Bug 657329] Re: APIC unusable on QEMU
  2010-10-09 13:51 [Qemu-devel] [Bug 657329] [NEW] APIC unusable on QEMU Geoffrey Lee
  2010-10-09 14:44 ` [Qemu-devel] " Jan Kiszka
  2018-04-10  8:50 ` [Qemu-devel] [Bug 657329] " Thomas Huth
@ 2018-06-10  4:17 ` Launchpad Bug Tracker
  2 siblings, 0 replies; 4+ messages in thread
From: Launchpad Bug Tracker @ 2018-06-10  4:17 UTC (permalink / raw)
  To: qemu-devel

[Expired for QEMU because there has been no activity for 60 days.]

** Changed in: qemu
       Status: Incomplete => Expired

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/657329

Title:
  APIC unusable on QEMU

Status in QEMU:
  Expired

Bug description:
  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=i386-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 = (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 = NULL;
  +#endif
       return ret;
   }

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/657329/+subscriptions

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-06-10  4:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-09 13:51 [Qemu-devel] [Bug 657329] [NEW] APIC unusable on QEMU Geoffrey Lee
2010-10-09 14:44 ` [Qemu-devel] " Jan Kiszka
2018-04-10  8:50 ` [Qemu-devel] [Bug 657329] " Thomas Huth
2018-06-10  4:17 ` Launchpad Bug Tracker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.