IOMMU: hold page ref until after deferred TLB flush
authorJan Beulich <jbeulich@suse.com>
Tue, 20 Oct 2020 12:21:32 +0000 (14:21 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Oct 2020 12:21:32 +0000 (14:21 +0200)
commit5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
tree00ba70145d834fc98708318fe562186d68c84f9d
parentdea460d86957bf1425a8a1572626099ac3f165a8
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>
xen/arch/arm/mm.c
xen/arch/x86/mm.c
xen/common/memory.c
xen/include/xen/mm.h