android_kernel_motorola_sm6225/arch
Alexey Kardashevskiy 2708da3dbb powerpc/iommu: Annotate nested lock for lockdep
[ Upstream commit cc7130bf119add37f36238343a593b71ef6ecc1e ]

The IOMMU table is divided into pools for concurrent mappings and each
pool has a separate spinlock. When taking the ownership of an IOMMU group
to pass through a device to a VM, we lock these spinlocks which triggers
a false negative warning in lockdep (below).

This fixes it by annotating the large pool's spinlock as a nest lock
which makes lockdep not complaining when locking nested locks if
the nest lock is locked already.

===
WARNING: possible recursive locking detected
5.11.0-le_syzkaller_a+fstn1 #100 Not tainted
--------------------------------------------
qemu-system-ppc/4129 is trying to acquire lock:
c0000000119bddb0 (&(p->lock)/1){....}-{2:2}, at: iommu_take_ownership+0xac/0x1e0

but task is already holding lock:
c0000000119bdd30 (&(p->lock)/1){....}-{2:2}, at: iommu_take_ownership+0xac/0x1e0

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&(p->lock)/1);
  lock(&(p->lock)/1);
===

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210301063653.51003-1-aik@ozlabs.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-22 10:59:42 +02:00
..
alpha alpha: fix annotation of io{read,write}{16,32}be() 2020-08-26 10:31:02 +02:00
arc arc: kernel: Return -EFAULT if copy_to_user() fails 2021-04-28 13:16:48 +02:00
arm ARM: dts: uniphier: Change phy-mode to RGMII-ID to enable delay pins for RTL8211E 2021-05-22 10:59:38 +02:00
arm64 arm64: dts: uniphier: Change phy-mode to RGMII-ID to enable delay pins for RTL8211E 2021-05-22 10:59:38 +02:00
c6x kbuild: rename LDFLAGS to KBUILD_LDFLAGS 2018-08-24 08:22:08 +09:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-23 15:00:58 +01:00
hexagon hexagon: define ioremap_uc 2020-05-10 10:30:11 +02:00
ia64 ia64: fix discontig.c section mismatches 2021-04-28 13:16:52 +02:00
m68k m68k: q40: Fix info-leak in rtc_ioctl 2020-10-01 13:14:24 +02:00
microblaze microblaze: Prevent the overflow of the start 2020-02-24 08:34:53 +01:00
mips MIPS: pci-legacy: stop using of_pci_range_to_resource 2021-05-22 10:59:37 +02:00
nds32 nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff 2021-04-14 08:22:32 +02:00
nios2 nios2: ksyms: Add missing symbol exports 2020-01-27 14:50:30 +01:00
openrisc openrisc: Fix cache API compile issue when not inlining 2020-09-23 12:10:58 +02:00
parisc parisc: avoid a warning on u8 cast for cmpxchg on u8 pointers 2021-04-14 08:22:33 +02:00
powerpc powerpc/iommu: Annotate nested lock for lockdep 2021-05-22 10:59:42 +02:00
riscv riscv,entry: fix misaligned base for excp_vect_table 2021-04-16 11:49:30 +02:00
s390 KVM: s390: split kvm_s390_real_to_abs 2021-05-22 10:59:26 +02:00
sh sh: dma: fix kconfig dependency for G2_DMA 2021-01-27 11:05:42 +01:00
sparc sparc64: Fix opcode filtering in handling of no fault loads 2021-03-30 14:36:58 +02:00
um block: genhd: add 'groups' argument to device_add_disk 2021-03-11 14:04:59 +01:00
unicore32 mm: convert return type of handle_mm_fault() caller to vm_fault_t 2018-08-17 16:20:28 -07:00
x86 x86/events/amd/iommu: Fix sysfs type mismatch 2021-05-22 10:59:34 +02:00
xtensa xtensa: uaccess: Add missing __user to strncpy_from_user() prototype 2020-12-02 08:48:10 +01:00
.gitignore
Kconfig mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race 2020-11-05 11:08:38 +01:00