Re: MmMapLockedPages with UserMode pointer

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Pavel,

You can just pass NULL and the system will pick an unused address
range for you.

I know. However, this is not what I want to do. I want to reserve a large
address range in user mode (2GByte) and have the driver map locked
pages into that space. Let me explain briefly.

I have designed an FPGA-accelerator which sits in a PCI-X-slot in my
64-bit Server 2003 machine. The PC has 32GByte of memory.
What I want to establish is "uniform memory access for heterogeneous
processors". Both the FPGA and the CPU are processing a large data set
simultaneously, the FPGA needs to access the data frequently just as the
CPU does. Explicit copying on demand from the CPU to the FPGA would
annihilate any performance gains.
So I want to lock a 2GByte memory region, which of course I don't always
get in one chunk. So, instead, I allocate 512 contiguous 4MByte-
segments and pin them down. The FPGA has an address translation table
with 512 entries, so I program the physical addresses into that "MMU".
This works fine.
However, when I try to map that memory into user space there is a
problem. I pass NULL to the first MmMapLockedPages, but for all other
4MByte chunks I pass the returned VA plus n*4MByte to create a
contiguous user space address range. Sooner or later, of course, it fails
because most likely it will cross already allocated space.
So, the other way round, first reserving 2GByte user VA range, and then
passing the start address to MmMapLockedPages would solve the
problem.
But, alas, that doesn't work.

Any idea how I can solve this problem?

Thanks


.



Relevant Pages

  • Re: [Patch 0/7] Implement crashkernel=auto
    ... That means a 1TB machine will have a 32GB crash kernel. ... loaded) reduce the amount of memory reserved by the crash kernel. ... Because it is absolutely ridiculous in size and user space will have ... to reserve based on how much memory we have in the system. ...
    (Linux-Kernel)
  • Re: [Patch 0/7] Implement crashkernel=auto
    ... To get a stock stat drive by hand I had to list about 5 kernel modules ... I am saying the problem is in user space. ... The kernel doesn't have to reserve the exact amount of memory that a kexec kernel will use, it just finds a big enough size for all cases which already assumes the physical memory is large enough. ...
    (Linux-Kernel)
  • Re: + edac-new-opteron-athlon64-memory-controller-driver.patch added to -
    ... So we can kill the processes using that memory. ... What is the chipsets idea of which DIMM the memory error occurred on. ... There has always been enough information to determine the hardware ... some that are not easily accessible to user space so a kernel driver ...
    (Linux-Kernel)
  • Re: 66MIPS 8bit microcontroller
    ... The FPSLIC runs at 40 MHz and has max 32 kB code memory and no external bus. ... It's pretty simple to knock over a FPGA on Priceand Icc, ... Plus, it skews design decisions. ... course there are the complications of any combination of FPGA and CPU ...
    (comp.arch.embedded)
  • Re: Problems with Marvell PXA320 using CS0 and CS1
    ... I was guessing that there might be a bug in the FPGA code. ... let's say that somewhere in the range of memory ... When caching is on, you get something back, presumably ... If we have caching turned on we can write to the second bank (CS1) ...
    (microsoft.public.windowsce.platbuilder)