Re: [PATCH 20/30] x86, mm: remove hard-coded ASID limit checks
From: Thomas Gleixner
Date: Mon Nov 20 2017 - 15:47:11 EST
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 (CR3_HW_ASID_BITS-KAISER_CONSUMED_ASID_BITS)
Spaces around '-' please. Same for other operators.
> +/*
> + * ASIDs are zero-based: 0->MAX_AVAIL_ASID are valid. -1 below
> + * to account for them being zero-absed. Another -1 is because ASID 0
s/absed/based/
> + * is reserved for use by non-PCID-aware users.
> + */
> +#define MAX_ASID_AVAILABLE ((1<<CR3_AVAIL_ASID_BITS) - 2)
> +
> /*
Thanks,
tglx