On Mon, May 14, 2018 at 11:07:14AM +1000, Paul Mackerras wrote: > 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@xxxxxxxxxx - use mark_pages_dirty instead of > kvmppc_update_dirty_map] Now applied, thanks. greg k-h