Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Thiemo Seufer <ths@networkno.de>
To: linux-mips@linux-mips.org
Cc: ralf@linux-mips.org
Subject: [PATCH] Use a sensible tlbex default for unknown CPUs
Date: Thu, 25 Oct 2007 16:59:12 +0100	[thread overview]
Message-ID: <20071025155912.GD3994@networkno.de> (raw)

Hello All,

currently the kernel panics when it boots on an unknown CPU model
(with an unknown PRID). Based on the assumption that the majority
of newly supported CPU will conform to Release 2 standard, I wrote
the appended patch which handles unknown CPUs as R2. It isn't
completely bulletproof, as (yet unsupported) non-R1/R2 CPUs may
use the AT config bits for different purposes. I still think this
is good enough a test.

This patch allows me to boot Linux on a "generic" MIPS64R2 Qemu
without making up a potentially conflicting PRID. All-zeroes
like for other undefined fields does fine.


Thiemo


Signed-Off-By: Thiemo Seufer <ths@networkno.de>
---

diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index a61246d..82188f2 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -935,14 +935,6 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
 		tlbw(p);
 		break;
 
-	case CPU_4KEC:
-	case CPU_24K:
-	case CPU_34K:
-	case CPU_74K:
-		i_ehb(p);
-		tlbw(p);
-		break;
-
 	case CPU_RM9000:
 		/*
 		 * When the JTLB is updated by tlbwi or tlbwr, a subsequent
@@ -982,8 +974,18 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
 		break;
 
 	default:
-		panic("No TLB refill handler yet (CPU type: %d)",
-		      current_cpu_data.cputype);
+		/* Panic if this isn't a Release 2 CPU. */
+		if (!((read_c0_config() & MIPS_CONF_AT) >> 13)) {
+			panic("No TLB refill handler yet (CPU type: %d)",
+			      current_cpu_data.cputype);
+		}
+		/* fall through */
+	case CPU_4KEC:
+	case CPU_24K:
+	case CPU_34K:
+	case CPU_74K:
+		i_ehb(p);
+		tlbw(p);
 		break;
 	}
 }

             reply	other threads:[~2007-10-25 16:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-25 15:59 Thiemo Seufer [this message]
2007-10-25 16:10 ` [PATCH] Use a sensible tlbex default for unknown CPUs Ralf Baechle
2007-10-25 16:53   ` Thiemo Seufer
2007-10-25 17:08 ` Maciej W. Rozycki
2007-10-25 20:56   ` Thiemo Seufer
2007-10-26  9:31     ` Maciej W. Rozycki
2007-10-28 23:39     ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071025155912.GD3994@networkno.de \
    --to=ths@networkno.de \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox