mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
KVM: selftests: Use vcpu_get_cpuid_entry() in PV features test (sort of)
Add a new helper, vcpu_clear_cpuid_entry(), to do a RMW operation on the vCPU's CPUID model to clear a given CPUID entry, and use it to clear KVM's paravirt feature instead of operating on kvm_get_supported_cpuid()'s static "cpuid" variable. This also eliminates a user of the soon-be-defunct set_cpuid() helper. Signed-off-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/r/20220614200707.3315957-26-seanjc@google.com
This commit is contained in:
@@ -770,6 +770,17 @@ void vcpu_set_cpuid_maxphyaddr(struct kvm_vcpu *vcpu, uint8_t maxphyaddr)
|
||||
vcpu_set_cpuid(vcpu);
|
||||
}
|
||||
|
||||
void vcpu_clear_cpuid_entry(struct kvm_vcpu *vcpu, uint32_t function)
|
||||
{
|
||||
struct kvm_cpuid_entry2 *entry = vcpu_get_cpuid_entry(vcpu, function);
|
||||
|
||||
entry->eax = 0;
|
||||
entry->ebx = 0;
|
||||
entry->ecx = 0;
|
||||
entry->edx = 0;
|
||||
vcpu_set_cpuid(vcpu);
|
||||
}
|
||||
|
||||
void vcpu_set_or_clear_cpuid_feature(struct kvm_vcpu *vcpu,
|
||||
struct kvm_x86_cpu_feature feature,
|
||||
bool set)
|
||||
|
||||
Reference in New Issue
Block a user