Hello, I want to read a memory(kmalloc in kernel) in EL3, and I have get the PA of memory. But I can't read it. Why? Thanks.
What happens when you try to read it?
Two initial thoughts...
Linux usually runs in Non-secure state, which can only see Non-secure physical addresses. EL3 is part of Secure state, which can see both Secure and Non-secure physical addresses. Translations table entries in Secure state have an NS attribute, which defines whether that VA maps to the Secure or Non-secure PA. When you mapped the kmalloc address into EL3 VA space, did you set the NS bit?
(Note, when the MMU is disabled in EL3 all addresses are treated as Secure)
Cache coherency is another possibility. I'm guessing this address is cacheable in Linux. If you map it into EL3 as non-cacheable or Device, you might get incoherent data. The access would appear to "work", but be returning stale data and writes might cause corruption/
Thanks.I have found this problem. I don't map the PA into EL3 VA space. Now I try to map the PA and fail to do it by function(mmap_add_dynamic_region_alloc_va and mmap_add_region_alloc_va), please tell me the way to mapp the PA into EL3 VA space. Thanks. Ignore my poor English.