From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 29091 invoked from network); 26 Jun 1999 04:32:12 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 26 Jun 1999 04:32:12 -0000 Received: from mail13.digital.com (mail13.digital.com [192.208.46.30]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id XAA30657 for ; Fri, 25 Jun 1999 23:36:07 -0400 Received: from segsrv.hlo.dec.com (segsrv.hlo.dec.com [16.128.112.18]) by mail13.digital.com (8.9.2/8.9.2/WV2.0g) with SMTP id XAA31295 for ; Fri, 25 Jun 1999 23:36:06 -0400 (EDT) Received: from ogors2.ogo.dec.com by segsrv.hlo.dec.com (5.65v4.0/1.1.10.5/21Aug98-0201PM) id AA10348; Fri, 25 Jun 1999 23:36:03 -0400 Received: from ma.ultranet.com (jestabro@localhost [127.0.0.1]) by alpha1.estabrook.org (8.8.7/8.8.7) with ESMTP id AAA02121 for ; Fri, 25 Jun 1999 00:34:44 -0400 Message-Id: <199906250434.AAA02121@alpha1.estabrook.org> X-Mailer: exmh version 2.0.2 X-Exmh-Isig-Comptype: repl X-Exmh-Isig-Folder: axp-list To: axp-list@redhat.com From: Jay.Estabrook@digital.com Subject: Re: Kernel questions (not mine) In-Reply-To: Your message of Thu, 24 Jun 1999 14:44:27 -0400. Mime-Version: 1.0 Content-Type: text/plain Date: Fri, 25 Jun 1999 00:34:42 -0400 Sender: jestabro@ma.ultranet.com >>> Rich Payne said: > > ---------- Forwarded message ---------- > Date: Thu, 24 Jun 1999 14:45:38 -0400 (EDT) > From: Christopher T. Lansdown > To: Rich Payne > 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 -------------------------------------------------------------------------------