linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Joakim Tjernlund" <Joakim.Tjernlund@lumentis.se>
To: "Dan Malek" <dan@embeddededge.com>
Cc: "Tom Rini" <trini@kernel.crashing.org>,
	"Linuxppc-Embedded@Lists. Linuxppc. Org"
	<linuxppc-embedded@lists.linuxppc.org>,
	<strauman@SLAC.Stanford.EDU>
Subject: Re: dcbz works on 862 everywhere!
Date: Tue, 25 Mar 2003 00:57:38 +0100	[thread overview]
Message-ID: <000b01c2f261$292427a0$020120b0@jockeXP> (raw)
In-Reply-To: 3E7F9017.2000900@embeddededge.com


> Joakim Tjernlund wrote:
>
> > OK, here it goes.
>
> No, this isn't correct......
>
>
> > + /* 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.
>
> No, don't be screwing around with these registers.

Did you read my mails? This is the key.
What harm can it do? This is much less intrusive than the
"copy DAR to MD_EPN" part in the TLB Error handler.

>
>
>
> > -#ifdef CONFIG_8xx
> > +#ifdef CONFIG_8xx_CPU6
>
> What is this all about?  The CPU6 errata is a clearly defined
> problem on well known silicon revisions.  Don't be using it where
> it isn't intended.

OK, I have removed all CONFIG_8xx_CPU6 and CONFIG_8xx
I restored the "copy DAR to MD_EPN"  in the TLB Error hanler as well.

>
> Please try again..........thanks.


Here it is:
===== 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 Tue Mar 25 00:43:39 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)
===== 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 Tue Mar 25 00:41:16 2003
@@ -664,15 +664,7 @@
 _GLOBAL(clear_page)
  li r0,4096/L1_CACHE_LINE_SIZE
  mtctr r0
-#ifdef CONFIG_8xx
- li r4, 0
-1: stw r4, 0(r3)
- stw r4, 4(r3)
- stw r4, 8(r3)
- stw r4, 12(r3)
-#else
 1: dcbz 0,r3
-#endif
  addi r3,r3,L1_CACHE_LINE_SIZE
  bdnz 1b
  blr
@@ -698,7 +690,6 @@
  addi r4,r4,-4
  li r5,4

-#ifndef CONFIG_8xx
 #if MAX_COPY_PREFETCH > 1
  li r0,MAX_COPY_PREFETCH
  li r11,4
@@ -706,7 +697,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 */
@@ -716,9 +707,10 @@
  mtctr r0
 1:
 #ifndef CONFIG_8xx
- dcbt r11,r4
- dcbz r5,r3
+ dcbt r11,r4 /* Makes 8xx slower */
 #endif
+ dcbz r5,r3
+
  COPY_16_BYTES
 #if L1_CACHE_LINE_SIZE >= 32
  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 Tue Mar 25 00:42:56 2003
@@ -151,14 +151,7 @@
  bdnz 4b
 3: mtctr r9
  li r7,4
-#if !defined(CONFIG_8xx)
 10: dcbz r7,r6
-#else
-10: stw r4, 4(r6)
- stw r4, 8(r6)
- stw r4, 12(r6)
- stw r4, 16(r6)
-#endif
  addi r6,r6,CACHELINE_BYTES
  bdnz 10b
  clrlwi r5,r8,32-LG_CACHELINE_BYTES
@@ -253,9 +246,8 @@
  mtctr r0
  beq 63f
 53:
-#if !defined(CONFIG_8xx)
  dcbz r11,r6
-#endif
+
  COPY_16_BYTES
 #if L1_CACHE_LINE_SIZE >= 32
  COPY_16_BYTES
@@ -427,7 +419,6 @@
  li r11,4
  beq 63f

-#if !defined(CONFIG_8xx)
  /* Here we decide how far ahead to prefetch the source */
 #if MAX_COPY_PREFETCH > 1
  /* Heuristically, for large transfers we prefetch
@@ -442,7 +433,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 */
@@ -451,9 +442,9 @@
  mtctr r0
 53:
 #if !defined(CONFIG_8xx)
- dcbt r3,r4
-54: dcbz r11,r6
+ dcbt r3,r4 /* Makes 8xx slower */
 #endif
+54: dcbz r11,r6
 /* had to move these to keep extable in order */
  .section __ex_table,"a"
  .align 2
@@ -461,9 +452,7 @@
  .long 71b,101f
  .long 72b,102f
  .long 73b,103f
-#if !defined(CONFIG_8xx)
  .long 54b,105f
-#endif
  .text
 /* the main body of the cacheline loop */
  COPY_16_BYTES_WITHEX(0)


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

  reply	other threads:[~2003-03-24 23:57 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
2003-03-24 23:09     ` Dan Malek
2003-03-24 23:57       ` Joakim Tjernlund [this message]
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='000b01c2f261$292427a0$020120b0@jockeXP' \
    --to=joakim.tjernlund@lumentis.se \
    --cc=dan@embeddededge.com \
    --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).