linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Joakim Tjernlund" <Joakim.Tjernlund@lumentis.se>
To: "Tom Rini" <trini@kernel.crashing.org>
Cc: "Linuxppc-Embedded@Lists. Linuxppc. Org"
	<linuxppc-embedded@lists.linuxppc.org>,
	<strauman@SLAC.Stanford.EDU>
Subject: Re: dcbz works on 862 everywhere!
Date: Mon, 24 Mar 2003 23:44:12 +0100	[thread overview]
Message-ID: <006601c2f256$e6ff5e80$020120b0@jockeXP> (raw)
In-Reply-To: 20030324201543.GB14264@ip68-0-152-218.tc.ph.cox.net


> Can you post a patch which does everything (remove the TLB change bit,
> etc)?  Thanks.
>
> --
> Tom Rini

OK, here it goes. I had do this blind since I am still  on 2.4.20. Let me know
if it does not compile.

 Jocke
===== arch/ppc/kernel/head_8xx.S 1.41 vs edited =====
--- 1.41/arch/ppc/kernel/head_8xx.S Thu Feb 27 20:40:15 2003
+++ edited/arch/ppc/kernel/head_8xx.S Mon Mar 24 23:31:27 2003
@@ -451,6 +451,13 @@
 #endif
  mtspr MD_RPN, r20 /* Update TLB entry */

+ /* The 20 msb of MD_EPN and DAR must be the same when rfi is
+  * executed. The dcxx instructions don't set DAR when they
+  * cause a DTLB Miss so copy them from MD_EPN.
+  */
+ mfspr r20, MD_EPN
+ mtspr DAR, r20
+
  mfspr r20, M_TW /* Restore registers */
  lwz r21, 0(r0)
  mtcr r21
@@ -460,7 +467,18 @@
 #endif
  rfi

-2: mfspr r20, M_TW /* Restore registers */
+2:
+ /* Copy 20 msb from EPN to DAR since the dcxx instuctions fails
+  * update the DAR when they cause a DTLB Miss.
+  */
+ mfspr r21, MD_EPN
+ rlwinm r21, r21, 0, 0, 19
+ mfspr r20, DAR
+ rlwinm r20, r20, 0, 20, 31
+ or r20, r20, r21
+ mtspr DAR, r20
+
+ mfspr r20, M_TW /* Restore registers */
  lwz r21, 0(r0)
  mtcr r21
  lwz r21, 4(r0)
@@ -504,6 +522,9 @@
  andis. r21, r20, 0x0200 /* If set, indicates store op */
  beq 2f

+#if 0
+ /* Maybe this should stay? Time will tell */
+
  /* The EA of a data TLB miss is automatically stored in the MD_EPN
   * register.  The EA of a data TLB error is automatically stored in
   * the DAR, but not the MD_EPN register.  We must copy the 20 most
@@ -531,7 +552,7 @@
  lwz r3, 12(r0)
 #endif
  mtspr MD_EPN, r21
-
+#endif
  mfspr r20, M_TWB /* Get level 1 table entry address */

  /* If we are faulting a kernel address, we have to use the
===== arch/ppc/kernel/misc.S 1.80 vs edited =====
--- 1.80/arch/ppc/kernel/misc.S Thu Mar  6 06:36:05 2003
+++ edited/arch/ppc/kernel/misc.S Mon Mar 24 23:33:53 2003
@@ -664,7 +664,7 @@
 _GLOBAL(clear_page)
  li r0,4096/L1_CACHE_LINE_SIZE
  mtctr r0
-#ifdef CONFIG_8xx
+#ifdef CONFIG_8xx_CPU6
  li r4, 0
 1: stw r4, 0(r3)
  stw r4, 4(r3)
@@ -698,7 +698,7 @@
  addi r4,r4,-4
  li r5,4

-#ifndef CONFIG_8xx
+#ifndef CONFIG_8xx_CPU6
 #if MAX_COPY_PREFETCH > 1
  li r0,MAX_COPY_PREFETCH
  li r11,4
@@ -706,7 +706,7 @@
 11: dcbt r11,r4
  addi r11,r11,L1_CACHE_LINE_SIZE
  bdnz 11b
-#else /* MAX_L1_COPY_PREFETCH == 1 */
+#elif !defined(CONFIG_8xx) /* MAX_L1_COPY_PREFETCH == 1 */
  dcbt r5,r4
  li r11,L1_CACHE_LINE_SIZE+4
 #endif /* MAX_L1_COPY_PREFETCH */
@@ -715,8 +715,10 @@
  li r0,4096/L1_CACHE_LINE_SIZE
  mtctr r0
 1:
+#ifndef CONFIG_8xx_CPU6
 #ifndef CONFIG_8xx
- dcbt r11,r4
+ dcbt r11,r4 /* Makes 8xx slower */
+#endif
  dcbz r5,r3
 #endif
  COPY_16_BYTES
===== arch/ppc/lib/string.S 1.20 vs edited =====
--- 1.20/arch/ppc/lib/string.S Thu Feb 27 20:40:16 2003
+++ edited/arch/ppc/lib/string.S Mon Mar 24 23:34:20 2003
@@ -151,7 +151,7 @@
  bdnz 4b
 3: mtctr r9
  li r7,4
-#if !defined(CONFIG_8xx)
+#if !defined(CONFIG_8xx_CPU6)
 10: dcbz r7,r6
 #else
 10: stw r4, 4(r6)
@@ -253,7 +253,7 @@
  mtctr r0
  beq 63f
 53:
-#if !defined(CONFIG_8xx)
+#if !defined(CONFIG_8xx_CPU6)
  dcbz r11,r6
 #endif
  COPY_16_BYTES
@@ -427,7 +427,7 @@
  li r11,4
  beq 63f

-#if !defined(CONFIG_8xx)
+#if !defined(CONFIG_8xx_CPU6)
  /* Here we decide how far ahead to prefetch the source */
 #if MAX_COPY_PREFETCH > 1
  /* Heuristically, for large transfers we prefetch
@@ -442,7 +442,7 @@
 112: dcbt r3,r4
  addi r3,r3,CACHELINE_BYTES
  bdnz 112b
-#else /* MAX_COPY_PREFETCH == 1 */
+#elif !defined(CONFIG_8xx) /* MAX_COPY_PREFETCH == 1 */
  li r3,CACHELINE_BYTES + 4
  dcbt r11,r4
 #endif /* MAX_COPY_PREFETCH */
@@ -450,8 +450,10 @@

  mtctr r0
 53:
+#if !defined(CONFIG_8xx_CPU6)
 #if !defined(CONFIG_8xx)
- dcbt r3,r4
+ dcbt r3,r4 /* Makes 8xx slower */
+#endif
 54: dcbz r11,r6
 #endif
 /* had to move these to keep extable in order */
@@ -461,7 +463,7 @@
  .long 71b,101f
  .long 72b,102f
  .long 73b,103f
-#if !defined(CONFIG_8xx)
+#if !defined(CONFIG_8xx_CPU6)
  .long 54b,105f
 #endif
  .text


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  parent reply	other threads:[~2003-03-24 22:44 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-24 10:19 dcbz works on 862 everywhere! Joakim Tjernlund
2003-03-24 11:01 ` Joakim Tjernlund
2003-03-24 12:25 ` Joakim Tjernlund
2003-03-24 14:20   ` Joakim Tjernlund
2003-03-24 17:09     ` Till Straumann
2003-03-24 17:42       ` Joakim Tjernlund
2003-03-24 20:15 ` Tom Rini
2003-03-24 20:57   ` Joakim Tjernlund
2003-03-24 21:07     ` Tom Rini
2003-03-24 21:54       ` Joakim Tjernlund
2003-03-24 22:59         ` Dan Malek
2003-03-25  0:33           ` Joakim Tjernlund
2003-03-24 21:42     ` Dan Malek
2003-03-24 21:51       ` Joakim Tjernlund
2003-03-24 22:44   ` Joakim Tjernlund [this message]
2003-03-24 23:09     ` Dan Malek
2003-03-24 23:57       ` Joakim Tjernlund
2003-03-25  0:48         ` Dan Malek
2003-03-25  1:22           ` Dan Malek
2003-03-25 14:02             ` Joakim Tjernlund
2003-03-26  2:17               ` Till Straumann
2003-03-26  7:57                 ` Joakim Tjernlund
2003-03-26 15:18                 ` Dan Malek
2003-03-26 17:04                   ` Joakim Tjernlund
2003-03-26 18:52                     ` Dan Malek
2003-03-27 21:49                       ` Joakim Tjernlund
2003-03-26 18:11                   ` Till Straumann
2003-03-26 19:06                     ` Dan Malek
2003-03-26 22:42                       ` mpc8xx DCBZ (&friends) hw bug. Tests, analysis + conclusions Till Straumann
2003-03-27  1:25                       ` Till Straumann
2003-03-27 14:01                         ` Joakim Tjernlund
2003-04-03 12:50                         ` Joakim Tjernlund
2003-04-08 10:47                           ` Joakim Tjernlund
2003-04-08 16:25                             ` Till Straumann
2003-04-08 16:42                               ` Joakim Tjernlund
2003-04-08 16:52                               ` Joakim Tjernlund
2003-04-08 21:01                               ` Dan Malek
2003-04-08 17:25                             ` Joakim Tjernlund
2003-04-08 18:14                               ` Tom Rini
2003-04-08 21:07                                 ` Joakim Tjernlund
2003-05-09 12:37                             ` Joakim Tjernlund
2003-04-01  9:37                       ` dcbz works on 862 everywhere! Joakim Tjernlund
2003-04-04 15:09                         ` Joakim Tjernlund
2003-04-04 15:43                           ` Dan Malek
2003-04-04 16:37                             ` Joakim Tjernlund
2003-04-09 14:32                             ` Joakim Tjernlund
2003-03-26 18:52                   ` Till Straumann
2003-03-25  1:57           ` Joakim Tjernlund
2003-03-25 17:37             ` Joakim Tjernlund
2003-03-26 15:22               ` Dan Malek
2003-03-26 17:09                 ` Joakim Tjernlund

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='006601c2f256$e6ff5e80$020120b0@jockeXP' \
    --to=joakim.tjernlund@lumentis.se \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=strauman@SLAC.Stanford.EDU \
    --cc=trini@kernel.crashing.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;
as well as URLs for NNTP newsgroup(s).