-
Notifications
You must be signed in to change notification settings - Fork 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
TI platforms broken on master #1556
Comments
After further debugging it seems what it is really upset about is that this offset start address is not on a page boundary. CFG_TEE_RAM_START is on a page boundary, but OP-TEE start address is not, if the start address now needs to also aligned then I'll move our start address, but this should be documented. |
My apologies, indeed there is a side effect of recently merged #1459 we did not see. In your case, the physical RAM below the load address should be mapped read-only-executable? read-write? both? Do you need this RAM to be flat map (pa=va) ? We must fix current optee_os to allow In case platform expects some flat mapped memory between P-R for coherent memory allows to flat map this area but without cache support so that may not fit your needs. |
We actually don't need this memory mapped at all, we used to need it for storing the OP-TEE header, but now we do not. The issue seems to be that VCORE_UNPG_RX_PA cannot be un-aligned, but when CFG_TEE_LOAD_ADDR is un-aligned then it will be. I think for us we should be fine with simply moving CFG_TEE_LOAD_ADDR to CFG_TEE_RAM_START, restoring the alignment. RPI3 also has an offset CFG_TEE_LOAD_ADDR but it is page aligned already, so this may not be an issue for them. I'll do a bit more testing then I'll push a patch for this. |
Ok, i will propose something to allow In the meantime, you can set |
Fixes OP-TEE#1556 Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Fixes OP-TEE#1556 Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
I'm actually okay with having the start address page aligned, it was just unexpected and broke our platforms (and rather hard to debug). I think having this rounding down patch works also as someone will probably do what we did when porting to a new platform and get very confused. |
Fixes: OP-TEE#1556 Fixes: 10d13b2 ("core: exclusive writable/executable attribute in core mapping") Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Fixes: OP-TEE/optee_os#1556 Fixes: 10d13b2 ("core: exclusive writable/executable attribute in core mapping") Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Bisecting was difficult due to #1459 having intermediate patches that do not build. After manually bisecting the offending commit seems to be: 10d13b2
Output:
It seems to have to do with our platforms having the start address +0x100 into our TEE_RAM_START area:
Removing this offset fixes the issue, I don't see why having this offset is not valid anymore? It seems that this first 0x100 bytes is no longer mapped as we assume the TEE_LOAD address is always the start of TEE_RAM, which is true for other platforms but not ours.
The two possible fixes then are to combine CFG_TEE_LOAD_ADDR and CFG_TEE_RAM_START to force these to be the same. Or set VCORE_UNPG_RO_PA to also include any space before CFG_TEE_LOAD_ADDR but after CFG_TEE_RAM_START.
Unless I'm not understanding the issue correctly (all this memory stuff has gotten very complex).
The text was updated successfully, but these errors were encountered: