Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64/sparc64 Fix the root cause of the hack "dis...



details:   https://anonhg.NetBSD.org/src/rev/de94cdd5a361
branches:  trunk
changeset: 777759:de94cdd5a361
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Sat Mar 03 03:17:32 2012 +0000

description:
Fix the root cause of the hack "disable optimizations for uvm_bio.c
on 32 bit kernels".

gcc converts a division in the calculation of UBC_UMAP_ADDR macro
to multiplication (smul or combination of add/sll), and the
register of its result contains a garbage in upper 32 bits (the
upper 32 bits of smul/add/sll's result isn't zero cleared).

Then it passes to pseg_get{,_real} through pmap_extract without the
zero clear of upper 32 bits in the optimization case.  So the
result of pseg_get and pmap_extact sometimes gets screwed up.

diffstat:

 sys/arch/sparc64/sparc64/locore.s |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r 9386428a917e -r de94cdd5a361 sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Sat Mar 03 03:06:30 2012 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Sat Mar 03 03:17:32 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.339 2012/02/19 21:06:30 rmind Exp $       */
+/*     $NetBSD: locore.s,v 1.340 2012/03/03 03:17:32 nakayama Exp $    */
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -5517,6 +5517,9 @@
  */
 ENTRY(pseg_get_real)
 !      flushw                  ! Make sure we don't have stack probs & lose hibits of %o
+#ifndef _LP64
+       clruw   %o1                                     ! Zero extend
+#endif
        ldx     [%o0 + PM_PHYS], %o2                    ! pmap->pm_segs
 
        srax    %o1, HOLESHIFT, %o3                     ! Check for valid address



Home | Main Index | Thread Index | Old Index