Commit 240efd71 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/kuap: Force inlining of all first level KUAP helpers.

All KUAP helpers defined in asm/kup.h are single line functions
that should be inlined. But on book3s/32 build, we get many
instances of <prevent_write_to_user.constprop.0>.

Force inlining of those helpers.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/8479a862e165a57a855292d47e24c259a578f5a0.1622711627.git.christophe.leroy@csgroup.eu
parent cb2f1fb2
...@@ -84,51 +84,51 @@ static __always_inline void setup_kup(void) ...@@ -84,51 +84,51 @@ static __always_inline void setup_kup(void)
setup_kuap(disable_kuap); setup_kuap(disable_kuap);
} }
static inline void allow_read_from_user(const void __user *from, unsigned long size) static __always_inline void allow_read_from_user(const void __user *from, unsigned long size)
{ {
barrier_nospec(); barrier_nospec();
allow_user_access(NULL, from, size, KUAP_READ); allow_user_access(NULL, from, size, KUAP_READ);
} }
static inline void allow_write_to_user(void __user *to, unsigned long size) static __always_inline void allow_write_to_user(void __user *to, unsigned long size)
{ {
allow_user_access(to, NULL, size, KUAP_WRITE); allow_user_access(to, NULL, size, KUAP_WRITE);
} }
static inline void allow_read_write_user(void __user *to, const void __user *from, static __always_inline void allow_read_write_user(void __user *to, const void __user *from,
unsigned long size) unsigned long size)
{ {
barrier_nospec(); barrier_nospec();
allow_user_access(to, from, size, KUAP_READ_WRITE); allow_user_access(to, from, size, KUAP_READ_WRITE);
} }
static inline void prevent_read_from_user(const void __user *from, unsigned long size) static __always_inline void prevent_read_from_user(const void __user *from, unsigned long size)
{ {
prevent_user_access(KUAP_READ); prevent_user_access(KUAP_READ);
} }
static inline void prevent_write_to_user(void __user *to, unsigned long size) static __always_inline void prevent_write_to_user(void __user *to, unsigned long size)
{ {
prevent_user_access(KUAP_WRITE); prevent_user_access(KUAP_WRITE);
} }
static inline void prevent_read_write_user(void __user *to, const void __user *from, static __always_inline void prevent_read_write_user(void __user *to, const void __user *from,
unsigned long size) unsigned long size)
{ {
prevent_user_access(KUAP_READ_WRITE); prevent_user_access(KUAP_READ_WRITE);
} }
static inline void prevent_current_access_user(void) static __always_inline void prevent_current_access_user(void)
{ {
prevent_user_access(KUAP_READ_WRITE); prevent_user_access(KUAP_READ_WRITE);
} }
static inline void prevent_current_read_from_user(void) static __always_inline void prevent_current_read_from_user(void)
{ {
prevent_user_access(KUAP_READ); prevent_user_access(KUAP_READ);
} }
static inline void prevent_current_write_to_user(void) static __always_inline void prevent_current_write_to_user(void)
{ {
prevent_user_access(KUAP_WRITE); prevent_user_access(KUAP_WRITE);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment