public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>, kvm <kvm@vger.kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v2] KVM: x86: Rework INIT and SIPI handling
Date: Thu, 14 Mar 2013 12:29:48 +0100	[thread overview]
Message-ID: <5141B4AC.2000708@siemens.com> (raw)
In-Reply-To: <5141A326.3090500@siemens.com>

On 2013-03-14 11:15, Jan Kiszka wrote:
>>>  
>>> -	if (unlikely(vcpu->arch.mp_state == KVM_MP_STATE_SIPI_RECEIVED)) {
>>> -		pr_debug("vcpu %d received sipi with vector # %x\n",
>>> -			 vcpu->vcpu_id, vcpu->arch.sipi_vector);
>>> -		kvm_lapic_reset(vcpu);
>>> -		kvm_vcpu_reset(vcpu);
>>> -		vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
>>> -	}
>>> -
>>>  	vcpu->srcu_idx = srcu_read_lock(&kvm->srcu);
>>>  	r = vapic_enter(vcpu);
>>
>> vmx_vcpu_reset overwrites vcpu->srcu_idx if ->vcpu_reset is called from
>> within srcu section.
> 
> Indeed.
> 
> Do you know what the look over vmx_set_cr0 actually protects?

Found it: It's not actually protecting anything. enter_rmode is called,
and that assumes that lock to be held. If enter_rmode faces an
uninitialized tss, it drops the lock before calling vmx_set_tss_addr.

Well, I wonder if that is a good place to fix the TSS issue. Why not
make that special case (lacking KVM_SET_TSS_ADDR before first KVM_RUN) a
static jump key and check for it on KVM_RUN?

Jan

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

  parent reply	other threads:[~2013-03-14 11:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-13 11:42 [PATCH v2] KVM: x86: Rework INIT and SIPI handling Jan Kiszka
2013-03-13 12:27 ` Paolo Bonzini
2013-03-13 12:42   ` Jan Kiszka
2013-03-13 14:08 ` Gleb Natapov
2013-03-14  0:08 ` Marcelo Tosatti
2013-03-14  2:10   ` Marcelo Tosatti
2013-03-14 10:15   ` Jan Kiszka
2013-03-14 11:24     ` Gleb Natapov
2013-03-14 11:29     ` Jan Kiszka [this message]
2013-03-14 12:12       ` Gleb Natapov
2013-03-14 12:16         ` Jan Kiszka
2013-03-14 12:18           ` Gleb Natapov
2013-03-14 12:25             ` Jan Kiszka
2013-03-14 12:28               ` Gleb Natapov
2013-03-14 15:32                 ` Jan Kiszka
2013-03-14 15:46                   ` Gleb Natapov
2013-03-14 14:32     ` Marcelo Tosatti
2013-03-14 14:53       ` 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=5141B4AC.2000708@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