Received: from milmhbs1.lsil.com (147.145.21.209) by coscas01.lsi.com
 (172.21.36.60) with Microsoft SMTP Server id 8.1.393.1; Fri, 5 Feb 2010
 16:29:16 -0700
Received: from mail1.lsil.com (mail1.lsil.com [147.145.40.21])	by
 milmhbs1.lsil.com (8.12.11/8.12.11) with ESMTP id o15NTG9a031714	for
 <andy.sharp@lsi.com>; Fri, 5 Feb 2010 15:29:16 -0800
Received: from psmtp.com (na3sys009amx251.postini.com [74.125.149.135])	by
 mail1.lsil.com (8.12.11/8.12.11) with SMTP id o15NTEDP025751	for
 <andy.sharp@lsi.com>; Fri, 5 Feb 2010 15:29:15 -0800 (PST)
Received: from source ([78.24.191.182]) by na3sys009amx251.postini.com
 ([74.125.148.14]) with SMTP;	Fri, 05 Feb 2010 18:29:15 EST
Received: from localhost.localdomain ([127.0.0.1]:55002 "EHLO
        eddie.linux-mips.org" rhost-flags-OK-OK-OK-FAIL)        by
 eddie.linux-mips.org with ESMTP id S1493076Ab0BEX3N (ORCPT
        <rfc822;andy.sharp@lsi.com>); Sat, 6 Feb 2010 00:29:13 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 06 Feb 2010 00:28:55
 +0100 (CET)
Received: from mail3.caviumnetworks.com ([12.108.191.235]:11641 "EHLO
        mail3.caviumnetworks.com" rhost-flags-OK-OK-OK-OK)        by
 eddie.linux-mips.org with ESMTP id S1491032Ab0BEX1i (ORCPT
        <rfc822;linux-mips@linux-mips.org>); Sat, 6 Feb 2010 00:27:38 +0100
Received: from caexch01.caveonetworks.com (Not Verified[192.168.16.9]) by
 mail3.caviumnetworks.com with MailMarshal (v6,7,2,8378)        id
 <B4b6ca96f0007>; Fri, 05 Feb 2010 15:27:43 -0800
Received: from caexch01.caveonetworks.com ([192.168.16.9]) by
 caexch01.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959);
         Fri, 5 Feb 2010 15:27:18 -0800
Received: from dd1.caveonetworks.com ([12.108.191.236]) by
 caexch01.caveonetworks.com over TLS secured channel with Microsoft
 SMTPSVC(6.0.3790.3959);         Fri, 5 Feb 2010 15:27:18 -0800
Received: from dd1.caveonetworks.com (localhost.localdomain [127.0.0.1])
        by dd1.caveonetworks.com (8.14.2/8.14.2) with ESMTP id o15NRF20028551;
        Fri, 5 Feb 2010 15:27:15 -0800
Received: (from ddaney@localhost)        by dd1.caveonetworks.com
 (8.14.2/8.14.2/Submit) id o15NRBN3028550;        Fri, 5 Feb 2010 15:27:12
 -0800
From: David Daney <ddaney@caviumnetworks.com>
To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"ralf@linux-mips.org" <ralf@linux-mips.org>
CC: David Daney <ddaney@caviumnetworks.com>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Fri, 5 Feb 2010 16:27:08 -0700
Subject: [PATCH 1/4] MIPS: Use 64-bit stores to c0_entrylo on 64-bit kernels.
Thread-Topic: [PATCH 1/4] MIPS: Use 64-bit stores to c0_entrylo on 64-bit
 kernels.
Thread-Index: Acqmuwi2EzL7tDU3QZm28tm+ZSjGtA==
Message-ID: <1265412431-28526-1-git-send-email-ddaney@caviumnetworks.com>
References: <4B6CA90C.1000609@caviumnetworks.com>
In-Reply-To: <4B6CA90C.1000609@caviumnetworks.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: coscas01.lsi.com
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-scanned-by: MIMEDefang 2.39
errors-to: linux-mips-bounce@linux-mips.org
x-originalarrivaltime: 05 Feb 2010 23:27:18.0059 (UTC)
 FILETIME=[C1E48FB0:01CAA6BA]
x-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
x-pstn-settings: 3 (1.0000:1.0000) s cv gt3 gt2 gt1 r p m c 
x-pstn-addresses: from <ddaney@caviumnetworks.com> [22/1] 
x-pstn-neptune: 0/0/0.00/0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

64-bit CPUs have 64-bit c0_entrylo{0,1} registers.  We should use the
64-bit dmtc0 instruction to set them.  This becomes important if we
want to set the RI and XI bits present in some processors.

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

diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 2c68849..35431e1 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -460,14 +460,14 @@ static __cpuinit void build_huge_update_entries(u32 *=
*p,
 		uasm_i_lui(p, tmp, HPAGE_SIZE >> (7 + 16));
=20
 	UASM_i_SRL(p, pte, pte, 6); /* convert to entrylo */
-	uasm_i_mtc0(p, pte, C0_ENTRYLO0); /* load it */
+	UASM_i_MTC0(p, pte, C0_ENTRYLO0); /* load it */
 	/* convert to entrylo1 */
 	if (small_sequence)
 		UASM_i_ADDIU(p, pte, pte, HPAGE_SIZE >> 7);
 	else
 		UASM_i_ADDU(p, pte, pte, tmp);
=20
-	uasm_i_mtc0(p, pte, C0_ENTRYLO1); /* load it */
+	UASM_i_MTC0(p, pte, C0_ENTRYLO1); /* load it */
 }
=20
 static __cpuinit void build_huge_handler_tail(u32 **p,
@@ -686,18 +686,18 @@ static void __cpuinit build_update_entries(u32 **p, u=
nsigned int tmp,
 		uasm_i_ld(p, tmp, 0, ptep); /* get even pte */
 		uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
 		uasm_i_dsrl(p, tmp, tmp, 6); /* convert to entrylo0 */
-		uasm_i_mtc0(p, tmp, C0_ENTRYLO0); /* load it */
+		UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
 		uasm_i_dsrl(p, ptep, ptep, 6); /* convert to entrylo1 */
-		uasm_i_mtc0(p, ptep, C0_ENTRYLO1); /* load it */
+		UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */
 	} else {
 		int pte_off_even =3D sizeof(pte_t) / 2;
 		int pte_off_odd =3D pte_off_even + sizeof(pte_t);
=20
 		/* The pte entries are pre-shifted */
 		uasm_i_lw(p, tmp, pte_off_even, ptep); /* get even pte */
-		uasm_i_mtc0(p, tmp, C0_ENTRYLO0); /* load it */
+		UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
 		uasm_i_lw(p, ptep, pte_off_odd, ptep); /* get odd pte */
-		uasm_i_mtc0(p, ptep, C0_ENTRYLO1); /* load it */
+		UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */
 	}
 #else
 	UASM_i_LW(p, tmp, 0, ptep); /* get even pte */
@@ -706,14 +706,14 @@ static void __cpuinit build_update_entries(u32 **p, u=
nsigned int tmp,
 		build_tlb_probe_entry(p);
 	UASM_i_SRL(p, tmp, tmp, 6); /* convert to entrylo0 */
 	if (r4k_250MHZhwbug())
-		uasm_i_mtc0(p, 0, C0_ENTRYLO0);
-	uasm_i_mtc0(p, tmp, C0_ENTRYLO0); /* load it */
+		UASM_i_MTC0(p, 0, C0_ENTRYLO0);
+	UASM_i_MTC0(p, tmp, C0_ENTRYLO0); /* load it */
 	UASM_i_SRL(p, ptep, ptep, 6); /* convert to entrylo1 */
 	if (r45k_bvahwbug())
 		uasm_i_mfc0(p, tmp, C0_INDEX);
 	if (r4k_250MHZhwbug())
-		uasm_i_mtc0(p, 0, C0_ENTRYLO1);
-	uasm_i_mtc0(p, ptep, C0_ENTRYLO1); /* load it */
+		UASM_i_MTC0(p, 0, C0_ENTRYLO1);
+	UASM_i_MTC0(p, ptep, C0_ENTRYLO1); /* load it */
 #endif
 }
=20
--=20
1.6.0.6


