[Linux-fbdev-devel] Re: Who is stomping PCI config space?

Benjamin Herrenschmidt benh at kernel.crashing.org
Sat Mar 5 14:39:50 PST 2005


> Right. And without any driver support it is difficult to know if the
> card decodes legacy resources or if this decoding is turned off.
> I can do waht Jon suggested and use the 'industry standard' VGA disable
> registers. 
> Depending on the card those registers may disable more than just VGA.
> 
>  > 
>  > There isn't a simple way to solve that that I know, except if the card
>  > can be configured to totally ignore VGA accesses, in which case it
>  > doesn't need to be disabled, but X doesn't know it...  (though if we
>  > have a central "arbibrer", the driver for the card can tell it to remove
>  > that card from the arbitration).
> 
> Right. But we don't load the driver.

Yes, you can assume the worst case at first, and later on have the
driver disable decoding of legacy stuff and inform your arbiter to stop
caring about that specific card, no ?

> On a multi-CPU system this can be a problem as one CPU may work on
> the previously enabled VGA card while the other one tries to service
> the VGA card that has sent the interrupt.

Yes. Fancy things like local disabling of irqs etc... aren't an option.
>  > 
>  > So even with a kernel based arbitrer, the irq scenario isn't possible to
>  > deal with properly, unless VGA decoding can be completely disabled on a
>  > given card, or nobody uses VGA memory accesses on any card. (Most modern
>  > drivers only use non-VGA memory/IO, or even IO are remapped to some
>  > different addresses with some cards).
> 
> On a lot of cards there may be situations where VGA registers need to
> be accessed for specific purposes.

Yup, though "modern" cards usually don't. A radeon operates 100% without
access to any legacy resource lately (except the console restore on
console switch, but that's fairly isolated and I even removed it on ppc
as it breaks things on setups where the card was boostrapped in "no VGA"
mode. I personally think it should be done by the kernel). I think
nvidia's "remap" the VGA registes somewhere in normal MMIO space, at
least I think I remember seeing something like that.

> Furthermore it must not be expected that nobody uses older cards which
> still require VGA registers.

Agreed.

> Is there a way to halt a process that is using VGA registers for the
> time the interrupt gets serviced? For example sending a signal to 
> this process so that it suspends norml execution waits in a signal 
> handler?

Not really. Well, something could be hacked, that is, the current CPU is
obviously handling the IRQ, so the process "below" has been halted, but
it would require some kind of IPI tricks to also halt other CPUs, quite
heavy handed I think.

> All this would only matter for systems with more than one CPU.

Yes, but those are becoming quite common. Also multicore is coming ;)

Ben.





More information about the xorg mailing list