Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jul 2006 07:55:39 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 101641 for review
Message-ID:  <200607150755.k6F7tdpM015735@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101641

Change 101641 by kmacy@kmacy_storage:sun4v_work_stable on 2006/07/15 07:54:51

	fix handling of alignment faults on user addresses in copyin and umtx

Affected files ...

.. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/trap.c#3 edit

Differences ...

==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/trap.c#3 (text+ko) ====

@@ -380,6 +380,31 @@
 			printf("trap: %ld=%s: 0x%lx at 0x%lx:0x%lx\n", trapno, trap_msg[trap_conversion[trapno]], data, tf->tf_tpc, tf->tf_tnpc);
 		case T_DATA_ERROR:
 		case T_MEM_ADDRESS_NOT_ALIGNED:
+			if (tf->tf_asi == ASI_AIUP) {
+				if (tf->tf_tpc >= (u_long)copy_nofault_begin &&
+				    tf->tf_tpc <= (u_long)copy_nofault_end) {
+					tf->tf_tpc = (u_long)copy_fault;
+					tf->tf_tnpc = tf->tf_tpc + 4;
+					error = 0;
+					break;
+				}
+				if (tf->tf_tpc >= (u_long)fs_nofault_begin &&
+				    tf->tf_tpc <= (u_long)fs_nofault_end) {
+					tf->tf_tpc = (u_long)fs_fault;
+					tf->tf_tnpc = tf->tf_tpc + 4;
+					error = 0;
+					break;
+				}
+				/* this is really too permissive, but it is needed to cope with umtx's 
+				 * casuptr
+				 */
+				tf->tf_tpc = (u_long)fs_fault;
+				tf->tf_tnpc = tf->tf_tpc + 4;
+				error = 0;
+				break;
+				
+				
+			}
 			error = 1;	
 			break;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607150755.k6F7tdpM015735>