diff options
author | Steven Capper <steve.capper@linaro.org> | 2013-07-26 09:58:22 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-07-31 06:13:22 -0400 |
commit | 4bfab2034bab9374eba1921cf7bd51fd8d48661b (patch) | |
tree | 1646fd0daf6df9bacb78a129c294df7a45bb49f1 /arch/arm | |
parent | c9218b163959fafa76ffbee0baa3ef269838f410 (diff) |
ARM: 7792/1: mm: Remove general hugetlb code from ARM
General forms of huge_pte_alloc, huge_pte_offset and follow_huge_pmd
are now available in mm/hugetlb.c.
This patch removes the ARM copies of these functions and activates
the general ones by enabling:
CONFIG_ARCH_WANT_GENERAL_HUGETLB
Signed-off-by: Steve Capper <steve.capper@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/mm/hugetlbpage.c | 43 |
2 files changed, 3 insertions, 43 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 1e987404d2b0..1b3a30361f9c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1793,6 +1793,9 @@ config HAVE_ARCH_TRANSPARENT_HUGEPAGE | |||
1793 | def_bool y | 1793 | def_bool y |
1794 | depends on ARM_LPAE | 1794 | depends on ARM_LPAE |
1795 | 1795 | ||
1796 | config ARCH_WANT_GENERAL_HUGETLB | ||
1797 | def_bool y | ||
1798 | |||
1796 | source "mm/Kconfig" | 1799 | source "mm/Kconfig" |
1797 | 1800 | ||
1798 | config FORCE_MAX_ZONEORDER | 1801 | config FORCE_MAX_ZONEORDER |
diff --git a/arch/arm/mm/hugetlbpage.c b/arch/arm/mm/hugetlbpage.c index 3d1e4a205b0b..66781bf34077 100644 --- a/arch/arm/mm/hugetlbpage.c +++ b/arch/arm/mm/hugetlbpage.c | |||
@@ -36,22 +36,6 @@ | |||
36 | * of type casting from pmd_t * to pte_t *. | 36 | * of type casting from pmd_t * to pte_t *. |
37 | */ | 37 | */ |
38 | 38 | ||
39 | pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) | ||
40 | { | ||
41 | pgd_t *pgd; | ||
42 | pud_t *pud; | ||
43 | pmd_t *pmd = NULL; | ||
44 | |||
45 | pgd = pgd_offset(mm, addr); | ||
46 | if (pgd_present(*pgd)) { | ||
47 | pud = pud_offset(pgd, addr); | ||
48 | if (pud_present(*pud)) | ||
49 | pmd = pmd_offset(pud, addr); | ||
50 | } | ||
51 | |||
52 | return (pte_t *)pmd; | ||
53 | } | ||
54 | |||
55 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | 39 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, |
56 | int write) | 40 | int write) |
57 | { | 41 | { |
@@ -68,33 +52,6 @@ int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep) | |||
68 | return 0; | 52 | return 0; |
69 | } | 53 | } |
70 | 54 | ||
71 | pte_t *huge_pte_alloc(struct mm_struct *mm, | ||
72 | unsigned long addr, unsigned long sz) | ||
73 | { | ||
74 | pgd_t *pgd; | ||
75 | pud_t *pud; | ||
76 | pte_t *pte = NULL; | ||
77 | |||
78 | pgd = pgd_offset(mm, addr); | ||
79 | pud = pud_alloc(mm, pgd, addr); | ||
80 | if (pud) | ||
81 | pte = (pte_t *)pmd_alloc(mm, pud, addr); | ||
82 | |||
83 | return pte; | ||
84 | } | ||
85 | |||
86 | struct page * | ||
87 | follow_huge_pmd(struct mm_struct *mm, unsigned long address, | ||
88 | pmd_t *pmd, int write) | ||
89 | { | ||
90 | struct page *page; | ||
91 | |||
92 | page = pte_page(*(pte_t *)pmd); | ||
93 | if (page) | ||
94 | page += ((address & ~PMD_MASK) >> PAGE_SHIFT); | ||
95 | return page; | ||
96 | } | ||
97 | |||
98 | int pmd_huge(pmd_t pmd) | 55 | int pmd_huge(pmd_t pmd) |
99 | { | 56 | { |
100 | return pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT); | 57 | return pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT); |