• David Gibson's avatar
    KVM: PPC: Book3S HV: Split HPT allocation from activation · aae0777f
    David Gibson authored
    Currently, kvmppc_alloc_hpt() both allocates a new hashed page table (HPT)
    and sets it up as the active page table for a VM.  For the upcoming HPT
    resize implementation we're going to want to allocate HPTs separately from
    activating them.
    
    So, split the allocation itself out into kvmppc_allocate_hpt() and perform
    the activation with a new kvmppc_set_hpt() function.  Likewise we split
    kvmppc_free_hpt(), which just frees the HPT, from kvmppc_release_hpt()
    which unsets it as an active HPT, then frees it.
    
    We also move the logic to fall back to smaller HPT sizes if the first try
    fails into the single caller which used that behaviour,
    kvmppc_hv_setup_htab_rma().  This introduces a slight semantic change, in
    that previously if the initial attempt at CMA allocation failed, we would
    fall back to attempting smaller sizes with the page allocator.  Now, we
    try first CMA, then the page allocator at each size.  As far as I can tell
    this change should be harmless.
    
    To match, we make kvmppc_free_hpt() just free the actual HPT itself.  The
    call to kvmppc_free_lpid() that was there, we move to the single caller.
    Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    aae0777f
book3s_64_mmu_hv.c 43.5 KB