linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: Remove execution hazard barriers for Octeon.

To: Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: Re: [PATCH] MIPS: Remove execution hazard barriers for Octeon.
From: David Daney <ddaney@caviumnetworks.com>
Date: Mon, 11 May 2009 15:24:17 -0700
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
In-reply-to: <7d1d9c250905111459p42ce2671n91625e6f62cb2d75@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1242069062-20991-1-git-send-email-ddaney@caviumnetworks.com> <7d1d9c250905111459p42ce2671n91625e6f62cb2d75@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 2.0.0.21 (X11/20090320)
Paul Gortmaker wrote:
On Mon, May 11, 2009 at 3:11 PM, David Daney <ddaney@caviumnetworks.com> wrote:
The Octeon has no execution hazards, so we can remove them and save an
instruction per TLB handler invocation.

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

diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 3548acf..4b2ea1f 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -257,7 +257,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct 
uasm_label **l,
       case tlb_indexed: tlbw = uasm_i_tlbwi; break;
       }

-       if (cpu_has_mips_r2) {
+       if (cpu_has_mips_r2 && current_cpu_type() != CPU_CAVIUM_OCTEON) {

Assuming that it is feasible that some other future cores might also be
free of execution hazards, wouldn't it be better to do:

  if (cpu_has_mips_r2 && cpu_has_exec_hazard) {


That would be a bit cleaner.  I will test a new patch.

Thanks,
David Daney



and then hide the CPU type listing (currently just one) in some header file?

Paul.


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