Re: [PATCH 20/30] x86, mm: remove hard-coded ASID limit checks

2017-11-20 Thread Thomas Gleixner
On Fri, 10 Nov 2017, Dave Hansen wrote: > > +/* There are 12 bits of space for ASIDS in CR3 */ > +#define CR3_HW_ASID_BITS 12 > +/* When enabled, KAISER consumes a single bit for user/kernel switches */ > +#define KAISER_CONSUMED_ASID_BITS 0 > + > +#define CR3_AVAIL_ASID_BITS

Re: [PATCH 20/30] x86, mm: remove hard-coded ASID limit checks

2017-11-20 Thread Thomas Gleixner
On Fri, 10 Nov 2017, Dave Hansen wrote: > > +/* There are 12 bits of space for ASIDS in CR3 */ > +#define CR3_HW_ASID_BITS 12 > +/* When enabled, KAISER consumes a single bit for user/kernel switches */ > +#define KAISER_CONSUMED_ASID_BITS 0 > + > +#define CR3_AVAIL_ASID_BITS

[PATCH 20/30] x86, mm: remove hard-coded ASID limit checks

2017-11-10 Thread Dave Hansen
From: Dave Hansen First, it's nice to remove the magic numbers. Second, KAISER is going to consume half of the available ASID space. The space is currently unused, but add a comment to spell out this new restriction. Signed-off-by: Dave Hansen

[PATCH 20/30] x86, mm: remove hard-coded ASID limit checks

2017-11-10 Thread Dave Hansen
From: Dave Hansen First, it's nice to remove the magic numbers. Second, KAISER is going to consume half of the available ASID space. The space is currently unused, but add a comment to spell out this new restriction. Signed-off-by: Dave Hansen Cc: Moritz Lipp Cc: Daniel Gruss Cc: Michael

Re: [PATCH 20/30] x86, mm: remove hard-coded ASID limit checks

2017-11-10 Thread Dave Hansen
On 11/10/2017 04:20 AM, Peter Zijlstra wrote: > On Wed, Nov 08, 2017 at 11:47:24AM -0800, Dave Hansen wrote: >> +#define CR3_HW_ASID_BITS 12 >> +#define NR_AVAIL_ASIDS ((1< That evaluates to 4095 > >> -VM_WARN_ON_ONCE(asid > 4094); >> +

Re: [PATCH 20/30] x86, mm: remove hard-coded ASID limit checks

2017-11-10 Thread Dave Hansen
On 11/10/2017 04:20 AM, Peter Zijlstra wrote: > On Wed, Nov 08, 2017 at 11:47:24AM -0800, Dave Hansen wrote: >> +#define CR3_HW_ASID_BITS 12 >> +#define NR_AVAIL_ASIDS ((1< That evaluates to 4095 > >> -VM_WARN_ON_ONCE(asid > 4094); >> +VM_WARN_ON_ONCE(asid >

Re: [PATCH 20/30] x86, mm: remove hard-coded ASID limit checks

2017-11-10 Thread Peter Zijlstra
On Wed, Nov 08, 2017 at 11:47:24AM -0800, Dave Hansen wrote: > +#define CR3_HW_ASID_BITS 12 > +#define NR_AVAIL_ASIDS ((1< - VM_WARN_ON_ONCE(asid > 4094); > + VM_WARN_ON_ONCE(asid > NR_AVAIL_ASIDS); Not the same number

Re: [PATCH 20/30] x86, mm: remove hard-coded ASID limit checks

2017-11-10 Thread Peter Zijlstra
On Wed, Nov 08, 2017 at 11:47:24AM -0800, Dave Hansen wrote: > +#define CR3_HW_ASID_BITS 12 > +#define NR_AVAIL_ASIDS ((1< - VM_WARN_ON_ONCE(asid > 4094); > + VM_WARN_ON_ONCE(asid > NR_AVAIL_ASIDS); Not the same number

[PATCH 20/30] x86, mm: remove hard-coded ASID limit checks

2017-11-08 Thread Dave Hansen
From: Dave Hansen First, it's nice to remove the magic numbers. Second, KAISER is going to eat up half of the available ASID space. We do not use it today, but we need to at least spell out this new restriction. Signed-off-by: Dave Hansen

[PATCH 20/30] x86, mm: remove hard-coded ASID limit checks

2017-11-08 Thread Dave Hansen
From: Dave Hansen First, it's nice to remove the magic numbers. Second, KAISER is going to eat up half of the available ASID space. We do not use it today, but we need to at least spell out this new restriction. Signed-off-by: Dave Hansen Cc: Moritz Lipp Cc: Daniel Gruss Cc: Michael