diff options
| author | Alexander Potapenko <glider@google.com> | 2025-09-18 17:34:09 +0200 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2025-09-19 08:38:14 +0000 |
| commit | 67c375600e44473aafff4ce6ff7abb90e4f4fff4 (patch) | |
| tree | f5ddae1bd763e3ccc8edf23eb8d9047c27e95c7f /sys | |
| parent | f04374a738f6693569f7e0c4ddb765081f433a0e (diff) | |
sys/linux/test: add amd64-syz_kvm_setup_syzos_vm-hlt
The new test validates that KVM exits with KVM_EXIT_HLT when
encountering the x86 HLT instruction.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/linux/test/amd64-syz_kvm_setup_syzos_vm-hlt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/linux/test/amd64-syz_kvm_setup_syzos_vm-hlt b/sys/linux/test/amd64-syz_kvm_setup_syzos_vm-hlt new file mode 100644 index 000000000..1a416ce4e --- /dev/null +++ b/sys/linux/test/amd64-syz_kvm_setup_syzos_vm-hlt @@ -0,0 +1,17 @@ +# +# requires: arch=amd64 -threaded +# +r0 = openat$kvm(0, &AUTO='/dev/kvm\x00', 0x0, 0x0) +r1 = ioctl$KVM_CREATE_VM(r0, AUTO, 0x0) +r2 = syz_kvm_setup_syzos_vm$x86(r1, &(0x7f0000c00000/0x400000)=nil) + +# 0xf4 is the HLT instruction. +# +r3 = syz_kvm_add_vcpu$x86(r2, &AUTO={0x0, &AUTO=[@code={AUTO, AUTO, {"f4", 0x1}}], AUTO}) +r4 = ioctl$KVM_GET_VCPU_MMAP_SIZE(r0, AUTO) +r5 = mmap$KVM_VCPU(&(0x7f0000009000/0x1000)=nil, r4, 0x3, 0x1, r3, 0x0) + +# KVM_RUN should exit with KVM_EXIT_HLT = 0x5. +# +ioctl$KVM_RUN(r3, AUTO, 0x0) +syz_kvm_assert_syzos_kvm_exit$x86(r5, 0x5) |
