Re: [PATCH v2 16/20] KVM: s390: Switch to new gmap

Heiko Carstens
2025-09-17T13:20:27Z

On Wed, Sep 10, 2025 at 08:07:42PM +0200, Claudio Imbrenda wrote:
> Switch KVM/s390 to use the new gmap code.
>
> Remove includes to <gmap.h> and include "gmap.h" instead; fix all the
> existing users of the old gmap functions to use the new ones instead.
>
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

...

> -static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
> - unsigned long *pgt, int *dat_protection,
> - int *fake)
> +static int walk_guest_tables(struct gmap *sg, unsigned long saddr, struct pgtwalk *w, bool wr)
...

> - if (rfte.i)
> + if (table.pgd.i)
> return PGM_REGION_FIRST_TRANS;
> - if (rfte.tt != TABLE_TYPE_REGION1)
> + if (table.pgd.tt != TABLE_TYPE_REGION1)
> return PGM_TRANSLATION_SPEC;
> - if (vaddr.rsx01 < rfte.tf || vaddr.rsx01 > rfte.tl)
> + if (vaddr.rsx01 < table.pgd.tf || vaddr.rsx01 > table.pgd.tl)
> return PGM_REGION_SECOND_TRANS;

This (and other places): this was easy to map 1:1 to the architecture. But
with the change to pgd & friends this is not the case anymore. From my point
of view this is clearly worse compared to before; and I don't see a pressing
need for such a change.