Re: [PATCH 15/24] x86/mm: Allow flushing for future ASID switches

From: Andy Lutomirski
Date: Thu Nov 30 2017 - 16:51:51 EST


On Thu, Nov 30, 2017 at 12:01 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Thu, Nov 30, 2017 at 10:48:56AM -0800, Andy Lutomirski wrote:
>> Should it be tlb_flush_shared_nonglobals_if_kernel_and_user_pagetables_are_separate()?
>
> Its effectively invpcid_flush_all_other() or something like that. Of
> course, its not invpcid based, so we should not name it such.
>
> flush_asid_other() ?

How about mark_other_asids_invalid()? It doesn't actually flush
anything. And the caller could be:

if (!kernel_ptes_are_global()) {
/* nothing to do. INVLPG flushes global mappings for all ASIDs. */
} else {
/* There is no efficient way to invalidate a given VA for all ASIDs
simultaneously. */
mark_other_asids_invalid();
}