aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/subpage-prot.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/subpage-prot.c')
-rw-r--r--arch/powerpc/mm/subpage-prot.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c
index 4cafc0c33d0a..e4f8f1fc81a5 100644
--- a/arch/powerpc/mm/subpage-prot.c
+++ b/arch/powerpc/mm/subpage-prot.c
@@ -10,7 +10,6 @@
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/gfp.h> 12#include <linux/gfp.h>
13#include <linux/slab.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/mm.h> 14#include <linux/mm.h>
16#include <linux/hugetlb.h> 15#include <linux/hugetlb.h>
@@ -24,9 +23,9 @@
24 * Also makes sure that the subpage_prot_table structure is 23 * Also makes sure that the subpage_prot_table structure is
25 * reinitialized for the next user. 24 * reinitialized for the next user.
26 */ 25 */
27void subpage_prot_free(pgd_t *pgd) 26void subpage_prot_free(struct mm_struct *mm)
28{ 27{
29 struct subpage_prot_table *spt = pgd_subpage_prot(pgd); 28 struct subpage_prot_table *spt = &mm->context.spt;
30 unsigned long i, j, addr; 29 unsigned long i, j, addr;
31 u32 **p; 30 u32 **p;
32 31
@@ -51,6 +50,13 @@ void subpage_prot_free(pgd_t *pgd)
51 spt->maxaddr = 0; 50 spt->maxaddr = 0;
52} 51}
53 52
53void subpage_prot_init_new_context(struct mm_struct *mm)
54{
55 struct subpage_prot_table *spt = &mm->context.spt;
56
57 memset(spt, 0, sizeof(*spt));
58}
59
54static void hpte_flush_range(struct mm_struct *mm, unsigned long addr, 60static void hpte_flush_range(struct mm_struct *mm, unsigned long addr,
55 int npages) 61 int npages)
56{ 62{
@@ -87,7 +93,7 @@ static void hpte_flush_range(struct mm_struct *mm, unsigned long addr,
87static void subpage_prot_clear(unsigned long addr, unsigned long len) 93static void subpage_prot_clear(unsigned long addr, unsigned long len)
88{ 94{
89 struct mm_struct *mm = current->mm; 95 struct mm_struct *mm = current->mm;
90 struct subpage_prot_table *spt = pgd_subpage_prot(mm->pgd); 96 struct subpage_prot_table *spt = &mm->context.spt;
91 u32 **spm, *spp; 97 u32 **spm, *spp;
92 int i, nw; 98 int i, nw;
93 unsigned long next, limit; 99 unsigned long next, limit;
@@ -136,7 +142,7 @@ static void subpage_prot_clear(unsigned long addr, unsigned long len)
136long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map) 142long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map)
137{ 143{
138 struct mm_struct *mm = current->mm; 144 struct mm_struct *mm = current->mm;
139 struct subpage_prot_table *spt = pgd_subpage_prot(mm->pgd); 145 struct subpage_prot_table *spt = &mm->context.spt;
140 u32 **spm, *spp; 146 u32 **spm, *spp;
141 int i, nw; 147 int i, nw;
142 unsigned long next, limit; 148 unsigned long next, limit;