Re: [PATCH v2 18/20] KVM: S390: Remove PGSTE code from linux/s390 mm

Steffen Eiden
2025-09-16T07:30:48Z

On Wed, Sep 10, 2025 at 08:07:44PM +0200, Claudio Imbrenda wrote:
> Remove the PGSTE config option.
> Remove all code from linux/s390 mm that involves PGSTEs.
>
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
> arch/s390/Kconfig | 3 -
> arch/s390/include/asm/mmu.h | 13 -
> arch/s390/include/asm/page.h | 4 -
> arch/s390/include/asm/pgalloc.h | 2 -
> arch/s390/include/asm/pgtable.h | 99 +---
> arch/s390/mm/hugetlbpage.c | 24 -
> arch/s390/mm/pgalloc.c | 29 --
> arch/s390/mm/pgtable.c | 827 +-------------------------------
> mm/khugepaged.c | 9 -
> 9 files changed, 14 insertions(+), 996 deletions(-)
>

...

> #define INIT_MM_CONTEXT(name) \
> diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
> index 4e5dbabdf202..b4fb4d7adff4 100644
> --- a/arch/s390/include/asm/page.h
> +++ b/arch/s390/include/asm/page.h
> @@ -78,7 +78,6 @@ static inline void copy_page(void *to, void *from)
> #ifdef STRICT_MM_TYPECHECKS
>
> typedef struct { unsigned long pgprot; } pgprot_t;
> -typedef struct { unsigned long pgste; } pgste_t;
> typedef struct { unsigned long pte; } pte_t;
> typedef struct { unsigned long pmd; } pmd_t;
> typedef struct { unsigned long pud; } pud_t;
> @@ -94,7 +93,6 @@ static __always_inline unsigned long name ## _val(name ## _t name) \
> #else /* STRICT_MM_TYPECHECKS */
>
> typedef unsigned long pgprot_t;
> -typedef unsigned long pgste_t;
> typedef unsigned long pte_t;
> typedef unsigned long pmd_t;
> typedef unsigned long pud_t;
> @@ -110,7 +108,6 @@ static __always_inline unsigned long name ## _val(name ## _t name) \
> #endif /* STRICT_MM_TYPECHECKS */
>
> DEFINE_PGVAL_FUNC(pgprot)
> -DEFINE_PGVAL_FUNC(pgste)
> DEFINE_PGVAL_FUNC(pte)
> DEFINE_PGVAL_FUNC(pmd)
> DEFINE_PGVAL_FUNC(pud)
> @@ -120,7 +117,6 @@ DEFINE_PGVAL_FUNC(pgd)
> typedef pte_t *pgtable_t;
>
> #define __pgprot(x) ((pgprot_t) { (x) } )
> -#define __pgste(x) ((pgste_t) { (x) } )
> #define __pte(x) ((pte_t) { (x) } )
> #define __pmd(x) ((pmd_t) { (x) } )
> #define __pud(x) ((pud_t) { (x) } )

You missed to remove the PGSTE_*_BIT{,S} and _PGSTE_GPS_* definitions in
arch/s390/include/asm/pgtable.h
(I found them at line 417.. (based on 6.16 with your patches applied))

Or are they kept on purpose? I could not find any usage after your patches.

Steffen