mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-04 12:54:37 +08:00
7fbc6038ac
Cache a vCPU's CPUID information in "struct kvm_vcpu" to allow fixing the mess where tests, often unknowingly, modify the global/static "cpuid" allocated by kvm_get_supported_cpuid(). Add vcpu_init_cpuid() to handle stuffing an entirely different CPUID model, e.g. during vCPU creation or when switching to the Hyper-V enabled CPUID model. Automatically refresh the cache on vcpu_set_cpuid() so that any adjustments made by KVM are always reflected in the cache. Drop vcpu_get_cpuid() entirely to force tests to use the cache, and to allow adding e.g. vcpu_get_cpuid_entry() in the future without creating a conflicting set of APIs where vcpu_get_cpuid() does KVM_GET_CPUID2, but vcpu_get_cpuid_entry() does not. Opportunistically convert the VMX nested state test and KVM PV test to manipulating the vCPU's CPUID (because it's easy), but use vcpu_init_cpuid() for the Hyper-V features test and "emulator error" test to effectively retain their current behavior as they're less trivial to convert. Signed-off-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/r/20220614200707.3315957-19-seanjc@google.com |
||
---|---|---|
.. | ||
aarch64 | ||
include | ||
lib | ||
s390x | ||
x86_64 | ||
.gitignore | ||
access_tracking_perf_test.c | ||
config | ||
demand_paging_test.c | ||
dirty_log_perf_test.c | ||
dirty_log_test.c | ||
hardware_disable_test.c | ||
kvm_binary_stats_test.c | ||
kvm_create_max_vcpus.c | ||
kvm_page_table_test.c | ||
Makefile | ||
max_guest_memory_test.c | ||
memslot_modification_stress_test.c | ||
memslot_perf_test.c | ||
rseq_test.c | ||
set_memory_region_test.c | ||
settings | ||
steal_time.c | ||
system_counter_offset_test.c |