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

Claudio Imbrenda
2025-09-16T17:04:19Z

On Tue, 16 Sep 2025 18:47:31 +0200
Heiko Carstens <hca@linux.ibm.com> wrote:

> 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.

no, CSPG is present with the DAT-Enhancement facility (z990), which also
brings IDTE. EDAT1 is more modern (z10)