Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182997
b: refs/heads/master
c: 4b3073e
h: refs/heads/master
i:
  182995: 31c83e0
v: v3
  • Loading branch information
Russell King committed Feb 20, 2010
1 parent ba26d28 commit da55553
Show file tree
Hide file tree
Showing 41 changed files with 70 additions and 63 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: ed42acaef1a9d51631a31b55e9ed52d400430492
refs/heads/master: 4b3073e1c53a256275f1079c0fbfbe85883d9275
6 changes: 3 additions & 3 deletions trunk/Documentation/cachetlb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ changes occur:
This is used primarily during fault processing.

5) void update_mmu_cache(struct vm_area_struct *vma,
unsigned long address, pte_t pte)
unsigned long address, pte_t *ptep)

At the end of every page fault, this routine is invoked to
tell the architecture specific code that a translation
described by "pte" now exists at virtual address "address"
for address space "vma->vm_mm", in the software page tables.
now exists at virtual address "address" for address space
"vma->vm_mm", in the software page tables.

A port may use this information in any way it so chooses.
For example, it could use this event to pre-load TLB
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ extern pgd_t swapper_pg_dir[1024];
* tables contain all the necessary information.
*/
extern inline void update_mmu_cache(struct vm_area_struct * vma,
unsigned long address, pte_t pte)
unsigned long address, pte_t *ptep)
{
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/arm/include/asm/tlbflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
* cache entries for the kernels virtual memory range are written
* back to the page.
*/
extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte);
extern void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
pte_t *ptep);

#endif

Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/arm/mm/fault-armv.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ make_coherent(struct address_space *mapping, struct vm_area_struct *vma, unsigne
*
* Note that the pte lock will be held.
*/
void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
pte_t *ptep)
{
unsigned long pfn = pte_pfn(pte);
unsigned long pfn = pte_pfn(*ptep);
struct address_space *mapping;
struct page *page;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/avr32/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)

struct vm_area_struct;
extern void update_mmu_cache(struct vm_area_struct * vma,
unsigned long address, pte_t pte);
unsigned long address, pte_t *ptep);

/*
* Encode and decode a swap entry
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/avr32/mm/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static void update_dtlb(unsigned long address, pte_t pte)
}

void update_mmu_cache(struct vm_area_struct *vma,
unsigned long address, pte_t pte)
unsigned long address, pte_t *ptep)
{
unsigned long flags;

Expand All @@ -110,7 +110,7 @@ void update_mmu_cache(struct vm_area_struct *vma,
return;

local_irq_save(flags);
update_dtlb(address, pte);
update_dtlb(address, *ptep);
local_irq_restore(flags);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/cris/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; /* defined in head.S */
* Actually I am not sure on what this could be used for.
*/
static inline void update_mmu_cache(struct vm_area_struct * vma,
unsigned long address, pte_t pte)
unsigned long address, pte_t *ptep)
{
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/frv/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static inline int pte_file(pte_t pte)
/*
* preload information about a newly instantiated PTE into the SCR0/SCR1 PGE cache
*/
static inline void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
static inline void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
{
struct mm_struct *mm;
unsigned long ampr;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/ia64/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ pte_same (pte_t a, pte_t b)
return pte_val(a) == pte_val(b);
}

#define update_mmu_cache(vma, address, pte) do { } while (0)
#define update_mmu_cache(vma, address, ptep) do { } while (0)

extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
extern void paging_init (void);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m32r/include/asm/tlbflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ static __inline__ void __flush_tlb_all(void)
);
}

extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);

#endif /* _ASM_M32R_TLBFLUSH_H */
2 changes: 1 addition & 1 deletion trunk/arch/m32r/mm/fault-nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
* update_mmu_cache()
*======================================================================*/
void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,
pte_t pte)
pte_t *ptep)
{
BUG();
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/m32r/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,

addr = (address & PAGE_MASK);
set_thread_fault_code(error_code);
update_mmu_cache(NULL, addr, *pte_k);
update_mmu_cache(NULL, addr, pte_k);
set_thread_fault_code(0);
return;
}
Expand All @@ -349,7 +349,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
#define ITLB_END (unsigned long *)(ITLB_BASE + (NR_TLB_ENTRIES * 8))
#define DTLB_END (unsigned long *)(DTLB_BASE + (NR_TLB_ENTRIES * 8))
void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr,
pte_t pte)
pte_t *ptep)
{
volatile unsigned long *entry1, *entry2;
unsigned long pte_data, flags;
Expand All @@ -365,7 +365,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr,

vaddr = (vaddr & PAGE_MASK) | get_asid();

pte_data = pte_val(pte);
pte_data = pte_val(*ptep);

#ifdef CONFIG_CHIP_OPSP
entry1 = (unsigned long *)ITLB_BASE;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m68k/include/asm/pgtable_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode);
* they are updated on demand.
*/
static inline void update_mmu_cache(struct vm_area_struct *vma,
unsigned long address, pte_t pte)
unsigned long address, pte_t *ptep)
{
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/microblaze/include/asm/tlbflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static inline void local_flush_tlb_range(struct vm_area_struct *vma,

#define flush_tlb_kernel_range(start, end) do { } while (0)

#define update_mmu_cache(vma, addr, pte) do { } while (0)
#define update_mmu_cache(vma, addr, ptep) do { } while (0)

#define flush_tlb_all local_flush_tlb_all
#define flush_tlb_mm local_flush_tlb_mm
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/mips/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,9 @@ extern void __update_cache(struct vm_area_struct *vma, unsigned long address,
pte_t pte);

static inline void update_mmu_cache(struct vm_area_struct *vma,
unsigned long address, pte_t pte)
unsigned long address, pte_t *ptep)
{
pte_t pte = *ptep;
__update_tlb(vma, address, pte);
__update_cache(vma, address, pte);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mn10300/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ static inline int set_kernel_exec(unsigned long vaddr, int enable)
* the kernel page tables containing the necessary information by tlb-mn10300.S
*/
extern void update_mmu_cache(struct vm_area_struct *vma,
unsigned long address, pte_t pte);
unsigned long address, pte_t *ptep);

#endif /* !__ASSEMBLY__ */

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/mn10300/mm/mmu-context.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
/*
* preemptively set a TLB entry
*/
void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
{
unsigned long pteu, ptel, cnx, flags;
pte_t pte = *ptep;

addr &= PAGE_MASK;
ptel = pte_val(pte) & ~(xPTEL_UNUSED1 | xPTEL_UNUSED2);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/parisc/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ extern void paging_init (void);

#define PG_dcache_dirty PG_arch_1

extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);

/* Encode and de-code a swap entry */

Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/parisc/kernel/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ flush_cache_all_local(void)
EXPORT_SYMBOL(flush_cache_all_local);

void
update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
{
struct page *page = pte_page(pte);
struct page *page = pte_page(*ptep);

if (pfn_valid(page_to_pfn(page)) && page_mapping(page) &&
test_bit(PG_dcache_dirty, &page->flags)) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ extern void paging_init(void);
* corresponding HPTE into the hash table ahead of time, instead of
* waiting for the inevitable extra hash-table miss exception.
*/
extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);

extern int gup_hugepd(hugepd_t *hugepd, unsigned pdshift, unsigned long addr,
unsigned long end, int write, struct page **pages, int *nr);
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/mm/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,13 +494,13 @@ EXPORT_SYMBOL(flush_icache_user_range);
* This must always be called with the pte lock held.
*/
void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
pte_t pte)
pte_t *ptep)
{
#ifdef CONFIG_PPC_STD_MMU
unsigned long access = 0, trap;

/* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
if (!pte_young(pte) || address >= TASK_SIZE)
if (!pte_young(*ptep) || address >= TASK_SIZE)
return;

/* We try to figure out if we are coming from an instruction
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern void vmem_map_init(void);
* The S390 doesn't have any external MMU info: the kernel page
* tables contain all the necessary information.
*/
#define update_mmu_cache(vma, address, pte) do { } while (0)
#define update_mmu_cache(vma, address, ptep) do { } while (0)

/*
* ZERO_PAGE is a global shared page that is always zero: used
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/score/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ extern void __update_cache(struct vm_area_struct *vma,
unsigned long address, pte_t pte);

static inline void update_mmu_cache(struct vm_area_struct *vma,
unsigned long address, pte_t pte)
unsigned long address, pte_t *ptep)
{
pte_t pte = *ptep;
__update_tlb(vma, address, pte);
__update_cache(vma, address, pte);
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/sh/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ extern void __update_tlb(struct vm_area_struct *vma,
unsigned long address, pte_t pte);

static inline void
update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
{
pte_t pte = *ptep;
__update_cache(vma, address, pte);
__update_tlb(vma, address, pte);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/mm/fault_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ handle_tlbmiss(struct pt_regs *regs, unsigned long writeaccess,
local_flush_tlb_one(get_asid(), address & PAGE_MASK);
#endif

update_mmu_cache(NULL, address, entry);
update_mmu_cache(NULL, address, pte);

return 0;
}
4 changes: 2 additions & 2 deletions trunk/arch/sparc/include/asm/pgtable_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ BTFIXUPDEF_CALL(void, mmu_info, struct seq_file *)
#define FAULT_CODE_WRITE 0x2
#define FAULT_CODE_USER 0x4

BTFIXUPDEF_CALL(void, update_mmu_cache, struct vm_area_struct *, unsigned long, pte_t)
BTFIXUPDEF_CALL(void, update_mmu_cache, struct vm_area_struct *, unsigned long, pte_t *)

#define update_mmu_cache(vma,addr,pte) BTFIXUP_CALL(update_mmu_cache)(vma,addr,pte)
#define update_mmu_cache(vma,addr,ptep) BTFIXUP_CALL(update_mmu_cache)(vma,addr,ptep)

BTFIXUPDEF_CALL(void, sparc_mapiorange, unsigned int, unsigned long,
unsigned long, unsigned int)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/include/asm/pgtable_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ extern unsigned long find_ecache_flush_span(unsigned long size);
#define mmu_unlockarea(vaddr, len) do { } while(0)

struct vm_area_struct;
extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);

/* Encode and de-code a swap entry */
#define __swp_type(entry) (((entry).val >> PAGE_SHIFT) & 0xffUL)
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/sparc/mm/fault_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ asmlinkage void do_sun4c_fault(struct pt_regs *regs, int text_fault, int write,
unsigned long address)
{
extern void sun4c_update_mmu_cache(struct vm_area_struct *,
unsigned long,pte_t);
unsigned long,pte_t *);
extern pte_t *sun4c_pte_offset_kernel(pmd_t *,unsigned long);
struct task_struct *tsk = current;
struct mm_struct *mm = tsk->mm;
Expand Down Expand Up @@ -447,7 +447,7 @@ asmlinkage void do_sun4c_fault(struct pt_regs *regs, int text_fault, int write,
* on the CPU and doing a shrink_mmap() on this vma.
*/
sun4c_update_mmu_cache (find_vma(current->mm, address), address,
*ptep);
ptep);
else
do_sparc_fault(regs, text_fault, write, address);
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/sparc/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,13 @@ static void flush_dcache(unsigned long pfn)
}
}

void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
{
struct mm_struct *mm;
struct tsb *tsb;
unsigned long tag, flags;
unsigned long tsb_index, tsb_hash_shift;
pte_t pte = *ptep;

if (tlb_type != hypervisor) {
unsigned long pfn = pte_pfn(pte);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/mm/nosun4c.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pte_t *sun4c_pte_offset_kernel(pmd_t *dir, unsigned long address)
return NULL;
}

void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
{
}

Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/sparc/mm/srmmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ extern void tsunami_setup_blockops(void);
* The following code is a deadwood that may be necessary when
* we start to make precise page flushes again. --zaitcev
*/
static void swift_update_mmu_cache(struct vm_area_struct * vma, unsigned long address, pte_t pte)
static void swift_update_mmu_cache(struct vm_area_struct * vma, unsigned long address, pte_t *ptep)
{
#if 0
static unsigned long last;
Expand All @@ -703,10 +703,10 @@ static void swift_update_mmu_cache(struct vm_area_struct * vma, unsigned long ad

if (address == last) {
val = srmmu_hwprobe(address);
if (val != 0 && pte_val(pte) != val) {
if (val != 0 && pte_val(*ptep) != val) {
printk("swift_update_mmu_cache: "
"addr %lx put %08x probed %08x from %p\n",
address, pte_val(pte), val,
address, pte_val(*ptep), val,
__builtin_return_address(0));
srmmu_flush_whole_tlb();
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/sparc/mm/sun4c.c
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@ static void sun4c_check_pgt_cache(int low, int high)
/* An experiment, turn off by default for now... -DaveM */
#define SUN4C_PRELOAD_PSEG

void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
{
unsigned long flags;
int pseg;
Expand Down Expand Up @@ -1929,7 +1929,7 @@ void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, p
start += PAGE_SIZE;
}
#ifndef SUN4C_PRELOAD_PSEG
sun4c_put_pte(address, pte_val(pte));
sun4c_put_pte(address, pte_val(*ptep));
#endif
local_irq_restore(flags);
return;
Expand All @@ -1940,7 +1940,7 @@ void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, p
add_lru(entry);
}

sun4c_put_pte(address, pte_val(pte));
sun4c_put_pte(address, pte_val(*ptep));
local_irq_restore(flags);
}

Expand Down
Loading

0 comments on commit da55553

Please sign in to comment.