diff options
| author | Alexander Potapenko <glider@google.com> | 2025-11-19 15:45:40 +0100 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2025-11-20 09:23:19 +0000 |
| commit | 5c74d2f73618084fe35322dbb04bf713f7d177f2 (patch) | |
| tree | 1c3b16cd8fa7e9a93adb462870551f6d99f04e72 /executor/kvm.h | |
| parent | ec988b2fb6c4aada0b3afcd9739ad27ec64b8249 (diff) | |
executor: sys/linux: implement SYZOS_API_NESTED_VMRESUME
Provide the SYZOS API command to resume L2 execution after a VM exit,
using VMRESUME on Intel and VMRUN on AMD.
For testing purpose, implement basic handling of the INVD instruction:
- enable INVD interception on AMD (set all bits in VMCB 00Ch);
- map EXIT_REASON_INVD and VMEXIT_INVD into SYZOS_NESTED_EXIT_REASON_INVD;
- advance L2 RIP to skip to the next instruction.
While at it, perform minor refactorings of L2 exit reason handling.
sys/linux/test/amd64-syz_kvm_nested_vmresume tests the new command by
executing two instructions, INVD and HLT, in the nested VM.
Diffstat (limited to 'executor/kvm.h')
| -rw-r--r-- | executor/kvm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/executor/kvm.h b/executor/kvm.h index 53ba00888..d7c708b34 100644 --- a/executor/kvm.h +++ b/executor/kvm.h @@ -393,7 +393,7 @@ // Control Area #define VMCB_CTRL_INTERCEPT_VEC3 0x0c -#define VMCB_CTRL_INTERCEPT_HLT (1 << 24) // Bit 24 in VEC3 +#define VMCB_CTRL_INTERCEPT_VEC3_ALL (0xffffffff) #define VMCB_CTRL_INTERCEPT_VEC4 0x10 // Bits 0-9: intercept VMRUN, VMMCALL, VMLOAD, VMSAVE, STGI, CLGI, SKINIT, RDTSCP, ICEBP, WBINVD. #define VMCB_CTRL_INTERCEPT_VEC4_ALL (0x3ff) |
