-
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
QEMU - Increase TA memory size #2079
Comments
There isn't enough SECRAM defined in QEMU to support TAs of 100MB. Even if there where enough memory it would still be a challenge. This is low level stuff that will break in mysterious ways, too hard to try to diagnose in an issue. |
Thank you very much for your help. |
https://github.com/qemu/qemu/blob/8e5dc9ba49743b46d955ec7dacb04e42ae7ada7c/hw/arm/virt.c#L145 says that |
Thank you for your help @jenswi-linaro |
@vunh91 did you solve the issue w/ TA memory limit? I am having the same trouble. My TA grew over 3Mb in size and OPTEE fails to load it on v8arm qemu. Those the parameters I tried to change but nothing seems to help:
Understandably, it's not a trivial task to change the memory layout but yet it could have been easier to do so, in my opinion. @jenswi-linaro any tips/advice you can share? |
Loading a single TA of 3Mb into memory shouldn't be a problem. Perhaps you're loading more than one? In OP-TEE it should be enough to change I don't think any changes are needed at all in TF-A. When it comes to QEMU, your guesses are as good as mine. |
@ademyankov do you by any chance increase the secure DRAM size? |
@ademyankov you mean you can increase the SECURE DRAM_SIZE with optee_os 3.4? I update the values of |
@SimonWan I haven't tried that cuz there was no need to. My TA is a bit over 3Mb and it didn't load by optee_os 3.1. but it has no issues w/ optee_os 3.4. and it loads and works fine. So, I just abandoned that idea for now. |
@ademyankov got you, thanks. |
How anyone successfully been able to modify the QEMU support for TZDRAM to enable loading large (in my case, > 22MB) TAs? However, I am still not able to load a large TA binary. |
Not sure if this is the correct answer, while if you already correctly configured the DRAM size as explainted in the ram_layout, then probably you can give it a try with |
as an update: I have used a larger CFG_TEE_RAM_VA_SIZE. However, I was still seeing memory allocation problems. to conf.mk solved the problem, and I was able to copy the full 22MB TA into TZ (still have a few problems, so this may not be the last word, but it's progress). |
Please help!
I need to develop a TA with memory size up to 100 MB.
PLATFORM=vexpress-qemu_virt
I tried to increase the TA memory size as below:
#define PGT_CACHE_SIZE ROUNDUP(CFG_NUM_THREADS * 2, PGT_NUM_PGT_PER_PAGE)
changed to:
#define PGT_CACHE_SIZE ROUNDUP(CFG_NUM_THREADS * 130, PGT_NUM_PGT_PER_PAGE)
#define TTBCR_N_VALUE 7
changed to:
#define TTBCR_N_VALUE 5
#define SECRAM_SIZE 0x01000000
changed to:
#define SECRAM_SIZE 0x02000000
#define TA_STACK_SIZE (2 * 1024 * 1024)
#define TA_DATA_SIZE (10 * 1024 * 1024)
Then it works fine. But when i changed the total of memory size greater than 12MB
#define TA_STACK_SIZE (2 * 1024 * 1024)
#define TA_DATA_SIZE (11 * 1024 * 1024)
i got errors as below:
The text was updated successfully, but these errors were encountered: