RFC arm64: change PoC D-cache flush to PoU
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest0 of 2 patches 0 repliesNew
Patches in v1 No applies recorded yet
None of the 2 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/2] arm64: change PoC D-cache flush to PoU
Quoted 14 lines · Ashok Kumar
Quoted 6 lines · Catalin Marinas
Quoted 4 lines · Ashok Kumar
Also deferred dcache flush in
__cpu_copy_user_pageto__sync_icache_dcache. May I know why I/D sync is needed in__cpu_copy_user_page? My understanding is that any self modifying code in userspace is supposed to take care of the coherency using the respective cache flush system call.Quoted 6 lines
I think it may have been there for historical reasons on
arch/arm(115b22474eb1- "ARM: 5794/1: Flush the D-cache duringcopy_user_highpage()") and imported inarch/arm64. But looking back at this, I don't think we need it for two reasons: dynamic linker no longer relocating symbols in a text page (and cause CoW) andset_pte_at()already calling__sync_icache_dcache().
Quoted 2 lines
In that case, shall we get rid of the flush in
__sync_icache_dcachealso by not callingflush_dcache_pagein__cpu_copy_user_page?
We should still keep it. Assuming that we get CoW mostly on no-exec pages, the penalty should be minimal since set_pte_at() only cares about executable mappings. But I can't guarantee that user space doesn't do any CoW on executable mappings. We could for example have some JIT'ed code that forked and the child changes some literal pool data (not instructions) causing a CoW. It would not expect the I/D caches to become incoherent.
Signature · 1 line
Catalin