On Sat Feb 17 02:54:25 2024 +0000, Jinoh Kang wrote:
I think this should be unconditional and not specific to aarch64. `madvise()`/`mprotect()` is and always will be a hack, and other archs might implement TLBI like operation too.
For a concrete example, on **x86-64** Linux on a hypervisor, [flush_tlb_multi](https://elixir.bootlin.com/linux/latest/source/arch/x86/mm/tlb.c#L941) may call the ["flush TLB" hypercall](https://elixir.bootlin.com/linux/latest/source/arch/x86/include/asm/paravirt.h#L84) rather than issuing IPIs directly. The hypervisor can then choose not to send IPIs to affected CPUs at all, if the hypervisor itself has never faulted in the "dontneed page" for other guest threads.
Also, x86/x64 is a moving target: with recent advancements like [x86s](https://www.intel.com/content/www/us/en/developer/articles/technical/envisioning-future-simplified-architecture.html) there's no guarantee Intel/AMD won't implement their own TLBI in the future.
This is why I said this should be unconditional: the FIXME should be printed on every architecture, not only arm and arm64 but *also* i386 and x86-64 (i.e., the #if should be removed).