aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/book3s/64
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@csgroup.eu>2020-12-09 05:29:23 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2020-12-09 23:48:13 +1100
commit3dc12dfe74300febc568c3b530c0f9bee01f2821 (patch)
tree42783ff7861836cf359ab4d83181cb01da5fce72 /arch/powerpc/include/asm/book3s/64
parentpowerpc/fault: Unnest definition of page_fault_is_write() and page_fault_is_bad() (diff)
downloadlinux-dev-3dc12dfe74300febc568c3b530c0f9bee01f2821.tar.xz
linux-dev-3dc12dfe74300febc568c3b530c0f9bee01f2821.zip
powerpc/mm: Move the WARN() out of bad_kuap_fault()
In order to prepare the removal of calls to search_exception_tables() on the fast path, move the WARN() out of bad_kuap_fault(). Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/9501311014bd6507e04b27a0c3035186ccf65cd5.1607491748.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/include/asm/book3s/64')
-rw-r--r--arch/powerpc/include/asm/book3s/64/kup.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/book3s/64/kup.h b/arch/powerpc/include/asm/book3s/64/kup.h
index 7075c92c320c..f50f72e535aa 100644
--- a/arch/powerpc/include/asm/book3s/64/kup.h
+++ b/arch/powerpc/include/asm/book3s/64/kup.h
@@ -371,11 +371,9 @@ static inline bool bad_kuap_fault(struct pt_regs *regs, unsigned long address,
* the AMR. Hence check for BLOCK_WRITE/READ against AMR.
*/
if (is_write) {
- return WARN(((regs->amr & AMR_KUAP_BLOCK_WRITE) == AMR_KUAP_BLOCK_WRITE),
- "Bug: Write fault blocked by AMR!");
+ return (regs->amr & AMR_KUAP_BLOCK_WRITE) == AMR_KUAP_BLOCK_WRITE;
}
- return WARN(((regs->amr & AMR_KUAP_BLOCK_READ) == AMR_KUAP_BLOCK_READ),
- "Bug: Read fault blocked by AMR!");
+ return (regs->amr & AMR_KUAP_BLOCK_READ) == AMR_KUAP_BLOCK_READ;
}
static __always_inline void allow_user_access(void __user *to, const void __user *from,