1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef SELFTEST_KVM_UTIL_ARCH_H
3 #define SELFTEST_KVM_UTIL_ARCH_H
4 
5 #include <stdbool.h>
6 #include <stdint.h>
7 
8 struct kvm_vm_arch {
9 	uint64_t c_bit;
10 	uint64_t s_bit;
11 	int sev_fd;
12 	bool is_pt_protected;
13 };
14 
15 static inline bool __vm_arch_has_protected_memory(struct kvm_vm_arch *arch)
16 {
17 	return arch->c_bit || arch->s_bit;
18 }
19 
20 #define vm_arch_has_protected_memory(vm) \
21 	__vm_arch_has_protected_memory(&(vm)->arch)
22 
23 #endif  // SELFTEST_KVM_UTIL_ARCH_H
24