[patch 4/7] kvm-tpr-opt: clean up usage of bios_enabled

Marcelo Tosatti
2010-03-09T00:49:28Z

[-- Attachment #1: kvm-tpr-bios-enabled-clean --]
[-- Type: text/plain, Size: 801 bytes --]

1. bios_enabled must already be set when enable_vapic is called.
2. kvm_tpr_vcpu_start is called during vcpu creation, when bios_enabled
is always zero.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Index: qemu-kvm-tpr/kvm-tpr-opt.c
===================================================================
--- qemu-kvm-tpr.orig/kvm-tpr-opt.c
+++ qemu-kvm-tpr/kvm-tpr-opt.c
@@ -250,7 +250,6 @@ int kvm_tpr_enable_vapic(CPUState *env)

static int enable_vapic(CPUState *env)
{
- bios_enabled = 1;
env->update_vapic = 1;
return 1;
}
@@ -322,8 +321,6 @@ void kvm_tpr_access_report(CPUState *env
void kvm_tpr_vcpu_start(CPUState *env)
{
kvm_enable_tpr_access_reporting(env);
- if (bios_enabled)
- kvm_tpr_enable_vapic(env);
}

static void tpr_save(QEMUFile *f, void *s)