From: Heiko Carstens <hca@linux.ibm.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] s390/mm: Add pmdp_idte() helper
Date: Tue, 24 Nov 2026 14:59:47 +0100 [thread overview]
Message-ID: <20261124135948.1295745-5-hca@linux.ibm.com> (raw)
In-Reply-To: <20261124135948.1295745-1-hca@linux.ibm.com>
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
next prev parent reply other threads:[~2026-11-24 13:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Heiko Carstens [this message]
2026-11-24 13:59 ` [PATCH 5/5] s390/mm: Add pudp_idte() helper Heiko Carstens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261124135948.1295745-5-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=gerald.schaefer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=svens@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox