All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jim Mattson <jmattson@google.com>
Cc: "Raslan, KarimAllah" <karahmed@amazon.de>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"x86@kernel.org" <x86@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"rkrcmar@redhat.com" <rkrcmar@redhat.com>
Subject: Re: [PATCH 2/2] kvm: nVMX: Introduce KVM_CAP_STATE
Date: Sat, 28 Apr 2018 02:42:02 +0200	[thread overview]
Message-ID: <724a2ae2-e38f-148c-ce29-9869b2ab535f@redhat.com> (raw)
In-Reply-To: <CALMp9eSG-nAuJEyavJoBp7QS1_VuYpuNSjKNUoK6MMEeywypeQ@mail.gmail.com>

On 27/04/2018 17:19, Jim Mattson wrote:
> 
> If the default treatment of SMIs and SMM (see Section 34.14) is
> active, the VMX-preemption timer counts across an SMI to VMX non-root
> operation, subsequent execution in SMM, and the return from SMM via
> the RSM instruction. However, the timer can cause a VM exit only from
> VMX non-root operation. If the timer expires during SMI, in SMM, or
> during RSM, a timer-induced VM exit occurs immediately after RSM with
> its normal priority unless it is blocked based on activity state
> (Section 25.2).
> 
> So, there's no loophole here that allows us to reset the VMX
> preemption timer when restoring nested state.

Or when an SMI occurs.  So the expiration TSC of the preemption timer
should be stored into an "artificial" field of the vmcs12 at vmentry
time and later reused.

vmx->nested.smm.guest_node should also be saved...

Paolo

> As a follow-on change, we should probably fix this.

  reply	other threads:[~2018-04-28  0:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12 15:12 [PATCH 1/2] X86/KVM: Properly restore 'tsc_offset' when running an L2 guest KarimAllah Ahmed
2018-04-12 15:12 ` [PATCH 2/2] kvm: nVMX: Introduce KVM_CAP_STATE KarimAllah Ahmed
2018-04-12 16:39   ` Paolo Bonzini
2018-04-14 15:56   ` Raslan, KarimAllah
2018-04-14 22:31     ` Raslan, KarimAllah
2018-04-16 16:22   ` Jim Mattson
2018-04-16 17:15     ` Raslan, KarimAllah
2018-04-26 22:28       ` Jim Mattson
2018-04-27 10:03         ` Paolo Bonzini
2018-04-27 15:19           ` Jim Mattson
2018-04-28  0:42             ` Paolo Bonzini [this message]
2018-04-12 16:35 ` [PATCH 1/2] X86/KVM: Properly restore 'tsc_offset' when running an L2 guest Paolo Bonzini
2018-04-12 17:04   ` Raslan, KarimAllah
2018-04-12 17:21     ` Raslan, KarimAllah
2018-04-12 20:21       ` Paolo Bonzini
2018-04-12 20:24         ` Raslan, KarimAllah

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=724a2ae2-e38f-148c-ce29-9869b2ab535f@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=karahmed@amazon.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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.