linux/arch/powerpc/include/asm/book3s/64
Alexey Kardashevskiy 425333bf3a KVM: PPC: Avoid marking DMA-mapped pages dirty in real mode
At the moment the real mode handler of H_PUT_TCE calls iommu_tce_xchg_rm()
which in turn reads the old TCE and if it was a valid entry, marks
the physical page dirty if it was mapped for writing. Since it is in
real mode, realmode_pfn_to_page() is used instead of pfn_to_page()
to get the page struct. However SetPageDirty() itself reads the compound
page head and returns a virtual address for the head page struct and
setting dirty bit for that kills the system.

This adds additional dirty bit tracking into the MM/IOMMU API for use
in the real mode. Note that this does not change how VFIO and
KVM (in virtual mode) set this bit. The KVM (real mode) changes include:
- use the lowest bit of the cached host phys address to carry
the dirty bit;
- mark pages dirty when they are unpinned which happens when
the preregistered memory is released which always happens in virtual
mode;
- add mm_iommu_ua_mark_dirty_rm() helper to set delayed dirty bit;
- change iommu_tce_xchg_rm() to take the kvm struct for the mm to use
in the new mm_iommu_ua_mark_dirty_rm() helper;
- move iommu_tce_xchg_rm() to book3s_64_vio_hv.c (which is the only
caller anyway) to reduce the real mode KVM and IOMMU knowledge
across different subsystems.

This removes realmode_pfn_to_page() as it is not used anymore.

While we at it, remove some EXPORT_SYMBOL_GPL() as that code is for
the real mode only and modules cannot call it anyway.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
2018-09-12 08:49:54 +10:00
..
hash-4k.h powerpc/mm: Implement helpers for pagetable fragment support at PMD level 2018-05-15 22:29:12 +10:00
hash-64k.h powerpc/mm/hash: Remove unnecessary do { } while(0) loop 2018-08-10 22:25:57 +10:00
hash.h powerpc: move ASM_CONST and stringify_in_c() into asm-const.h 2018-07-30 22:48:16 +10:00
hugetlb.h powerpc/64s: Remove POWER9 DD1 support 2018-07-16 11:37:21 +10:00
mmu-hash.h powerpc/64s: move machine check SLB flushing to mm/slb.c 2018-08-10 22:12:39 +10:00
mmu.h powerpc/mm: Implement helpers for pagetable fragment support at PMD level 2018-05-15 22:29:12 +10:00
pgalloc.h powerpc/mm/book3s/radix: Add mapping statistics 2018-08-13 16:35:05 +10:00
pgtable-4k.h powerpc/mm/hash/4k: Free hugetlb page table caches correctly. 2018-06-20 09:13:25 +10:00
pgtable-64k.h powerpc/mm/hash/4k: Free hugetlb page table caches correctly. 2018-06-20 09:13:25 +10:00
pgtable.h KVM: PPC: Avoid marking DMA-mapped pages dirty in real mode 2018-09-12 08:49:54 +10:00
radix-4k.h powerpc/mm: Implement helpers for pagetable fragment support at PMD level 2018-05-15 22:29:12 +10:00
radix-64k.h powerpc/mm: Implement helpers for pagetable fragment support at PMD level 2018-05-15 22:29:12 +10:00
radix.h powerpc/mm/book3s/radix: Add mapping statistics 2018-08-13 16:35:05 +10:00
slice.h powerpc/mm/slice: create header files dedicated to slices 2018-03-06 09:21:22 +11:00
tlbflush-hash.h powerpc/64s: Improve local TLB flush for boot and MCE on POWER9 2018-01-18 00:40:31 +11:00
tlbflush-radix.h powerpc/64s: Remove POWER9 DD1 support 2018-07-16 11:37:21 +10:00
tlbflush.h powerpc/64s/radix: do not flush TLB on spurious fault 2018-06-03 20:40:35 +10:00