summaryrefslogtreecommitdiff
path: root/tools/include
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@ozlabs.org>2018-02-23 13:21:12 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-16 11:10:31 +0300
commit5138dd0db530548f3390098636e3e36cd7681eec (patch)
tree0e3ca89e31fcf48eea2a0a457b3118d97b7b9704 /tools/include
parent82e91e07e6546888ce479f9b10cfcdf55ec92967 (diff)
downloadlinux-5138dd0db530548f3390098636e3e36cd7681eec.tar.xz
KVM: PPC: Book3S HV: Fix handling of large pages in radix page fault handler
commit c3856aeb29402e94ad9b3879030165cc6a4fdc56 upstream. This fixes several bugs in the radix page fault handler relating to the way large pages in the memory backing the guest were handled. First, the check for large pages only checked for explicit huge pages and missed transparent huge pages. Then the check that the addresses (host virtual vs. guest physical) had appropriate alignment was wrong, meaning that the code never put a large page in the partition scoped radix tree; it was always demoted to a small page. Fixing this exposed bugs in kvmppc_create_pte(). We were never invalidating a 2MB PTE, which meant that if a page was initially faulted in without write permission and the guest then attempted to store to it, we would never update the PTE to have write permission. If we find a valid 2MB PTE in the PMD, we need to clear it and do a TLB invalidation before installing either the new 2MB PTE or a pointer to a page table page. This also corrects an assumption that get_user_pages_fast would set the _PAGE_DIRTY bit if we are writing, which is not true. Instead we mark the page dirty explicitly with set_page_dirty_lock(). This also means we don't need the dirty bit set on the host PTE when providing write access on a read fault. [paulus@ozlabs.org - use mark_pages_dirty instead of kvmppc_update_dirty_map] Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/include')
0 files changed, 0 insertions, 0 deletions