No description
Find a file
Alexey Kardashevskiy c7d9ff454f KVM: PPC: Release all hardware TCE tables attached to a group
[ Upstream commit a67614cc05 ]

The SPAPR TCE KVM device references all hardware IOMMU tables assigned to
some IOMMU group to ensure that in-kernel KVM acceleration of H_PUT_TCE
can work. The tables are references when an IOMMU group gets registered
with the VFIO KVM device by the KVM_DEV_VFIO_GROUP_ADD ioctl;
KVM_DEV_VFIO_GROUP_DEL calls into the dereferencing code
in kvm_spapr_tce_release_iommu_group() which walks through the list of
LIOBNs, finds a matching IOMMU table and calls kref_put() when found.

However that code stops after the very first successful derefencing
leaving other tables referenced till the SPAPR TCE KVM device is destroyed
which normally happens on guest reboot or termination so if we do hotplug
and unplug in a loop, we are leaking IOMMU tables here.

This removes a premature return to let kvm_spapr_tce_release_iommu_group()
find and dereference all attached tables.

Fixes: 121f80ba68 ("KVM: PPC: VFIO: Add in-kernel acceleration for VFIO")
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:50:24 +01:00
arch KVM: PPC: Release all hardware TCE tables attached to a group 2020-01-27 14:50:24 +01:00
block block: don't use bio->bi_vcnt to figure out segment number 2020-01-27 14:50:23 +01:00
certs export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR() 2018-08-22 23:21:44 +09:00
crypto crypto: tgr192 - fix unaligned memory access 2020-01-27 14:50:13 +01:00
Documentation bus: ti-sysc: Add mcasp optional clocks flag 2020-01-27 14:50:02 +01:00
drivers mdio_bus: Fix PTR_ERR() usage after initialization to constant 2020-01-27 14:50:24 +01:00
firmware Fix built-in early-load Intel microcode alignment 2020-01-23 08:21:29 +01:00
fs exportfs: fix 'passing zero to ERR_PTR()' warning 2020-01-27 14:50:02 +01:00
include driver core: Fix possible supplier PM-usage counter imbalance 2020-01-27 14:50:22 +01:00
init fork: fix some -Wmissing-prototypes warnings 2019-12-05 09:21:04 +01:00
ipc ipc/mqueue.c: only perform resource calculation if user valid 2019-08-06 19:06:52 +02:00
kernel fork, memcg: fix cached_stacks case 2020-01-27 14:50:11 +01:00
lib idr: Fix idr_get_next_ul race with idr_remove 2019-12-17 20:36:02 +01:00
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text 2018-10-18 11:28:50 +02:00
mm mm/huge_memory.c: thp: fix conflict of above-47bit hint address and PMD alignment 2020-01-23 08:21:32 +01:00
net xsk: add missing smp_rmb() in xsk_mmap 2020-01-27 14:50:21 +01:00
samples samples: bpf: fix syscall_tp due to unused syscall 2020-01-12 12:17:13 +01:00
scripts kconfig: don't crash on NULL expressions in expr_eq() 2020-01-12 12:17:19 +01:00
security keys: Timestamp new keys 2020-01-27 14:50:23 +01:00
sound ASoC: imx-sgtl5000: put of nodes if finding codec fails 2020-01-27 14:50:14 +01:00
tools perf map: No need to adjust the long name of modules 2020-01-27 14:49:53 +01:00
usr kbuild: clean compressed initramfs image 2019-10-07 18:57:16 +02:00
virt KVM: arm/arm64: vgic: Don't rely on the wrong pending table 2019-12-13 08:52:45 +01:00
.clang-format clang-format: Set IndentWrappedFunctionNames false 2018-08-01 18:38:51 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files 2016-10-07 18:46:30 -07:00
.gitignore Kbuild updates for v4.17 (2nd) 2018-04-15 17:21:30 -07:00
.mailmap libnvdimm-for-4.19_misc 2018-08-25 18:13:10 -07:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS 9p: remove Ron Minnich from MAINTAINERS 2018-08-17 16:20:26 -07:00
Kbuild Kbuild updates for v4.15 2017-11-17 17:45:29 -08:00
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt 2018-08-02 08:06:55 +09:00
MAINTAINERS USB: rio500: Remove Rio 500 kernel driver 2019-10-17 13:44:47 -07:00
Makefile kbuild: mark prepare0 as PHONY to fix external module build 2020-01-27 14:50:13 +01:00
README Docs: Added a pointer to the formatted docs to README 2018-03-21 09:02:53 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.