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

ARM cortext A53 Physical Address Flush

Since ARM caches are physically indexed is there any way to flush based on the PA? I know I can get the set, but what about the way? If I am flushing from L1 would I have to flush all ways in L1 and then L2 assuming there is no L3 to get to system memory?

Is there an example of this written somewhere? All examples I have seen use VA.

Thanks!

Parents
  • Not quite. Taking Cortex-A53:

    • L1 Instruction Cache is Virtually Indexed Physically Tagged (VIPT) so you have the proper translations in place for the cache to work
    • L1 Date Cache is Physically Indexed Physically Tagged
    • L2 Unified cache is Physically indexed and tagged

    This is inner caches, for outer caches, eg. L3 could be different but as you say you don't have.

    I know I can get the set, but what about the way?

    if you want to flush a set manually (that is by SW Cache Maint. Operations) you must clean a set from each of the ways as you cannot tell what way your date is. You can tell the set but not the way as you noticed. Well HW design surely have the means to determine that but it is not exposed to us.

    If I am flushing from L1 would I have to flush all ways in L1 and then L2 assuming there is no L3 to get to system memory?

    You have a variety of options:

    • Clean and invalidate by Set/Way
    • Clean and Invalidate by Virtual Address to Point of Coherency
    • Clean by Set/Way
    • Clean by Virtual Address to Point of Coherency
    • Clean by Virtual Address to Point of Unification

    There are loads of examples in Uboot at arch/arm/cpu/armv8/cache.S.

    If you have a system with more than 1x Cluster then you should also take into consideration what Cache Maint. Operations are broadcast

    IC IALLUIS I-cache invalidate all to Point of Unification, Inner Shareable Yes (inner only)
    IC IALLU I-cache invalidate all to Point of Unification Noa
    IC IVAU, Xt I-cache invalidate by address to Point of Unification Maybeb
    DC ZVA, Xt D-cache zero by address No
    DC IVAC, Xt D-cache invalidate by address to Point of Coherency Yes
    DC ISW, Xt D-cache invalidate by Set/Way No
    DC CVAC, Xt D-cache clean by address to Point of Coherency Maybeb
    DC CSW, Xt D-cache clean by Set/Way No
    DC CVAU, Xt D-cache clean by address to Point of Unification Maybeb
    DC CIVAC, Xt D-cache clean and invalidate by address to Point of Coherency Yes
    DC CISW, Xt D-cache clean and invalidate by Set/Way No

    If an operation is not broadcast OS/Uboot (or any other) must issue the clean or invalidate operations locally on each core even though you may have the Cache Coherent Network/Interconnect connecting the Clusters.

    Loads of details are in "ARM® Cortex®-A Series Version: 1.0 Programmer’s Guide for ARMv8-A"

Reply
  • Not quite. Taking Cortex-A53:

    • L1 Instruction Cache is Virtually Indexed Physically Tagged (VIPT) so you have the proper translations in place for the cache to work
    • L1 Date Cache is Physically Indexed Physically Tagged
    • L2 Unified cache is Physically indexed and tagged

    This is inner caches, for outer caches, eg. L3 could be different but as you say you don't have.

    I know I can get the set, but what about the way?

    if you want to flush a set manually (that is by SW Cache Maint. Operations) you must clean a set from each of the ways as you cannot tell what way your date is. You can tell the set but not the way as you noticed. Well HW design surely have the means to determine that but it is not exposed to us.

    If I am flushing from L1 would I have to flush all ways in L1 and then L2 assuming there is no L3 to get to system memory?

    You have a variety of options:

    • Clean and invalidate by Set/Way
    • Clean and Invalidate by Virtual Address to Point of Coherency
    • Clean by Set/Way
    • Clean by Virtual Address to Point of Coherency
    • Clean by Virtual Address to Point of Unification

    There are loads of examples in Uboot at arch/arm/cpu/armv8/cache.S.

    If you have a system with more than 1x Cluster then you should also take into consideration what Cache Maint. Operations are broadcast

    IC IALLUIS I-cache invalidate all to Point of Unification, Inner Shareable Yes (inner only)
    IC IALLU I-cache invalidate all to Point of Unification Noa
    IC IVAU, Xt I-cache invalidate by address to Point of Unification Maybeb
    DC ZVA, Xt D-cache zero by address No
    DC IVAC, Xt D-cache invalidate by address to Point of Coherency Yes
    DC ISW, Xt D-cache invalidate by Set/Way No
    DC CVAC, Xt D-cache clean by address to Point of Coherency Maybeb
    DC CSW, Xt D-cache clean by Set/Way No
    DC CVAU, Xt D-cache clean by address to Point of Unification Maybeb
    DC CIVAC, Xt D-cache clean and invalidate by address to Point of Coherency Yes
    DC CISW, Xt D-cache clean and invalidate by Set/Way No

    If an operation is not broadcast OS/Uboot (or any other) must issue the clean or invalidate operations locally on each core even though you may have the Cache Coherent Network/Interconnect connecting the Clusters.

    Loads of details are in "ARM® Cortex®-A Series Version: 1.0 Programmer’s Guide for ARMv8-A"

Children
No data