Re: [PATCH v2 09/20] KVM: s390: KVM page table management functions: clear and replace

Heiko Carstens
2025-09-16T16:47:46Z

On Wed, Sep 10, 2025 at 08:07:35PM +0200, Claudio Imbrenda wrote:
> Add page table management functions to be used for KVM guest (gmap)
> page tables.
>
> This patch adds functions to clear, replace or exchange DAT table
> entries.
>
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
> arch/s390/kvm/dat.c | 120 ++++++++++++++++++++++++++++++++++++++++++++
> arch/s390/kvm/dat.h | 40 +++++++++++++++
> 2 files changed, 160 insertions(+)

...

> +bool dat_crstep_xchg_atomic(union crste *crstep, union crste old, union crste new, gfn_t gfn,
> + union asce asce)
> +{
> + if (old.h.i)
> + return arch_try_cmpxchg((long *)crstep, &old.val, new.val);
> + if (cpu_has_edat2())
> + return crdte_crste(crstep, old, new, gfn, asce);
> + if (cpu_has_idte())
> + return cspg_crste(crstep, old, new);

FWIW, CSPG is present if EDAT1 is installed. So this should be
cpu_has_edat1() instead, I would guess.