1 /*
2 * Copyright (c) 2018 The strace developers.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8 #define KVM_NO_CPUID_CALLBACK \
9 error_msg_and_skip("newer kernel (>= 4.16) is needed")
10
11 #include "ioctl_kvm_run_common.c"
12
13 #if need_print_KVM_RUN
14
15 static void
16 print_KVM_RUN(const int fd, const char *const dev, const unsigned int reason)
17 {
18 const char *str;
19
20 # define CASE_ENTRY(R) case R: str = #R; break
21 switch (reason) {
22 CASE_ENTRY(KVM_EXIT_HLT);
23 CASE_ENTRY(KVM_EXIT_IO);
24 CASE_ENTRY(KVM_EXIT_MMIO);
25 default: str = "???";
26 }
27
28 printf("ioctl(%d<%s>, KVM_RUN, 0) = 0 (%s)\n", fd, dev, str);
29 }
30
31 #endif