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.
This commit is contained in:
parent
34ae6a8457
commit
f8135722c9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user