This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

read memory in EL3

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.

Parents
  • 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/

Reply
  • 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/

Children