[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - Access Host(O/S)-Ram from Epiphany via DMA
Page 1 of 1

Access Host(O/S)-Ram from Epiphany via DMA

PostPosted: Tue May 23, 2017 11:16 pm
by moses_rotesmeer

Re: Access Host(O/S)-Ram from Epiphany via DMA

PostPosted: Mon May 29, 2017 12:10 pm
by sebraa
The Epiphany can only access the 32 MB shared memory area directly. Officially.

However, if the Epiphany chip accesses an off-chip address and that access goes out on the correct eLink interface, then it will go directly into the physical memory of the ARM host. I once did a proof-of-concept showing that, but I wouldn't recommend going this route. Keep in mind that these kind of accesses basically bypass any security measurements, ARM caches and Linux memory management simultaneously. Getting this to work reliably definitely requires more understanding than I have. Don't do it.

Re: Access Host(O/S)-Ram from Epiphany via DMA

PostPosted: Mon May 29, 2017 12:37 pm
by moses_rotesmeer
Ok, thank you for your response. I understand that this Access would bypass e.g the Linux memory Protection. However, I'm actually tring to access some bss section of a program running in linux, without any awareness of this by either linux or the program and also by avoiding interference/modification of this program. I thought using a DMA Acces from the Epiphany core to the main memory might be the best solution for this requirement. Any other suggestions to achieve this are highly appreciated :-)

Re: Access Host(O/S)-Ram from Epiphany via DMA

PostPosted: Mon May 29, 2017 1:44 pm
by polas

Re: Access Host(O/S)-Ram from Epiphany via DMA

PostPosted: Mon May 29, 2017 2:06 pm
by moses_rotesmeer
Any program on the host.
Btw. I only need to read from the main-memory (not to write)
Thank you for your suggestion, I considered a similar approach, however, I thought a direct access from the epiphany cores is preferred since I could safe a memcopy from main-mem to shared mem first.
From the ARM/Linux perspective the access should be as invisible/non-intrusive as possible (including as little overhead on the host system (ARM) as possible).
That's another reason why I considered the DMA as my preferred solution in this scenario.

Re: Access Host(O/S)-Ram from Epiphany via DMA

PostPosted: Tue May 30, 2017 7:20 am
by sebraa
Hi,

the Epiphany can directly access Linux' physical memory by just reading and writing through pointers; there is no need to use any DMA engines. At least, this was the state when I tried it (see the attached file), I do not know if this works with the current images. I have not tested the code now.

Keep in mind that these direct accesses bypass any caches, so the Epiphany may read stale data, and writes may not be noticed by the application. Getting this to work reliable may require some evil invalidation magic. Also, the Epiphany may be able to directly access some of the ARM peripheral registers (i.e. interrupt controller and such), but the same reservations apply there.

Another thing to consider is that finding the physical memory page of a running Linux application is tricky (think of ASLR), and may change at any time (think of swapping). Also, the routing algorithm employed by the Epiphany strictly routes by addresses, and only one of the eLink interfaces is actually connected to the Zynq. This means that large areas of the address space are not reachable from the Epiphany chip at all.

Best of luck,
sebraa

Re: Access Host(O/S)-Ram from Epiphany via DMA

PostPosted: Tue May 30, 2017 8:34 am
by moses_rotesmeer
thank you, that helps me a lot.
Ok, it's going to be tricky, but otherwise it wouldn't be fun, would it? :D
best,
moses