diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2022-08-18 04:07:29 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2022-08-24 19:12:05 +0000 |
commit | e8b2980e4a126407e15d33ee8d987385c8321261 (patch) | |
tree | 883b6acff6937510cbd5cd6e2d83ab1a0c4e2a34 | |
parent | dc4a2d1d0e838579f21d9d1fef8655f902f06ab2 (diff) | |
download | src-e8b2980e4a126407e15d33ee8d987385c8321261.tar.gz src-e8b2980e4a126407e15d33ee8d987385c8321261.zip |
i386 doreti: stop saving/restoring %ecx around calls into C
There is no reason to do this. Instead just calculate it later.
Reviewed by: jhb
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36302
-rw-r--r-- | sys/i386/i386/exception.s | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index 5eef9c1d512c..8279a4602ebf 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -518,22 +518,21 @@ doreti_exit: je doreti_iret_nmi cmpl $T_TRCTRAP, TF_TRAPNO(%esp) je doreti_iret_nmi - movl $TF_SZ, %ecx testl $PSL_VM,TF_EFLAGS(%esp) - jz 1f /* PCB_VM86CALL is not set */ - addl $VM86_STACK_SPACE, %ecx - jmp 2f -1: testl $SEL_RPL_MASK, TF_CS(%esp) + jnz 1f /* PCB_VM86CALL is not set */ + testl $SEL_RPL_MASK, TF_CS(%esp) jz doreti_popl_fs -2: movl $handle_ibrs_exit,%eax - pushl %ecx /* preserve enough call-used regs */ +1: movl $handle_ibrs_exit,%eax call *%eax movl mds_handler,%eax call *%eax - popl %ecx movl %esp, %esi movl PCPU(TRAMPSTK), %edx - subl %ecx, %edx + movl $TF_SZ, %ecx + testl $PSL_VM,TF_EFLAGS(%esp) + jz 2f /* PCB_VM86CALL is not set */ + addl $VM86_STACK_SPACE, %ecx +2: subl $TF_SZ, %edx movl %edx, %edi rep; movsb movl %edx, %esp |