3

In the linux kernel I know that it's possible to memory map in pcie memory. Is it possible to execute from the memory mapped pcie device if it provides a region of memory?

For example, I have a PCIe card with an FPGA and some memory on it. I would like to map this region into a process address space and execute directly from the PCIe memory region. This means that I don't want the kernel to copy data from the PCIe device into a memory page in DDR.

The end goal would be do add this PCIe memory into a new linux memory zone and be able to use kmalloc to manage it.

Jay Hirata
  • 71
  • 2
  • 1
    Not clear what you want to do. Either instructions or data will be placed in that memory? – 0andriy Sep 18 '15 at 07:06
  • Technically it should be possible, but I don't know if the linux allows you to mark this memory region as executable. Compared to main memory it's very slow. It's also very risky to trust generated code from such a device. Copying even small amount back into main memory should be faster then accessing single datawords at cacheline granularity. – Paebbels Sep 18 '15 at 22:21
  • In order to execute I would need at least to have instructions placed in that memory. Data would be optional. I understand that if I could run out of PCIe memory, it would be slower and possibly have other risks. It's my understanding that PCIe memory *can* be cached, either way, performance of the issue isn't a concern. I figured that linux would have to be modified to support this, but I'm trying to get an understanding if the hardware would even support this. Hardware is x86_64 Xeon in server motherboard. Although, other x86_64 hardware knowledge would be welcome. – Jay Hirata Sep 21 '15 at 21:08
  • Since data is optional, I believe DAX is able to handle this functionality: https://www.kernel.org/doc/Documentation/filesystems/dax.txt – MateoConLechuga Aug 19 '20 at 23:46

0 Answers0