updated on Thu Jan 19 16:10:29 UTC 2012
[aur-mirror.git] / kvm-opensuse / kvm-kernel-cpuid4.patch
blob9c2a641f1b92b05f600e5d84688e4bcc0b39750f
1 # Quick patch until proper version is upstream, but is safe.
2 # Signed-off-by: Alex Graf - agraf@suse
3 Index: kvm-75/kernel/x86/x86.c
4 ===================================================================
5 --- kvm-75.orig/kernel/x86/x86.c
6 +++ kvm-75/kernel/x86/x86.c
7 @@ -1260,7 +1260,7 @@ static int kvm_vcpu_ioctl_set_cpuid(stru
8 struct kvm_cpuid *cpuid,
9 struct kvm_cpuid_entry *entries)
11 - int r, i;
12 + int r, i, n = 0;
13 struct kvm_cpuid_entry *cpuid_entries;
15 r = -E2BIG;
16 @@ -1280,8 +1280,17 @@ static int kvm_vcpu_ioctl_set_cpuid(stru
17 vcpu->arch.cpuid_entries[i].ebx = cpuid_entries[i].ebx;
18 vcpu->arch.cpuid_entries[i].ecx = cpuid_entries[i].ecx;
19 vcpu->arch.cpuid_entries[i].edx = cpuid_entries[i].edx;
20 - vcpu->arch.cpuid_entries[i].index = 0;
21 - vcpu->arch.cpuid_entries[i].flags = 0;
22 + switch(vcpu->arch.cpuid_entries[i].function) {
23 + case 4:
24 + vcpu->arch.cpuid_entries[i].index = n;
25 + vcpu->arch.cpuid_entries[i].flags = KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
26 + n++;
27 + break;
28 + default:
29 + vcpu->arch.cpuid_entries[i].index = 0;
30 + vcpu->arch.cpuid_entries[i].flags = 0;
31 + break;
32 + }
33 vcpu->arch.cpuid_entries[i].padding[0] = 0;
34 vcpu->arch.cpuid_entries[i].padding[1] = 0;
35 vcpu->arch.cpuid_entries[i].padding[2] = 0;