diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2012-09-28 10:29:55 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2012-09-28 10:29:55 -0400 |
commit | cb418b34caddc970c1513e515aaa535246a4bba3 (patch) | |
tree | b89720b74d6a85a9407f03bb064248c7235b9dea /arch/mips/mm/tlbex.c | |
parent | 77a0d763c461da81c2a3fc9a7e58162a40854a1a (diff) | |
parent | ff401e52100dcdc85e572d1ad376d3307b3fe28e (diff) |
Merge branch 'ralf-3.7' of git://git.linux-mips.org/pub/scm/sjhill/linux-sjhill into mips-for-linux-next
Diffstat (limited to 'arch/mips/mm/tlbex.c')
-rw-r--r-- | arch/mips/mm/tlbex.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 1832f17e6be4..e09d49256908 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -449,8 +449,20 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l, | |||
449 | } | 449 | } |
450 | 450 | ||
451 | if (cpu_has_mips_r2) { | 451 | if (cpu_has_mips_r2) { |
452 | if (cpu_has_mips_r2_exec_hazard) | 452 | /* |
453 | * The architecture spec says an ehb is required here, | ||
454 | * but a number of cores do not have the hazard and | ||
455 | * using an ehb causes an expensive pipeline stall. | ||
456 | */ | ||
457 | switch (current_cpu_type()) { | ||
458 | case CPU_M14KC: | ||
459 | case CPU_74K: | ||
460 | break; | ||
461 | |||
462 | default: | ||
453 | uasm_i_ehb(p); | 463 | uasm_i_ehb(p); |
464 | break; | ||
465 | } | ||
454 | tlbw(p); | 466 | tlbw(p); |
455 | return; | 467 | return; |
456 | } | 468 | } |
@@ -921,6 +933,13 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr) | |||
921 | #endif | 933 | #endif |
922 | uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */ | 934 | uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */ |
923 | uasm_i_lw(p, ptr, uasm_rel_lo(pgdc), ptr); | 935 | uasm_i_lw(p, ptr, uasm_rel_lo(pgdc), ptr); |
936 | |||
937 | if (cpu_has_mips_r2) { | ||
938 | uasm_i_ext(p, tmp, tmp, PGDIR_SHIFT, (32 - PGDIR_SHIFT)); | ||
939 | uasm_i_ins(p, ptr, tmp, PGD_T_LOG2, (32 - PGDIR_SHIFT)); | ||
940 | return; | ||
941 | } | ||
942 | |||
924 | uasm_i_srl(p, tmp, tmp, PGDIR_SHIFT); /* get pgd only bits */ | 943 | uasm_i_srl(p, tmp, tmp, PGDIR_SHIFT); /* get pgd only bits */ |
925 | uasm_i_sll(p, tmp, tmp, PGD_T_LOG2); | 944 | uasm_i_sll(p, tmp, tmp, PGD_T_LOG2); |
926 | uasm_i_addu(p, ptr, ptr, tmp); /* add in pgd offset */ | 945 | uasm_i_addu(p, ptr, ptr, tmp); /* add in pgd offset */ |
@@ -956,6 +975,15 @@ static void __cpuinit build_adjust_context(u32 **p, unsigned int ctx) | |||
956 | 975 | ||
957 | static void __cpuinit build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr) | 976 | static void __cpuinit build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr) |
958 | { | 977 | { |
978 | if (cpu_has_mips_r2) { | ||
979 | /* PTE ptr offset is obtained from BadVAddr */ | ||
980 | UASM_i_MFC0(p, tmp, C0_BADVADDR); | ||
981 | UASM_i_LW(p, ptr, 0, ptr); | ||
982 | uasm_i_ext(p, tmp, tmp, PAGE_SHIFT+1, PGDIR_SHIFT-PAGE_SHIFT-1); | ||
983 | uasm_i_ins(p, ptr, tmp, PTE_T_LOG2+1, PGDIR_SHIFT-PAGE_SHIFT-1); | ||
984 | return; | ||
985 | } | ||
986 | |||
959 | /* | 987 | /* |
960 | * Bug workaround for the Nevada. It seems as if under certain | 988 | * Bug workaround for the Nevada. It seems as if under certain |
961 | * circumstances the move from cp0_context might produce a | 989 | * circumstances the move from cp0_context might produce a |