Lines Matching full:kvm
4 Subject: [PATCH 14/20] ANDROID: kvm: Test that pVM memory is wiped during
7 In protected KVM mode, we expect the hypervisor to protect guest secrets
21 .../selftests/kvm/aarch64/pvm_wipe_mem.c | 174 ++++++++++++++++++
23 create mode 100644 tools/testing/selftests/kvm/aarch64/pvm_wipe_mem.c
25 diff --git a/tools/testing/selftests/kvm/aarch64/pvm_wipe_mem.c b/tools/testing/selftests/kvm/aarch…
29 +++ b/tools/testing/selftests/kvm/aarch64/pvm_wipe_mem.c
49 +#include <linux/kvm.h>
78 + int kvm, ret;
80 + kvm = open("/dev/kvm", O_RDWR | O_CLOEXEC);
81 + if (kvm < 0)
82 + ksft_exit_skip("KVM not supported\n");
84 + ret = ioctl(kvm, KVM_GET_API_VERSION, NULL);
88 + run_size = ioctl(kvm, KVM_GET_VCPU_MMAP_SIZE, NULL);
92 + return kvm;
95 +static int create_protected_vm(int kvm)
97 + int vmfd = ioctl(kvm, KVM_CREATE_VM, KVM_VM_TYPE_ARM_PROTECTED);
129 +static void teardown(int kvm, int vmfd, int vcpufd, struct kvm_run *run)
144 + ret = close(kvm);
146 + ksft_exit_fail_msg("Failed to close KVM fd: %d\n", ret);
153 + int ret, kvm, vmfd, vcpufd;
159 + kvm = get_kvm();
160 + vmfd = create_protected_vm(kvm);
193 + ksft_exit_fail_msg("Unexpected KVM exit reason: %u\n", run->exit_reason);
199 + teardown(kvm, vmfd, vcpufd, run);