Please try the following revert diff. It works for me on that particular
non-ioapic system with yds(4).
Index: arch/i386/i386/locore.s
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/locore.s,v
retrieving revision 1.150
diff -u -p -r1.150 locore.s
--- arch/i386/i386/locore.s 11 Feb 2015 00:16:07 -0000 1.150
+++ arch/i386/i386/locore.s 26 Feb 2015 20:37:20 -0000
@@ -104,7 +104,6 @@
* These are used on interrupt or trap entry or exit.
*/
#define INTRENTRY \
- cld ; \
pushl %eax ; \
pushl %ecx ; \
pushl %edx ; \
Index: lib/libkern/arch/i386/bcmp.S
===================================================================
RCS file: /cvs/src/sys/lib/libkern/arch/i386/bcmp.S,v
retrieving revision 1.3
diff -u -p -r1.3 bcmp.S
--- lib/libkern/arch/i386/bcmp.S 29 Nov 2014 18:51:23 -0000 1.3
+++ lib/libkern/arch/i386/bcmp.S 26 Feb 2015 20:37:21 -0000
@@ -13,6 +13,7 @@ ENTRY(bcmp)
movl 12(%esp),%edi
movl 16(%esp),%esi
xorl %eax,%eax /* clear return value */
+ cld /* set compare direction forward */
movl 20(%esp),%ecx /* compare by words */
shrl $2,%ecx
Index: lib/libkern/arch/i386/bzero.S
===================================================================
RCS file: /cvs/src/sys/lib/libkern/arch/i386/bzero.S,v
retrieving revision 1.5
diff -u -p -r1.5 bzero.S
--- lib/libkern/arch/i386/bzero.S 29 Nov 2014 18:51:23 -0000 1.5
+++ lib/libkern/arch/i386/bzero.S 26 Feb 2015 20:37:21 -0000
@@ -13,6 +13,7 @@ ENTRY(bzero)
movl 8(%esp),%edi
movl 12(%esp),%edx
+ cld /* set fill direction forward */
xorl %eax,%eax /* set fill data to 0 */
/*
Index: lib/libkern/arch/i386/memchr.S
===================================================================
RCS file: /cvs/src/sys/lib/libkern/arch/i386/memchr.S,v
retrieving revision 1.2
diff -u -p -r1.2 memchr.S
--- lib/libkern/arch/i386/memchr.S 29 Nov 2014 18:51:23 -0000 1.2
+++ lib/libkern/arch/i386/memchr.S 26 Feb 2015 20:37:21 -0000
@@ -14,6 +14,7 @@ ENTRY(memchr)
movl 16(%esp),%ecx /* set length of search */
testl %ecx,%ecx /* test for len == 0 */
jz L1
+ cld /* set search forward */
repne /* search! */
scasb
jne L1 /* scan failed, return null */
Index: lib/libkern/arch/i386/memcmp.S
===================================================================
RCS file: /cvs/src/sys/lib/libkern/arch/i386/memcmp.S,v
retrieving revision 1.2
diff -u -p -r1.2 memcmp.S
--- lib/libkern/arch/i386/memcmp.S 29 Nov 2014 18:51:23 -0000 1.2
+++ lib/libkern/arch/i386/memcmp.S 26 Feb 2015 20:37:21 -0000
@@ -12,6 +12,7 @@ ENTRY(memcmp)
pushl %esi
movl 12(%esp),%edi
movl 16(%esp),%esi
+ cld /* set compare direction forward */
movl 20(%esp),%ecx /* compare by words */
shrl $2,%ecx
Index: lib/libkern/arch/i386/memmove.S
===================================================================
RCS file: /cvs/src/sys/lib/libkern/arch/i386/memmove.S,v
retrieving revision 1.7
diff -u -p -r1.7 memmove.S
--- lib/libkern/arch/i386/memmove.S 29 Nov 2014 18:51:23 -0000 1.7
+++ lib/libkern/arch/i386/memmove.S 26 Feb 2015 20:37:21 -0000
@@ -74,6 +74,7 @@ ENTRY(memcpy)
movl 20(%esp),%ecx
docopyf:
movl %edi,%eax # setup return value for memcpy/memmove
+ cld # copy forward
shrl $2,%ecx # copy by 32-bit words
rep
movsl
Index: lib/libkern/arch/i386/memset.S
===================================================================
RCS file: /cvs/src/sys/lib/libkern/arch/i386/memset.S,v
retrieving revision 1.4
diff -u -p -r1.4 memset.S
--- lib/libkern/arch/i386/memset.S 29 Nov 2014 18:51:23 -0000 1.4
+++ lib/libkern/arch/i386/memset.S 26 Feb 2015 20:37:21 -0000
@@ -15,6 +15,8 @@ ENTRY(memset)
movl 20(%esp),%ecx
pushl %edi /* push address of buffer */
+ cld /* set fill direction forward */
+
/*
* if the string is too short, it's really not worth the overhead
* of aligning to word boundaries, etc. So we jump to a plain
Index: lib/libkern/arch/i386/scanc.S
===================================================================
RCS file: /cvs/src/sys/lib/libkern/arch/i386/scanc.S,v
retrieving revision 1.3
diff -u -p -r1.3 scanc.S
--- lib/libkern/arch/i386/scanc.S 29 Nov 2014 18:51:23 -0000 1.3
+++ lib/libkern/arch/i386/scanc.S 26 Feb 2015 20:37:21 -0000
@@ -42,6 +42,7 @@ ENTRY(scanc)
movl 20(%esp),%edi
movb 24(%esp),%dl
xorl %eax,%eax
+ cld
1:
lodsb
testb %dl,(%eax,%edi)
Index: lib/libkern/arch/i386/skpc.S
===================================================================
RCS file: /cvs/src/sys/lib/libkern/arch/i386/skpc.S,v
retrieving revision 1.3
diff -u -p -r1.3 skpc.S
--- lib/libkern/arch/i386/skpc.S 29 Nov 2014 18:51:23 -0000 1.3
+++ lib/libkern/arch/i386/skpc.S 26 Feb 2015 20:37:21 -0000
@@ -37,6 +37,7 @@ ENTRY(skpc)
movl 16(%esp),%edi
movl 12(%esp),%ecx
movl 8(%esp),%eax
+ cld
repe
scasb
je 1f