aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Capper <steve.capper@arm.com>2017-08-22 06:42:41 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2017-08-22 10:41:16 -0400
commitd3ea79527757ba65b3ee08e10c59a3c84f34e4bf (patch)
tree531347e4a1d9c7cd9acf94dcc08e4e57a9f48ea9
parenta88ce63b642cf8cd82cbc278429ccd9de4455a07 (diff)
arm64: hugetlb: set_huge_pte_at Add WARN_ON on !pte_present
This patch adds a WARN_ON to set_huge_pte_at as the accessor assumes that entries to be written down are all present. (There are separate accessors to clear huge ptes). We will need to handle the !pte_present case where memory offlining is used on hugetlb pages. swap and migration entries will be supplied to set_huge_pte_at in this case. Cc: David Woods <dwoods@mellanox.com> Signed-off-by: Steve Capper <steve.capper@arm.com> Signed-off-by: Punit Agrawal <punit.agrawal@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r--arch/arm64/mm/hugetlbpage.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
index 656e0ece2289..7b61e4833432 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -67,6 +67,12 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
67 unsigned long pfn; 67 unsigned long pfn;
68 pgprot_t hugeprot; 68 pgprot_t hugeprot;
69 69
70 /*
71 * Code needs to be expanded to handle huge swap and migration
72 * entries. Needed for HUGETLB and MEMORY_FAILURE.
73 */
74 WARN_ON(!pte_present(pte));
75
70 if (!pte_cont(pte)) { 76 if (!pte_cont(pte)) {
71 set_pte_at(mm, addr, ptep, pte); 77 set_pte_at(mm, addr, ptep, pte);
72 return; 78 return;