Re: [PATCH 4/5] x86/kernel: Move page table macros to new header

Juergen Gross
2024-05-23T11:40:24Z

[-- Attachment #1.1.1: Type: text/plain, Size: 897 bytes --]

On 10.04.24 21:48, Jason Andryuk wrote:
> The PVH entry point will need an additional set of prebuild page tables.
> Move the macros and defines to a new header so they can be re-used.
>
> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>

With the one nit below addressed:

Reviewed-by: Juergen Gross <jgross@suse.com>

...

> diff --git a/arch/x86/kernel/pgtable_64_helpers.h b/arch/x86/kernel/pgtable_64_helpers.h
> new file mode 100644
> index 000000000000..0ae87d768ce2
> --- /dev/null
> +++ b/arch/x86/kernel/pgtable_64_helpers.h
> @@ -0,0 +1,28 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef __PGTABLES_64_H__
> +#define __PGTABLES_64_H__
> +
> +#ifdef __ASSEMBLY__
> +
> +#define l4_index(x) (((x) >> 39) & 511)
> +#define pud_index(x) (((x) >> PUD_SHIFT) & (PTRS_PER_PUD-1))

Please fix the minor style issue in this line by s/-/ - /

Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]