mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
Merge tag 'kvm-x86-misc-6.5' of https://github.com/kvm-x86/linux into HEAD
KVM x86 changes for 6.5: * Move handling of PAT out of MTRR code and dedup SVM+VMX code * Fix output of PIC poll command emulation when there's an interrupt * Add a maintainer's handbook to document KVM x86 processes, preferred coding style, testing expectations, etc. * Misc cleanups
This commit is contained in:
@@ -163,6 +163,25 @@ static void set_cpuid_after_run(struct kvm_vcpu *vcpu)
|
||||
ent->eax = eax;
|
||||
}
|
||||
|
||||
static void test_get_cpuid2(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct kvm_cpuid2 *cpuid = allocate_kvm_cpuid2(vcpu->cpuid->nent + 1);
|
||||
int i, r;
|
||||
|
||||
vcpu_ioctl(vcpu, KVM_GET_CPUID2, cpuid);
|
||||
TEST_ASSERT(cpuid->nent == vcpu->cpuid->nent,
|
||||
"KVM didn't update nent on success, wanted %u, got %u\n",
|
||||
vcpu->cpuid->nent, cpuid->nent);
|
||||
|
||||
for (i = 0; i < vcpu->cpuid->nent; i++) {
|
||||
cpuid->nent = i;
|
||||
r = __vcpu_ioctl(vcpu, KVM_GET_CPUID2, cpuid);
|
||||
TEST_ASSERT(r && errno == E2BIG, KVM_IOCTL_ERROR(KVM_GET_CPUID2, r));
|
||||
TEST_ASSERT(cpuid->nent == i, "KVM modified nent on failure");
|
||||
}
|
||||
free(cpuid);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
struct kvm_vcpu *vcpu;
|
||||
@@ -183,5 +202,7 @@ int main(void)
|
||||
|
||||
set_cpuid_after_run(vcpu);
|
||||
|
||||
test_get_cpuid2(vcpu);
|
||||
|
||||
kvm_vm_free(vm);
|
||||
}
|
||||
|
Reference in New Issue
Block a user