diff options
| author | Alexander Potapenko <glider@google.com> | 2025-11-19 11:53:31 +0100 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2025-11-20 09:23:19 +0000 |
| commit | f789f57f25de937cc56a2628ee6757af1ae60534 (patch) | |
| tree | e222fdeb0cf6a6e5320ef7e6571c1d34aa112bf2 /executor | |
| parent | 26ee5237507419c1fa5dea5b2a84a0b7dcce9307 (diff) | |
executor: x86: retire UEXIT_STOP_L2
It was useful initially for vendor-agnostic tests, but given that we
have guest_uexit_l2() right before it, we can save an extra L2-L1 exit.
Perhaps this should increase the probability of executing more complex
payloads (fewer KVM_RUN calls to reach the same point in L2 code).
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/common_kvm_amd64_syzos.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/executor/common_kvm_amd64_syzos.h b/executor/common_kvm_amd64_syzos.h index 26e1297a2..dc092409b 100644 --- a/executor/common_kvm_amd64_syzos.h +++ b/executor/common_kvm_amd64_syzos.h @@ -107,7 +107,6 @@ typedef enum { UEXIT_END = (uint64)-1, UEXIT_IRQ = (uint64)-2, UEXIT_ASSERT = (uint64)-3, - UEXIT_STOP_L2 = (uint64)-4, } uexit_code; typedef enum { @@ -1117,11 +1116,10 @@ guest_handle_nested_vmentry_intel(struct api_call_1* cmd, uint64 cpu_id, bool is // VMLAUNCH/VMRESUME failed, so VMCS is still valid and can be read. vmx_error_code = vmread(VMCS_VM_INSTRUCTION_ERROR); guest_uexit(0xE2E10000 | (uint32)vmx_error_code); - } else { - // This path is only taken if VMLAUNCH/VMRESUME truly succeeded (CF=0 and ZF=0) - // and the L2 guest has run and exited. - guest_uexit(UEXIT_STOP_L2); + return; } + // If we get here, this means VMLAUNCH/VMRESUME truly succeeded (CF=0 and ZF=0) + // and the L2 guest has run and exited. } GUEST_CODE static noinline void @@ -1148,7 +1146,6 @@ guest_run_amd_vm(uint64 cpu_id, uint64 vm_id) // VMRUN succeeded and we have a VM-exit. uint64 exit_reason = vmcb_read64(vmcb_ptr, VMCB_EXIT_CODE); nested_vm_exit_handler_amd(exit_reason, cpu_id, vm_id); - guest_uexit(UEXIT_STOP_L2); } GUEST_CODE static noinline void |
