First sorry my english writing level. :-)
In non-secure world using android system(linux kernel).
I use big.little core Cortex-A53, Cortex-A57
I was tested to 2case.
previous stage.
1. Linux allocation memory using(malloc or mmap)
2. Pass allocated memory and TTBR value to secure-world.
3. Find mapped physical address in TTB address.
1 case.
- Using only 1core test (linux set_sched_affinity)
Result : Find very well 100%. (Valid physical address : 0xXXXXXXXX)
2 case.
- No use set_sched_affinity
Result : Some time not found (Invalid physical address : 0x0)
I think Linux no mapping page-table. but i didn't understand why 1case success.
1case testing around 1000times.
If probleam is no mapping, why didn't occured 2case situation.
I guess this probleam related page-table attribute like a shareability(inner shareable, outer shareable?) or cache? or etc.
Question.
How to fixing this case? or I want to some advice.
thanks!
I'd recommend not to pass virtual addresses between the worlds. Pass only physical addresses that the secure world then has to map in. Furthermore, on the NWd sides you also have to tell the OS not so swap out or move the memory behind the virtual address while they are shared. Otherwise, the secure world may corrupt the whole memory, as it accesses different memory. So there more involved here if you want to setup shared memory than just passing a virtual address.
Thanks. and more question.
how to find physical address allocated by user space.
I have only 3 idea.
do you have a any idea? Please share your idea! thanks
Well, all these are valid approaches for certain scenarios. It depends on the use case what to pick there.