>+/* Set debug control for trapped instruction exiting to userspace */ >+static void vcpu_set_debug_exit_userspace(struct kvm_vm *vm, int vcpuid, >+ struct kvm_guest_debug *debug) { The debug argument looks pointless. Probably you can remove it. >+ memset(debug, 0, sizeof(*debug)); >+ debug->control = KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_EXIT_USERSPACE; >+ vcpu_set_guest_debug(vm, VCPU_ID_1, debug); >+}