Re: [PATCH 5/8] x86/mm: Add basic defines/helpers for CONFIG_X86_5LEVEL

From: Ingo Molnar
Date: Tue Mar 28 2017 - 02:12:36 EST



* Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> wrote:

> +#ifdef CONFIG_X86_5LEVEL
> +
> +/*
> + * PGDIR_SHIFT determines what a top-level page table entry can map
> + */
> +#define PGDIR_SHIFT 48
> +#define PTRS_PER_PGD 512
> +
> +/*
> + * 4rd level page in 5-level paging case

4th.

> + */
> +#define P4D_SHIFT 39
> +#define PTRS_PER_P4D 512
> +#define P4D_SIZE (_AC(1, UL) << P4D_SHIFT)
> +#define P4D_MASK (~(P4D_SIZE - 1))
> +
> +#else /* CONFIG_X86_5LEVEL */

Single space suffices before teh comment.

> +
> /*
> * PGDIR_SHIFT determines what a top-level page table entry can map
> */
> #define PGDIR_SHIFT 39
> #define PTRS_PER_PGD 512
>
> +#endif /* CONFIG_X86_5LEVEL */

Ditto.

> +#ifdef CONFIG_X86_5LEVEL
> +/**
> + * p4d_set_huge - setup kernel P4D mapping
> + *
> + * No 512GB pages yet -- always return 0
> + *
> + * Returns 1 on success and 0 on failure.
> + */
> +int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot)
> +{
> + return 0;
> +}

The last comment line can be deleted I suppose.

Thanks,

Ingo