Re: PCI resource problems caused by improper address rounding

From: Keith Packard
Date: Tue Dec 18 2007 - 21:55:24 EST



On Tue, 2007-12-18 at 13:09 -0800, Linus Torvalds wrote:

> It's not like 256MB is even as large as they come, half-gig graphics cards
> are getting to be fairly common at the high end, and X absolutely _has_ to
> be able to handle a 64-bit address for those.

We're now using a system-dependent wrapper library 'libpciaccess' for
all of this stuff, it uses 64-bits for all PCI addresses and should make
this transparent to the X driver.

In addition, our kernel drivers are moving to support graphics cards
that have memory beyond that addressable through their aperture, so we
should be able to manage cards with even more memory, some of which is
not reachable from the CPU.

> Also, I'm surprised it doesn't work with X already: the ChangeLog for X
> says that there are "Minor fixes to the handling of 64-bit PCI BARs [..]"
> in 4.6.99.18, so I'd have assumed that XFree86-4.7.0 should be able to
> handle this perfectly well.

And that code has been replaced with an even more general library that
abstracts away all of the PCI routing issues.

> I'll add Keithp to the cc too, to see if the X issues can be clarified.
> Maybe he can set us right. But maybe you just have an old X server? If so,
> considering the situation, I really think the kernel has done a good job
> already, and I'd be *very* nervous about making the kernel allocate new
> PCI resources right after the end-of-memory thing.

Trying a libpciaccess-based X server is certainly something worth doing,
that should be 1.4 or later (thanks, git-describe).

> I bet it would work in this case, but as mentioned, we definitely know of
> cases where the BIOS did *not* document the magic memory region that was
> stolen for UMA graphics, and trying to put PCI devices just after the top
> of reserved memory in the e820 list causes machines to not work at all
> because the address decoding will clash.

There is an additional single-page BAR on 9xx chips which may end up
mapped and not documented. Our kernel driver should correctly deal with
that now though.

--
keith.packard@xxxxxxxxx

Attachment: signature.asc
Description: This is a digitally signed message part