Skip to content

Commit dea2028

Browse files
author
Russell King (Oracle)
committed
ARM: group is_permission_fault() with is_translation_fault()
Group is_permission_fault() with is_translation_fault(), which is needed to use is_permission_fault() in __do_kernel_fault(). As this is static inline, there is no need for this to be under CONFIG_MMU. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
1 parent edb924a commit dea2028

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

arch/arm/mm/fault.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,19 @@ static inline bool is_translation_fault(unsigned int fsr)
128128
return false;
129129
}
130130

131+
static inline bool is_permission_fault(unsigned int fsr)
132+
{
133+
int fs = fsr_fs(fsr);
134+
#ifdef CONFIG_ARM_LPAE
135+
if ((fs & FS_MMU_NOLL_MASK) == FS_PERM_NOLL)
136+
return true;
137+
#else
138+
if (fs == FS_L1_PERM || fs == FS_L2_PERM)
139+
return true;
140+
#endif
141+
return false;
142+
}
143+
131144
static void die_kernel_fault(const char *msg, struct mm_struct *mm,
132145
unsigned long addr, unsigned int fsr,
133146
struct pt_regs *regs)
@@ -225,19 +238,6 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
225238
}
226239

227240
#ifdef CONFIG_MMU
228-
static inline bool is_permission_fault(unsigned int fsr)
229-
{
230-
int fs = fsr_fs(fsr);
231-
#ifdef CONFIG_ARM_LPAE
232-
if ((fs & FS_MMU_NOLL_MASK) == FS_PERM_NOLL)
233-
return true;
234-
#else
235-
if (fs == FS_L1_PERM || fs == FS_L2_PERM)
236-
return true;
237-
#endif
238-
return false;
239-
}
240-
241241
#ifdef CONFIG_CPU_TTBR0_PAN
242242
static inline bool ttbr0_usermode_access_allowed(struct pt_regs *regs)
243243
{

0 commit comments

Comments
 (0)