From: Paul Mackerras <paulus@ozlabs.org>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH kernel] KVM: PPC: Release all hardware TCE tables attached to a group
Date: Fri, 22 Feb 2019 20:39:38 +1100 [thread overview]
Message-ID: <20190222093938.GC6006@blackberry> (raw)
In-Reply-To: <20190212043745.18290-1-aik@ozlabs.ru>
On Tue, Feb 12, 2019 at 03:37:45PM +1100, Alexey Kardashevskiy wrote:
> 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: 121f80ba68f "KVM: PPC: VFIO: Add in-kernel acceleration for VFIO"
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Thanks, applied to my kvm-ppc-next tree.
Paul.
prev parent reply other threads:[~2019-02-22 9:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 4:37 [PATCH kernel] KVM: PPC: Release all hardware TCE tables attached to a group Alexey Kardashevskiy
2019-02-22 9:39 ` Paul Mackerras [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190222093938.GC6006@blackberry \
--to=paulus@ozlabs.org \
--cc=aik@ozlabs.ru \
--cc=david@gibson.dropbear.id.au \
--cc=kvm-ppc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulmck@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).