Module Name:    src
Committed By:   nakayama
Date:           Sat Mar  3 03:17:32 UTC 2012

Modified Files:
        src/sys/arch/sparc64/sparc64: locore.s

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.339 -r1.340 src/sys/arch/sparc64/sparc64/locore.s

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.339 src/sys/arch/sparc64/sparc64/locore.s:1.340
--- src/sys/arch/sparc64/sparc64/locore.s:1.339	Sun Feb 19 21:06:30 2012
+++ src/sys/arch/sparc64/sparc64/locore.s	Sat Mar  3 03:17:32 2012
@@ -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(pmap_copy_page_phys)
  */
 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

Reply via email to