Restore a part of r323722.

Do not return from interrupt using the POP_FRAME;iret instruction
sequence, always jump to doreti.

The user segments selectors saved on the stack might become invalid
because userspace manipulated LDT in a parallel thread.  trap() is
aware of such issue, but it is only prepared to handle it at iret and
segment registers load operations in doreti path.

Also remove POP_FRAME macro because it is no longer used.

Reviewed by:	bde, jhb (as part of r323722)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
kib 2017-09-28 08:46:15 +00:00
parent 81faa225ff
commit 071c00f495
2 changed files with 4 additions and 17 deletions

View File

@ -189,8 +189,7 @@ IDTVEC(xen_intr_upcall)
SUPERALIGN_TEXT
invltlb_ret:
call as_lapic_eoi
POP_FRAME
iret
jmp doreti
SUPERALIGN_TEXT
IDTVEC(invltlb)
@ -274,9 +273,7 @@ IDTVEC(cpustop)
call as_lapic_eoi
call cpustop_handler
POP_FRAME
iret
jmp doreti
/*
* Executed by a CPU when it receives an IPI_SUSPEND from another CPU.
@ -290,9 +287,7 @@ IDTVEC(cpususpend)
call as_lapic_eoi
call cpususpend_handler
POP_FRAME
jmp doreti_iret
jmp doreti
/*
* Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU.
@ -314,7 +309,6 @@ IDTVEC(rendezvous)
call smp_rendezvous_action
call as_lapic_eoi
POP_FRAME
iret
jmp doreti
#endif /* SMP */

View File

@ -153,13 +153,6 @@
pushl $0 ; \
movw %fs,(%esp)
#define POP_FRAME \
popl %fs ; \
popl %es ; \
popl %ds ; \
popal ; \
addl $4+4,%esp
/*
* Access per-CPU data.
*/