Commit d7afc82b authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/net-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 8583974f 87050fae
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
#define _ASM_GENERIC_PGTABLE_H #define _ASM_GENERIC_PGTABLE_H
#ifndef __HAVE_ARCH_PTEP_ESTABLISH #ifndef __HAVE_ARCH_PTEP_ESTABLISH
#ifndef ptep_update_dirty_accessed
#define ptep_update_dirty_accessed(__ptep, __entry, __dirty) set_pte(__ptep, __entry)
#endif
/* /*
* Establish a new mapping: * Establish a new mapping:
* - flush the old one * - flush the old one
...@@ -10,9 +15,9 @@ ...@@ -10,9 +15,9 @@
* *
* We hold the mm semaphore for reading and vma->vm_mm->page_table_lock * We hold the mm semaphore for reading and vma->vm_mm->page_table_lock
*/ */
#define ptep_establish(__vma, __address, __ptep, __entry) \ #define ptep_establish(__vma, __address, __ptep, __entry, __dirty) \
do { \ do { \
set_pte(__ptep, __entry); \ ptep_update_dirty_accessed(__ptep, __entry, __dirty); \
flush_tlb_page(__vma, __address); \ flush_tlb_page(__vma, __address); \
} while (0) } while (0)
#endif #endif
......
...@@ -317,8 +317,18 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) ...@@ -317,8 +317,18 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
/* /*
* The i386 doesn't have any external MMU info: the kernel page * The i386 doesn't have any external MMU info: the kernel page
* tables contain all the necessary information. * tables contain all the necessary information.
*
* Also, we only update the dirty/accessed state if we set
* the dirty bit by hand in the kernel, since the hardware
* will do the accessed bit for us, and we don't want to
* race with other CPU's that might be updating the dirty
* bit at the same time.
*/ */
#define update_mmu_cache(vma,address,pte) do { } while (0) #define update_mmu_cache(vma,address,pte) do { } while (0)
#define ptep_update_dirty_accessed(__ptep, __entry, __dirty) \
do { \
if (__dirty) set_pte(__ptep, __entry); \
} while (0)
/* Encode and de-code a swap entry */ /* Encode and de-code a swap entry */
#define __swp_type(x) (((x).val >> 1) & 0x1f) #define __swp_type(x) (((x).val >> 1) & 0x1f)
......
...@@ -580,7 +580,8 @@ static inline void ptep_mkdirty(pte_t *ptep) ...@@ -580,7 +580,8 @@ static inline void ptep_mkdirty(pte_t *ptep)
static inline void static inline void
ptep_establish(struct vm_area_struct *vma, ptep_establish(struct vm_area_struct *vma,
unsigned long address, pte_t *ptep, pte_t entry) unsigned long address, pte_t *ptep,
pte_t entry, int dirty)
{ {
ptep_clear_flush(vma, address, ptep); ptep_clear_flush(vma, address, ptep);
set_pte(ptep, entry); set_pte(ptep, entry);
......
...@@ -1004,7 +1004,7 @@ static inline void break_cow(struct vm_area_struct * vma, struct page * new_page ...@@ -1004,7 +1004,7 @@ static inline void break_cow(struct vm_area_struct * vma, struct page * new_page
flush_cache_page(vma, address); flush_cache_page(vma, address);
entry = maybe_mkwrite(pte_mkdirty(mk_pte(new_page, vma->vm_page_prot)), entry = maybe_mkwrite(pte_mkdirty(mk_pte(new_page, vma->vm_page_prot)),
vma); vma);
ptep_establish(vma, address, page_table, entry); ptep_establish(vma, address, page_table, entry, 1);
update_mmu_cache(vma, address, entry); update_mmu_cache(vma, address, entry);
} }
...@@ -1056,7 +1056,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma, ...@@ -1056,7 +1056,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
flush_cache_page(vma, address); flush_cache_page(vma, address);
entry = maybe_mkwrite(pte_mkyoung(pte_mkdirty(pte)), entry = maybe_mkwrite(pte_mkyoung(pte_mkdirty(pte)),
vma); vma);
ptep_establish(vma, address, page_table, entry); ptep_establish(vma, address, page_table, entry, 1);
update_mmu_cache(vma, address, entry); update_mmu_cache(vma, address, entry);
pte_unmap(page_table); pte_unmap(page_table);
spin_unlock(&mm->page_table_lock); spin_unlock(&mm->page_table_lock);
...@@ -1646,7 +1646,7 @@ static inline int handle_pte_fault(struct mm_struct *mm, ...@@ -1646,7 +1646,7 @@ static inline int handle_pte_fault(struct mm_struct *mm,
entry = pte_mkdirty(entry); entry = pte_mkdirty(entry);
} }
entry = pte_mkyoung(entry); entry = pte_mkyoung(entry);
ptep_establish(vma, address, pte, entry); ptep_establish(vma, address, pte, entry, write_access);
update_mmu_cache(vma, address, entry); update_mmu_cache(vma, address, entry);
pte_unmap(pte); pte_unmap(pte);
spin_unlock(&mm->page_table_lock); spin_unlock(&mm->page_table_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment