Re: [PATCH v2 10/15] KVM: s390: stop using page->index for non-shadow gmaps

Janosch Frank
2025-01-17T16:52:32Z

On 1/16/25 12:33 PM, Claudio Imbrenda wrote:
> The host_to_guest radix tree will now map userspace addresses to guest
> addresses, instead of userspace addresses to segment tables.
>
> When segment tables and page tables are needed, they are found using an
> additional gmap_table_walk().
>
> This gets rid of all usage of page->index for non-shadow gmaps.
>
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
> arch/s390/mm/gmap.c | 96 +++++++++++++++++++++------------------------
> 1 file changed, 45 insertions(+), 51 deletions(-)
>
> diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
> index 12d681b657b4..c0f79c14277e 100644
> --- a/arch/s390/mm/gmap.c
> +++ b/arch/s390/mm/gmap.c
> @@ -24,8 +24,11 @@
> #include <asm/page.h>
> #include <asm/tlb.h>
>
> +#define GADDR_VALID(gaddr) ((gaddr) & 1)

That's wild, please make the 1 a named constant.