From: Gleb Natapov Subject: Re: No kernel interface to reset a VCPU Date: Fri, 25 Sep 2009 20:13:56 +0300 Message-ID: <20090925171356.GB30416@redhat.com> References: <4ABCD915.5090503@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm-devel To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21351 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750936AbZIYRNz (ORCPT ); Fri, 25 Sep 2009 13:13:55 -0400 Content-Disposition: inline In-Reply-To: <4ABCD915.5090503@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Sep 25, 2009 at 04:52:05PM +0200, Jan Kiszka wrote: > Hi all, > > looks to me like there is no way to properly reset the boot processor. > The current pattern used by qemu[-kvm] is to reload all registers with > their reset values. But that does not affect the internal VCPU states > the KVM keeps in the kernel. They are only reset during VCPU setup or > after receiving a SIPI (and the latter only helps with secondary CPUs). > Userspace should have access to internal VCPU states too, otherwise migration will not work. > So the only way around it with the current kernel interface is to > destroy/recreate the BSP on reset, right? /me is looking into such an > approach now. I don't think destroying/recreating vcpu will work. I don't remember exact details though. > > We stumbled over inconsistent VCPU states with our internal qemu-kvm > tree. We have a legacy watchdog emulation here that triggered but failed > to bring up the system again. I wasn't able to create a similar case > with a standard environment yet, but I think it is not unrealistic for > qemu-kvm as well. Hacking kvm_arch_vcpu_reset() into KVM that triggers > on the right register values "solved" the issue here. > Can you find the root cause of the problem? As I said above qemu should have full access to vcpu state for proper migration support. Not that kvm_vcpu_reset()/kvm_apic_reset()/kvm_ioapic_reset()/kvm_pit_reset() is bad idea. Actually I want to add them one day. -- Gleb.