* [PATCH 0/5] s390/mm: Deduplicate machine_has_tlb_guest() usage
@ 2026-11-24 13:59 Heiko Carstens
2026-11-24 13:59 ` [PATCH 1/5] s390/mm: Remove gmap_asce from mm_context_t Heiko Carstens
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Heiko Carstens @ 2026-11-24 13:59 UTC (permalink / raw)
To: Claudio Imbrenda, Janosch Frank, Alexander Gordeev, Sven Schnelle,
Vasily Gorbik, Christian Borntraeger, Gerald Schaefer
Cc: linux-s390, linux-kernel
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.
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
--
2.53.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] s390/mm: Remove gmap_asce from mm_context_t
2026-11-24 13:59 [PATCH 0/5] s390/mm: Deduplicate machine_has_tlb_guest() usage Heiko Carstens
@ 2026-11-24 13:59 ` Heiko Carstens
2026-11-24 13:59 ` [PATCH 2/5] s390/mm: Remove unused nodat parameter from ptep flush helpers Heiko Carstens
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Heiko Carstens @ 2026-11-24 13:59 UTC (permalink / raw)
To: Claudio Imbrenda, Janosch Frank, Alexander Gordeev, Sven Schnelle,
Vasily Gorbik, Christian Borntraeger, Gerald Schaefer
Cc: linux-s390, linux-kernel
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@linux.ibm.com>
---
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] s390/mm: Remove unused nodat parameter from ptep flush helpers
2026-11-24 13:59 [PATCH 0/5] s390/mm: Deduplicate machine_has_tlb_guest() usage Heiko Carstens
2026-11-24 13:59 ` [PATCH 1/5] s390/mm: Remove gmap_asce from mm_context_t Heiko Carstens
@ 2026-11-24 13:59 ` Heiko Carstens
2026-11-24 13:59 ` [PATCH 3/5] s390/mm: Add ptep_ipte() helper Heiko Carstens
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Heiko Carstens @ 2026-11-24 13:59 UTC (permalink / raw)
To: Claudio Imbrenda, Janosch Frank, Alexander Gordeev, Sven Schnelle,
Vasily Gorbik, Christian Borntraeger, Gerald Schaefer
Cc: linux-s390, linux-kernel
The nodat parameter of ptep_ipte_local() and ptep_ipte_global() is not
used anymore. Remove it and update its callers.
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
arch/s390/mm/pgtable.c | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 561d280d485f..1aa5fe0b30d8 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -36,8 +36,7 @@ pgprot_t pgprot_writecombine(pgprot_t prot)
}
EXPORT_SYMBOL_GPL(pgprot_writecombine);
-static inline void ptep_ipte_local(struct mm_struct *mm, unsigned long addr,
- pte_t *ptep, int nodat)
+static inline void ptep_ipte_local(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
{
if (machine_has_tlb_guest())
__ptep_ipte(addr, ptep, IPTE_NODAT | IPTE_GUEST_ASCE, mm->context.asce, IPTE_LOCAL);
@@ -45,8 +44,7 @@ static inline void ptep_ipte_local(struct mm_struct *mm, unsigned long addr,
__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)
+static inline void ptep_ipte_global(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
{
if (machine_has_tlb_guest())
__ptep_ipte(addr, ptep, IPTE_NODAT | IPTE_GUEST_ASCE, mm->context.asce, IPTE_GLOBAL);
@@ -54,9 +52,7 @@ static inline void ptep_ipte_global(struct mm_struct *mm, unsigned long addr,
__ptep_ipte(addr, ptep, 0, 0, IPTE_GLOBAL);
}
-static inline pte_t ptep_flush_direct(struct mm_struct *mm,
- unsigned long addr, pte_t *ptep,
- int nodat)
+static inline pte_t ptep_flush_direct(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
{
pte_t old;
@@ -66,16 +62,14 @@ static inline pte_t ptep_flush_direct(struct mm_struct *mm,
atomic_inc(&mm->context.flush_count);
if (cpu_has_tlb_lc() &&
cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id())))
- ptep_ipte_local(mm, addr, ptep, nodat);
+ ptep_ipte_local(mm, addr, ptep);
else
- ptep_ipte_global(mm, addr, ptep, nodat);
+ ptep_ipte_global(mm, addr, ptep);
atomic_dec(&mm->context.flush_count);
return old;
}
-static inline pte_t ptep_flush_lazy(struct mm_struct *mm,
- unsigned long addr, pte_t *ptep,
- int nodat)
+static inline pte_t ptep_flush_lazy(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
{
pte_t old;
@@ -88,7 +82,7 @@ static inline pte_t ptep_flush_lazy(struct mm_struct *mm,
set_pte(ptep, set_pte_bit(old, __pgprot(_PAGE_INVALID)));
mm->context.flush_mm = 1;
} else
- ptep_ipte_global(mm, addr, ptep, nodat);
+ ptep_ipte_global(mm, addr, ptep);
atomic_dec(&mm->context.flush_count);
return old;
}
@@ -99,7 +93,7 @@ pte_t ptep_xchg_direct(struct mm_struct *mm, unsigned long addr,
pte_t old;
preempt_disable();
- old = ptep_flush_direct(mm, addr, ptep, 1);
+ old = ptep_flush_direct(mm, addr, ptep);
set_pte(ptep, new);
preempt_enable();
return old;
@@ -137,7 +131,7 @@ pte_t ptep_xchg_lazy(struct mm_struct *mm, unsigned long addr,
pte_t old;
preempt_disable();
- old = ptep_flush_lazy(mm, addr, ptep, 1);
+ old = ptep_flush_lazy(mm, addr, ptep);
set_pte(ptep, new);
preempt_enable();
return old;
@@ -147,7 +141,7 @@ EXPORT_SYMBOL(ptep_xchg_lazy);
pte_t ptep_modify_prot_start(struct vm_area_struct *vma, unsigned long addr,
pte_t *ptep)
{
- return ptep_flush_lazy(vma->vm_mm, addr, ptep, 1);
+ return ptep_flush_lazy(vma->vm_mm, addr, ptep);
}
void ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr,
--
2.53.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] s390/mm: Add ptep_ipte() helper
2026-11-24 13:59 [PATCH 0/5] s390/mm: Deduplicate machine_has_tlb_guest() usage Heiko Carstens
2026-11-24 13:59 ` [PATCH 1/5] s390/mm: Remove gmap_asce from mm_context_t Heiko Carstens
2026-11-24 13:59 ` [PATCH 2/5] s390/mm: Remove unused nodat parameter from ptep flush helpers Heiko Carstens
@ 2026-11-24 13:59 ` Heiko Carstens
2026-11-24 13:59 ` [PATCH 4/5] s390/mm: Add pmdp_idte() helper Heiko Carstens
2026-11-24 13:59 ` [PATCH 5/5] s390/mm: Add pudp_idte() helper Heiko Carstens
4 siblings, 0 replies; 6+ messages in thread
From: Heiko Carstens @ 2026-11-24 13:59 UTC (permalink / raw)
To: Claudio Imbrenda, Janosch Frank, Alexander Gordeev, Sven Schnelle,
Vasily Gorbik, Christian Borntraeger, Gerald Schaefer
Cc: linux-s390, linux-kernel
Add a common ptep_ipte() helper in order to avoid the
repeated machine_has_tlb_guest() checks.
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
arch/s390/include/asm/pgtable.h | 11 +++++++++++
arch/s390/kvm/gmap/dat.c | 5 +----
arch/s390/mm/pgtable.c | 10 ++--------
3 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 2d5c2ab06de9..378d2db6e6be 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -21,6 +21,7 @@
#include <linux/atomic.h>
#include <linux/mmap_lock.h>
#include <asm/ctlreg.h>
+#include <asm/machine.h>
#include <asm/bug.h>
#include <asm/page.h>
#include <asm/uv.h>
@@ -1156,6 +1157,16 @@ static __always_inline void __ptep_ipte(unsigned long address, pte_t *ptep,
: [r1] "a" (pto), [m4] "i" (local) : "memory");
}
+static __always_inline void ptep_ipte(unsigned long address, pte_t *ptep,
+ unsigned long opt, unsigned long asce,
+ int local)
+{
+ if (machine_has_tlb_guest())
+ __ptep_ipte(address, ptep, opt, asce, local);
+ else
+ __ptep_ipte(address, ptep, 0, 0, local);
+}
+
static __always_inline void __ptep_ipte_range(unsigned long address, int nr,
pte_t *ptep, int local)
{
diff --git a/arch/s390/kvm/gmap/dat.c b/arch/s390/kvm/gmap/dat.c
index 7a25e41a1423..909d665a67a9 100644
--- a/arch/s390/kvm/gmap/dat.c
+++ b/arch/s390/kvm/gmap/dat.c
@@ -173,10 +173,7 @@ union pgste __dat_ptep_xchg(union pte *ptep, union pgste pgste, union pte new, g
if (!old.h.i) {
unsigned long opts = IPTE_GUEST_ASCE | (pgste.nodat ? IPTE_NODAT : 0);
- if (machine_has_tlb_guest())
- __ptep_ipte(gfn_to_gpa(gfn), (void *)ptep, opts, asce.val, IPTE_GLOBAL);
- else
- __ptep_ipte(gfn_to_gpa(gfn), (void *)ptep, 0, 0, IPTE_GLOBAL);
+ ptep_ipte(gfn_to_gpa(gfn), (void *)ptep, opts, asce.val, IPTE_GLOBAL);
}
if (uses_skeys) {
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 1aa5fe0b30d8..f6a960f39abf 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -38,18 +38,12 @@ EXPORT_SYMBOL_GPL(pgprot_writecombine);
static inline void ptep_ipte_local(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
{
- 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);
+ ptep_ipte(addr, ptep, IPTE_NODAT | IPTE_GUEST_ASCE, mm->context.asce, IPTE_LOCAL);
}
static inline void ptep_ipte_global(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
{
- 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);
+ ptep_ipte(addr, ptep, IPTE_NODAT | IPTE_GUEST_ASCE, mm->context.asce, IPTE_GLOBAL);
}
static inline pte_t ptep_flush_direct(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
--
2.53.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] s390/mm: Add pmdp_idte() helper
2026-11-24 13:59 [PATCH 0/5] s390/mm: Deduplicate machine_has_tlb_guest() usage Heiko Carstens
` (2 preceding siblings ...)
2026-11-24 13:59 ` [PATCH 3/5] s390/mm: Add ptep_ipte() helper Heiko Carstens
@ 2026-11-24 13:59 ` Heiko Carstens
2026-11-24 13:59 ` [PATCH 5/5] s390/mm: Add pudp_idte() helper Heiko Carstens
4 siblings, 0 replies; 6+ messages in thread
From: Heiko Carstens @ 2026-11-24 13:59 UTC (permalink / raw)
To: Claudio Imbrenda, Janosch Frank, Alexander Gordeev, Sven Schnelle,
Vasily Gorbik, Christian Borntraeger, Gerald Schaefer
Cc: linux-s390, linux-kernel
Add a common pmdp_idte() helper in order to avoid the
repeated machine_has_tlb_guest() checks.
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
arch/s390/include/asm/pgtable.h | 10 ++++++++++
arch/s390/mm/pgtable.c | 18 ++++--------------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 378d2db6e6be..0d5ea2dca786 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -1661,6 +1661,16 @@ static __always_inline void __pmdp_idte(unsigned long addr, pmd_t *pmdp,
}
}
+static __always_inline void pmdp_idte(unsigned long addr, pmd_t *pmdp,
+ unsigned long opt, unsigned long asce,
+ int local)
+{
+ if (machine_has_tlb_guest())
+ __pmdp_idte(addr, pmdp, opt, asce, local);
+ else
+ __pmdp_idte(addr, pmdp, 0, 0, local);
+}
+
static __always_inline void __pudp_idte(unsigned long addr, pud_t *pudp,
unsigned long opt, unsigned long asce,
int local)
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index f6a960f39abf..72b62ad480bd 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -144,24 +144,14 @@ void ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr,
set_pte(ptep, pte);
}
-static inline void pmdp_idte_local(struct mm_struct *mm,
- unsigned long addr, pmd_t *pmdp)
+static inline void pmdp_idte_local(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp)
{
- if (machine_has_tlb_guest())
- __pmdp_idte(addr, pmdp, IDTE_NODAT | IDTE_GUEST_ASCE, mm->context.asce, IDTE_LOCAL);
- else
- __pmdp_idte(addr, pmdp, 0, 0, IDTE_LOCAL);
+ pmdp_idte(addr, pmdp, IDTE_NODAT | IDTE_GUEST_ASCE, mm->context.asce, IDTE_LOCAL);
}
-static inline void pmdp_idte_global(struct mm_struct *mm,
- unsigned long addr, pmd_t *pmdp)
+static inline void pmdp_idte_global(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp)
{
- if (machine_has_tlb_guest()) {
- __pmdp_idte(addr, pmdp, IDTE_NODAT | IDTE_GUEST_ASCE,
- mm->context.asce, IDTE_GLOBAL);
- } else {
- __pmdp_idte(addr, pmdp, 0, 0, IDTE_GLOBAL);
- }
+ pmdp_idte(addr, pmdp, IDTE_NODAT | IDTE_GUEST_ASCE, mm->context.asce, IDTE_GLOBAL);
}
static inline pmd_t pmdp_flush_direct(struct mm_struct *mm,
--
2.53.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] s390/mm: Add pudp_idte() helper
2026-11-24 13:59 [PATCH 0/5] s390/mm: Deduplicate machine_has_tlb_guest() usage Heiko Carstens
` (3 preceding siblings ...)
2026-11-24 13:59 ` [PATCH 4/5] s390/mm: Add pmdp_idte() helper Heiko Carstens
@ 2026-11-24 13:59 ` Heiko Carstens
4 siblings, 0 replies; 6+ messages in thread
From: Heiko Carstens @ 2026-11-24 13:59 UTC (permalink / raw)
To: Claudio Imbrenda, Janosch Frank, Alexander Gordeev, Sven Schnelle,
Vasily Gorbik, Christian Borntraeger, Gerald Schaefer
Cc: linux-s390, linux-kernel
Add a common pudp_idte() helper in order to avoid the
repeated machine_has_tlb_guest() checks.
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
arch/s390/include/asm/pgtable.h | 10 ++++++++++
arch/s390/mm/pgtable.c | 18 ++++--------------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 0d5ea2dca786..e8bb46071306 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -1698,6 +1698,16 @@ static __always_inline void __pudp_idte(unsigned long addr, pud_t *pudp,
}
}
+static __always_inline void pudp_idte(unsigned long addr, pud_t *pudp,
+ unsigned long opt, unsigned long asce,
+ int local)
+{
+ if (machine_has_tlb_guest())
+ __pudp_idte(addr, pudp, opt, asce, local);
+ else
+ __pudp_idte(addr, pudp, 0, 0, local);
+}
+
pmd_t pmdp_xchg_direct(struct mm_struct *, unsigned long, pmd_t *, pmd_t);
pmd_t pmdp_xchg_lazy(struct mm_struct *, unsigned long, pmd_t *, pmd_t);
pud_t pudp_xchg_direct(struct mm_struct *, unsigned long, pud_t *, pud_t);
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 72b62ad480bd..23125e88d17a 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -218,24 +218,14 @@ pmd_t pmdp_xchg_lazy(struct mm_struct *mm, unsigned long addr,
}
EXPORT_SYMBOL(pmdp_xchg_lazy);
-static inline void pudp_idte_local(struct mm_struct *mm,
- unsigned long addr, pud_t *pudp)
+static inline void pudp_idte_local(struct mm_struct *mm, unsigned long addr, pud_t *pudp)
{
- if (machine_has_tlb_guest())
- __pudp_idte(addr, pudp, IDTE_NODAT | IDTE_GUEST_ASCE,
- mm->context.asce, IDTE_LOCAL);
- else
- __pudp_idte(addr, pudp, 0, 0, IDTE_LOCAL);
+ pudp_idte(addr, pudp, IDTE_NODAT | IDTE_GUEST_ASCE, mm->context.asce, IDTE_LOCAL);
}
-static inline void pudp_idte_global(struct mm_struct *mm,
- unsigned long addr, pud_t *pudp)
+static inline void pudp_idte_global(struct mm_struct *mm, unsigned long addr, pud_t *pudp)
{
- if (machine_has_tlb_guest())
- __pudp_idte(addr, pudp, IDTE_NODAT | IDTE_GUEST_ASCE,
- mm->context.asce, IDTE_GLOBAL);
- else
- __pudp_idte(addr, pudp, 0, 0, IDTE_GLOBAL);
+ pudp_idte(addr, pudp, IDTE_NODAT | IDTE_GUEST_ASCE, mm->context.asce, IDTE_GLOBAL);
}
static inline pud_t pudp_flush_direct(struct mm_struct *mm,
--
2.53.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-24 13:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 13:59 [PATCH 0/5] s390/mm: Deduplicate machine_has_tlb_guest() usage Heiko Carstens
2026-11-24 13:59 ` [PATCH 1/5] s390/mm: Remove gmap_asce from mm_context_t Heiko Carstens
2026-11-24 13:59 ` [PATCH 2/5] s390/mm: Remove unused nodat parameter from ptep flush helpers Heiko Carstens
2026-11-24 13:59 ` [PATCH 3/5] s390/mm: Add ptep_ipte() helper Heiko Carstens
2026-11-24 13:59 ` [PATCH 4/5] s390/mm: Add pmdp_idte() helper Heiko Carstens
2026-11-24 13:59 ` [PATCH 5/5] s390/mm: Add pudp_idte() helper Heiko Carstens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox