Re: [PATCH 4/4] selftests: kvm: add get_emulated_cpuid test

2021-04-01 Thread Emanuele Giuseppe Esposito
+static void check_cpuid(struct kvm_cpuid2 *cpuid, struct kvm_cpuid_entry2 *entrie) +{ + int i; + + for (i = 0; i < cpuid->nent; i++) { + if (cpuid->entries[i].function == entrie->function && + cpuid->entries[i].index == entrie->index) { +

Re: [PATCH 4/4] selftests: kvm: add get_emulated_cpuid test

2021-04-01 Thread Vitaly Kuznetsov
Emanuele Giuseppe Esposito writes: > Introduce a new selftest for the KVM_GET_EMULATED_CPUID > ioctl. Since the behavior and functionality is similar to > get_cpuid_test, the test checks: > > 1) checks for corner case in the nent field of the struct kvm_cpuid2. > 2) sets and gets it as cpuid

[PATCH 4/4] selftests: kvm: add get_emulated_cpuid test

2021-03-30 Thread Emanuele Giuseppe Esposito
Introduce a new selftest for the KVM_GET_EMULATED_CPUID ioctl. Since the behavior and functionality is similar to get_cpuid_test, the test checks: 1) checks for corner case in the nent field of the struct kvm_cpuid2. 2) sets and gets it as cpuid from the guest VM Signed-off-by: Emanuele Giuseppe