linux-stable/arch/powerpc
Leonardo Bras 3c33066a21 powerpc/kernel/iommu: Add new iommu_table_in_use() helper
Having a function to check if the iommu table has any allocation helps
deciding if a tbl can be reset for using a new DMA window.

It should be enough to replace all instances of !bitmap_empty(tbl...).

iommu_table_in_use() skips reserved memory, so we don't need to worry about
releasing it before testing. This causes iommu_table_release_pages() to
become unnecessary, given it is only used to remove reserved memory for
testing.

Also, only allow storing reserved memory values in tbl if they are valid
in the table, so there is no need to check it in the new helper.

Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210817063929.38701-3-leobras.c@gmail.com
2021-08-27 00:56:54 +10:00
..
boot powerpc/microwatt: Add Ethernet to device tree 2021-08-27 00:56:53 +10:00
configs powerpc/configs/microwatt: Enable options for systemd 2021-08-27 00:56:53 +10:00
crypto
include powerpc/kernel/iommu: Add new iommu_table_in_use() helper 2021-08-27 00:56:54 +10:00
kernel powerpc/kernel/iommu: Add new iommu_table_in_use() helper 2021-08-27 00:56:54 +10:00
kexec powerpc: Avoid link stack corruption in misc asm functions 2021-08-25 13:35:47 +10:00
kvm Merge branch 'topic/ppc-kvm' into next 2021-08-26 21:21:11 +10:00
lib powerpc: Only build restart_table.c for 64s 2021-07-01 22:50:54 +10:00
math-emu powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
mm powerpc/numa: Update cpu_cpu_map on CPU online/offline 2021-08-27 00:56:54 +10:00
net powerpc/bpf: Reject atomic ops in ppc32 JIT 2021-07-05 22:23:25 +10:00
perf powerpc/perf: Fix the check for SIAR value 2021-08-25 22:38:19 +10:00
platforms powerpc/pseries/iommu: Replace hard-coded page shift 2021-08-27 00:56:54 +10:00
purgatory powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S 2021-04-08 21:17:43 +10:00
sysdev powerpc: Refactor verification of MSR_RI 2021-08-26 21:21:07 +10:00
tools powerpc/head_check: Fix shellcheck errors 2021-08-17 22:52:02 +10:00
xmon powerpc: Refactor verification of MSR_RI 2021-08-26 21:21:07 +10:00
Kbuild
Kconfig powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP 2021-08-25 13:35:48 +10:00
Kconfig.debug powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP 2021-08-25 13:35:48 +10:00
Makefile powerpc: Add "-z notext" flag to disable diagnostic 2021-08-15 13:49:39 +10:00
Makefile.postlink