-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core data-abort while reading from mapped virtual address in pTA #3236
Comments
Could the problem arise because, as far as I can see, the mapped memory is automatically used as dynamic shared memory? When I map the area as Is anybody able to help or explain, please? |
Physical address 0..0x08000000 is secure memory, BootROM. So the data you're reading depends on how large ROM you're feeding to QEMU. |
In that case I am probably searching for the wrong offset. I want to read the linux kernel loaded in QEMU (using the qemu_v8 profile). After some more research into the physical memory of the QEMU guest, it seems that |
That address is more reasonable. |
It does work now, thank you very much for your hint about the BootROM location. It helped finding the correct address. |
For a project I am working on, I need to map the normal world memory, so the secure world can read from it. To accomplish this, I am using a pTA, as, according to related issues #2933, #2150, #1706 and especially #1343, it is not possible to use core mapped memory via
register_phys_mem
in user TAs. According to my research of the memory in QEMU, I wanted to read from the address0x00080830
(only 2 bytes for testing) and because of that, I mapped that small area in theplat-vexpress/main.c
like that:When I boot up in QEMU, this mapping seems to work. See the output on startup:
My pTA application, called from the normal world, uses the physical address given from the normal world, translates it to the according virtual address and then tries to read from it. The full code of this part looks like this:
The
DMSG
output shows:So the physical address can be converted into its virtual address without any problems. But the following error arises as soon as the pTA reaches the
memcpy()
call:If I comment out the
memcpy()
call, everything runs fine. I even tried to only read fromvaddr
by outputting its contents directly to the console viaDMSG
, without copying it which results in the same core data-abort error as thememcpy()
call, so it is not an error while writing the contents to the memref buffer.Have I somehow overlooked something here? Is it not possible to read from a virtual address like that when mapped into the core? According to the documentation, pTAs should have the same access to memory as the rest of the OP-TEE core. Please help me figuring out, why reading from the virtual address is not possible at all. Thank you very much in advance!
The text was updated successfully, but these errors were encountered: