Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9377
b: refs/heads/master
c: 8b1f312
h: refs/heads/master
i:
  9375: fe6f4a2
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Sep 28, 2005
1 parent 91f92ab commit d27a621
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95001ee9256df846e374f116c92ca8e0beec1527
refs/heads/master: 8b1f3124618b54cf125dea3a074b9cf469117723
13 changes: 13 additions & 0 deletions trunk/include/asm-generic/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,19 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
#define lazy_mmu_prot_update(pte) do { } while (0)
#endif

#ifndef __HAVE_ARCH_MULTIPLE_ZERO_PAGE
#define move_pte(pte, prot, old_addr, new_addr) (pte)
#else
#define move_pte(pte, prot, old_addr, new_addr) \
({ \
pte_t newpte = (pte); \
if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \
pte_page(pte) == ZERO_PAGE(old_addr)) \
newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \
newpte; \
})
#endif

/*
* When walking page tables, get the address of the next boundary,
* or the end address of the range if that comes earlier. Although no
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-mips/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ extern unsigned long zero_page_mask;
#define ZERO_PAGE(vaddr) \
(virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))

#define __HAVE_ARCH_MULTIPLE_ZERO_PAGE

extern void paging_init(void);

/*
Expand Down
6 changes: 3 additions & 3 deletions trunk/mm/mremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ move_one_page(struct vm_area_struct *vma, unsigned long old_addr,
if (dst) {
pte_t pte;
pte = ptep_clear_flush(vma, old_addr, src);

/* ZERO_PAGE can be dependant on virtual addr */
if (pfn_valid(pte_pfn(pte)) &&
pte_page(pte) == ZERO_PAGE(old_addr))
pte = pte_wrprotect(mk_pte(ZERO_PAGE(new_addr), new_vma->vm_page_prot));
pte = move_pte(pte, new_vma->vm_page_prot,
old_addr, new_addr);
set_pte_at(mm, new_addr, dst, pte);
} else
error = -ENOMEM;
Expand Down

0 comments on commit d27a621

Please sign in to comment.