All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>, kvm <kvm@vger.kernel.org>
Subject: Re: [RFC][PATCH] KVM: nVMX: Leave VMX mode on apparent CPU reset
Date: Tue, 17 Dec 2013 15:40:47 +0100	[thread overview]
Message-ID: <52B0626F.2090905@siemens.com> (raw)
In-Reply-To: <52B050C6.5090407@redhat.com>

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 <jan.kiszka@siemens.com>
>> ---
>>
>> 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

  reply	other threads:[~2013-12-17 14:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16  9:32 [RFC][PATCH] KVM: nVMX: Leave VMX mode on apparent CPU reset Jan Kiszka
2013-12-17 13:25 ` Paolo Bonzini
2013-12-17 14:40   ` Jan Kiszka [this message]
2013-12-17 14:43     ` Paolo Bonzini
2013-12-30 20:02 ` Marcelo Tosatti
2013-12-30 20:05   ` Marcelo Tosatti
2013-12-30 20:02 ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52B0626F.2090905@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.