https://github.com/klange/toaruos/blob/master/kernel/sys/ptrace.c#L289
PTRACE_SETREGS copies the value of eflags from userspace with no checks. This lets the tracer change the tracee's IOPL in the the tracee's EFLAGS. When IOPL=3 the tracee can directly talk to the hardware with port I/O from userspace.