Skip to contentSkip to conversation

Cortex A15: Errata 798181: Moving a virtual page that is being accessed by an active process can lead to unexpected behavior

DISCUSSION Matija Glavinic Pecotic 2 participants 2 messages Feb 22, 2023

lore
Share & tools
lore
#0 lore raw

Hello,

I have noticed that we are using local_flush_tlb_kernel_range in couple of places while errata from subject is applied in flush_tlb_kernel_range. We have local_flush_tlb_kernel in:

section_update
__set_fixmap
set_top_pte
#define arch_kmap_local_post_map local_flush_tlb_kernel_page
- arch_kmap_local_post_map is further used around kmap

I would like to double check this is safe. From errata itself, I cannot make up whether it depends to context, I have impression it doesnt, and one should apply it even in e.g. when map/unmap is done in interrupt.

I hope you still remember this topic. Would you please be able to help to clarify whether applying it depends to context?

Thanks,

Matija

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#1 lore raw
Quoted 10 lines · Matija Glavinic Pecotic

I have noticed that we are using local_flush_tlb_kernel_range in couple of places while errata from subject is applied in flush_tlb_kernel_range. We have local_flush_tlb_kernel in:

section_update
__set_fixmap
set_top_pte
#define arch_kmap_local_post_map local_flush_tlb_kernel_page
- arch_kmap_local_post_map is further used around kmap

Quoted 7 lines

I would like to double check this is safe. From errata itself, I cannot make up whether it depends to context, I have impression it doesnt, and one should apply it even in e.g. when map/unmap is done in interrupt.

I hope you still remember this topic. Would you please be able to help to clarify whether applying it depends to context?

IIRC this erratum is problematic only when there are concurrent CPUs still accessing the mapping being modified. That's usually when touching user pages (e.g. for migration, write-back) and the kernel either goes through a break-before-make sequence or changes the PTE permissions. I don't think any of the functions you mentioned fall into this category (of concurrent accesses to the VA being unmapped).

I found the erratum on page 28 in this document:

https://documentation-service.arm.com/static/5fb64a3bd77dd807b9a80852

Signature · 6 lines
Catalin

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel