Creating an executable user-space mapping to write-back memory synchronizes the icache with the page's contents, whether or not those contents have changed since the previous synchronization. Use the page flag PGA_EXECUTABLE to record that the icache has been synchronized with a managed page's contents and that the page has no writable mappings. When the flag is set, the creation of another executable mapping of the page can skip the synchronization. The flag is cleared when a writable mapping of the page is created, using a single atomic operation that keeps PGA_WRITEABLE and PGA_EXECUTABLE from ever being simultaneously set, and when the page's last mapping is destroyed.
(This is stricter than mmu_oea64's use of the same flag, PGA_EXECUTABLE. Specifically, mmu_oea64 allows PGA_WRITEABLE and PGA_EXECUTABLE to be set simultaneously.)
Assisted-by: Claude Code (Fable 5.1)