I do like the idea. I applied some of the suggestions to this proof of concept patch (attached). Still not compile-tested, since the CI seems a bit slow today.
arch_grant_cache_flush is missing the return type on x86, sorry. -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)
