linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* local APIC may cause XFree86 hang
@ 2002-11-13 22:29 Mikael Pettersson
  2002-11-13 23:19 ` Alan Cox
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Mikael Pettersson @ 2002-11-13 22:29 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: local APIC may cause XFree86 hang
@ 2002-11-14  0:29 Nakajima, Jun
  2002-11-14  0:48 ` Linus Torvalds
  0 siblings, 1 reply; 11+ messages in thread
From: Nakajima, Jun @ 2002-11-14  0:29 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel



Are we disabling vm86 code to access to PIT or PIC? I saw some video ROM
code (either BIOS call or far call) did access PIT, confusing the OS.

Thanks,
Jun

> -----Original Message-----
> From: torvalds@transmeta.com [mailto:torvalds@transmeta.com]
> Sent: Wednesday, November 13, 2002 3:53 PM
> To: linux-kernel@vger.kernel.org
> Subject: Re: local APIC may cause XFree86 hang
> 
> In article <15826.53818.621879.661253@kim.it.uu.se>,
> Mikael Pettersson  <mikpe@csd.uu.se> wrote:
> >
> >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
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: local APIC may cause XFree86 hang
@ 2002-11-14  1:16 Nakajima, Jun
  2002-11-14  1:38 ` Linus Torvalds
  0 siblings, 1 reply; 11+ messages in thread
From: Nakajima, Jun @ 2002-11-14  1:16 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel


The one instance I saw was that the BIOS was reading 8254 in a tight loop
for a calibration purpose, and it was assuming the time proceeded in a
constant speed, to exit the loop. In other words, it never assumed it could
get interrupts. To vm86, interrupts are invisible, but they have impacts on
the actual speed. 

Jun

> -----Original Message-----
> From: Linus Torvalds [mailto:torvalds@transmeta.com]
> Sent: Wednesday, November 13, 2002 4:48 PM
> To: Nakajima, Jun
> Cc: linux-kernel@vger.kernel.org
> Subject: RE: local APIC may cause XFree86 hang
> 
> 
> On Wed, 13 Nov 2002, Nakajima, Jun wrote:
> >
> > Are we disabling vm86 code to access to PIT or PIC? I saw some video ROM
> > code (either BIOS call or far call) did access PIT, confusing the OS.
> 
> Well, the kernel itself doesn't actually disable/enable anything, it
> leaves that decision to the caller.
> 
> XFree86 obviously does have IO rights, and I suspect it may allow the
> video BIOS to do just about anything, simply because it doesn't have much
> choise (the video bios clearly needs a lot of IO privileges too). So yes,
> that could easily confuse the OS if it happens, but it should be
> independent of IO-APIC vs not.
> 
> 		Linus

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

end of thread, other threads:[~2002-11-14 13:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-13 22:29 local APIC may cause XFree86 hang Mikael Pettersson
2002-11-13 23:19 ` Alan Cox
2002-11-13 23:01   ` Mikael Pettersson
2002-11-13 23:52 ` Linus Torvalds
2002-11-14  7:58 ` Gregoire Favre
2002-11-14  0:29 Nakajima, Jun
2002-11-14  0:48 ` Linus Torvalds
2002-11-14  1:16 Nakajima, Jun
2002-11-14  1:38 ` Linus Torvalds
2002-11-14  8:08   ` george anzinger
2002-11-14 14:27     ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).