Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Oct 2010 16:11:43 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 185088 for review
Message-ID:  <201010251611.o9PGBhtI052318@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@185088?ac=10

Change 185088 by jhb@jhb_jhbbsd on 2010/10/25 16:11:20

	Just conditionally re-enable interrupts in intr_restore() on x86.
	Always writing all of flags clobbers PSL_T during single stepping.
	
	Reported by:	bde

Affected files ...

.. //depot/projects/smpng/sys/amd64/include/cpufunc.h#21 edit
.. //depot/projects/smpng/sys/i386/include/cpufunc.h#46 edit

Differences ...

==== //depot/projects/smpng/sys/amd64/include/cpufunc.h#21 (text+ko) ====

@@ -43,6 +43,8 @@
 #error this file needs sys/cdefs.h as a prerequisite
 #endif
 
+#include <machine/psl.h>
+
 struct region_descriptor;
 
 #define readb(va)	(*(volatile u_int8_t *) (va))
@@ -655,7 +657,8 @@
 static __inline void
 intr_restore(register_t rflags)
 {
-	write_rflags(rflags);
+	if (rflags & PSL_I)
+		enable_intr();
 }
 
 #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */

==== //depot/projects/smpng/sys/i386/include/cpufunc.h#46 (text+ko) ====

@@ -42,6 +42,8 @@
 #error this file needs sys/cdefs.h as a prerequisite
 #endif
 
+#include <machine/psl.h>
+
 #ifdef XEN
 extern void xen_cli(void);
 extern void xen_sti(void);
@@ -669,7 +671,8 @@
 static __inline void
 intr_restore(register_t eflags)
 {
-	write_eflags(eflags);
+	if (eflags & PSL_I)
+		enable_intr();
 }
 
 #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */



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