dect
/
linux-2.6
Archived
13
0
Fork 0

sh64: Invert page fault fast-path error path values.

This brings the sh64 version in line with the sh32 one with regards to
how errors are handled. Base work for further unification of the
implementations.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
Paul Mundt 2012-05-14 16:44:45 +09:00
parent c06fd28387
commit 4de5185629
2 changed files with 19 additions and 19 deletions

View File

@ -335,7 +335,7 @@ tlb_miss:
/* If the fast path handler fixed the fault, just drop through quickly /* If the fast path handler fixed the fault, just drop through quickly
to the restore code right away to return to the excepting context. to the restore code right away to return to the excepting context.
*/ */
beqi/u r2, 0, tr1 bnei/u r2, 0, tr1
fast_tlb_miss_restore: fast_tlb_miss_restore:
ld.q SP, SAVED_TR0, r2 ld.q SP, SAVED_TR0, r2

View File

@ -53,23 +53,23 @@ static int handle_vmalloc_fault(struct mm_struct *mm,
pud = pud_offset(dir, address); pud = pud_offset(dir, address);
if (pud_none_or_clear_bad(pud)) if (pud_none_or_clear_bad(pud))
return 0; return 1;
pmd = pmd_offset(pud, address); pmd = pmd_offset(pud, address);
if (pmd_none_or_clear_bad(pmd)) if (pmd_none_or_clear_bad(pmd))
return 0; return 1;
pte = pte_offset_kernel(pmd, address); pte = pte_offset_kernel(pmd, address);
entry = *pte; entry = *pte;
if (pte_none(entry) || !pte_present(entry)) if (pte_none(entry) || !pte_present(entry))
return 0; return 1;
if ((pte_val(entry) & protection_flags) != protection_flags) if ((pte_val(entry) & protection_flags) != protection_flags)
return 0; return 1;
update_mmu_cache(NULL, address, pte); update_mmu_cache(NULL, address, pte);
return 1; return 0;
} }
static int handle_tlbmiss(struct mm_struct *mm, static int handle_tlbmiss(struct mm_struct *mm,
@ -94,27 +94,27 @@ static int handle_tlbmiss(struct mm_struct *mm,
the next test is necessary. - RPC */ the next test is necessary. - RPC */
if (address >= (unsigned long) TASK_SIZE) if (address >= (unsigned long) TASK_SIZE)
/* upper half - never has page table entries. */ /* upper half - never has page table entries. */
return 0; return 1;
dir = pgd_offset(mm, address); dir = pgd_offset(mm, address);
if (pgd_none(*dir) || !pgd_present(*dir)) if (pgd_none(*dir) || !pgd_present(*dir))
return 0; return 1;
if (!pgd_present(*dir)) if (!pgd_present(*dir))
return 0; return 1;
pud = pud_offset(dir, address); pud = pud_offset(dir, address);
if (pud_none(*pud) || !pud_present(*pud)) if (pud_none(*pud) || !pud_present(*pud))
return 0; return 1;
pmd = pmd_offset(pud, address); pmd = pmd_offset(pud, address);
if (pmd_none(*pmd) || !pmd_present(*pmd)) if (pmd_none(*pmd) || !pmd_present(*pmd))
return 0; return 1;
pte = pte_offset_kernel(pmd, address); pte = pte_offset_kernel(pmd, address);
entry = *pte; entry = *pte;
if (pte_none(entry) || !pte_present(entry)) if (pte_none(entry) || !pte_present(entry))
return 0; return 1;
/* /*
* If the page doesn't have sufficient protection bits set to * If the page doesn't have sufficient protection bits set to
@ -123,11 +123,11 @@ static int handle_tlbmiss(struct mm_struct *mm,
* handler. * handler.
*/ */
if ((pte_val(entry) & protection_flags) != protection_flags) if ((pte_val(entry) & protection_flags) != protection_flags)
return 0; return 1;
update_mmu_cache(NULL, address, pte); update_mmu_cache(NULL, address, pte);
return 1; return 0;
} }
/* /*
@ -214,12 +214,12 @@ asmlinkage int do_fast_page_fault(unsigned long long ssr_md,
* Process-contexts can never have this address * Process-contexts can never have this address
* range mapped * range mapped
*/ */
if (handle_vmalloc_fault(mm, protection_flags, address)) if (handle_vmalloc_fault(mm, protection_flags, address) == 0)
return 1; return 0;
} else if (!in_interrupt() && mm) { } else if (!in_interrupt() && mm) {
if (handle_tlbmiss(mm, protection_flags, address)) if (handle_tlbmiss(mm, protection_flags, address) == 0)
return 1; return 0;
} }
return 0; return 1;
} }