Skip to content

Commit

Permalink
[ARM] Unuse another Linux PTE bit
Browse files Browse the repository at this point in the history
L_PTE_ASID is not really required to be stored in every PTE, since we
can identify it via the address passed to set_pte_at().  So, create
set_pte_ext() which takes the address of the PTE to set, the Linux
PTE value, and the additional CPU PTE bits which aren't encoded in
the Linux PTE value.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Dec 13, 2006
1 parent f06b97f commit ad1ae2f
Show file tree
Hide file tree
Showing 28 changed files with 84 additions and 84 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mm/consistent.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
* x86 does not mark the pages reserved...
*/
SetPageReserved(page);
set_pte(pte, mk_pte(page, prot));
set_pte_ext(pte, mk_pte(page, prot), 0);
page++;
pte++;
off++;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/copypage-v4mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void v4_mc_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
{
spin_lock(&minicache_lock);

set_pte(TOP_PTE(0xffff8000), pfn_pte(__pa(kfrom) >> PAGE_SHIFT, minicache_pgprot));
set_pte_ext(TOP_PTE(0xffff8000), pfn_pte(__pa(kfrom) >> PAGE_SHIFT, minicache_pgprot), 0);
flush_tlb_kernel_page(0xffff8000);

mc_copy_user_page((void *)0xffff8000, kto);
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mm/copypage-v6.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ static void v6_copy_user_page_aliasing(void *kto, const void *kfrom, unsigned lo
*/
spin_lock(&v6_lock);

set_pte(TOP_PTE(from_address) + offset, pfn_pte(__pa(kfrom) >> PAGE_SHIFT, PAGE_KERNEL));
set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kto) >> PAGE_SHIFT, PAGE_KERNEL));
set_pte_ext(TOP_PTE(from_address) + offset, pfn_pte(__pa(kfrom) >> PAGE_SHIFT, PAGE_KERNEL), 0);
set_pte_ext(TOP_PTE(to_address) + offset, pfn_pte(__pa(kto) >> PAGE_SHIFT, PAGE_KERNEL), 0);

from = from_address + (offset << PAGE_SHIFT);
to = to_address + (offset << PAGE_SHIFT);
Expand Down Expand Up @@ -110,7 +110,7 @@ static void v6_clear_user_page_aliasing(void *kaddr, unsigned long vaddr)
*/
spin_lock(&v6_lock);

set_pte(TOP_PTE(to_address) + offset, pfn_pte(__pa(kaddr) >> PAGE_SHIFT, PAGE_KERNEL));
set_pte_ext(TOP_PTE(to_address) + offset, pfn_pte(__pa(kaddr) >> PAGE_SHIFT, PAGE_KERNEL), 0);
flush_tlb_kernel_page(to);
clear_page((void *)to);

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/copypage-xscale.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void xscale_mc_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
{
spin_lock(&minicache_lock);

set_pte(TOP_PTE(COPYPAGE_MINICACHE), pfn_pte(__pa(kfrom) >> PAGE_SHIFT, minicache_pgprot));
set_pte_ext(TOP_PTE(COPYPAGE_MINICACHE), pfn_pte(__pa(kfrom) >> PAGE_SHIFT, minicache_pgprot), 0);
flush_tlb_kernel_page(COPYPAGE_MINICACHE);

mc_copy_user_page((void *)COPYPAGE_MINICACHE, kto);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/fault-armv.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address)
if (pte_present(entry) && pte_val(entry) & shared_pte_mask) {
flush_cache_page(vma, address, pte_pfn(entry));
pte_val(entry) &= ~shared_pte_mask;
set_pte(pte, entry);
set_pte_at(vma->vm_mm, address, pte, entry);
flush_tlb_page(vma, address);
ret = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
unsigned long to = ALIAS_FLUSH_START + (CACHE_COLOUR(vaddr) << PAGE_SHIFT);
const int zero = 0;

set_pte(TOP_PTE(to), pfn_pte(pfn, PAGE_KERNEL));
set_pte_ext(TOP_PTE(to), pfn_pte(pfn, PAGE_KERNEL), 0);
flush_tlb_kernel_page(to);

asm( "mcrr p15, 0, %1, %0, c14\n"
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

static inline void
remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
unsigned long phys_addr, pgprot_t pgprot)
unsigned long phys_addr, pgprot_t prot)
{
unsigned long end;

Expand All @@ -53,7 +53,7 @@ remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
if (!pte_none(*pte))
goto bad;

set_pte(pte, pfn_pte(phys_addr >> PAGE_SHIFT, pgprot));
set_pte_ext(pte, pfn_pte(phys_addr >> PAGE_SHIFT, prot), 0);
address += PAGE_SIZE;
phys_addr += PAGE_SIZE;
pte++;
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,6 @@ static void __init build_mem_type_table(void)
mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE;
mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED;

/*
* User pages need to be mapped with the ASID
* (iow, non-global)
*/
user_pgprot |= L_PTE_ASID;

#ifdef CONFIG_SMP
/*
* Mark memory with the "shared" attribute for SMP systems
Expand Down Expand Up @@ -408,7 +402,7 @@ alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pg
}
ptep = pte_offset_kernel(pmdp, virt);

set_pte(ptep, pfn_pte(phys >> PAGE_SHIFT, prot));
set_pte_ext(ptep, pfn_pte(phys >> PAGE_SHIFT, prot), 0);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/pgd.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pgd_t *get_pgd_slow(struct mm_struct *mm)

init_pmd = pmd_offset(init_pgd, 0);
init_pte = pte_offset_map_nested(init_pmd, 0);
set_pte(new_pte, *init_pte);
set_pte_ext(new_pte, *init_pte, 0);
pte_unmap_nested(init_pte);
pte_unmap(new_pte);
}
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mm/proc-arm1020.S
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ ENTRY(cpu_arm1020_switch_mm)
* Set a PTE and flush it out
*/
.align 5
ENTRY(cpu_arm1020_set_pte)
ENTRY(cpu_arm1020_set_pte_ext)
#ifdef CONFIG_MMU
str r1, [r0], #-2048 @ linux version

Expand Down Expand Up @@ -477,7 +477,7 @@ arm1020_processor_functions:
.word cpu_arm1020_do_idle
.word cpu_arm1020_dcache_clean_area
.word cpu_arm1020_switch_mm
.word cpu_arm1020_set_pte
.word cpu_arm1020_set_pte_ext
.size arm1020_processor_functions, . - arm1020_processor_functions

.section ".rodata"
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mm/proc-arm1020e.S
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ ENTRY(cpu_arm1020e_switch_mm)
* Set a PTE and flush it out
*/
.align 5
ENTRY(cpu_arm1020e_set_pte)
ENTRY(cpu_arm1020e_set_pte_ext)
#ifdef CONFIG_MMU
str r1, [r0], #-2048 @ linux version

Expand Down Expand Up @@ -458,7 +458,7 @@ arm1020e_processor_functions:
.word cpu_arm1020e_do_idle
.word cpu_arm1020e_dcache_clean_area
.word cpu_arm1020e_switch_mm
.word cpu_arm1020e_set_pte
.word cpu_arm1020e_set_pte_ext
.size arm1020e_processor_functions, . - arm1020e_processor_functions

.section ".rodata"
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mm/proc-arm1022.S
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,12 @@ ENTRY(cpu_arm1022_switch_mm)
mov pc, lr
/*
* cpu_arm1022_set_pte(ptep, pte)
* cpu_arm1022_set_pte_ext(ptep, pte, ext)
*
* Set a PTE and flush it out
*/
.align 5
ENTRY(cpu_arm1022_set_pte)
ENTRY(cpu_arm1022_set_pte_ext)
#ifdef CONFIG_MMU
str r1, [r0], #-2048 @ linux version

Expand Down Expand Up @@ -441,7 +441,7 @@ arm1022_processor_functions:
.word cpu_arm1022_do_idle
.word cpu_arm1022_dcache_clean_area
.word cpu_arm1022_switch_mm
.word cpu_arm1022_set_pte
.word cpu_arm1022_set_pte_ext
.size arm1022_processor_functions, . - arm1022_processor_functions

.section ".rodata"
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mm/proc-arm1026.S
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,12 @@ ENTRY(cpu_arm1026_switch_mm)
mov pc, lr
/*
* cpu_arm1026_set_pte(ptep, pte)
* cpu_arm1026_set_pte_ext(ptep, pte, ext)
*
* Set a PTE and flush it out
*/
.align 5
ENTRY(cpu_arm1026_set_pte)
ENTRY(cpu_arm1026_set_pte_ext)
#ifdef CONFIG_MMU
str r1, [r0], #-2048 @ linux version

Expand Down Expand Up @@ -436,7 +436,7 @@ arm1026_processor_functions:
.word cpu_arm1026_do_idle
.word cpu_arm1026_dcache_clean_area
.word cpu_arm1026_switch_mm
.word cpu_arm1026_set_pte
.word cpu_arm1026_set_pte_ext
.size arm1026_processor_functions, . - arm1026_processor_functions

.section .rodata
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mm/proc-arm6_7.S
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ ENTRY(cpu_arm7_switch_mm)
mov pc, lr

/*
* Function: arm6_7_set_pte(pte_t *ptep, pte_t pte)
* Function: arm6_7_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext)
* Params : r0 = Address to set
* : r1 = value to set
* Purpose : Set a PTE and flush it out of any WB cache
*/
.align 5
ENTRY(cpu_arm6_set_pte)
ENTRY(cpu_arm7_set_pte)
ENTRY(cpu_arm6_set_pte_ext)
ENTRY(cpu_arm7_set_pte_ext)
#ifdef CONFIG_MMU
str r1, [r0], #-2048 @ linux version

Expand Down Expand Up @@ -299,7 +299,7 @@ ENTRY(arm6_processor_functions)
.word cpu_arm6_do_idle
.word cpu_arm6_dcache_clean_area
.word cpu_arm6_switch_mm
.word cpu_arm6_set_pte
.word cpu_arm6_set_pte_ext
.size arm6_processor_functions, . - arm6_processor_functions

/*
Expand All @@ -315,7 +315,7 @@ ENTRY(arm7_processor_functions)
.word cpu_arm7_do_idle
.word cpu_arm7_dcache_clean_area
.word cpu_arm7_switch_mm
.word cpu_arm7_set_pte
.word cpu_arm7_set_pte_ext
.size arm7_processor_functions, . - arm7_processor_functions

.section ".rodata"
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mm/proc-arm720.S
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ ENTRY(cpu_arm720_switch_mm)
mov pc, lr

/*
* Function: arm720_set_pte(pte_t *ptep, pte_t pte)
* Function: arm720_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext)
* Params : r0 = Address to set
* : r1 = value to set
* Purpose : Set a PTE and flush it out of any WB cache
*/
.align 5
ENTRY(cpu_arm720_set_pte)
ENTRY(cpu_arm720_set_pte_ext)
#ifdef CONFIG_MMU
str r1, [r0], #-2048 @ linux version

Expand Down Expand Up @@ -204,7 +204,7 @@ ENTRY(arm720_processor_functions)
.word cpu_arm720_do_idle
.word cpu_arm720_dcache_clean_area
.word cpu_arm720_switch_mm
.word cpu_arm720_set_pte
.word cpu_arm720_set_pte_ext
.size arm720_processor_functions, . - arm720_processor_functions

.section ".rodata"
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mm/proc-arm920.S
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,12 @@ ENTRY(cpu_arm920_switch_mm)
mov pc, lr

/*
* cpu_arm920_set_pte(ptep, pte)
* cpu_arm920_set_pte(ptep, pte, ext)
*
* Set a PTE and flush it out
*/
.align 5
ENTRY(cpu_arm920_set_pte)
ENTRY(cpu_arm920_set_pte_ext)
#ifdef CONFIG_MMU
str r1, [r0], #-2048 @ linux version

Expand Down Expand Up @@ -423,7 +423,7 @@ arm920_processor_functions:
.word cpu_arm920_do_idle
.word cpu_arm920_dcache_clean_area
.word cpu_arm920_switch_mm
.word cpu_arm920_set_pte
.word cpu_arm920_set_pte_ext
.size arm920_processor_functions, . - arm920_processor_functions

.section ".rodata"
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mm/proc-arm922.S
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ ENTRY(cpu_arm922_switch_mm)
mov pc, lr

/*
* cpu_arm922_set_pte(ptep, pte)
* cpu_arm922_set_pte_ext(ptep, pte, ext)
*
* Set a PTE and flush it out
*/
.align 5
ENTRY(cpu_arm922_set_pte)
ENTRY(cpu_arm922_set_pte_ext)
#ifdef CONFIG_MMU
str r1, [r0], #-2048 @ linux version

Expand Down Expand Up @@ -427,7 +427,7 @@ arm922_processor_functions:
.word cpu_arm922_do_idle
.word cpu_arm922_dcache_clean_area
.word cpu_arm922_switch_mm
.word cpu_arm922_set_pte
.word cpu_arm922_set_pte_ext
.size arm922_processor_functions, . - arm922_processor_functions

.section ".rodata"
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mm/proc-arm925.S
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,12 @@ ENTRY(cpu_arm925_switch_mm)
mov pc, lr

/*
* cpu_arm925_set_pte(ptep, pte)
* cpu_arm925_set_pte_ext(ptep, pte, ext)
*
* Set a PTE and flush it out
*/
.align 5
ENTRY(cpu_arm925_set_pte)
ENTRY(cpu_arm925_set_pte_ext)
#ifdef CONFIG_MMU
str r1, [r0], #-2048 @ linux version

Expand Down Expand Up @@ -490,7 +490,7 @@ arm925_processor_functions:
.word cpu_arm925_do_idle
.word cpu_arm925_dcache_clean_area
.word cpu_arm925_switch_mm
.word cpu_arm925_set_pte
.word cpu_arm925_set_pte_ext
.size arm925_processor_functions, . - arm925_processor_functions

.section ".rodata"
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mm/proc-arm926.S
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ ENTRY(cpu_arm926_switch_mm)
mov pc, lr

/*
* cpu_arm926_set_pte(ptep, pte)
* cpu_arm926_set_pte_ext(ptep, pte, ext)
*
* Set a PTE and flush it out
*/
.align 5
ENTRY(cpu_arm926_set_pte)
ENTRY(cpu_arm926_set_pte_ext)
#ifdef CONFIG_MMU
str r1, [r0], #-2048 @ linux version

Expand Down Expand Up @@ -439,7 +439,7 @@ arm926_processor_functions:
.word cpu_arm926_do_idle
.word cpu_arm926_dcache_clean_area
.word cpu_arm926_switch_mm
.word cpu_arm926_set_pte
.word cpu_arm926_set_pte_ext
.size arm926_processor_functions, . - arm926_processor_functions

.section ".rodata"
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mm/proc-sa110.S
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ ENTRY(cpu_sa110_switch_mm)
#endif

/*
* cpu_sa110_set_pte(ptep, pte)
* cpu_sa110_set_pte_ext(ptep, pte, ext)
*
* Set a PTE and flush it out
*/
.align 5
ENTRY(cpu_sa110_set_pte)
ENTRY(cpu_sa110_set_pte_ext)
#ifdef CONFIG_MMU
str r1, [r0], #-2048 @ linux version

Expand Down Expand Up @@ -222,7 +222,7 @@ ENTRY(sa110_processor_functions)
.word cpu_sa110_do_idle
.word cpu_sa110_dcache_clean_area
.word cpu_sa110_switch_mm
.word cpu_sa110_set_pte
.word cpu_sa110_set_pte_ext
.size sa110_processor_functions, . - sa110_processor_functions

.section ".rodata"
Expand Down
Loading

0 comments on commit ad1ae2f

Please sign in to comment.