public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events
Date: Tue, 12 Mar 2013 14:13:50 +0100	[thread overview]
Message-ID: <513F2A0E.50903@siemens.com> (raw)
In-Reply-To: <513F2904.2050905@redhat.com>

On 2013-03-12 14:09, Paolo Bonzini wrote:
> Il 12/03/2013 13:46, Jan Kiszka ha scritto:
>>>>>>>> @@ -6178,7 +6177,13 @@ int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
>>>>>>>>  int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
>>>>>>>>  				    struct kvm_mp_state *mp_state)
>>>>>>>>  {
>>>>>>>> -	vcpu->arch.mp_state = mp_state->mp_state;
>>>>>>>> +	if (mp_state->mp_state == KVM_MP_STATE_SIPI_RECEIVED) {
>>>>>>>> +		if (!kvm_vcpu_has_lapic(vcpu))
>>>>>>>> +			return -EINVAL;
>>>>>>>> +		vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED;
>>>>>>>> +		set_bit(KVM_APIC_SIPI, &vcpu->arch.apic->pending_events);
>>>>>>>> +	} else
>>>>>>>> +		vcpu->arch.mp_state = mp_state->mp_state;
>>>>>>
>>>>>> Should INIT_RECEIVED also be invalid without an in-kernel LAPIC?
>>>>
>>>> And since migration was brought up yesterday, do we need an interface to
>>>> retrieve and set this?
>>>>
>>>> And should KVM_GET/SET_VCPU_EVENTS use the new sipi_vector in the APIC
>>>> rather than the old one?
>> I hope not. The idea is that the APIC events are processed before the
>> migration completes. Translating events on get_mpstate should ensure this.
> 
> What about persistent state such as "an INIT has been received and
> caused a vmexit, but is being latched until vmxoff"?  Perhaps we could
> use the top 8 bits of vcpu->arch.sipi_vector for this, they are always
> shifted out when sipi_vector is used, and should be zero in all cases.
> It would then be possible to reuse KVM_GET/SET_VCPU_EVENTS.

See my other mail.

> 
> Migration support for nested VMX is still far far away, so perhaps we do
> not care, but we still need a way to inject INIT from userspace.

Ack for INIT injection. In theory, you could use the VCPU event IOCTL,
it is extensible. If that is elegant is another question.

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2013-03-12 13:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 11:44 [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events Jan Kiszka
2013-03-12 12:06 ` Paolo Bonzini
2013-03-12 12:29   ` Gleb Natapov
2013-03-12 12:29   ` Paolo Bonzini
2013-03-12 12:46     ` Jan Kiszka
2013-03-12 12:49       ` Gleb Natapov
2013-03-12 12:52         ` Jan Kiszka
2013-03-12 12:53           ` Gleb Natapov
2013-03-12 13:09       ` Paolo Bonzini
2013-03-12 13:13         ` Jan Kiszka [this message]
2013-03-12 12:58   ` Jan Kiszka
2013-03-12 13:01     ` Jan Kiszka
2013-03-12 13:13       ` Paolo Bonzini
2013-03-12 13:16         ` Jan Kiszka
2013-03-12 13:25           ` Gleb Natapov
2013-03-12 13:27             ` Jan Kiszka
2013-03-12 13:37               ` Gleb Natapov
2013-03-13  7:39   ` Jan Kiszka
2013-03-13  9:03     ` Paolo Bonzini
2013-03-13  9:08       ` Jan Kiszka
2013-03-12 13:12 ` Gleb Natapov
2013-03-12 13:21   ` Jan Kiszka
2013-03-12 13:41     ` Gleb Natapov
2013-03-12 13:43       ` Paolo Bonzini
2013-03-12 13:52         ` Gleb Natapov

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=513F2A0E.50903@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox