1. 19 Mar, 2020 2 commits
    • Michael Ellerman's avatar
      KVM: PPC: Book3S HV: Use RADIX_PTE_INDEX_SIZE in Radix MMU code · afd31356
      Michael Ellerman authored
      In kvmppc_unmap_free_pte() in book3s_64_mmu_radix.c, we use the
      non-constant value PTE_INDEX_SIZE to clear a PTE page.
      
      We can instead use the constant RADIX_PTE_INDEX_SIZE, because we know
      this code will only be running when the Radix MMU is active.
      
      Note that we already use RADIX_PTE_INDEX_SIZE for the allocation of
      kvm_pte_cache.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Reviewed-by: default avatarLeonardo Bras <leonardo@linux.ibm.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      afd31356
    • Paul Mackerras's avatar
      KVM: PPC: Book3S HV: Use __gfn_to_pfn_memslot in HPT page fault handler · cd758a9b
      Paul Mackerras authored
      This makes the same changes in the page fault handler for HPT guests
      that commits 31c8b0d0 ("KVM: PPC: Book3S HV: Use __gfn_to_pfn_memslot()
      in page fault handler", 2018-03-01), 71d29f43 ("KVM: PPC: Book3S HV:
      Don't use compound_order to determine host mapping size", 2018-09-11)
      and 6579804c ("KVM: PPC: Book3S HV: Avoid crash from THP collapse
      during radix page fault", 2018-10-04) made for the page fault handler
      for radix guests.
      
      In summary, where we used to call get_user_pages_fast() and then do
      special handling for VM_PFNMAP vmas, we now call __get_user_pages_fast()
      and then __gfn_to_pfn_memslot() if that fails, followed by reading the
      Linux PTE to get the host PFN, host page size and mapping attributes.
      
      This also brings in the change from SetPageDirty() to set_page_dirty_lock()
      which was done for the radix page fault handler in commit c3856aeb
      ("KVM: PPC: Book3S HV: Fix handling of large pages in radix page fault
      handler", 2018-02-23).
      Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      cd758a9b
  2. 16 Mar, 2020 38 commits