From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: linux-arm-kernel@lists.infradead.org
Cc: Clark Williams <clrkwllms@kernel.org>,
linux-rt-devel@lists.linux.dev,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH 3/6] ARM: move is_permission_fault() and is_translation_fault() to fault.h
Date: Fri, 27 Feb 2026 15:19:18 +0000 [thread overview]
Message-ID: <E1vvzcc-0000000Awo6-2oph@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <aaG1wrNUaq_L0I5g@shell.armlinux.org.uk>
is_permission_fault() and is_translation_fault() are both conditional
on the FSR encodings, which are dependent on LPAE. We define the
constants in fault.h. Move these inline functions to fault.h to be
near the FSR definitions.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
arch/arm/mm/fault.c | 26 --------------------------
arch/arm/mm/fault.h | 26 ++++++++++++++++++++++++++
2 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 0f3b6cc516c1..e62cc4be5adf 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -115,32 +115,6 @@ static inline bool is_write_fault(unsigned int fsr)
return (fsr & FSR_WRITE) && !(fsr & FSR_CM);
}
-static inline bool is_translation_fault(unsigned int fsr)
-{
- int fs = fsr_fs(fsr);
-#ifdef CONFIG_ARM_LPAE
- if ((fs & FS_MMU_NOLL_MASK) == FS_TRANS_NOLL)
- return true;
-#else
- if (fs == FS_L1_TRANS || fs == FS_L2_TRANS)
- return true;
-#endif
- return false;
-}
-
-static inline bool is_permission_fault(unsigned int fsr)
-{
- int fs = fsr_fs(fsr);
-#ifdef CONFIG_ARM_LPAE
- if ((fs & FS_MMU_NOLL_MASK) == FS_PERM_NOLL)
- return true;
-#else
- if (fs == FS_L1_PERM || fs == FS_L2_PERM)
- return true;
-#endif
- return false;
-}
-
static void die_kernel_fault(const char *msg, struct mm_struct *mm,
unsigned long addr, unsigned int fsr,
struct pt_regs *regs)
diff --git a/arch/arm/mm/fault.h b/arch/arm/mm/fault.h
index e8f8c1902544..e95f44757dc9 100644
--- a/arch/arm/mm/fault.h
+++ b/arch/arm/mm/fault.h
@@ -35,6 +35,32 @@ static inline int fsr_fs(unsigned int fsr)
}
#endif
+static inline bool is_translation_fault(unsigned int fsr)
+{
+ int fs = fsr_fs(fsr);
+#ifdef CONFIG_ARM_LPAE
+ if ((fs & FS_MMU_NOLL_MASK) == FS_TRANS_NOLL)
+ return true;
+#else
+ if (fs == FS_L1_TRANS || fs == FS_L2_TRANS)
+ return true;
+#endif
+ return false;
+}
+
+static inline bool is_permission_fault(unsigned int fsr)
+{
+ int fs = fsr_fs(fsr);
+#ifdef CONFIG_ARM_LPAE
+ if ((fs & FS_MMU_NOLL_MASK) == FS_PERM_NOLL)
+ return true;
+#else
+ if (fs == FS_L1_PERM || fs == FS_L2_PERM)
+ return true;
+#endif
+ return false;
+}
+
void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
void early_abt_enable(void);
asmlinkage void do_DataAbort(unsigned long addr, unsigned int fsr,
--
2.47.3
next prev parent reply other threads:[~2026-02-27 15:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 15:18 [PATCH 0/6] ARM: cleanup fault handling Russell King (Oracle)
2026-02-27 15:19 ` [PATCH 1/6] ARM: ensure interrupts are enabled in __do_user_fault() Russell King (Oracle)
2026-03-02 10:33 ` Sebastian Andrzej Siewior
2026-02-27 15:19 ` [PATCH 2/6] ARM: move vmalloc() lazy-page table population Russell King (Oracle)
2026-03-02 10:43 ` Sebastian Andrzej Siewior
2026-03-02 10:57 ` Russell King (Oracle)
2026-03-02 11:00 ` Sebastian Andrzej Siewior
2026-03-02 11:19 ` Russell King (Oracle)
2026-03-02 11:51 ` Sebastian Andrzej Siewior
2026-02-27 15:19 ` Russell King (Oracle) [this message]
2026-03-02 10:45 ` [PATCH 3/6] ARM: move is_permission_fault() and is_translation_fault() to fault.h Sebastian Andrzej Siewior
2026-02-27 15:19 ` [PATCH 4/6] ARM: use BIT() and GENMASK() for fault status register fields Russell King (Oracle)
2026-03-02 10:50 ` Sebastian Andrzej Siewior
2026-02-27 15:19 ` [PATCH 5/6] ARM: move FSR fault status definitions before fsr_fs() Russell King (Oracle)
2026-03-02 10:51 ` Sebastian Andrzej Siewior
2026-02-27 15:19 ` [PATCH 6/6] ARM: provide individual is_translation_fault() and is_permission_fault() Russell King (Oracle)
2026-03-02 10:54 ` Sebastian Andrzej Siewior
2026-03-02 10:57 ` [PATCH 0/6] ARM: cleanup fault handling Sebastian Andrzej Siewior
2026-03-19 15:37 ` Sebastian Andrzej Siewior
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=E1vvzcc-0000000Awo6-2oph@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=rostedt@goodmis.org \
/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