Re: 1G DMA buffer under XP - how?
From: Peter Wieland [MSFT] (peterwie_at_online.microsoft.com)
Date: 10/28/04
- Next message: Kishore: "Re: Problems wth my own User Mode WDM Audio Driver on Windows 2003"
- Previous message: Peter Wieland [MSFT]: "Re: BugCheck in TDI Filter TDI_RECEIVE Completion."
- In reply to: Ferenc Valenta: "Re: 1G DMA buffer under XP - how?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 28 Oct 2004 09:23:50 -0700
In the world of the future, controllers might not be able to see all of
system memory, and what is address 0 to the controller could be something
completely different to the host. This was the case for the old RISC
systems which used actual map registers to create DMA windows for the
controllers. Only the HAL knows how your device is attached to the system,
so only the HAL's DMA routines (exposed by the I/O manager) can allocate
common buffer correctly in all situations.
With the hardware you've defined (next physical address being stored in the
data stream) you can't do direct I/O safely nor can you share the common
buffer with the application. If you do this then nothing stops the app from
overwriting the "next PA" value after your driver has set it. Now my app
can open your device and have it DMA from any address in the system (or from
an invalid address causing a DMA error). Unless i'm missing something,
using direct I/O opens a pretty big security/stability hole in the
customer's system.
-p
-- This posting is provided "AS IS" with no warranties, and confers no rights. "Ferenc Valenta" <Ferenc Valenta@discussions.microsoft.com> wrote in message news:B095FF45-13EB-44BC-A6F1-7CA4C7B4E6D0@microsoft.com... > "Eliyas Yakub [MSFT]" wrote: > >>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/kmarch/hh/kmarch/k104_8f4336cd-03b0-4ca2-9538-182970594ba3.xml.asp >> > >> > How can this function be helpful to me? >> >> I just put that link to show you the math on 64 MB limit. > > I get it! Does this mean, that no Mdl can describe a buffer larger than > 64M? > If it does, then it's impossible to perform scatter DMA of more than 64M > of > length. (?) Because of this, the only solution (?) can be the following: > >> Most of the information about MmAllocatContiguousMemory holds good for >> AllocateCommonBuffer but you should not use MmAllocatContiguousMemory for >> DMA operation. You should only use AllocateCommonBuffer because it knows >> the >> addressing capabilities of your device and the bus it's attached to, and >> it >> will make sure that memory allocated (using >> MmAllocateContiguousMemorySpecifyCache) does not cross physical >> boundaries. > > I'll try if AllocateCommonBuffer can deal with 1G. If it succeeds, we are > ready. > (But not very happy, because the wonderful scatter DMA capable hardware > can't present us it's real performance) > If it doesn't, I'll have to use MmAllocateContiguousMemory or > ...SpecifyCache. > Why can this cause problems? My card is happy with any physical address > below 4G, and I can tell this call to only allocate below the given > HighestAcceptableAddress. If the memory returned is not aligned to system > page size, I make it allocate one more page, and then discard the first > and > last > partial pages. (Examining the physical address of the allocated memory, > not > the virtual address returned, of course) > Or it isn't that simple as I imagine? > > Again, we can declare, that windows XP kernel is not capable to deal with > direct io buffers and scatter DMA larger than 64M? > I want to know it absolutely sure. I wonder if some buffers can be > allocated > simultaneously, passed to the same driver, and the driver then could link > the > buffers together, and start the DMA... Hmm. > > Thank you for the informations, you helped me a lot. > If do you have any idea, where to go, who to ask, please let me know. > I begin to make the code using common buffer or contiguous memory.... :( > >> -Eliyas > > VF >
- Next message: Kishore: "Re: Problems wth my own User Mode WDM Audio Driver on Windows 2003"
- Previous message: Peter Wieland [MSFT]: "Re: BugCheck in TDI Filter TDI_RECEIVE Completion."
- In reply to: Ferenc Valenta: "Re: 1G DMA buffer under XP - how?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|