Clear the vapic address immediately after reset. This allows dual-boot guests to work efficiently, and more importantly, works around the bios using 'rep insb' to read in the option rom and confusing the vapic machinery. Signed-off-by: Avi Kivity <avi@xxxxxxxxxx> --- target-i386/kvm.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index b7b2430..95e5d02 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -439,8 +439,20 @@ int kvm_arch_init_vcpu(CPUState *env) return kvm_vcpu_ioctl(env, KVM_SET_CPUID2, &cpuid_data); } +static void kvm_clear_vapic(CPUState *env) +{ +#ifdef KVM_SET_VAPIC_ADDR + struct kvm_vapic_addr va = { + .vapic_addr = 0, + }; + + kvm_vcpu_ioctl(env, KVM_SET_VAPIC_ADDR, &va); +#endif +} + void kvm_arch_reset_vcpu(CPUState *env) { + kvm_clear_vapic(env); env->exception_injected = -1; env->interrupt_injected = -1; env->nmi_injected = 0; -- 1.7.3.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html