Skip to content

Commit

Permalink
powerpc/mm: Handle hypervisor pte insert failure in __hash_page_huge
Browse files Browse the repository at this point in the history
If the hypervisor gives us an error on a hugepage insert we panic. The
normal page code already handles this by returning an error instead and we end
calling low_hash_fault which will just kill the task if possible.

The patch below does a similar thing for the hugepage case.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Jul 22, 2010
1 parent b37fa16 commit b1623e7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions arch/powerpc/mm/hugetlbpage-hash64.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,15 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
}
}

if (unlikely(slot == -2))
panic("hash_huge_page: pte_insert failed\n");
/*
* Hypervisor failure. Restore old pte and return -1
* similar to __hash_page_*
*/
if (unlikely(slot == -2)) {
*ptep = __pte(old_pte);
err = -1;
goto out;
}

new_pte |= (slot << 12) & (_PAGE_F_SECOND | _PAGE_F_GIX);
}
Expand Down

0 comments on commit b1623e7

Please sign in to comment.