From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [RFC][PATCH] KVM: nVMX: Leave VMX mode on apparent CPU reset Date: Tue, 17 Dec 2013 15:40:47 +0100 Message-ID: <52B0626F.2090905@siemens.com> References: <52AEC8B2.7010602@siemens.com> <52B050C6.5090407@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , kvm To: Paolo Bonzini Return-path: Received: from thoth.sbs.de ([192.35.17.2]:22422 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274Ab3LQOk4 (ORCPT ); Tue, 17 Dec 2013 09:40:56 -0500 In-Reply-To: <52B050C6.5090407@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2013-12-17 14:25, Paolo Bonzini wrote: > 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); > > ? Well, I could make setting of MSR_IA32_FEATURE_CONTROL to 0 an official "clear VMX" interface. Then QEMU would have to issue this MSR set request before doing any other CPU state manipulation. Is that what you have in mind? Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux