提交 300bae76 编写于 作者: P Paolo Bonzini 提交者: Joseph Qi

CPX: KVM: cpuid: rename do_cpuid_1_ent

commit 50a9e1a4b1dece60fd79ecdee25db01274a7f291 upstream.

do_cpuid_1_ent does not do the entire processing for a CPUID entry, it
only retrieves the host's values.  Rename it to match reality.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NLin Wang <lin.x.wang@intel.com>
Signed-off-by: NJeffle Xu <jefflexu@linux.alibaba.com>
Acked-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
上级 fc4e269e
...@@ -282,7 +282,7 @@ static void cpuid_mask(u32 *word, int wordnum) ...@@ -282,7 +282,7 @@ static void cpuid_mask(u32 *word, int wordnum)
*word &= boot_cpu_data.x86_capability[wordnum]; *word &= boot_cpu_data.x86_capability[wordnum];
} }
static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function, static void do_host_cpuid(struct kvm_cpuid_entry2 *entry, u32 function,
u32 index) u32 index)
{ {
entry->function = function; entry->function = function;
...@@ -476,7 +476,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, ...@@ -476,7 +476,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
if (*nent >= maxnent) if (*nent >= maxnent)
goto out; goto out;
do_cpuid_1_ent(entry, function, 0); do_host_cpuid(entry, function, 0);
++*nent; ++*nent;
switch (function) { switch (function) {
...@@ -504,7 +504,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, ...@@ -504,7 +504,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
if (*nent >= maxnent) if (*nent >= maxnent)
goto out; goto out;
do_cpuid_1_ent(&entry[t], function, 0); do_host_cpuid(&entry[t], function, 0);
++*nent; ++*nent;
} }
break; break;
...@@ -521,7 +521,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, ...@@ -521,7 +521,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
cache_type = entry[i - 1].eax & 0x1f; cache_type = entry[i - 1].eax & 0x1f;
if (!cache_type) if (!cache_type)
break; break;
do_cpuid_1_ent(&entry[i], function, i); do_host_cpuid(&entry[i], function, i);
++*nent; ++*nent;
} }
break; break;
...@@ -544,7 +544,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, ...@@ -544,7 +544,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
goto out; goto out;
++i; ++i;
do_cpuid_1_ent(&entry[i], function, i); do_host_cpuid(&entry[i], function, i);
++*nent; ++*nent;
} }
break; break;
...@@ -592,7 +592,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, ...@@ -592,7 +592,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
level_type = entry[i - 1].ecx & 0xff00; level_type = entry[i - 1].ecx & 0xff00;
if (!level_type) if (!level_type)
break; break;
do_cpuid_1_ent(&entry[i], function, i); do_host_cpuid(&entry[i], function, i);
++*nent; ++*nent;
} }
break; break;
...@@ -613,7 +613,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, ...@@ -613,7 +613,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
if (*nent >= maxnent) if (*nent >= maxnent)
goto out; goto out;
do_cpuid_1_ent(&entry[i], function, idx); do_host_cpuid(&entry[i], function, idx);
if (idx == 1) { if (idx == 1) {
entry[i].eax &= kvm_cpuid_D_1_eax_x86_features; entry[i].eax &= kvm_cpuid_D_1_eax_x86_features;
cpuid_mask(&entry[i].eax, CPUID_D_1_EAX); cpuid_mask(&entry[i].eax, CPUID_D_1_EAX);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册