Hi,
Please find the comments in-line.
Regards Pankaj
-----Original Message----- From: Olivier Deprez Olivier.Deprez@arm.com Sent: Wednesday, February 5, 2020 6:54 PM To: Pankaj Gupta pankaj.gupta@nxp.com Cc: nd nd@arm.com; tf-a@lists.trustedfirmware.org Subject: [EXT] RE: Issue with addition of NXP Platform support on TFA v2.2
Caution: EXT Email
Hi Pankaj,
Can you pls provide a bit more background: Which boot stage (BL1/BL2/BL31...) get affected?
BL2
Is there any crash report to console?
No. But, using the external debugger, it is found that core gets to non-responding.
Is this an aarch64/or aarch32 platform?
aarch64
There can be different root causes to this e.g.
- a stale translation in TLB, or a dirty cache line remnant from earlier boot stages. If this is the case, it would need invalidating TLB and/or caches on BL entry.
- the empty table ptr given by xlat_table_get_empty is pointing nowhere sensible because of this specific platform layout
There are multiple calls to xlat_clean_dcache_range in this file, do you confirm the crash happen within xlat_tables_map_region?
Yes. Basis of saying 'yes' is: if this function is commented, the BL2 comes up successfully.
Flow in the code base is :
mmap_add_dynamic_region -> mmap_add_dynamic_region_ctx -> xlat_tables_map_region-> xlat_table_get_empty //....issue is seen.
Can you try one or both statements below after the call to xlat_table_get_empty (and uncomment calls to clean_dcache_range):
inv_dcache_range((uintptr_t)subtable, XLAT_TABLE_SIZE); xlat_arch_tlbi_va((uintptr_t)subtable, ctx->xlat_regime); xlat_arch_tlbi_va_sync();
mmap_add_dynamic_region -> mmap_add_dynamic_region_ctx -> xlat_tables_map_region-> xlat_table_get_empty-> xlat_arch_tlbi_va //issue is resolved.
The root cause of this issue is race condition. Please correct me if I am wrong.
Another observation: mmap_add_dynamic_region -> mmap_add_dynamic_region_ctx (Putting console debug logs in this function)-> xlat_tables_map_region-> xlat_table_get_empty //issue is resolved.
Please share your view for this observation as well.
Regards, Olivier.
-----Original Message----- From: TF-A tf-a-bounces@lists.trustedfirmware.org On Behalf Of Pankaj Gupta via TF-A Sent: 05 February 2020 11:45 To: tf-a@lists.trustedfirmware.org Subject: [TF-A] Issue with addition of NXP Platform support on TFA v2.2
Hi,
In the TFA v2.2 code base, the file "lib/xlat_tables_v2/xlat_tables_core.c" has the implementation for function "xlat_tables_map_region()". The implementation for this function is changed in TFAv2.2 (compared TFAv1.5), with addition of function "xlat_clean_dcache_range()".
Due to this addition, my earlier* working platform on TFAv1.5, is hanging here. If the function call for the function "xlat_clean_dcache_range()", is comment, then the platform works well.
Code snippet: static inline __attribute__((unused)) void xlat_clean_dcache_range(uintptr_t addr, size_t size) { if (is_dcache_enabled()) clean_dcache_range(addr, size); // On commenting this line, my platform works fine with TFAv2.2 }
Please share your views on what could I be missing here.
Thanks.
Regards Pankaj
*Earlier raised patch for this platform was not merged due to review comments are not disposed-off in time; and TF-A got migrated from github to gerrit. -- TF-A mailing list TF-A@lists.trustedfirmware.org https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.trus...