git: 2b35b717188a - main - amd64 vmx: micro-optimize vmlaunch failure path
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 24 Aug 2025 19:21:10 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=2b35b717188adb843de100c4221ec1ded13024f0
commit 2b35b717188adb843de100c4221ec1ded13024f0
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-08-23 12:52:08 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-08-24 16:28:47 +0000
amd64 vmx: micro-optimize vmlaunch failure path
Eliminate two unneeded jumps. One is the jmp to the next instruction,
where there is no requrement that vmlaunch is followed by jmp. Another
one conditionally sets %r11d value, and can be replaced by cmovcc.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D52136
---
sys/amd64/vmm/intel/vmx_support.S | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/sys/amd64/vmm/intel/vmx_support.S b/sys/amd64/vmm/intel/vmx_support.S
index 130130b64541..877e377f892d 100644
--- a/sys/amd64/vmm/intel/vmx_support.S
+++ b/sys/amd64/vmm/intel/vmx_support.S
@@ -171,13 +171,11 @@ do_launch:
*/
movq %rsp, %rdi /* point %rdi back to 'vmxctx' */
movl $VMX_VMLAUNCH_ERROR, %eax
- jmp decode_inst_error
-
+ /* FALLTHROUGH */
decode_inst_error:
movl $VM_FAIL_VALID, %r11d
- jz inst_error
- movl $VM_FAIL_INVALID, %r11d
-inst_error:
+ movl $VM_FAIL_INVALID, %esi
+ cmovnzl %esi, %r11d
movl %r11d, VMXCTX_INST_FAIL_STATUS(%rdi)
/*