From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [RFC][PATCH] KVM: nVMX: Leave VMX mode on apparent CPU reset Date: Tue, 17 Dec 2013 14:25:26 +0100 Message-ID: <52B050C6.5090407@redhat.com> References: <52AEC8B2.7010602@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , kvm To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34289 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753322Ab3LQNZh (ORCPT ); Tue, 17 Dec 2013 08:25:37 -0500 In-Reply-To: <52AEC8B2.7010602@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 16/12/2013 10:32, Jan Kiszka ha scritto: > As long as we do not expose all the VMX related states to user space, > there is no way to properly reset a VCPU when VMX is enabled. Emulate > this for now by catching host-side clearings of the feature control MSR. > This allows to reboot a VM while it is running some hypervisor code. > > Signed-off-by: Jan Kiszka > --- > > Better ideas? Or continue to leave it as it is? The final vmx_vcpu_reset is the only really ugly part, but it is _really_ ugly... Can you modify QEMU to restore MSRs first, and reduce vmx_reset_nested to just if (is_guest_mode(vcpu)) nested_vmx_vmexit(vcpu); free_nested(vmx); ? Paolo