kvm: clear vapic after reset
PATCH 1/1 kvm: clear vapic after reset
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 <[email protected]>
--- target-i386/kvm.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
target-i386/kvm.c +12 -0
@@ -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 ;
Signature · 1 line
1.7.3.1