linux-mips
[Top] [All Lists]

[PATCH] MIPS: Optimize TLB refill for RI/XI configurations.

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH] MIPS: Optimize TLB refill for RI/XI configurations.
From: David Daney <ddaney.cavm@gmail.com>
Date: Thu, 23 Aug 2012 10:02:03 -0700
Cc: David Daney <ddaney@caviumnetworks.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=caVaFmjpJoQZbDZw1dYo3j0dae4AdfP7IF1zMdsDEAU=; b=NU5e/GXETKmTYCX07anqVFPSS67Zdo1FAZEBJpOaPjrTxseRBSnKABXesFj1t2Wd0Q v3XXMHgc4FftoPLUb7I9UPCw6EDfk8b7Gkk1jeHyNlkGElzyExTHKp6AzE2LAuIu+fJq cYLsHF8uGRqWmPrIcaUPJiNVNES9Fznqka+7iz27X6NEtzeBHSF9/jABOx/mGierjdHv 5oGcdJNifmxnvg1IyyI1cwQ8Ypg2ywafKErKdcmuyeCVK+sQCKJyQ0rhzIYRokO34sKp TpUfJ9TFpx/nIOVVkhIZ4mSDyDv038PUdIkbQESZaPquIyvYVeC46wSbh3TY+qf68V2n 66gA==
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Sender: linux-mips-bounce@linux-mips.org
From: David Daney <ddaney@caviumnetworks.com>

We don't have to do a separate shift to eliminate the software bits,
just rotate them into the fill and they will be ignored.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 arch/mips/mm/tlbex.c | 23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 03eb0ef..4f33acd 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -587,8 +587,7 @@ static __cpuinit __maybe_unused void 
build_convert_pte_to_entrylo(u32 **p,
                                                                  unsigned int 
reg)
 {
        if (kernel_uses_smartmips_rixi) {
-               UASM_i_SRL(p, reg, reg, ilog2(_PAGE_NO_EXEC));
-               UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL) - 
ilog2(_PAGE_NO_EXEC));
+               UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL));
        } else {
 #ifdef CONFIG_64BIT_PHYS_ADDR
                uasm_i_dsrl_safe(p, reg, reg, ilog2(_PAGE_GLOBAL));
@@ -991,11 +990,9 @@ static void __cpuinit build_update_entries(u32 **p, 
unsigned int tmp,
                uasm_i_ld(p, tmp, 0, ptep); /* get even pte */
                uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
                if (kernel_uses_smartmips_rixi) {
-                       UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC));
-                       UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
-                       UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - 
ilog2(_PAGE_NO_EXEC));
+                       UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL));
                        UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
-                       UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - 
ilog2(_PAGE_NO_EXEC));
+                       UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL));
                } else {
                        uasm_i_dsrl_safe(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* 
convert to entrylo0 */
                        UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
@@ -1018,13 +1015,11 @@ static void __cpuinit build_update_entries(u32 **p, 
unsigned int tmp,
        if (r45k_bvahwbug())
                build_tlb_probe_entry(p);
        if (kernel_uses_smartmips_rixi) {
-               UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC));
-               UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
-               UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - 
ilog2(_PAGE_NO_EXEC));
+               UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL));
                if (r4k_250MHZhwbug())
                        UASM_i_MTC0(p, 0, C0_ENTRYLO0);
                UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
-               UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL) - 
ilog2(_PAGE_NO_EXEC));
+               UASM_i_ROTR(p, ptep, ptep, ilog2(_PAGE_GLOBAL));
        } else {
                UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_GLOBAL)); /* convert to 
entrylo0 */
                if (r4k_250MHZhwbug())
@@ -1184,13 +1179,9 @@ build_fast_tlb_refill_handler (u32 **p, struct 
uasm_label **l,
                UASM_i_LW(p, odd, sizeof(pte_t), ptr); /* get odd pte */
        }
        if (kernel_uses_smartmips_rixi) {
-               uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_NO_EXEC));
-               uasm_i_dsrl_safe(p, odd, odd, ilog2(_PAGE_NO_EXEC));
-               uasm_i_drotr(p, even, even,
-                            ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
+               uasm_i_drotr(p, even, even, ilog2(_PAGE_GLOBAL));
                UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */
-               uasm_i_drotr(p, odd, odd,
-                            ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
+               uasm_i_drotr(p, odd, odd, ilog2(_PAGE_GLOBAL));
        } else {
                uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_GLOBAL));
                UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */
-- 
1.7.11.4


<Prev in Thread] Current Thread [Next in Thread>