From 3c3275b0c27e2180bc885f481bedbc17ebe7bc23 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 7 Sep 2008 19:38:33 +0300 Subject: Stop using tr as cpu id for vtpr instead, use byte 4 of the vtpr region. Signed-off-by: Avi Kivity --- kvm-tpr-opt.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kvm-tpr-opt.c b/kvm-tpr-opt.c index 6677741d8..f2a3a1e6e 100644 --- a/kvm-tpr-opt.c +++ b/kvm-tpr-opt.c @@ -225,15 +225,11 @@ static int bios_is_mapped(CPUState *env, uint64_t rip) static int enable_vapic(CPUState *env) { struct kvm_sregs sregs; - - if (smp_cpus > 1) {/* uniprocessor doesn't need cpu id */ - kvm_get_sregs(kvm_context, env->cpu_index, &sregs); - sregs.tr.selector = 0xdb + (env->cpu_index << 8); - kvm_set_sregs(kvm_context, env->cpu_index, &sregs); - } + static uint8_t one = 1; kvm_enable_vapic(kvm_context, env->cpu_index, vapic_phys + (env->cpu_index << 7)); + cpu_physical_memory_rw(vapic_phys + (env->cpu_index << 7) + 4, &one, 1, 1); bios_enabled = 1; return 1; -- cgit v1.2.3