IOMMU/EPT: avoid double flushing in shared page table case
authorJan Beulich <jbeulich@suse.com>
Fri, 23 Oct 2020 08:06:53 +0000 (10:06 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 23 Oct 2020 08:06:53 +0000 (10:06 +0200)
commit83432adeb82122e392a3bfc2a8818d25ca9e69ed
tree2bb35191e609f9de1ee9577c883cb14a24d85a83
parentf9c53bd9eeff5d93e63665d67265dd27155e905e
IOMMU/EPT: avoid double flushing in shared page table case

While the flush coalescing optimization has been helping the non-shared
case, it has actually lead to double flushes in the shared case (which
ought to be the more common one nowadays at least): Once from
*_set_entry() and a second time up the call tree from wherever the
overriding flag gets played with. In alignment with XSA-346 suppress
flushing in this case.

Similarly avoid excessive setting of IOMMU_FLUSHF_added on the batched
flushes: "idx" hasn't been added a new mapping for.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/mm/p2m-ept.c
xen/common/memory.c