summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-06-25 15:20:59 +0300
committerAvi Kivity <avi@redhat.com>2009-06-28 12:25:47 +0300
commitac3f40cd27d7a320cd8c8016eed64d477d1fa19a (patch)
treef4f60d93e298b0bb9b07d1f22b065b4215315e41 /qemu-kvm-x86.c
parentMove x86 specific code from qemu-kvm.c to qemu-kvm-x86.c (diff)
downloadqemu-kvm-ac3f40cd27d7a320cd8c8016eed64d477d1fa19a.tar.gz
qemu-kvm-ac3f40cd27d7a320cd8c8016eed64d477d1fa19a.tar.bz2
qemu-kvm-ac3f40cd27d7a320cd8c8016eed64d477d1fa19a.zip
Use cpu_is_bsp() to check for bsp cpu
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'qemu-kvm-x86.c')
-rw-r--r--qemu-kvm-x86.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index 568df5383..a78073e01 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -23,6 +23,7 @@
#include <sys/ioctl.h>
#include "kvm.h"
+#include "hw/pc.h"
#define MSR_IA32_TSC 0x10
@@ -1349,7 +1350,7 @@ int handle_tpr_access(void *opaque, kvm_vcpu_context_t vcpu,
void kvm_arch_cpu_reset(CPUState *env)
{
kvm_arch_load_regs(env);
- if (env->cpu_index != 0) {
+ if (!cpu_is_bsp(env)) {
if (kvm_irqchip_in_kernel(kvm_context)) {
#ifdef KVM_CAP_MP_STATE
kvm_reset_mpstate(env->kvm_cpu_state.vcpu_ctx);
@@ -1583,7 +1584,7 @@ void kvm_update_after_sipi(CPUState *env)
void kvm_apic_init(CPUState *env)
{
- if (env->cpu_index != 0)
+ if (!cpu_is_bsp(env))
env->kvm_cpu_state.init = 1;
kvm_update_interrupt_request(env);
}