diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S index 2a96a10b7c8f..3ff08bae4a92 100644 --- a/sys/amd64/amd64/cpu_switch.S +++ b/sys/amd64/amd64/cpu_switch.S @@ -100,8 +100,6 @@ ENTRY(cpu_switch) movq %r13,PCB_R13(%r8) movq %r14,PCB_R14(%r8) movq %r15,PCB_R15(%r8) - pushfq /* PSL */ - popq PCB_RFLAGS(%r8) testl $PCB_32BIT,PCB_FLAGS(%r8) jz 1f /* no, skip over */ @@ -218,8 +216,6 @@ sw1: movq PCB_R15(%r8),%r15 movq PCB_RIP(%r8),%rax movq %rax,(%rsp) - pushq PCB_RFLAGS(%r8) - popfq movq %r8, PCPU(CURPCB) movq %rsi, PCPU(CURTHREAD) /* into next thread */ @@ -269,8 +265,6 @@ ENTRY(savectx) movq %r13,PCB_R13(%rcx) movq %r14,PCB_R14(%rcx) movq %r15,PCB_R15(%rcx) - pushfq - popq PCB_RFLAGS(%rcx) /* * If fpcurthread == NULL, then the fpu h/w state is irrelevant and the diff --git a/sys/amd64/amd64/gdb_machdep.c b/sys/amd64/amd64/gdb_machdep.c index dd775e332f19..6a50d7d857ab 100644 --- a/sys/amd64/amd64/gdb_machdep.c +++ b/sys/amd64/amd64/gdb_machdep.c @@ -62,6 +62,7 @@ gdb_cpu_getreg(int regnum, size_t *regsz) case 9: return (&kdb_frame->tf_r9); case 10: return (&kdb_frame->tf_r10); case 11: return (&kdb_frame->tf_r11); + case 17: return (&kdb_frame->tf_rflags); case 18: return (&kdb_frame->tf_cs); case 19: return (&kdb_frame->tf_ss); } @@ -75,7 +76,6 @@ gdb_cpu_getreg(int regnum, size_t *regsz) case 14: return (&kdb_thrctx->pcb_r14); case 15: return (&kdb_thrctx->pcb_r15); case 16: return (&kdb_thrctx->pcb_rip); - case 17: return (&kdb_thrctx->pcb_rflags); } return (NULL); } diff --git a/sys/amd64/amd64/genassym.c b/sys/amd64/amd64/genassym.c index 6157348d0b13..e4fd1961ac19 100644 --- a/sys/amd64/amd64/genassym.c +++ b/sys/amd64/amd64/genassym.c @@ -121,7 +121,6 @@ ASSYM(PCB_RBP, offsetof(struct pcb, pcb_rbp)); ASSYM(PCB_RSP, offsetof(struct pcb, pcb_rsp)); ASSYM(PCB_RBX, offsetof(struct pcb, pcb_rbx)); ASSYM(PCB_RIP, offsetof(struct pcb, pcb_rip)); -ASSYM(PCB_RFLAGS, offsetof(struct pcb, pcb_rflags)); ASSYM(PCB_FSBASE, offsetof(struct pcb, pcb_fsbase)); ASSYM(PCB_GSBASE, offsetof(struct pcb, pcb_gsbase)); ASSYM(PCB_DS, offsetof(struct pcb, pcb_ds)); diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 424adafc5bb3..701dd33755e6 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -154,7 +154,6 @@ cpu_fork(td1, p2, td2, flags) pcb2->pcb_rsp = (register_t)td2->td_frame - sizeof(void *); pcb2->pcb_rbx = (register_t)td2; /* fork_trampoline argument */ pcb2->pcb_rip = (register_t)fork_trampoline; - pcb2->pcb_rflags = td2->td_frame->tf_rflags & ~PSL_I; /* ints disabled */ /*- * pcb2->pcb_dr*: cloned above. * pcb2->pcb_savefpu: cloned above. @@ -289,12 +288,10 @@ cpu_set_upcall(struct thread *td, struct thread *td0) pcb2->pcb_rsp = (register_t)td->td_frame - sizeof(void *); /* trampoline arg */ pcb2->pcb_rbx = (register_t)td; /* trampoline arg */ pcb2->pcb_rip = (register_t)fork_trampoline; - pcb2->pcb_rflags = PSL_KERNEL; /* ints disabled */ /* * If we didn't copy the pcb, we'd need to do the following registers: * pcb2->pcb_dr*: cloned above. * pcb2->pcb_savefpu: cloned above. - * pcb2->pcb_rflags: cloned above. * pcb2->pcb_onfault: cloned above (always NULL here?). * pcb2->pcb_[fg]sbase: cloned above */ diff --git a/sys/amd64/include/pcb.h b/sys/amd64/include/pcb.h index 305b7ff895fe..69a20b628d54 100644 --- a/sys/amd64/include/pcb.h +++ b/sys/amd64/include/pcb.h @@ -43,7 +43,7 @@ #include struct pcb { - register_t padxx[8]; + register_t __pad0[8]; /* Spare */ register_t pcb_cr3; register_t pcb_r15; register_t pcb_r14; @@ -53,7 +53,7 @@ struct pcb { register_t pcb_rsp; register_t pcb_rbx; register_t pcb_rip; - register_t pcb_rflags; + register_t __pad1; /* Spare */ register_t pcb_fsbase; register_t pcb_gsbase; u_int32_t pcb_ds;