Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166209
b: refs/heads/master
c: e090808
h: refs/heads/master
i:
  166207: 398acf8
v: v3
  • Loading branch information
Rex Feany authored and Benjamin Herrenschmidt committed Sep 24, 2009
1 parent 53c8425 commit 6ffa32b
Show file tree
Hide file tree
Showing 2 changed files with 17 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: daf8f40391b2a1978ea2071c20959d91fade6b1a
refs/heads/master: e0908085fc2391c85b85fb814ae1df377c8e0dcb
19 changes: 16 additions & 3 deletions trunk/arch/powerpc/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <asm/tlbflush.h>
#include <asm/tlb.h>

#include "mmu_decl.h"

DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);

#ifdef CONFIG_SMP
Expand Down Expand Up @@ -166,7 +168,7 @@ struct page * maybe_pte_to_page(pte_t pte)
* support falls into the same category.
*/

static pte_t set_pte_filter(pte_t pte)
static pte_t set_pte_filter(pte_t pte, unsigned long addr)
{
pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
if (pte_looks_normal(pte) && !(cpu_has_feature(CPU_FTR_COHERENT_ICACHE) ||
Expand All @@ -175,6 +177,17 @@ static pte_t set_pte_filter(pte_t pte)
if (!pg)
return pte;
if (!test_bit(PG_arch_1, &pg->flags)) {
#ifdef CONFIG_8xx
/* On 8xx, cache control instructions (particularly
* "dcbst" from flush_dcache_icache) fault as write
* operation if there is an unpopulated TLB entry
* for the address in question. To workaround that,
* we invalidate the TLB here, thus avoiding dcbst
* misbehaviour.
*/
/* 8xx doesn't care about PID, size or ind args */
_tlbil_va(addr, 0, 0, 0);
#endif /* CONFIG_8xx */
flush_dcache_icache_page(pg);
set_bit(PG_arch_1, &pg->flags);
}
Expand All @@ -194,7 +207,7 @@ static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma,
* as we don't have two bits to spare for _PAGE_EXEC and _PAGE_HWEXEC so
* instead we "filter out" the exec permission for non clean pages.
*/
static pte_t set_pte_filter(pte_t pte)
static pte_t set_pte_filter(pte_t pte, unsigned long addr)
{
struct page *pg;

Expand Down Expand Up @@ -276,7 +289,7 @@ void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
* this context might not have been activated yet when this
* is called.
*/
pte = set_pte_filter(pte);
pte = set_pte_filter(pte, addr);

/* Perform the setting of the PTE */
__set_pte_at(mm, addr, ptep, pte, 0);
Expand Down

0 comments on commit 6ffa32b

Please sign in to comment.