• Paul Mackerras's avatar
    KVM: PPC: Book3S HV: Fix handling of secondary HPTEG in HPT resizing code · 05f2bb03
    Paul Mackerras authored
    This fixes the computation of the HPTE index to use when the HPT
    resizing code encounters a bolted HPTE which is stored in its
    secondary HPTE group.  The code inverts the HPTE group number, which
    is correct, but doesn't then mask it with new_hash_mask.  As a result,
    new_pteg will be effectively negative, resulting in new_hptep
    pointing before the new HPT, which will corrupt memory.
    
    In addition, this removes two BUG_ON statements.  The condition that
    the BUG_ONs were testing -- that we have computed the hash value
    incorrectly -- has never been observed in testing, and if it did
    occur, would only affect the guest, not the host.  Given that
    BUG_ON should only be used in conditions where the kernel (i.e.
    the host kernel, in this case) can't possibly continue execution,
    it is not appropriate here.
    Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    05f2bb03
book3s_64_mmu_hv.c 52.3 KB