Re: [PATCH v3 04/11] x86/mm: Give each mm TLB flush generation a unique ID

2017-06-21 Thread Andy Lutomirski
On Wed, Jun 21, 2017 at 10:43 AM, Borislav Petkov wrote: > On Tue, Jun 20, 2017 at 10:22:10PM -0700, Andy Lutomirski wrote: >> - * The x86 doesn't have a mmu context, but >> - * we put the segment information here. >> + * x86 has arch-specific MMU state beyond what lives in mm_struct. >> */ >>

Re: [PATCH v3 04/11] x86/mm: Give each mm TLB flush generation a unique ID

2017-06-21 Thread Borislav Petkov
On Tue, Jun 20, 2017 at 10:22:10PM -0700, Andy Lutomirski wrote: > - * The x86 doesn't have a mmu context, but > - * we put the segment information here. > + * x86 has arch-specific MMU state beyond what lives in mm_struct. > */ > typedef struct { > + /* > + * ctx_id uniquely identifies

Re: [PATCH v3 04/11] x86/mm: Give each mm TLB flush generation a unique ID

2017-06-21 Thread Borislav Petkov
On Wed, Jun 21, 2017 at 08:23:07AM -0700, Andy Lutomirski wrote: > It's stated explicitly in the comment where it's declared in the same file. Doh, it says "zero" there. I should learn how to read. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply

Re: [PATCH v3 04/11] x86/mm: Give each mm TLB flush generation a unique ID

2017-06-21 Thread Andy Lutomirski
On Wed, Jun 21, 2017 at 3:33 AM, Borislav Petkov wrote: > On Tue, Jun 20, 2017 at 10:22:10PM -0700, Andy Lutomirski wrote: >> +#define INIT_MM_CONTEXT(mm) \ >> + .context = {\ >> + .ctx_id

Re: [PATCH v3 04/11] x86/mm: Give each mm TLB flush generation a unique ID

2017-06-21 Thread Borislav Petkov
On Tue, Jun 20, 2017 at 10:22:10PM -0700, Andy Lutomirski wrote: > - * The x86 doesn't have a mmu context, but > - * we put the segment information here. > + * x86 has arch-specific MMU state beyond what lives in mm_struct. > */ > typedef struct { > + /* > + * ctx_id uniquely identifies

Re: [PATCH v3 04/11] x86/mm: Give each mm TLB flush generation a unique ID

2017-06-21 Thread Thomas Gleixner
On Tue, 20 Jun 2017, Andy Lutomirski wrote: > This adds two new variables to mmu_context_t: ctx_id and tlb_gen. > ctx_id uniquely identifies the mm_struct and will never be reused. > For a given mm_struct (and hence ctx_id), tlb_gen is a monotonic > count of the number of times that a TLB flush ha

[PATCH v3 04/11] x86/mm: Give each mm TLB flush generation a unique ID

2017-06-20 Thread Andy Lutomirski
This adds two new variables to mmu_context_t: ctx_id and tlb_gen. ctx_id uniquely identifies the mm_struct and will never be reused. For a given mm_struct (and hence ctx_id), tlb_gen is a monotonic count of the number of times that a TLB flush has been requested. The pair (ctx_id, tlb_gen) can be u