IOMMU: hold page ref until after deferred TLB flush
authorJan Beulich <jbeulich@suse.com>
Tue, 20 Oct 2020 12:38:53 +0000 (14:38 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Oct 2020 12:38:53 +0000 (14:38 +0200)
commit94c157f2e3eaf036e04ba5e7186b6f1d5671fa93
treeb2441ea2bbf95abf090e11a78418e5a3c255f038
parent79f17015e7f45e51de87dda7ff9d6fac104e1cc6
IOMMU: hold page ref until after deferred TLB flush

When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
flush for the "from" GFN range requires that the page remains allocated
to the guest until the TLB flush has actually occurred. Otherwise a
parallel hypercall to remove the page would only flush the TLB for the
GFN it has been moved to, but not the one is was mapped at originally.

This is part of XSA-346.

Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
Reported-by: Julien Grall <jgrall@amazon.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com>
master commit: 5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
master date: 2020-10-20 14:21:32 +0200
xen/arch/arm/mm.c
xen/arch/x86/mm.c
xen/common/memory.c
xen/include/xen/mm.h