arm64 cache maintenance on read only address loops forever

Will Deacon will.deacon at arm.com
Wed Feb 26 08:55:21 EST 2014


On Wed, Feb 26, 2014 at 04:59:46AM +0000, Laura Abbott wrote:
> Hi,

Hi Laura,

> On arm64, set_pte_at currently write protects user ptes that are not 
> dirty. The expected behavior is that the fault handler will fix this up 
> on a write to the address. do_page_fault will not mark the fault as a 
> write though if ESR has the CM (cache maintenance) bit set. This has the 
> unfortunate side effect that if cache maintenance is performed on a user 
> address that has not yet been marked as dirty, handle_mm_fault may 
> return without actually adjusting the pte or returning an error. This 
> means that the fault will be infinitely retried.
> 
> Calling cache maintenance on an address that hasn't actually been 
> written to isn't all that useful but looping forever seems like a poor 
> result. It seems like the check in do_page_fault is too restrictive and 
> we need to be able to fault in pages via cache maintenance.

My understanding is that the EL0 cache maintenance instructions only require
read permission (note that DC ZVA is treated like a store and doesn't set
ESR.CM), so I'm failing to appreciate the problem here.

Do you have a small testcase I can play with?

Will



More information about the linux-arm-kernel mailing list