Skip to contentSkip to conversation

local APIC may cause XFree86 hang

DISCUSSION Mikael Pettersson 4 participants 5 messages Nov 13, 2002 – Nov 14, 2002

lore
Share & tools
lore
#0 lore raw

Yesterday I installed a Radeon 8500 in a box. Suddenly the box consistently hung hard every time I tried to shut down XFree86.

It turned out to be the local APIC timer: with it enabled, the hangs occur; with it disabled but with the rest of the local APIC and the performance counters in use, there are no problems at all.

Does XFree86 (its core or particular drivers) use vm86() to invoke, possibly graphics card specific, BIOS code? That would explain the hangs I got. The fix would be to disable the local APIC around vm86()'s BIOS calls, just like we now disable it before APM suspend.

Doesn't the PCI code also do BIOS calls?

/Mikael

#1 lore raw
Quoted 5 lines · Mikael Pettersson

Does XFree86 (its core or particular drivers) use vm86() to invoke, possibly graphics card specific, BIOS code? That would explain the hangs I got. The fix would be to disable the local APIC around vm86()'s BIOS calls, just like we now disable it before APM suspend.

It does yes

#2 lore raw
Quoted 8 lines · Alan Cox
Quoted 5 lines · Mikael Pettersson

Does XFree86 (its core or particular drivers) use vm86() to invoke, possibly graphics card specific, BIOS code? That would explain the hangs I got. The fix would be to disable the local APIC around vm86()'s BIOS calls, just like we now disable it before APM suspend.

It does yes

Ok. I'll start working on a patch to vm86() tomorrow.

/Mikael

#3 lore raw
In reply to Mikael Pettersson

In article <[email protected]>,

Quoted 6 lines · Mikael Pettersson

Does XFree86 (its core or particular drivers) use vm86() to invoke, possibly graphics card specific, BIOS code? That would explain the hangs I got. The fix would be to disable the local APIC around vm86()'s BIOS calls, just like we now disable it before APM suspend.

It does.

HOWEVER, vm86() mode is very very different from APM, which uses real mode. External interrupts in vm86 mode will not be taken inside vm86 mode - and disabling the local timer (by disabling the APIC) around a vm86 mode is definitely _not_ a good idea, since it would be an instant denial-of-service attack on SMP machines (the PIT timer only goes to CPU0, so we depend on the local timer to do process timeouts etc on other CPUs). The vm86 code might just be looping forever.

In other words, if it is really vm86-related, then
(a) it's a CPU bug
(b) we're screwed

I bet it's something else. Possibly just timing-specific (the APIC makes interrupts much faster), but also possibly something to do with the VGA interrupt (some XFree86 drivers actually use the gfx interrupts these days)

Linus

#4 lore raw
In reply to Mikael Pettersson

Hello,

I don't know if it's related or not, but under .47 if I enable fb, switching from X to the console hangs my system, with just VGA console I don't have this problem (and anyway, with my Mach 64 card since a lots of 2.5 the console is not usable: the white is replaced by an ilisible blue???).

Have a great day,

Grégoire
________________________________________________________________
http://ulima.unil.ch/greg ICQ:16624071 mailto:[email protected]