id = 2977 title = "QEMU SVM VMCB exit_code is uint32_t when AMD spec requires uint64_t" state = "opened" created_at = "2025-05-22T14:39:46.478Z" closed_at = "n/a" labels = [] url = "https://gitlab.com/qemu-project/qemu/-/issues/2977" host-os = "Linux" host-arch = "x86_64" qemu-version = "QEMU emulator version 10.0.0" guest-os = "Custom Type 1 Hypervisor" guest-arch = "x86_64" description = """QEMU's SVM implementation incorrectly uses a 32-bit parameter for the exit code in the `cpu_vmexit` function, despite the AMD SVM specification requiring a 64-bit exit code field in the VMCB (Virtual Machine Control Block). I think the issue is in `target/i386/svm.c` in the `cpu_vmexit` function. The `exit_code` parameter is declared as `uint32_t` but should be `uint64_t` according to the AMD SVM specification. This causes exit codes to be truncated to 32 bits, resulting in values like 0xffff_ffff instead of the expected 0xffff_ffff_ffff_ffff.""" reproduce = """""" additional = """[this](https://stackoverflow.com/questions/79632531/qemu-svm-vmcb-exit-code-is-uint32-t-when-amd-spec-requires-uint64-t?noredirect=1#comment140448815_79632531) question I posted on stack overflow"""