From: Jay.Estabrook@digital.com
To: axp-list@redhat.com
Subject: Re: Kernel questions (not mine)
Date: Fri, 25 Jun 1999 00:34:42 -0400 [thread overview]
Message-ID: <199906250434.AAA02121@alpha1.estabrook.org> (raw)
In-Reply-To: Your message of Thu, 24 Jun 1999 14:44:27 -0400. <Pine.LNX.4.10.9906241443290.18107-100000@talisman.mv.com>
>>> Rich Payne said:
>
> ---------- Forwarded message ----------
> Date: Thu, 24 Jun 1999 14:45:38 -0400 (EDT)
> From: Christopher T. Lansdown <lansdoct@screech.cs.alfred.edu>
> To: Rich Payne <rdp@talisman.alphalinux.org>
> Subject: Re: Is anyone on the axp list?
>
> Hello,
> I have a few kernel related questions:
> 1. Why does the kernel start out at 0x10000000, and thus all normal stuff
> that is kalloc()ed has a virt_to_bus address somewhere after that?
First off, virt_to_bus() provides an address FOR A BUS DEVICE TO ISSUE to
get access to host memory (often referred to as DMA).
On Alpha, we define a direct-map PCI DMA window (a range of addresses on the
PCI bus) which will be translated, by the core logic chipset, into host memory
addresses. We normally set this window at some high PCI bus address, above
where other devices have had their local memory configured; on most Alpha
platforms this window goes at 1Gb, for a length of 1Gb; newer platforms may
direct-map an additional 1Gb at 2Gb, or start at 2Gb for 2Gb.
So, a page of memory at physical address 0 would return a virt_to_bus()
address of 1Gb + 0 (0x40000000). A page at the end of 256Mb of memory would
return 1Gb + 0x0fffe000 (0x4fffe000) as a virt_to_bus(). Most kmalloc'd
memory will be below 0x300000 or above the end of the kernel (0x500000 and
up, usually).
> 2. How is ISA DMA memory forced down to an adress in the first 16MB of
> RAM? (i.e. how is it that dma memory has a virt_to_bus address in the
> first 16MB of memory? Is there something special done to make the memory
> dma memory instead of simply doing kalloc() than virt_to_bus() on it?)
There are currently no PCI DMA windows in the address range 0 - 16Mb, which
makes "true" ISA devices (24-bit addresses) unsupported on Alpha. Most
common so-called ISA devices actually can work with 32-bit addresses,
allowing them to access to the PCI DMA window range usually located at 1Gb.
Some, like Adaptec 1540, are true ISA, and thus difficult to support with
the current direct-map PCI DMA window scheme.
The LINUX kernel does support the request for ISA DMA-able memory via kmalloc
flags, but this is useless on Alpha.
But wait! There's hope... ;-}
In addition to the direct-map windows, there is support in the hardware for
what is called in the documentation "scatter-gather" windows. These employ a
single-level-page-table-like scheme, to allow physical memory addresses that
are larger than 4Gb (32 bits) to be mapped to by 32-bit PCI bus addresses.
Using this scheme, Digital UNIX currently manages a scatter-gather window
starting at 8Mb for a length of 8Mb, so that true ISA devices, along with
typical PCI devices, can gain access to ANY physical memory up to the
hardware memory limits (32Gb on DS20, and probably more on the 8200/8400
series). There's no reason that LINUX on Alpha couldn't use the same
technique.
But, this flexibility comes at a price: that 8Mb scatter-gather window is
a limited resource and must be managed, ie BOTH "allocate" AND "free" MUST
be used by drivers who need to acquire and release a range of addresses for
their device to use to access host memory.
Unfortunately, this is not something that most LINUX drivers have
considered, with the exception of some of the SPARC-specific ones.
It also means that official generic large-memory configuration support in
LINUX will most likely be added in 2.3 (or 2.5), as it cannot be added into
just Alpha code, it needs common driver involvement at some level.
--Jay++
-------------------------------------------------------------------------------
American Non Sequitur Society: we don't make sense, but we do like pizza...
Jay A Estabrook Alpha Motherboards - LINUX Project
Compaq Computer Corporation - SHR3-2/R28 (508) 841-3241 or (DTN) 237-3241
334 South Street, Shrewsbury, MA 01545 Jay.Estabrook@digital.com
-------------------------------------------------------------------------------
prev parent reply other threads:[~1999-06-26 4:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-24 18:44 Kernel questions (not mine) Rich Payne
1999-06-25 4:34 ` Jay.Estabrook [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox