From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: jing2.liu@linux.intel.com
Subject: [PATCH 4/5] KVM: cpuid: rename do_cpuid_1_ent
Date: Thu, 4 Jul 2019 16:07:14 +0200 [thread overview]
Message-ID: <20190704140715.31181-5-pbonzini@redhat.com> (raw)
In-Reply-To: <20190704140715.31181-1-pbonzini@redhat.com>
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: Paolo Bonzini <pbonzini@redhat.com>
---
arch/x86/kvm/cpuid.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 9ebc5ae7fa0e..d403695f2f3b 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -289,7 +289,7 @@ static void cpuid_mask(u32 *word, int 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)
{
entry->function = function;
@@ -487,7 +487,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
if (*nent >= maxnent)
goto out;
- do_cpuid_1_ent(entry, function, 0);
+ do_host_cpuid(entry, function, 0);
++*nent;
switch (function) {
@@ -516,7 +516,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
if (*nent >= maxnent)
goto out;
- do_cpuid_1_ent(&entry[t], function, 0);
+ do_host_cpuid(&entry[t], function, 0);
++*nent;
}
break;
@@ -534,7 +534,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
cache_type = entry[i - 1].eax & 0x1f;
if (!cache_type)
break;
- do_cpuid_1_ent(&entry[i], function, i);
+ do_host_cpuid(&entry[i], function, i);
++*nent;
}
break;
@@ -557,7 +557,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
goto out;
++i;
- do_cpuid_1_ent(&entry[i], function, i);
+ do_host_cpuid(&entry[i], function, i);
++*nent;
}
break;
@@ -609,7 +609,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
level_type = entry[i - 1].ecx & 0xff00;
if (!level_type)
break;
- do_cpuid_1_ent(&entry[i], function, i);
+ do_host_cpuid(&entry[i], function, i);
++*nent;
}
break;
@@ -630,7 +630,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
if (*nent >= maxnent)
goto out;
- do_cpuid_1_ent(&entry[i], function, idx);
+ do_host_cpuid(&entry[i], function, idx);
if (idx == 1) {
entry[i].eax &= kvm_cpuid_D_1_eax_x86_features;
cpuid_mask(&entry[i].eax, CPUID_D_1_EAX);
@@ -662,7 +662,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
for (t = 1; t <= times; ++t) {
if (*nent >= maxnent)
goto out;
- do_cpuid_1_ent(&entry[t], function, t);
+ do_host_cpuid(&entry[t], function, t);
++*nent;
}
break;
--
2.21.0
next prev parent reply other threads:[~2019-07-04 14:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 14:07 [PATCH 0/5] KVM: cpuid: cleanups, simplify multi-index CPUID leaves Paolo Bonzini
2019-07-04 14:07 ` [PATCH 1/5] KVM: cpuid: do_cpuid_ent works on a whole CPUID function Paolo Bonzini
2019-07-08 7:05 ` Jing Liu
2019-07-04 14:07 ` [PATCH 2/5] KVM: cpuid: extract do_cpuid_7_mask and support multiple subleafs Paolo Bonzini
2019-07-08 7:07 ` Jing Liu
2019-07-10 6:30 ` Paolo Bonzini
2019-07-10 7:32 ` Jing Liu
2019-07-10 7:48 ` Paolo Bonzini
2019-07-04 14:07 ` [PATCH 3/5] KVM: cpuid: set struct kvm_cpuid_entry2 flags in do_cpuid_1_ent Paolo Bonzini
2019-07-04 14:07 ` Paolo Bonzini [this message]
2019-07-04 14:07 ` [PATCH 5/5] KVM: cpuid: remove has_leaf_count from struct kvm_cpuid_param Paolo Bonzini
2019-07-08 7:09 ` Jing Liu
2019-07-10 6:34 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190704140715.31181-5-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=jing2.liu@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®