android_kernel_xiaomi_sm8450/arch
Marco Elver aed2e27d51 UPSTREAM: kfence, x86: fix preemptible warning on KPTI-enabled systems
On systems with KPTI enabled, we can currently observe the following
warning:

  BUG: using smp_processor_id() in preemptible
  caller is invalidate_user_asid+0x13/0x50
  CPU: 6 PID: 1075 Comm: dmesg Not tainted 5.12.0-rc4-gda4a2b1a5479-kfence_1+ #1
  Hardware name: Hewlett-Packard HP Pro 3500 Series/2ABF, BIOS 8.11 10/24/2012
  Call Trace:
   dump_stack+0x7f/0xad
   check_preemption_disabled+0xc8/0xd0
   invalidate_user_asid+0x13/0x50
   flush_tlb_one_kernel+0x5/0x20
   kfence_protect+0x56/0x80
   ...

While it normally makes sense to require preemption to be off, so that
the expected CPU's TLB is flushed and not another, in our case it really
is best-effort (see comments in kfence_protect_page()).

Avoid the warning by disabling preemption around flush_tlb_one_kernel().

Link: https://lore.kernel.org/lkml/YGIDBAboELGgMgXy@elver.google.com/
Link: https://lkml.kernel.org/r/20210330065737.652669-1-elver@google.com
Signed-off-by: Marco Elver <elver@google.com>
Reported-by: Tomi Sarvela <tomi.p.sarvela@intel.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: Jann Horn <jannh@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit 6a77d38efcda40f555a920909eab22ee0917fd0d)

Bug: 229863099
Signed-off-by: Colin Downs-Razouk <colindr@google.com>
Change-Id: Ia917b052ffbb267254f281f55141c34ad193c78e
2022-04-27 11:12:09 -07:00
..
alpha Merge tag 'android12-5.10.81_r00' into android12-5.10 2022-01-21 09:35:04 +01:00
arc ARC: export clear_user_page() for modules 2021-09-22 12:28:04 +02:00
arm Merge tag 'android12-5.10.101_r00' into android12-5.10 2022-03-21 14:29:02 +01:00
arm64 ANDROID: GKI: Enable CRYPTO_DES 2022-04-08 15:29:18 +00:00
c6x Revert "Revert "uaccess: add infrastructure for kernel builds with set_fs()"" 2020-10-28 15:08:39 +01:00
csky This is the 5.10.93 stable release 2022-01-20 09:34:45 +01:00
h8300 Merge 5.10.17 into android12-5.10 2021-02-18 11:21:01 +01:00
hexagon hexagon: clean up timer-regs.h 2021-11-26 10:39:19 +01:00
ia64 Merge tag 'android12-5.10.81_r00' into android12-5.10 2022-01-21 09:35:04 +01:00
m68k Merge tag 'android12-5.10.81_r00' into android12-5.10 2022-01-21 09:35:04 +01:00
microblaze UPSTREAM: mm: wire up syscall process_mrelease 2022-01-06 17:37:36 +00:00
mips This is the 5.10.94 stable release 2022-01-27 11:49:22 +01:00
nds32 perf: Protect perf_guest_cbs with RCU 2022-01-20 09:17:50 +01:00
nios2 nios2: Make NIOS2_DTB_SOURCE_BOOL depend on !COMPILE_TEST 2021-11-02 19:48:23 +01:00
openrisc openrisc: Add clone3 ABI wrapper 2022-01-27 10:54:06 +01:00
parisc This is the 5.10.94 stable release 2022-01-27 11:49:22 +01:00
powerpc This is the 5.10.101 stable release 2022-02-16 15:16:06 +01:00
riscv This is the 5.10.101 stable release 2022-02-16 15:16:06 +01:00
s390 This is the 5.10.100 stable release 2022-02-11 09:19:01 +01:00
sh Merge tag 'android12-5.10.81_r00' into android12-5.10 2022-01-21 09:35:04 +01:00
sparc Merge tag 'android12-5.10.81_r00' into android12-5.10 2022-01-21 09:35:04 +01:00
um This is the 5.10.94 stable release 2022-01-27 11:49:22 +01:00
x86 UPSTREAM: kfence, x86: fix preemptible warning on KPTI-enabled systems 2022-04-27 11:12:09 -07:00
xtensa Merge tag 'android12-5.10.81_r00' into android12-5.10 2022-01-21 09:35:04 +01:00
.gitignore
Kconfig This is the 5.10.80 stable release 2021-11-19 11:50:41 +01:00