lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251124134120.3803aede@p-imbrenda>
Date: Mon, 24 Nov 2025 13:41:20 +0100
From: Claudio Imbrenda <imbrenda@...ux.ibm.com>
To: Janosch Frank <frankja@...ux.ibm.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-s390@...r.kernel.org, borntraeger@...ibm.com, nsg@...ux.ibm.com,
        nrb@...ux.ibm.com, seiden@...ux.ibm.com, gra@...ux.ibm.com,
        schlameuss@...ux.ibm.com, hca@...ux.ibm.com, svens@...ux.ibm.com,
        agordeev@...ux.ibm.com, gor@...ux.ibm.com, david@...hat.com,
        gerald.schaefer@...ux.ibm.com
Subject: Re: [PATCH v5 08/23] KVM: s390: KVM page table management
 functions: allocation

On Mon, 24 Nov 2025 13:27:24 +0100
Janosch Frank <frankja@...ux.ibm.com> wrote:

> On 11/24/25 12:55, Claudio Imbrenda wrote:
> > Add page table management functions to be used for KVM guest (gmap)
> > page tables.
> > 
> > This patch adds the boilerplate and functions for the allocation and
> > deallocation of DAT tables.
> > 
> > Signed-off-by: Claudio Imbrenda <imbrenda@...ux.ibm.com>  
> 
> What's the cache for, why did you add it?

the cache is needed to allocate memory when we can sleep (to avoid
atomic allocations), and use it when holding spinlocks (when we can't
sleep).

this is similar to what other architectures do, except that in their
case they only have one type of page table to worry about, we need at
least 3 types of objects.

unlike other architectures, allocations from the cache can fail, and
the calling code needs to handle failures (e.g. by replenishing the
cache and trying again)

> 
> > ---
> >   arch/s390/kvm/Makefile     |   1 +
> >   arch/s390/kvm/dat.c        | 103 +++++++++++++++++++++++++++++++++++++
> >   arch/s390/kvm/dat.h        |  77 +++++++++++++++++++++++++++
> >   arch/s390/mm/page-states.c |   1 +
> >   4 files changed, 182 insertions(+)
> >   create mode 100644 arch/s390/kvm/dat.c
> > 
> > diff --git a/arch/s390/kvm/Makefile b/arch/s390/kvm/Makefile
> > index 9a723c48b05a..84315d2f75fb 100644
> > --- a/arch/s390/kvm/Makefile
> > +++ b/arch/s390/kvm/Makefile
> > @@ -9,6 +9,7 @@ ccflags-y := -Ivirt/kvm -Iarch/s390/kvm
> >   
> >   kvm-y += kvm-s390.o intercept.o interrupt.o priv.o sigp.o
> >   kvm-y += diag.o gaccess.o guestdbg.o vsie.o pv.o gmap-vsie.o
> > +kvm-y += dat.o
> >   
> >   kvm-$(CONFIG_VFIO_PCI_ZDEV_KVM) += pci.o
> >   obj-$(CONFIG_KVM) += kvm.o
> > diff --git a/arch/s390/kvm/dat.c b/arch/s390/kvm/dat.c
> > new file mode 100644
> > index 000000000000..c324a27f379f
> > --- /dev/null
> > +++ b/arch/s390/kvm/dat.c
> > @@ -0,0 +1,103 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + *  KVM guest address space mapping code
> > + *
> > + *    Copyright IBM Corp. 2007, 2020, 2024  
> 
> Should definitely add 2025

yes

> 
> > + *    Author(s): Claudio Imbrenda <imbrenda@...ux.ibm.com>
> > + *		 Martin Schwidefsky <schwidefsky@...ibm.com>
> > + *		 David Hildenbrand <david@...hat.com>
> > + *		 Janosch Frank <frankja@...ux.ibm.com>  
> 
> Did you retain the authors here because you bring in code from other 
> files with these authors in the future?

in the beginning I had copied stuff from other files, but things have
changed a lot. do you think I should drop the other names?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ