diff options
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 2889a0f359ea..7a2aeba0bfbd 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1246,6 +1246,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, | |||
1246 | int t, times = entry->eax & 0xff; | 1246 | int t, times = entry->eax & 0xff; |
1247 | 1247 | ||
1248 | entry->flags |= KVM_CPUID_FLAG_STATEFUL_FUNC; | 1248 | entry->flags |= KVM_CPUID_FLAG_STATEFUL_FUNC; |
1249 | entry->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT; | ||
1249 | for (t = 1; t < times && *nent < maxnent; ++t) { | 1250 | for (t = 1; t < times && *nent < maxnent; ++t) { |
1250 | do_cpuid_1_ent(&entry[t], function, 0); | 1251 | do_cpuid_1_ent(&entry[t], function, 0); |
1251 | entry[t].flags |= KVM_CPUID_FLAG_STATEFUL_FUNC; | 1252 | entry[t].flags |= KVM_CPUID_FLAG_STATEFUL_FUNC; |
@@ -2801,7 +2802,7 @@ static int move_to_next_stateful_cpuid_entry(struct kvm_vcpu *vcpu, int i) | |||
2801 | 2802 | ||
2802 | e->flags &= ~KVM_CPUID_FLAG_STATE_READ_NEXT; | 2803 | e->flags &= ~KVM_CPUID_FLAG_STATE_READ_NEXT; |
2803 | /* when no next entry is found, the current entry[i] is reselected */ | 2804 | /* when no next entry is found, the current entry[i] is reselected */ |
2804 | for (j = i + 1; j == i; j = (j + 1) % nent) { | 2805 | for (j = i + 1; ; j = (j + 1) % nent) { |
2805 | struct kvm_cpuid_entry2 *ej = &vcpu->arch.cpuid_entries[j]; | 2806 | struct kvm_cpuid_entry2 *ej = &vcpu->arch.cpuid_entries[j]; |
2806 | if (ej->function == e->function) { | 2807 | if (ej->function == e->function) { |
2807 | ej->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT; | 2808 | ej->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT; |