Disable all H/W prefetchers on ARM Cortex A-57

Hi Community,

I am trying to disable the hardware prefetchers on arm cortex A57. This includes and cache line preftching or any other data pefetching etc.

I am aware of ARM's exception levels and the fact that i might have to tweak bootloader itself. 

Some set of blogs, specific registers to set/unset etc. or some flowchart regarding this specific/ similar problem would be a great assistance.

if anyone could help regarding this , then it would solve a long standing problem for me.

Regards

Shikhar Jain.

Parents
  • i.e controlling data prefetching from user-space without tweaking bootloader etc

    The controls that impact prefetching/speculation require EL1 or greater privilege (so OS or above).  The MMU translation tables control the Type (Normal vs Device) and Permissions (R/W/X).  Marking a region as Device blocks data speculation.  Marking a region as not executable blocks instruction prefetching.

    A given processor might have IMPDEF controls to tune/tweak prefetching, you'd need to check the individual Technical Reference Manuals.  But all such controls I'm aware of require EL1 or greater privilege.

    What you can use in EL0 (user space) is the cache prefetch instructions.  But these are usually to tell the processor that it should prefetch something, which I think is the reverse of what you want.  Plus, the cache prefetch instructions need to be used carefully and sparingly.  Often the automatic prefetchers will do a better job on their own, the prefetch instructions can be useful for the first iteration to help them learn.

    Which brings me back to my original question, why are you looking to disable speculation?

Reply
  • i.e controlling data prefetching from user-space without tweaking bootloader etc

    The controls that impact prefetching/speculation require EL1 or greater privilege (so OS or above).  The MMU translation tables control the Type (Normal vs Device) and Permissions (R/W/X).  Marking a region as Device blocks data speculation.  Marking a region as not executable blocks instruction prefetching.

    A given processor might have IMPDEF controls to tune/tweak prefetching, you'd need to check the individual Technical Reference Manuals.  But all such controls I'm aware of require EL1 or greater privilege.

    What you can use in EL0 (user space) is the cache prefetch instructions.  But these are usually to tell the processor that it should prefetch something, which I think is the reverse of what you want.  Plus, the cache prefetch instructions need to be used carefully and sparingly.  Often the automatic prefetchers will do a better job on their own, the prefetch instructions can be useful for the first iteration to help them learn.

    Which brings me back to my original question, why are you looking to disable speculation?

Children