Re: PCI Express support for 2.4 kernel

From: Linus Torvalds
Date: Mon Dec 15 2003 - 15:01:26 EST




On Mon, 15 Dec 2003, Vladimir Kondratiev wrote:
>
> Should I understand it this way: for system with >=1Gb RAM, I will be
> unable to ioremap 256Mb region?

Yes.

> It looks confusing. On my test system (don't ask details, I am not
> alowed to share this info), I see
> video controller with 256Mb BAR. Does it mean this controller will not
> work as well?

It works, but that's because the kernel doesn't even _try_ to map it into
the kernel virtual address space.

XFree86 maps it into its user address space (which is 3GB, and doesn't
have to try to map much else into it).

> There is alternative solution, for each transaction to ioremap/unmap
> corresponded page.

Nope, you can't do that. It's not really supported from interrupts and
early boot - both of which will want to access PCI config space.

> I don't like it, it involves huge overhead.

Indeed it would. But using fixmaps does _not_.

But a fixmap will be easy to use, and reasonable efficient: it will
allocate just one virtual page, and then it will force a TLB flush when it
switches over the mapping.

You can improve the efficiency by caching the "last fixmap entry" and only
doing "set_fixmap()" when changing devices.

You could also do a per-cpu fixmap, which would help further, but that
ends up being more work too. Probably not worth it, especially as it is
entirely possible that the hardware requires single-threaded access
anyway (ie I would not be surprised at all if the southbridge got very
confused if you tried to do overlapping config accesses)..

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/