From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH] KVM: nSVM/nVMX: Implement vmexit on INIT assertion Date: Wed, 27 Feb 2013 12:17:27 +0100 Message-ID: <20130227111727.GF26252@8bytes.org> References: <512A1EF5.2070709@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , Gleb Natapov , Nadav Har'El , "Nakajima, Jun" , kvm To: Jan Kiszka Return-path: Received: from 8bytes.org ([85.214.48.195]:35878 "EHLO mail.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758419Ab3B0LRd (ORCPT ); Wed, 27 Feb 2013 06:17:33 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.8bytes.org (Postfix) with SMTP id BEBEB12B0EE for ; Wed, 27 Feb 2013 12:17:28 +0100 (CET) Content-Disposition: inline In-Reply-To: <512A1EF5.2070709@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Feb 24, 2013 at 03:08:53PM +0100, Jan Kiszka wrote: > From: Jan Kiszka > @@ -2390,6 +2390,21 @@ static int nested_svm_vmexit(struct vcpu_svm *svm) > return 0; > } > +static bool nested_svm_handle_init_received(struct kvm_vcpu *vcpu) > +{ > + struct vcpu_svm *svm = to_svm(vcpu); > + > + if (!is_guest_mode(vcpu) || > + !(svm->nested.intercept & (1ULL << INTERCEPT_INIT))) > + return false; > + > + svm->vmcb->control.exit_code = SVM_EXIT_INIT; > + svm->vmcb->control.exit_int_info = 0; > + nested_svm_vmexit(svm); > + > + return true; > +} [...] > + if (vcpu->arch.mp_state == KVM_MP_STATE_INIT_RECEIVED && > + kvm_x86_ops->handle_init_received(vcpu)) { > + /* nested vmexit, L1 is runnable now */ > + vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; > + return 1; > + } Hmm, looks like the INIT signal is lost after the VMEXIT. But on SVM the INIT signal is still pending an will be delivered when GIF becomes one again. Do I miss anything? Joerg