[PATCH 1/5] s390/mm: Remove gmap_asce from mm_context_t
From: Heiko Carstens
Date: Tue Nov 24 2026 - 09:00:36 EST
After the gmap rework mm->context.gmap_asce is always 0.
Remove it, and simplify the mm code accordingly.
Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
---
arch/s390/include/asm/mmu.h | 1 -
arch/s390/include/asm/mmu_context.h | 1 -
arch/s390/include/asm/tlbflush.h | 12 +---------
arch/s390/mm/pgtable.c | 34 +++++------------------------
4 files changed, 7 insertions(+), 41 deletions(-)
diff --git a/arch/s390/include/asm/mmu.h b/arch/s390/include/asm/mmu.h
index d4fd7bf3692e..3bf06dcba050 100644
--- a/arch/s390/include/asm/mmu.h
+++ b/arch/s390/include/asm/mmu.h
@@ -12,7 +12,6 @@ typedef struct {
atomic_t flush_count;
unsigned int flush_mm;
struct list_head gmap_list;
- unsigned long gmap_asce;
unsigned long asce;
unsigned long asce_limit;
unsigned long vdso_base;
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h
index bd1ef5e2d2eb..4e5da0017c15 100644
--- a/arch/s390/include/asm/mmu_context.h
+++ b/arch/s390/include/asm/mmu_context.h
@@ -27,7 +27,6 @@ static inline int init_new_context(struct task_struct *tsk,
cpumask_clear(&mm->context.cpu_attach_mask);
atomic_set(&mm->context.flush_count, 0);
atomic_set(&mm->context.protected_count, 0);
- mm->context.gmap_asce = 0;
mm->context.flush_mm = 0;
#if IS_ENABLED(CONFIG_KVM)
mm->context.allow_cow_sharing = 1;
diff --git a/arch/s390/include/asm/tlbflush.h b/arch/s390/include/asm/tlbflush.h
index 163ccbbe8c47..ca517013b5d0 100644
--- a/arch/s390/include/asm/tlbflush.h
+++ b/arch/s390/include/asm/tlbflush.h
@@ -46,22 +46,12 @@ static inline void __tlb_flush_global(void)
*/
static inline void __tlb_flush_mm(struct mm_struct *mm)
{
- unsigned long gmap_asce;
-
preempt_disable();
atomic_inc(&mm->context.flush_count);
/* Reset TLB flush mask */
cpumask_copy(mm_cpumask(mm), &mm->context.cpu_attach_mask);
barrier();
- gmap_asce = READ_ONCE(mm->context.gmap_asce);
- if (gmap_asce != -1UL) {
- if (gmap_asce)
- __tlb_flush_idte(gmap_asce);
- __tlb_flush_idte(mm->context.asce);
- } else {
- /* Global TLB flush */
- __tlb_flush_global();
- }
+ __tlb_flush_idte(mm->context.asce);
atomic_dec(&mm->context.flush_count);
preempt_enable();
}
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index da076928b63b..561d280d485f 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -39,41 +39,19 @@ EXPORT_SYMBOL_GPL(pgprot_writecombine);
static inline void ptep_ipte_local(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, int nodat)
{
- unsigned long opt, asce;
-
- if (machine_has_tlb_guest()) {
- opt = 0;
- asce = READ_ONCE(mm->context.gmap_asce);
- if (asce == 0UL || nodat)
- opt |= IPTE_NODAT;
- if (asce != -1UL) {
- asce = asce ? : mm->context.asce;
- opt |= IPTE_GUEST_ASCE;
- }
- __ptep_ipte(addr, ptep, opt, asce, IPTE_LOCAL);
- } else {
+ if (machine_has_tlb_guest())
+ __ptep_ipte(addr, ptep, IPTE_NODAT | IPTE_GUEST_ASCE, mm->context.asce, IPTE_LOCAL);
+ else
__ptep_ipte(addr, ptep, 0, 0, IPTE_LOCAL);
- }
}
static inline void ptep_ipte_global(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, int nodat)
{
- unsigned long opt, asce;
-
- if (machine_has_tlb_guest()) {
- opt = 0;
- asce = READ_ONCE(mm->context.gmap_asce);
- if (asce == 0UL || nodat)
- opt |= IPTE_NODAT;
- if (asce != -1UL) {
- asce = asce ? : mm->context.asce;
- opt |= IPTE_GUEST_ASCE;
- }
- __ptep_ipte(addr, ptep, opt, asce, IPTE_GLOBAL);
- } else {
+ if (machine_has_tlb_guest())
+ __ptep_ipte(addr, ptep, IPTE_NODAT | IPTE_GUEST_ASCE, mm->context.asce, IPTE_GLOBAL);
+ else
__ptep_ipte(addr, ptep, 0, 0, IPTE_GLOBAL);
- }
}
static inline pte_t ptep_flush_direct(struct mm_struct *mm,
--
2.53.0