From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>,
Glauber Costa <glommer@redhat.com>
Cc: kvm@vger.kernel.org
Subject: [PATCH 4/5] Use skeleton of upstream's kvm_arch_init_vcpu()
Date: Tue, 1 Jun 2010 15:33:46 +0300 [thread overview]
Message-ID: <1275395627-2321-5-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1275395627-2321-1-git-send-email-avi@redhat.com>
Currently all content from qemu-kvm's kvm_arch_init_vcpu().
Signed-off-by: Avi Kivity <avi@redhat.com>
---
qemu-kvm-x86.c | 2 +-
target-i386/kvm.c | 17 +++++++++++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index f5c76bc..853d50e 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -1129,7 +1129,7 @@ static void kvm_trim_features(uint32_t *features, uint32_t supported)
}
}
-int kvm_arch_init_vcpu(CPUState *env)
+static int _kvm_arch_init_vcpu(CPUState *env)
{
struct kvm_cpuid_entry2 cpuid_ent[100];
#ifdef KVM_CPUID_SIGNATURE
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index ac9e17b..8db6d54 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -163,10 +163,13 @@ static int get_para_features(CPUState *env)
}
#endif
-#ifdef KVM_UPSTREAM
+static int _kvm_arch_init_vcpu(CPUState *env);
int kvm_arch_init_vcpu(CPUState *env)
{
+ int r;
+#ifdef KVM_UPSTREAM
+
struct {
struct kvm_cpuid2 cpuid;
struct kvm_cpuid_entry2 entries[100];
@@ -178,6 +181,15 @@ int kvm_arch_init_vcpu(CPUState *env)
uint32_t signature[3];
#endif
+#endif
+
+ r = _kvm_arch_init_vcpu(env);
+ if (r < 0) {
+ return r;
+ }
+
+#ifdef KVM_UPSTREAM
+
env->mp_state = KVM_MP_STATE_RUNNABLE;
env->cpuid_features &= kvm_arch_get_supported_cpuid(env, 1, R_EDX);
@@ -273,9 +285,10 @@ int kvm_arch_init_vcpu(CPUState *env)
cpuid_data.cpuid.nent = cpuid_i;
return kvm_vcpu_ioctl(env, KVM_SET_CPUID2, &cpuid_data);
+#endif
+ return 0;
}
-#endif
void kvm_arch_reset_vcpu(CPUState *env)
{
env->exception_injected = -1;
--
1.7.1
next prev parent reply other threads:[~2010-06-01 12:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-01 12:33 [PATCH 0/5] Use more cpuid bits from upstream Avi Kivity
2010-06-01 12:33 ` [PATCH 1/5] Make get_para_features() similar to upstream Avi Kivity
2010-06-01 14:26 ` Glauber Costa
2010-06-01 12:33 ` [PATCH 2/5] Use get_para_features() from upstream Avi Kivity
2010-06-01 14:26 ` Glauber Costa
2010-06-01 12:33 ` [PATCH 3/5] Rename kvm_arch_vcpu_init()s cenv argument to env Avi Kivity
2010-06-01 14:27 ` Glauber Costa
2010-06-01 12:33 ` Avi Kivity [this message]
2010-06-01 14:29 ` [PATCH 4/5] Use skeleton of upstream's kvm_arch_init_vcpu() Glauber Costa
2010-06-01 12:33 ` [PATCH 5/5] Use upstream's kvm_arch_init_vcpu()'s cpuid bits Avi Kivity
2010-06-01 14:51 ` Glauber Costa
2010-06-02 16:23 ` [PATCH 0/5] Use more cpuid bits from upstream Marcelo Tosatti
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=1275395627-2321-5-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=glommer@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/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).