diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2013-08-23 08:07:18 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2013-08-30 12:12:18 -0400 |
commit | 5bd87adf9b2ae5fa1bb469c68029b4eec06d6e03 (patch) | |
tree | 25b80c5717ae313fa52d4153caa6fef3100055bb /arch/arc/mm/tlb.c | |
parent | ade922f8e269115252d199bf6c524a10379cf716 (diff) |
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, | |||
688 | * Low Level ASM TLB handler calls this if it finds that HW and SW ASIDS | 688 | * Low Level ASM TLB handler calls this if it finds that HW and SW ASIDS |
689 | * don't match | 689 | * don't match |
690 | */ | 690 | */ |
691 | void print_asid_mismatch(int is_fast_path) | 691 | void print_asid_mismatch(int mm_asid, int mmu_asid, int is_fast_path) |
692 | { | 692 | { |
693 | int pid_sw, pid_hw; | ||
694 | pid_sw = current->active_mm->context.asid; | ||
695 | pid_hw = read_aux_reg(ARC_REG_PID) & 0xff; | ||
696 | |||
697 | pr_emerg("ASID Mismatch in %s Path Handler: sw-pid=0x%x hw-pid=0x%x\n", | 693 | pr_emerg("ASID Mismatch in %s Path Handler: sw-pid=0x%x hw-pid=0x%x\n", |
698 | is_fast_path ? "Fast" : "Slow", pid_sw, pid_hw); | 694 | is_fast_path ? "Fast" : "Slow", mm_asid, mmu_asid); |
699 | 695 | ||
700 | __asm__ __volatile__("flag 1"); | 696 | __asm__ __volatile__("flag 1"); |
701 | } | 697 | } |
702 | 698 | ||
703 | void tlb_paranoid_check(unsigned int pid_sw, unsigned long addr) | 699 | void tlb_paranoid_check(unsigned int mm_asid, unsigned long addr) |
704 | { | 700 | { |
705 | unsigned int pid_hw; | 701 | unsigned int mmu_asid; |
706 | 702 | ||
707 | pid_hw = read_aux_reg(ARC_REG_PID) & 0xff; | 703 | mmu_asid = read_aux_reg(ARC_REG_PID) & 0xff; |
708 | 704 | ||
709 | if (addr < 0x70000000 && ((pid_hw != pid_sw) || (pid_sw == NO_ASID))) | 705 | /* |
710 | print_asid_mismatch(0); | 706 | * At the time of a TLB miss/installation |
707 | * - HW version needs to match SW version | ||
708 | * - SW needs to have a valid ASID | ||
709 | */ | ||
710 | if (addr < 0x70000000 && | ||
711 | ((mmu_asid != mm_asid) || (mm_asid == NO_ASID))) | ||
712 | print_asid_mismatch(mm_asid, mmu_asid, 0); | ||
711 | } | 713 | } |
712 | #endif | 714 | #endif |