diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2013-06-20 08:56:17 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-06-21 12:07:03 -0400 |
commit | 73acc7df534ff458a81435178dab3ea037ed6d78 (patch) | |
tree | 7e6f7c7af7ccbeb81224eb88bc17d498fa529290 /arch/mips/mm/tlbex.c | |
parent | b90b3802624e1f2a509f3e9f39775d94ec4762d7 (diff) |
MIPS: Fix TLBR-use hazards for R2 cores in the TLB reload handlers
MIPS R2 documents state that an execution hazard barrier is needed
after a TLBR before reading EntryLo.
Original patch by Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/5526/
Diffstat (limited to 'arch/mips/mm/tlbex.c')
-rw-r--r-- | arch/mips/mm/tlbex.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index afeef93f81a7..f0f4dc44f394 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -1935,6 +1935,19 @@ static void __cpuinit build_r4000_tlb_load_handler(void) | |||
1935 | uasm_i_nop(&p); | 1935 | uasm_i_nop(&p); |
1936 | 1936 | ||
1937 | uasm_i_tlbr(&p); | 1937 | uasm_i_tlbr(&p); |
1938 | |||
1939 | switch (current_cpu_type()) { | ||
1940 | default: | ||
1941 | if (cpu_has_mips_r2) { | ||
1942 | uasm_i_ehb(&p); | ||
1943 | |||
1944 | case CPU_CAVIUM_OCTEON: | ||
1945 | case CPU_CAVIUM_OCTEON_PLUS: | ||
1946 | case CPU_CAVIUM_OCTEON2: | ||
1947 | break; | ||
1948 | } | ||
1949 | } | ||
1950 | |||
1938 | /* Examine entrylo 0 or 1 based on ptr. */ | 1951 | /* Examine entrylo 0 or 1 based on ptr. */ |
1939 | if (use_bbit_insns()) { | 1952 | if (use_bbit_insns()) { |
1940 | uasm_i_bbit0(&p, wr.r2, ilog2(sizeof(pte_t)), 8); | 1953 | uasm_i_bbit0(&p, wr.r2, ilog2(sizeof(pte_t)), 8); |
@@ -1989,6 +2002,19 @@ static void __cpuinit build_r4000_tlb_load_handler(void) | |||
1989 | uasm_i_nop(&p); | 2002 | uasm_i_nop(&p); |
1990 | 2003 | ||
1991 | uasm_i_tlbr(&p); | 2004 | uasm_i_tlbr(&p); |
2005 | |||
2006 | switch (current_cpu_type()) { | ||
2007 | default: | ||
2008 | if (cpu_has_mips_r2) { | ||
2009 | uasm_i_ehb(&p); | ||
2010 | |||
2011 | case CPU_CAVIUM_OCTEON: | ||
2012 | case CPU_CAVIUM_OCTEON_PLUS: | ||
2013 | case CPU_CAVIUM_OCTEON2: | ||
2014 | break; | ||
2015 | } | ||
2016 | } | ||
2017 | |||
1992 | /* Examine entrylo 0 or 1 based on ptr. */ | 2018 | /* Examine entrylo 0 or 1 based on ptr. */ |
1993 | if (use_bbit_insns()) { | 2019 | if (use_bbit_insns()) { |
1994 | uasm_i_bbit0(&p, wr.r2, ilog2(sizeof(pte_t)), 8); | 2020 | uasm_i_bbit0(&p, wr.r2, ilog2(sizeof(pte_t)), 8); |