kernel - Clear the quick-return flag when changing PSL_IOPL.
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 8 Dec 2011 04:18:07 +0000 (20:18 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 8 Dec 2011 04:18:07 +0000 (20:18 -0800)
* Make sure we do a full syscall return when changing PSL_IOPL.

sys/platform/pc64/x86_64/sysarch.c

index c2a875b..cb8fd52 100644 (file)
  */
 #include <sys/types.h>
 #include <sys/kernel.h>
+#include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/sysproto.h>
 #include <sys/memrange.h>
 #include <sys/errno.h>
 #include <sys/proc.h>
 
+#include <machine/cpu.h>
+
 int
 sys_sysarch(struct sysarch_args *uap)
 {
@@ -49,6 +52,7 @@ int
 cpu_set_iopl(void)
 {
        curthread->td_lwp->lwp_md.md_regs->tf_rflags |= PSL_IOPL;
+       clear_quickret();
        return(0);
 }
 
@@ -56,6 +60,7 @@ int
 cpu_clr_iopl(void)
 {
        curthread->td_lwp->lwp_md.md_regs->tf_rflags &= ~PSL_IOPL;
+       clear_quickret();
        return(0);
 }