From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH 2/3] convert cpuid registration to KVM_SET_CPUID2
Date: Wed, 28 Jan 2009 14:02:04 -0500 [thread overview]
Message-ID: <1233169325-5487-3-git-send-email-glommer@redhat.com> (raw)
In-Reply-To: <1233169325-5487-2-git-send-email-glommer@redhat.com>
Use KVM_SET_CPUID2 instead of KVM_SET_CPUID. This
will allow us to do registration of cpuid leaves without
multiple calls to the kernel in the future.
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
target-i386/kvm.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 7f4e5aa..87ddff5 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -65,13 +65,13 @@ static uint32_t get_para_features(CPUState *env)
int kvm_arch_init_vcpu(CPUState *env)
{
struct {
- struct kvm_cpuid cpuid;
- struct kvm_cpuid_entry entries[100];
+ struct kvm_cpuid2 cpuid;
+ struct kvm_cpuid_entry2 entries[100];
} __attribute__((packed)) cpuid_data;
uint32_t limit, i, cpuid_i = 0;
uint32_t eax, ebx, ecx, edx;
#ifdef KVM_CPUID_SIGNATURE
- struct kvm_cpuid_entry *pv_ent;
+ struct kvm_cpuid_entry2 *pv_ent;
/* Paravirtualization CPUIDs */
pv_ent = &cpuid_data.entries[cpuid_i++];
@@ -93,7 +93,7 @@ int kvm_arch_init_vcpu(CPUState *env)
limit = eax;
for (i = 0; i <= limit; i++) {
- struct kvm_cpuid_entry *c = &cpuid_data.entries[cpuid_i++];
+ struct kvm_cpuid_entry2 *c = &cpuid_data.entries[cpuid_i++];
cpu_x86_cpuid(env, i, &eax, &ebx, &ecx, &edx);
c->function = i;
@@ -107,7 +107,7 @@ int kvm_arch_init_vcpu(CPUState *env)
limit = eax;
for (i = 0x80000000; i <= limit; i++) {
- struct kvm_cpuid_entry *c = &cpuid_data.entries[cpuid_i++];
+ struct kvm_cpuid_entry2 *c = &cpuid_data.entries[cpuid_i++];
cpu_x86_cpuid(env, i, &eax, &ebx, &ecx, &edx);
c->function = i;
@@ -119,7 +119,7 @@ int kvm_arch_init_vcpu(CPUState *env)
cpuid_data.cpuid.nent = cpuid_i;
- return kvm_vcpu_ioctl(env, KVM_SET_CPUID, &cpuid_data);
+ return kvm_vcpu_ioctl(env, KVM_SET_CPUID2, &cpuid_data);
}
static int kvm_has_msr_star(CPUState *env)
--
1.5.6.5
next prev parent reply other threads:[~2009-01-28 19:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-28 19:02 [Qemu-devel] [PATCH 0/3] Enhance kvm cpuid Glauber Costa
2009-01-28 19:02 ` [Qemu-devel] [PATCH 1/3] expose paravirt feature list to cpuid Glauber Costa
2009-01-28 19:02 ` Glauber Costa [this message]
2009-01-28 19:02 ` [Qemu-devel] [PATCH 3/3] mask out forbidden cpuid features Glauber Costa
2009-01-28 21:36 ` [Qemu-devel] Re: [PATCH 1/3] expose paravirt feature list to cpuid Anthony Liguori
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=1233169325-5487-3-git-send-email-glommer@redhat.com \
--to=glommer@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).