Re: [PATCH 0/5] s390/mm: Deduplicate machine_has_tlb_guest() usage

From: Claudio Imbrenda

Date: Tue Nov 24 2026 - 13:25:52 EST


On Tue, 24 Nov 2026 14:59:43 +0100
Heiko Carstens <hca@xxxxxxxxxxxxx> wrote:

> While working on something different there was the need to add yet
> another machine_has_tlb_guest() check. The machine_has_tlb_guest() check
> pattern is duplicated all over the place. It seems to make sense to add
> common helpers instead of duplicating the code again.
>
> This also revealed that the gmap_asce member in mm_context_t is always
> zero since Claudio's gmap rework. Removing it allows to simplify quite a
> bit of code.
>
> Code applies on top of linux-next 20261123.

Moving the checks inside the helper is the cleanest way. I was already
working to do this for KVM too.


Whole series:

Reviewed-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>

>
> Thanks,
> Heiko
>
> Heiko Carstens (5):
> s390/mm: Remove gmap_asce from mm_context_t
> s390/mm: Remove unused nodat parameter from ptep flush helpers
> s390/mm: Add ptep_ipte() helper
> s390/mm: Add pmdp_idte() helper
> s390/mm: Add pudp_idte() helper
>
> arch/s390/include/asm/mmu.h | 1 -
> arch/s390/include/asm/mmu_context.h | 1 -
> arch/s390/include/asm/pgtable.h | 31 ++++++++++
> arch/s390/include/asm/tlbflush.h | 12 +---
> arch/s390/kvm/gmap/dat.c | 5 +-
> arch/s390/mm/pgtable.c | 94 ++++++-----------------------
> 6 files changed, 53 insertions(+), 91 deletions(-)
>
>
> base-commit: 3191063649dbf7c0d0b768e1f3655e4c5fc6edb5