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

Caches EL3 and EL1 on A53 Clusters

Hello Forum,

I am using a cluster of 4 x A53 and two of the cores are assigned to run Linux, and the other two a custom application. I have reserved a memory region to the Linux that is not mapped. Some of it is used to run the custom OS and the rest of it shared buffer to pass/get data to Linux. I've mapped the share memory to the Linux and I try to achieve cache shareability between the Linux and custom OS cores, but I don't see it happening.  Linux is on EL1 and my custom OS is on EL3. 

The custom OS is fixing its EL3 MMU and all the other necessary attributes on the page table, inner and outer shareable. However, when I have the cache enabled in the shared memory region , I see that the memory is not coherent between cores. If I disable cache then I can see valid data from the other end.

In order to understand a bit better what is happening, I have split the shared memory to two regions, one with cache enabled (inner/outer shared) and one no cached. I have a small test app that writes a small region of cached memory with some test vectors and then I communicate with the custom OS via non cached memory to read the specific block of data  written by the Linux test app. The RTOS reports back via the non cached region if the data are valid in the cached shared memory.

In the first run of my test, the RT core reports back that it read the test vector correctly, if I run it again it fails, if I run it after 2 minutes passes.

I am not sure what may be wrong here. Is it possible EL1 and EL3 to have memory region that is shared and is cachable

Any kind of advice will be quite helpful.

Thank you

Andreas

Parents
  • Is it possible EL1 and EL3 to have memory region that is shared and is cachable

    Yes it is.  The rules are accessing a location from different ELs aren't really different from accessing the location from within the same EL.

    Two initial thoughts:

    Are you using the same set of attributes to access the location from EL1 and EL3?  Accessing a given location with mismatched attributes can lead to a loss of coherency.

    How is EL3 setting the NS bit in it's translation table descriptors?  The NS in the block/page descriptors sets the output physical address space.  Remember that the Secure and Non-secure aren't just an attribute for physical addresses, there different sets of locations.  So for example, S:0x8000 is treated as a different location to NS:0x8000.  Now the end device/memory might not care, and could be aliasing them together.  However the caches will care, and would allocate them to different cache lines.

Reply
  • Is it possible EL1 and EL3 to have memory region that is shared and is cachable

    Yes it is.  The rules are accessing a location from different ELs aren't really different from accessing the location from within the same EL.

    Two initial thoughts:

    Are you using the same set of attributes to access the location from EL1 and EL3?  Accessing a given location with mismatched attributes can lead to a loss of coherency.

    How is EL3 setting the NS bit in it's translation table descriptors?  The NS in the block/page descriptors sets the output physical address space.  Remember that the Secure and Non-secure aren't just an attribute for physical addresses, there different sets of locations.  So for example, S:0x8000 is treated as a different location to NS:0x8000.  Now the end device/memory might not care, and could be aliasing them together.  However the caches will care, and would allocate them to different cache lines.

Children