Commit dbfd657a authored by Paul Burton's avatar Paul Burton Committed by Ralf Baechle

MIPS: tlbex: Stop open-coding build_convert_pte_to_entrylo

Make use of build_convert_pte_to_entrylo in the RIXI cases within
build_update_entries rather than open-coding it 4 times.
Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: linux-kernel@vger.kernel.org
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Patchwork: https://patchwork.linux-mips.org/patch/11214/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 5b10a0e8
...@@ -1010,13 +1010,13 @@ static void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep) ...@@ -1010,13 +1010,13 @@ static void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep)
uasm_i_ld(p, tmp, 0, ptep); /* get even pte */ uasm_i_ld(p, tmp, 0, ptep); /* get even pte */
uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */ uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
if (cpu_has_rixi) { if (cpu_has_rixi) {
UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); build_convert_pte_to_entrylo(p, tmp);
UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL)); build_convert_pte_to_entrylo(p, ptep);
} else { } else {
uasm_i_dsrl_safe(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */ build_convert_pte_to_entrylo(p, tmp);
UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
uasm_i_dsrl_safe(p, ptep, ptep, ilog2(_PAGE_GLOBAL)); /* convert to entrylo1 */ build_convert_pte_to_entrylo(p, ptep);
} }
UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */ UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */
} else { } else {
...@@ -1050,17 +1050,17 @@ static void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep) ...@@ -1050,17 +1050,17 @@ static void build_update_entries(u32 **p, unsigned int tmp, unsigned int ptep)
if (r45k_bvahwbug()) if (r45k_bvahwbug())
build_tlb_probe_entry(p); build_tlb_probe_entry(p);
if (cpu_has_rixi) { if (cpu_has_rixi) {
UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); build_convert_pte_to_entrylo(p, tmp);
if (r4k_250MHZhwbug()) if (r4k_250MHZhwbug())
UASM_i_MTC0(p, 0, C0_ENTRYLO0); UASM_i_MTC0(p, 0, C0_ENTRYLO0);
UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL)); build_convert_pte_to_entrylo(p, ptep);
} else { } else {
UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to entrylo0 */ build_convert_pte_to_entrylo(p, tmp);
if (r4k_250MHZhwbug()) if (r4k_250MHZhwbug())
UASM_i_MTC0(p, 0, C0_ENTRYLO0); UASM_i_MTC0(p, 0, C0_ENTRYLO0);
UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */ UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_GLOBAL)); /* convert to entrylo1 */ build_convert_pte_to_entrylo(p, ptep);
if (r45k_bvahwbug()) if (r45k_bvahwbug())
uasm_i_mfc0(p, tmp, C0_INDEX); uasm_i_mfc0(p, tmp, C0_INDEX);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment