So we do not want to allow sleep during call to mmu_notifier_invalidate_page()
but some code do not have surrounding mmu_notifier_invalidate_range_start()/
mmu_notifier_invalidate_range_end() or mmu_notifier_invalidate_range()

This patch serie just make sure that there is at least a call (outside spinlock
section) to mmu_notifier_invalidate_range() after mmu_notifier_invalidate_page()

This fix issue with AMD IOMMU v2 while avoiding to introduce issue for others
user of the mmu_notifier API. For releavent threads see:

https://lkml.kernel.org/r/20170809204333.27485-1-jgli...@redhat.com
https://lkml.kernel.org/r/20170804134928.l4klfcnqatni7...@black.fi.intel.com
https://marc.info/?l=kvm&m=150327081325160&w=2

Signed-off-by: Jérôme Glisse <jgli...@redhat.com>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: Bernhard Held <berny...@gmx.de>
Cc: Adam Borowski <kilob...@angband.pl>
Cc: Andrea Arcangeli <aarca...@redhat.com>
Cc: Radim Krčmář <rkrc...@redhat.com>
Cc: Wanpeng Li <kernel...@gmail.com>
Cc: Paolo Bonzini <pbonz...@redhat.com>
Cc: Takashi Iwai <ti...@suse.de>
Cc: Nadav Amit <nadav.a...@gmail.com>
Cc: Mike Galbraith <efa...@gmx.de>
Cc: Kirill A. Shutemov <kirill.shute...@linux.intel.com>
Cc: axie <a...@amd.com>
Cc: Andrew Morton <a...@linux-foundation.org>
Cc: Dan Williams <dan.j.willi...@intel.com>
Cc: Ross Zwisler <ross.zwis...@linux.intel.com>

Jérôme Glisse (4):
  mm/mmu_notifier: document new behavior for
    mmu_notifier_invalidate_page()
  dax/mmu_notifier: update to new mmu_notifier semantic
  mm/rmap: update to new mmu_notifier_invalidate_page() semantic
  iommu/amd: update to new mmu_notifier_invalidate_page() semantic

 drivers/iommu/amd_iommu_v2.c |  8 --------
 fs/dax.c                     |  8 ++++++--
 include/linux/mmu_notifier.h |  6 ++++++
 mm/rmap.c                    | 18 +++++++++++++++++-
 4 files changed, 29 insertions(+), 11 deletions(-)

-- 
2.13.5

Reply via email to