Re: [PATCH v5 08/23] KVM: s390: KVM page table management functions: allocation

From: Janosch Frank
Date: Mon Nov 24 2025 - 08:01:29 EST


On 11/24/25 13:41, Claudio Imbrenda wrote:
On Mon, 24 Nov 2025 13:27:24 +0100
Janosch Frank <frankja@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxx>

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)

Well, this information should make it into this patch, either into the description or in the body.



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