xref: /aosp_15_r20/external/strace/tests-m32/ioctl_kvm_run_auxstr_vcpu.c (revision cf84ac9a129d8ea9952db616b4e9b904c4bdde56)
1 #define KVM_NO_CPUID_CALLBACK	\
2 	error_msg_and_skip("newer kernel (>= 4.16) is needed")
3 
4 #include "ioctl_kvm_run_common.c"
5 
6 #if need_print_KVM_RUN
7 
8 static void
print_KVM_RUN(const int fd,const char * const dev,const unsigned int reason)9 print_KVM_RUN(const int fd, const char *const dev, const unsigned int reason)
10 {
11 	const char *str;
12 
13 # define CASE_ENTRY(R) case R: str = #R; break
14 	switch (reason) {
15 		CASE_ENTRY(KVM_EXIT_HLT);
16 		CASE_ENTRY(KVM_EXIT_IO);
17 		CASE_ENTRY(KVM_EXIT_MMIO);
18 		default: str = "???";
19 	}
20 
21 	printf("ioctl(%d<%s>, KVM_RUN, 0) = 0 (%s)\n", fd, dev, str);
22 }
23 
24 #endif
25