PERFORCE change 185088 for review

John Baldwin jhb at FreeBSD.org
Mon Oct 25 16:11:43 UTC 2010


http://p4web.freebsd.org/@@185088?ac=10

Change 185088 by jhb at 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) */


More information about the p4-projects mailing list