summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-06-23 20:44:07 +0000
committerkib <kib@FreeBSD.org>2010-06-23 20:44:07 +0000
commit8dcd1daee8fe0803727673a014545c545bf684e4 (patch)
tree6f2a6ce8d3aa678205f3ae8e8fe722441473ab3e /sys/i386
parent1cd81ae69301b363e554de070b5f1f28f5b93d17 (diff)
downloadFreeBSD-src-8dcd1daee8fe0803727673a014545c545bf684e4.zip
FreeBSD-src-8dcd1daee8fe0803727673a014545c545bf684e4.tar.gz
Clear DF bit in eflags/rflags on the kernel entry. The i386 and amd64
ABI specifies the DF should be zero, and newer compilers do not clear DF before using DF-sensitive instructions. The DF clearing for signal handlers was done some time ago. MFC after: 1 week
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/apic_vector.s8
-rw-r--r--sys/i386/i386/atpic_vector.s1
-rw-r--r--sys/i386/i386/exception.s3
3 files changed, 12 insertions, 0 deletions
diff --git a/sys/i386/i386/apic_vector.s b/sys/i386/i386/apic_vector.s
index e3000e1..cbe3871 100644
--- a/sys/i386/i386/apic_vector.s
+++ b/sys/i386/i386/apic_vector.s
@@ -56,6 +56,7 @@
IDTVEC(vec_name) ; \
PUSH_FRAME ; \
SET_KERNEL_SREGS ; \
+ cld ; \
FAKE_MCOUNT(TF_EIP(%esp)) ; \
movl lapic, %edx ; /* pointer to local APIC */ \
movl LA_ISR + 16 * (index)(%edx), %eax ; /* load ISR */ \
@@ -103,6 +104,7 @@ IDTVEC(spuriousint)
IDTVEC(timerint)
PUSH_FRAME
SET_KERNEL_SREGS
+ cld
FAKE_MCOUNT(TF_EIP(%esp))
pushl %esp
call lapic_handle_timer
@@ -118,6 +120,7 @@ IDTVEC(timerint)
IDTVEC(cmcint)
PUSH_FRAME
SET_KERNEL_SREGS
+ cld
FAKE_MCOUNT(TF_EIP(%esp))
call lapic_handle_cmc
MEXITCOUNT
@@ -131,6 +134,7 @@ IDTVEC(cmcint)
IDTVEC(errorint)
PUSH_FRAME
SET_KERNEL_SREGS
+ cld
FAKE_MCOUNT(TF_EIP(%esp))
call lapic_handle_error
MEXITCOUNT
@@ -302,6 +306,7 @@ IDTVEC(invlcache)
IDTVEC(ipi_intr_bitmap_handler)
PUSH_FRAME
SET_KERNEL_SREGS
+ cld
movl lapic, %edx
movl $0, LA_EOI(%edx) /* End Of Interrupt to APIC */
@@ -320,6 +325,7 @@ IDTVEC(ipi_intr_bitmap_handler)
IDTVEC(cpustop)
PUSH_FRAME
SET_KERNEL_SREGS
+ cld
movl lapic, %eax
movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */
@@ -339,6 +345,7 @@ IDTVEC(cpustop)
IDTVEC(rendezvous)
PUSH_FRAME
SET_KERNEL_SREGS
+ cld
#ifdef COUNT_IPIS
movl PCPU(CPUID), %eax
@@ -360,6 +367,7 @@ IDTVEC(rendezvous)
IDTVEC(lazypmap)
PUSH_FRAME
SET_KERNEL_SREGS
+ cld
call pmap_lazyfix_action
diff --git a/sys/i386/i386/atpic_vector.s b/sys/i386/i386/atpic_vector.s
index 0e4e1b6..a477aee 100644
--- a/sys/i386/i386/atpic_vector.s
+++ b/sys/i386/i386/atpic_vector.s
@@ -49,6 +49,7 @@
IDTVEC(vec_name) ; \
PUSH_FRAME ; \
SET_KERNEL_SREGS ; \
+ cld ; \
; \
FAKE_MCOUNT(TF_EIP(%esp)) ; \
pushl %esp ; \
diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s
index 9db9532..575b98d 100644
--- a/sys/i386/i386/exception.s
+++ b/sys/i386/i386/exception.s
@@ -159,6 +159,7 @@ alltraps:
pushl %fs
alltraps_with_regs_pushed:
SET_KERNEL_SREGS
+ cld
FAKE_MCOUNT(TF_EIP(%esp))
calltrap:
pushl %esp
@@ -233,6 +234,7 @@ IDTVEC(lcall_syscall)
pushl %es
pushl %fs
SET_KERNEL_SREGS
+ cld
FAKE_MCOUNT(TF_EIP(%esp))
pushl %esp
call syscall
@@ -256,6 +258,7 @@ IDTVEC(int0x80_syscall)
pushl %es
pushl %fs
SET_KERNEL_SREGS
+ cld
FAKE_MCOUNT(TF_EIP(%esp))
pushl %esp
call syscall
OpenPOWER on IntegriCloud