From 5c74d2f73618084fe35322dbb04bf713f7d177f2 Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Wed, 19 Nov 2025 15:45:40 +0100 Subject: 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. --- executor/kvm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'executor/kvm.h') 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) -- cgit mrf-deployment