Re: [kvm-unit-tests 1/5] lib: s390x: Add function to get page root

Nico Boehr
2026-04-15T11:53:18Z

On Wed Apr 15, 2026 at 10:45 AM CEST, Janosch Frank wrote:
[...]
> diff --git a/lib/s390x/mmu.h b/lib/s390x/mmu.h
> index dadc2e60..6ba19d28 100644
> --- a/lib/s390x/mmu.h
> +++ b/lib/s390x/mmu.h
> @@ -10,6 +10,8 @@
> #ifndef _S390X_MMU_H_
> #define _S390X_MMU_H_
>
> +#include <asm/arch_def.h>
> +
> enum pgt_level {
> pgtable_level_pgd = 1,
> pgtable_level_p4d,
> @@ -95,4 +97,9 @@ static inline void unprotect_page(void *vaddr, unsigned long prot)
>
> void *get_dat_entry(pgd_t *pgtable, void *vaddr, enum pgt_level level);
>
> +static inline pgd_t *get_page_root(void)

Only nit I have: naming is hard... do you think it makes sense to reflect that
we're talking about the primary-space root here?

get_primary_page_root()?

It's not like we're using the other spaces much in kut, but maybe we will in the
future.