diff options
author | Amit Shah <amit.shah@redhat.com> | 2009-01-14 11:56:00 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-03-24 05:03:05 -0400 |
commit | 193554750441d91e127dd5066b8aebe0f769101c (patch) | |
tree | 689de10c2f32ed32dd523516046c296d7ea3e2ad | |
parent | 9aa4dd5e5f47a5feb96fc394fccf0265ab7d85a4 (diff) |
KVM: x86: Fix typos and whitespace errors
Some typos, comments, whitespace errors corrected in the cpuid code
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | arch/x86/kvm/x86.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 19ccde621cd0..141a0166e51c 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1067,7 +1067,7 @@ long kvm_arch_dev_ioctl(struct file *filp, | |||
1067 | if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) | 1067 | if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) |
1068 | goto out; | 1068 | goto out; |
1069 | r = kvm_dev_ioctl_get_supported_cpuid(&cpuid, | 1069 | r = kvm_dev_ioctl_get_supported_cpuid(&cpuid, |
1070 | cpuid_arg->entries); | 1070 | cpuid_arg->entries); |
1071 | if (r) | 1071 | if (r) |
1072 | goto out; | 1072 | goto out; |
1073 | 1073 | ||
@@ -1165,8 +1165,8 @@ out: | |||
1165 | } | 1165 | } |
1166 | 1166 | ||
1167 | static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu, | 1167 | static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu, |
1168 | struct kvm_cpuid2 *cpuid, | 1168 | struct kvm_cpuid2 *cpuid, |
1169 | struct kvm_cpuid_entry2 __user *entries) | 1169 | struct kvm_cpuid_entry2 __user *entries) |
1170 | { | 1170 | { |
1171 | int r; | 1171 | int r; |
1172 | 1172 | ||
@@ -1185,8 +1185,8 @@ out: | |||
1185 | } | 1185 | } |
1186 | 1186 | ||
1187 | static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu, | 1187 | static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu, |
1188 | struct kvm_cpuid2 *cpuid, | 1188 | struct kvm_cpuid2 *cpuid, |
1189 | struct kvm_cpuid_entry2 __user *entries) | 1189 | struct kvm_cpuid_entry2 __user *entries) |
1190 | { | 1190 | { |
1191 | int r; | 1191 | int r; |
1192 | 1192 | ||
@@ -1195,7 +1195,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu, | |||
1195 | goto out; | 1195 | goto out; |
1196 | r = -EFAULT; | 1196 | r = -EFAULT; |
1197 | if (copy_to_user(entries, &vcpu->arch.cpuid_entries, | 1197 | if (copy_to_user(entries, &vcpu->arch.cpuid_entries, |
1198 | vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2))) | 1198 | vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2))) |
1199 | goto out; | 1199 | goto out; |
1200 | return 0; | 1200 | return 0; |
1201 | 1201 | ||
@@ -1205,12 +1205,12 @@ out: | |||
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function, | 1207 | static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function, |
1208 | u32 index) | 1208 | u32 index) |
1209 | { | 1209 | { |
1210 | entry->function = function; | 1210 | entry->function = function; |
1211 | entry->index = index; | 1211 | entry->index = index; |
1212 | cpuid_count(entry->function, entry->index, | 1212 | cpuid_count(entry->function, entry->index, |
1213 | &entry->eax, &entry->ebx, &entry->ecx, &entry->edx); | 1213 | &entry->eax, &entry->ebx, &entry->ecx, &entry->edx); |
1214 | entry->flags = 0; | 1214 | entry->flags = 0; |
1215 | } | 1215 | } |
1216 | 1216 | ||
@@ -1249,7 +1249,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, | |||
1249 | bit(X86_FEATURE_LAHF_LM) | bit(X86_FEATURE_CMP_LEGACY) | | 1249 | bit(X86_FEATURE_LAHF_LM) | bit(X86_FEATURE_CMP_LEGACY) | |
1250 | bit(X86_FEATURE_SVM); | 1250 | bit(X86_FEATURE_SVM); |
1251 | 1251 | ||
1252 | /* all func 2 cpuid_count() should be called on the same cpu */ | 1252 | /* all calls to cpuid_count() should be made on the same cpu */ |
1253 | get_cpu(); | 1253 | get_cpu(); |
1254 | do_cpuid_1_ent(entry, function, index); | 1254 | do_cpuid_1_ent(entry, function, index); |
1255 | ++*nent; | 1255 | ++*nent; |
@@ -1323,7 +1323,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, | |||
1323 | } | 1323 | } |
1324 | 1324 | ||
1325 | static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid, | 1325 | static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid, |
1326 | struct kvm_cpuid_entry2 __user *entries) | 1326 | struct kvm_cpuid_entry2 __user *entries) |
1327 | { | 1327 | { |
1328 | struct kvm_cpuid_entry2 *cpuid_entries; | 1328 | struct kvm_cpuid_entry2 *cpuid_entries; |
1329 | int limit, nent = 0, r = -E2BIG; | 1329 | int limit, nent = 0, r = -E2BIG; |
@@ -1340,7 +1340,7 @@ static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid, | |||
1340 | limit = cpuid_entries[0].eax; | 1340 | limit = cpuid_entries[0].eax; |
1341 | for (func = 1; func <= limit && nent < cpuid->nent; ++func) | 1341 | for (func = 1; func <= limit && nent < cpuid->nent; ++func) |
1342 | do_cpuid_ent(&cpuid_entries[nent], func, 0, | 1342 | do_cpuid_ent(&cpuid_entries[nent], func, 0, |
1343 | &nent, cpuid->nent); | 1343 | &nent, cpuid->nent); |
1344 | r = -E2BIG; | 1344 | r = -E2BIG; |
1345 | if (nent >= cpuid->nent) | 1345 | if (nent >= cpuid->nent) |
1346 | goto out_free; | 1346 | goto out_free; |
@@ -1349,10 +1349,10 @@ static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid, | |||
1349 | limit = cpuid_entries[nent - 1].eax; | 1349 | limit = cpuid_entries[nent - 1].eax; |
1350 | for (func = 0x80000001; func <= limit && nent < cpuid->nent; ++func) | 1350 | for (func = 0x80000001; func <= limit && nent < cpuid->nent; ++func) |
1351 | do_cpuid_ent(&cpuid_entries[nent], func, 0, | 1351 | do_cpuid_ent(&cpuid_entries[nent], func, 0, |
1352 | &nent, cpuid->nent); | 1352 | &nent, cpuid->nent); |
1353 | r = -EFAULT; | 1353 | r = -EFAULT; |
1354 | if (copy_to_user(entries, cpuid_entries, | 1354 | if (copy_to_user(entries, cpuid_entries, |
1355 | nent * sizeof(struct kvm_cpuid_entry2))) | 1355 | nent * sizeof(struct kvm_cpuid_entry2))) |
1356 | goto out_free; | 1356 | goto out_free; |
1357 | cpuid->nent = nent; | 1357 | cpuid->nent = nent; |
1358 | r = 0; | 1358 | r = 0; |
@@ -1496,7 +1496,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, | |||
1496 | if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) | 1496 | if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) |
1497 | goto out; | 1497 | goto out; |
1498 | r = kvm_vcpu_ioctl_set_cpuid2(vcpu, &cpuid, | 1498 | r = kvm_vcpu_ioctl_set_cpuid2(vcpu, &cpuid, |
1499 | cpuid_arg->entries); | 1499 | cpuid_arg->entries); |
1500 | if (r) | 1500 | if (r) |
1501 | goto out; | 1501 | goto out; |
1502 | break; | 1502 | break; |
@@ -1509,7 +1509,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, | |||
1509 | if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) | 1509 | if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) |
1510 | goto out; | 1510 | goto out; |
1511 | r = kvm_vcpu_ioctl_get_cpuid2(vcpu, &cpuid, | 1511 | r = kvm_vcpu_ioctl_get_cpuid2(vcpu, &cpuid, |
1512 | cpuid_arg->entries); | 1512 | cpuid_arg->entries); |
1513 | if (r) | 1513 | if (r) |
1514 | goto out; | 1514 | goto out; |
1515 | r = -EFAULT; | 1515 | r = -EFAULT; |
@@ -2864,7 +2864,7 @@ static int is_matching_cpuid_entry(struct kvm_cpuid_entry2 *e, | |||
2864 | if ((e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX) && e->index != index) | 2864 | if ((e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX) && e->index != index) |
2865 | return 0; | 2865 | return 0; |
2866 | if ((e->flags & KVM_CPUID_FLAG_STATEFUL_FUNC) && | 2866 | if ((e->flags & KVM_CPUID_FLAG_STATEFUL_FUNC) && |
2867 | !(e->flags & KVM_CPUID_FLAG_STATE_READ_NEXT)) | 2867 | !(e->flags & KVM_CPUID_FLAG_STATE_READ_NEXT)) |
2868 | return 0; | 2868 | return 0; |
2869 | return 1; | 2869 | return 1; |
2870 | } | 2870 | } |
@@ -2892,7 +2892,6 @@ struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu, | |||
2892 | if (!best || e->function > best->function) | 2892 | if (!best || e->function > best->function) |
2893 | best = e; | 2893 | best = e; |
2894 | } | 2894 | } |
2895 | |||
2896 | return best; | 2895 | return best; |
2897 | } | 2896 | } |
2898 | 2897 | ||