exception.S (343782) | exception.S (347568) |
---|---|
1/*- 2 * Copyright (c) 1989, 1990 William F. Jolitz. 3 * Copyright (c) 1990 The Regents of the University of California. 4 * Copyright (c) 2007-2018 The FreeBSD Foundation 5 * All rights reserved. 6 * 7 * Portions of this software were developed by A. Joseph Koshy under 8 * sponsorship from the FreeBSD Foundation and Google, Inc. --- 21 unchanged lines hidden (view full) --- 30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * | 1/*- 2 * Copyright (c) 1989, 1990 William F. Jolitz. 3 * Copyright (c) 1990 The Regents of the University of California. 4 * Copyright (c) 2007-2018 The FreeBSD Foundation 5 * All rights reserved. 6 * 7 * Portions of this software were developed by A. Joseph Koshy under 8 * sponsorship from the FreeBSD Foundation and Google, Inc. --- 21 unchanged lines hidden (view full) --- 30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * |
38 * $FreeBSD: stable/11/sys/amd64/amd64/exception.S 343782 2019-02-05 17:54:02Z kib $ | 38 * $FreeBSD: stable/11/sys/amd64/amd64/exception.S 347568 2019-05-14 17:05:02Z kib $ |
39 */ 40 41#include "opt_atpic.h" 42#include "opt_compat.h" 43#include "opt_hwpmc_hooks.h" 44 45#include "assym.s" 46 --- 450 unchanged lines hidden (view full) --- 497 cli 498 testl $PCB_FULL_IRET,PCB_FLAGS(%rax) 499 jnz 4f 500 /* Check for and handle AST's on return to userland. */ 501 movq PCPU(CURTHREAD),%rax 502 testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax) 503 jne 3f 504 call handle_ibrs_exit | 39 */ 40 41#include "opt_atpic.h" 42#include "opt_compat.h" 43#include "opt_hwpmc_hooks.h" 44 45#include "assym.s" 46 --- 450 unchanged lines hidden (view full) --- 497 cli 498 testl $PCB_FULL_IRET,PCB_FLAGS(%rax) 499 jnz 4f 500 /* Check for and handle AST's on return to userland. */ 501 movq PCPU(CURTHREAD),%rax 502 testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax) 503 jne 3f 504 call handle_ibrs_exit |
505 callq *mds_handler |
|
505 /* Restore preserved registers. */ 506 MEXITCOUNT 507 movq TF_RDI(%rsp),%rdi /* bonus; preserve arg 1 */ 508 movq TF_RSI(%rsp),%rsi /* bonus: preserve arg 2 */ 509 movq TF_RDX(%rsp),%rdx /* return value 2 */ 510 movq TF_RAX(%rsp),%rax /* return value 1 */ 511 movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ 512 movq TF_RIP(%rsp),%rcx /* original %rip */ --- 621 unchanged lines hidden (view full) --- 1134ld_ds: 1135 movw TF_DS(%rsp),%ds 1136ld_regs: 1137 RESTORE_REGS 1138 testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ 1139 jz 2f /* keep running with kernel GS.base */ 1140 cli 1141 call handle_ibrs_exit_rs | 506 /* Restore preserved registers. */ 507 MEXITCOUNT 508 movq TF_RDI(%rsp),%rdi /* bonus; preserve arg 1 */ 509 movq TF_RSI(%rsp),%rsi /* bonus: preserve arg 2 */ 510 movq TF_RDX(%rsp),%rdx /* return value 2 */ 511 movq TF_RAX(%rsp),%rax /* return value 1 */ 512 movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ 513 movq TF_RIP(%rsp),%rcx /* original %rip */ --- 621 unchanged lines hidden (view full) --- 1135ld_ds: 1136 movw TF_DS(%rsp),%ds 1137ld_regs: 1138 RESTORE_REGS 1139 testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ 1140 jz 2f /* keep running with kernel GS.base */ 1141 cli 1142 call handle_ibrs_exit_rs |
1143 callq *mds_handler |
|
1142 cmpq $~0,PCPU(UCR3) 1143 je 1f 1144 pushq %rdx 1145 movq PCPU(PTI_RSP0),%rdx 1146 subq $PTI_SIZE,%rdx 1147 movq %rax,PTI_RAX(%rdx) 1148 popq %rax 1149 movq %rax,PTI_RDX(%rdx) --- 157 unchanged lines hidden --- | 1144 cmpq $~0,PCPU(UCR3) 1145 je 1f 1146 pushq %rdx 1147 movq PCPU(PTI_RSP0),%rdx 1148 subq $PTI_SIZE,%rdx 1149 movq %rax,PTI_RAX(%rdx) 1150 popq %rax 1151 movq %rax,PTI_RDX(%rdx) --- 157 unchanged lines hidden --- |