diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2013-08-23 17:37:18 +0530 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2013-08-30 21:42:18 +0530 |
commit | 5bd87adf9b2ae5fa1bb469c68029b4eec06d6e03 (patch) | |
tree | 25b80c5717ae313fa52d4153caa6fef3100055bb /arch/arc/mm/tlb.c | |
parent | ade922f8e269115252d199bf6c524a10379cf716 (diff) | |
download | linux-stable-5bd87adf9b2ae5fa1bb469c68029b4eec06d6e03.tar.gz linux-stable-5bd87adf9b2ae5fa1bb469c68029b4eec06d6e03.tar.bz2 linux-stable-5bd87adf9b2ae5fa1bb469c68029b4eec06d6e03.zip |
ARC: [ASID] Refactor the TLB paranoid debug code
-Asm code already has values of SW and HW ASID values, so they can be
passed to the printing routine.
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/mm/tlb.c')
-rw-r--r-- | arch/arc/mm/tlb.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index 7646a96f3155..a4ad68c4b50d 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c @@ -688,25 +688,27 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address, * Low Level ASM TLB handler calls this if it finds that HW and SW ASIDS * don't match */ -void print_asid_mismatch(int is_fast_path) +void print_asid_mismatch(int mm_asid, int mmu_asid, int is_fast_path) { - int pid_sw, pid_hw; - pid_sw = current->active_mm->context.asid; - pid_hw = read_aux_reg(ARC_REG_PID) & 0xff; - pr_emerg("ASID Mismatch in %s Path Handler: sw-pid=0x%x hw-pid=0x%x\n", - is_fast_path ? "Fast" : "Slow", pid_sw, pid_hw); + is_fast_path ? "Fast" : "Slow", mm_asid, mmu_asid); __asm__ __volatile__("flag 1"); } -void tlb_paranoid_check(unsigned int pid_sw, unsigned long addr) +void tlb_paranoid_check(unsigned int mm_asid, unsigned long addr) { - unsigned int pid_hw; + unsigned int mmu_asid; - pid_hw = read_aux_reg(ARC_REG_PID) & 0xff; + mmu_asid = read_aux_reg(ARC_REG_PID) & 0xff; - if (addr < 0x70000000 && ((pid_hw != pid_sw) || (pid_sw == NO_ASID))) - print_asid_mismatch(0); + /* + * At the time of a TLB miss/installation + * - HW version needs to match SW version + * - SW needs to have a valid ASID + */ + if (addr < 0x70000000 && + ((mmu_asid != mm_asid) || (mm_asid == NO_ASID))) + print_asid_mismatch(mm_asid, mmu_asid, 0); } #endif |