[PATCH 22/30] x86, pcid, kaiser: allow flushing for future ASID switches

2017-11-10 Thread Dave Hansen
From: Dave Hansen If changing the page tables in such a way that an invalidation of all contexts (aka. PCIDs / ASIDs) is required, they can be actively invalidated by: 1. INVPCID for each PCID (works for single pages too). 2. Load CR3 with each PCID without the

[PATCH 22/30] x86, pcid, kaiser: allow flushing for future ASID switches

2017-11-10 Thread Dave Hansen
From: Dave Hansen If changing the page tables in such a way that an invalidation of all contexts (aka. PCIDs / ASIDs) is required, they can be actively invalidated by: 1. INVPCID for each PCID (works for single pages too). 2. Load CR3 with each PCID without the NOFLUSH bit set 3. Load CR3

Re: [PATCH 22/30] x86, pcid, kaiser: allow flushing for future ASID switches

2017-11-10 Thread Peter Zijlstra
On Wed, Nov 08, 2017 at 11:47:28AM -0800, Dave Hansen wrote: > +/* > + * We get here when we do something requiring a TLB invalidation > + * but could not go invalidate all of the contexts. We do the > + * necessary invalidation by clearing out the 'ctx_id' which > + * forces a TLB flush when the

Re: [PATCH 22/30] x86, pcid, kaiser: allow flushing for future ASID switches

2017-11-10 Thread Peter Zijlstra
On Wed, Nov 08, 2017 at 11:47:28AM -0800, Dave Hansen wrote: > +/* > + * We get here when we do something requiring a TLB invalidation > + * but could not go invalidate all of the contexts. We do the > + * necessary invalidation by clearing out the 'ctx_id' which > + * forces a TLB flush when the

[PATCH 22/30] x86, pcid, kaiser: allow flushing for future ASID switches

2017-11-08 Thread Dave Hansen
From: Dave Hansen If we change the page tables in such a way that we need an invalidation of all contexts (aka. PCIDs / ASIDs) we can actively invalidate them by: 1. INVPCID for each PCID (works for single pages too). 2. Load CR3 with each PCID without the NOFLUSH

[PATCH 22/30] x86, pcid, kaiser: allow flushing for future ASID switches

2017-11-08 Thread Dave Hansen
From: Dave Hansen If we change the page tables in such a way that we need an invalidation of all contexts (aka. PCIDs / ASIDs) we can actively invalidate them by: 1. INVPCID for each PCID (works for single pages too). 2. Load CR3 with each PCID without the NOFLUSH bit set 3. Load CR3 with